Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 1 | AC_INIT(ssh.c) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 2 | |
| 3 | AC_CONFIG_HEADER(config.h) |
Damien Miller | 856799b | 2000-03-15 21:18:10 +1100 | [diff] [blame] | 4 | AC_PROG_CC |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 5 | AC_CANONICAL_HOST |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 6 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 7 | # Checks for programs. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 8 | AC_PROG_CPP |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 9 | AC_PROG_RANLIB |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 10 | AC_PROG_INSTALL |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 11 | AC_CHECK_PROG(AR, ar, ar) |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 12 | AC_PATH_PROG(PERL, perl) |
| 13 | AC_SUBST(PERL) |
Damien Miller | 8d1fd57 | 2000-05-17 21:34:07 +1000 | [diff] [blame] | 14 | AC_PATH_PROG(ENT, ent) |
| 15 | AC_SUBST(ENT) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 16 | AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 17 | |
Damien Miller | 3f62aba | 2000-11-29 11:56:35 +1100 | [diff] [blame] | 18 | if test -z "$AR" ; then |
| 19 | AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***]) |
| 20 | fi |
| 21 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 22 | # Use LOGIN_PROGRAM from environment if possible |
| 23 | if test ! -z "$LOGIN_PROGRAM" ; then |
| 24 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM") |
| 25 | else |
| 26 | # Search for login |
| 27 | AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login) |
| 28 | if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then |
| 29 | AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK") |
| 30 | fi |
| 31 | fi |
| 32 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 33 | if test -z "$LD" ; then |
| 34 | LD=$CC |
| 35 | fi |
| 36 | AC_SUBST(LD) |
| 37 | |
| 38 | # C Compiler features |
| 39 | AC_C_INLINE |
| 40 | if test "$GCC" = "yes"; then |
| 41 | CFLAGS="$CFLAGS -Wall" |
| 42 | fi |
| 43 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 44 | CFLAGS="$CFLAGS -I. -I${srcdir-.}" |
| 45 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 46 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 47 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 48 | *-*-aix*) |
| 49 | AFS_LIBS="-lld" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 50 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 51 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 52 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 53 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 54 | fi |
Damien Miller | d2c208a | 2000-05-17 22:00:02 +1000 | [diff] [blame] | 55 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 56 | AC_DEFINE(BROKEN_GETADDRINFO) |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 57 | MANTYPE='$(CATMAN)' |
| 58 | mansubdir=cat |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 59 | dnl AIX handles lastlog as part of its login message |
| 60 | AC_DEFINE(DISABLE_LASTLOG) |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 61 | MANTYPE='$(CATMAN)' |
| 62 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 63 | ;; |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 64 | *-*-cygwin*) |
Damien Miller | ef767ac | 2000-10-17 23:14:08 +1100 | [diff] [blame] | 65 | LIBS="$LIBS -lregex /usr/lib/textmode.o" |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 66 | AC_DEFINE(HAVE_CYGWIN) |
| 67 | AC_DEFINE(DISABLE_PAM) |
| 68 | AC_DEFINE(DISABLE_SHADOW) |
| 69 | AC_DEFINE(IPV4_DEFAULT) |
| 70 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 71 | AC_DEFINE(BROKEN_VHANGUP) |
| 72 | no_pam=1 |
| 73 | no_libsocket=1 |
| 74 | no_libnsl=1 |
| 75 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 76 | *-*-hpux10*) |
| 77 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 78 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 79 | fi |
| 80 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 81 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 82 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 83 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 84 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 85 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 86 | LIBS="$LIBS -lsec" |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 87 | MANTYPE='$(CATMAN)' |
| 88 | mansubdir=cat |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 89 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 90 | *-*-hpux11*) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 91 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 92 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 93 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 94 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame] | 95 | AC_DEFINE(DISABLE_UTMP) |
Kevin Steves | 8848b24 | 2000-10-18 13:11:44 +0000 | [diff] [blame] | 96 | AC_DEFINE(SPT_TYPE,SPT_PSTAT) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 97 | LIBS="$LIBS -lsec" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 98 | MANTYPE='$(CATMAN)' |
| 99 | mansubdir=cat |
| 100 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 101 | *-*-irix5*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 102 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 103 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 104 | PATH="$PATH:/usr/etc" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 105 | MANTYPE='$(CATMAN)' |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 106 | no_libsocket=1 |
| 107 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 108 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 109 | ;; |
| 110 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 111 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 112 | LDFLAGS="$LDFLAGS" |
Damien Miller | 190d5a8 | 2000-09-30 09:43:19 +1100 | [diff] [blame] | 113 | PATH="$PATH:/usr/etc" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 114 | MANTYPE='$(CATMAN)' |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 115 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 116 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 117 | AC_DEFINE(WITH_IRIX_AUDIT) |
Ben Lindstrom | 4a1d916 | 2000-11-21 10:45:31 +0000 | [diff] [blame] | 118 | AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 119 | no_libsocket=1 |
| 120 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 121 | AC_DEFINE(BROKEN_INET_NTOA) |
Ben Lindstrom | 75214f9 | 2000-12-01 21:19:51 +0000 | [diff] [blame^] | 122 | mansubdir=man |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 123 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 124 | *-*-linux*) |
| 125 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 126 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 127 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 128 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 129 | ;; |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 130 | mips-sony-bsd|mips-sony-newsos4) |
| 131 | AC_DEFINE(HAVE_NEWS4) |
| 132 | SONY=1 |
| 133 | AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT), |
| 134 | AC_MSG_ERROR([*** libiberty missing - please install first ***]) |
| 135 | ) |
| 136 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 137 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 138 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 139 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 140 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 141 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 142 | conf_utmp_location=/etc/utmp |
| 143 | conf_wtmp_location=/usr/adm/wtmp |
| 144 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 145 | AC_DEFINE(HAVE_NEXT) |
Ben Lindstrom | b4df15d | 2000-10-15 00:17:36 +0000 | [diff] [blame] | 146 | AC_DEFINE(BROKEN_REALPATH) |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 147 | AC_DEFINE(USE_PIPES) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 148 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 149 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 150 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 151 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 08c788a | 2000-03-16 07:52:29 +1100 | [diff] [blame] | 152 | LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 153 | need_dash_r=1 |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 154 | # hardwire lastlog location (can't detect it on some versions) |
| 155 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 156 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 157 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 158 | if test "$sol2ver" -ge 8; then |
| 159 | AC_MSG_RESULT(yes) |
| 160 | AC_DEFINE(DISABLE_UTMP) |
| 161 | AC_DEFINE(DISABLE_WTMP) |
| 162 | else |
| 163 | AC_MSG_RESULT(no) |
| 164 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 165 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 166 | *-*-sunos4*) |
| 167 | CFLAGS="$CFLAGS -DSUNOS4" |
| 168 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 169 | conf_utmp_location=/etc/utmp |
| 170 | conf_wtmp_location=/var/adm/wtmp |
| 171 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 172 | AC_DEFINE(USE_PIPES) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 173 | MANTYPE='$(CATMAN)' |
| 174 | mansubdir=cat |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 175 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 176 | *-sni-sysv*) |
| 177 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 178 | LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" |
| 179 | MANTYPE='$(CATMAN)' |
| 180 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 181 | mansubdir=cat |
Damien Miller | b2dc28e | 2000-07-12 09:18:33 +1000 | [diff] [blame] | 182 | LIBS="$LIBS -lgen -lnsl -lucb" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 183 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 184 | *-*-sysv4.2*) |
| 185 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 186 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 187 | MANTYPE='$(CATMAN)' |
| 188 | mansubdir=cat |
| 189 | LIBS="$LIBS -lgen -lsocket -lnsl -lresolv" |
| 190 | enable_suid_ssh=no |
| 191 | ;; |
| 192 | *-*-sysv5*) |
| 193 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 194 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 195 | MANTYPE='$(CATMAN)' |
| 196 | mansubdir=cat |
| 197 | LIBS="$LIBS -lgen -lsocket" |
| 198 | enable_suid_ssh=no |
| 199 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 200 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 201 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 202 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 203 | MANTYPE='$(CATMAN)' |
| 204 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 205 | LIBS="$LIBS -lgen -lsocket" |
| 206 | ;; |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 207 | *-*-sco3.2v4*) |
Damien Miller | 238a9fa | 2000-08-31 09:20:05 +1100 | [diff] [blame] | 208 | AC_DEFINE(USE_PIPES) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 209 | CFLAGS="$CFLAGS -Dftruncate=chsize -I/usr/local/include" |
| 210 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 211 | MANTYPE='$(CATMAN)' |
| 212 | mansubdir=cat |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 213 | LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm" |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 214 | no_dev_ptmx=1 |
| 215 | RANLIB=true |
| 216 | AC_DEFINE(BROKEN_SYS_TERMIO_H) |
| 217 | rsh_path="/usr/bin/rcmd" |
| 218 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 219 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 220 | ;; |
| 221 | *-*-sco3.2v5*) |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 222 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 223 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 224 | MANTYPE='$(CATMAN)' |
| 225 | mansubdir=cat |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 226 | LIBS="$LIBS -lgen -lsocket -lprot -lx -ltinfo -lm" |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 227 | no_dev_ptmx=1 |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 228 | rsh_path="/usr/bin/rcmd" |
| 229 | AC_DEFINE(HAVE_SCO_PROTECTED_PW) |
Ben Lindstrom | 980754c | 2000-11-12 00:04:24 +0000 | [diff] [blame] | 230 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 231 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 232 | *-dec-osf*) |
| 233 | # This is untested |
| 234 | if test ! -z "USE_SIA" ; then |
| 235 | AC_MSG_CHECKING(for Digital Unix Security Integration Architecture) |
| 236 | if test -f /etc/sia/matrix.conf; then |
| 237 | AC_MSG_RESULT(yes) |
| 238 | AC_DEFINE(HAVE_OSF_SIA) |
| 239 | AC_DEFINE(DISABLE_LOGIN) |
| 240 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 241 | else |
| 242 | AC_MSG_RESULT(no) |
| 243 | fi |
| 244 | fi |
| 245 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 246 | esac |
| 247 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 248 | # Allow user to specify flags |
| 249 | AC_ARG_WITH(cflags, |
| 250 | [ --with-cflags Specify additional flags to pass to compiler], |
| 251 | [ |
| 252 | if test "x$withval" != "xno" ; then |
| 253 | CFLAGS="$CFLAGS $withval" |
| 254 | fi |
| 255 | ] |
| 256 | ) |
| 257 | AC_ARG_WITH(ldflags, |
Ben Lindstrom | 2ed9818 | 2000-11-06 07:15:43 +0000 | [diff] [blame] | 258 | [ --with-ldflags Specify additional flags to pass to linker], |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 259 | [ |
| 260 | if test "x$withval" != "xno" ; then |
| 261 | LDFLAGS="$LDFLAGS $withval" |
| 262 | fi |
| 263 | ] |
| 264 | ) |
| 265 | AC_ARG_WITH(libs, |
| 266 | [ --with-libs Specify additional libraries to link with], |
| 267 | [ |
| 268 | if test "x$withval" != "xno" ; then |
| 269 | LIBS="$LIBS $withval" |
| 270 | fi |
| 271 | ] |
| 272 | ) |
| 273 | |
| 274 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 275 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 276 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 277 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 278 | |
| 279 | AC_CHECK_FUNC(regcomp, |
| 280 | [], |
| 281 | [ |
| 282 | AC_CHECK_LIB(pcre, pcre_info, |
| 283 | AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre") |
| 284 | ] |
| 285 | ) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 286 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 287 | if test -z "$no_libsocket" ; then |
| 288 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 289 | fi |
| 290 | if test -z "$no_libnsl" ; then |
| 291 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 292 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 293 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 294 | # Checks for header files. |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 295 | AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h vis.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 296 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 297 | dnl Checks for library functions. |
Ben Lindstrom | 67e21e1 | 2000-11-05 09:08:45 +0000 | [diff] [blame] | 298 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis waitpid _getpty __b64_ntop) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 299 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 300 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 301 | dnl Checks for libutil functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 302 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 303 | dnl Checks for utmp functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 304 | AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent) |
| 305 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 306 | dnl Checks for utmpx functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 307 | AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline ) |
| 308 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 309 | |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 310 | AC_CHECK_FUNC(getuserattr, |
| 311 | [AC_DEFINE(HAVE_GETUSERATTR)], |
| 312 | [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])] |
| 313 | ) |
| 314 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 315 | AC_CHECK_FUNC(login, |
| 316 | [AC_DEFINE(HAVE_LOGIN)], |
| 317 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 318 | ) |
| 319 | |
| 320 | AC_CHECK_FUNC(daemon, |
| 321 | [AC_DEFINE(HAVE_DAEMON)], |
| 322 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 323 | ) |
| 324 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 325 | AC_CHECK_FUNC(getpagesize, |
| 326 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 327 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 328 | ) |
| 329 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 330 | # Check for broken snprintf |
| 331 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 332 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 333 | AC_TRY_RUN( |
| 334 | [ |
| 335 | #include <stdio.h> |
| 336 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 337 | ], |
| 338 | [AC_MSG_RESULT(yes)], |
| 339 | [ |
| 340 | AC_MSG_RESULT(no) |
| 341 | AC_DEFINE(BROKEN_SNPRINTF) |
| 342 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 343 | ] |
| 344 | ) |
| 345 | fi |
| 346 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 347 | AC_FUNC_GETPGRP |
| 348 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 349 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 350 | AC_ARG_WITH(pam, |
| 351 | [ --without-pam Disable PAM support ], |
| 352 | [ |
| 353 | if test "x$withval" = "xno" ; then |
| 354 | no_pam=1 |
| 355 | AC_DEFINE(DISABLE_PAM) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 356 | PAM_MSG="disabled" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 357 | fi |
| 358 | ] |
| 359 | ) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 360 | if (test -z "$no_pam" && test "x$ac_cv_header_security_pam_appl_h" = "xyes") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 361 | AC_CHECK_LIB(dl, dlopen, , ) |
| 362 | LIBS="$LIBS -lpam" |
| 363 | |
Damien Miller | 0e65eed | 2000-05-17 22:16:05 +1000 | [diff] [blame] | 364 | AC_CHECK_FUNCS(pam_getenvlist) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 365 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 366 | disable_shadow=yes |
| 367 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 368 | PAM_MSG="yes" |
| 369 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 370 | # Check PAM strerror arguments (old PAM) |
| 371 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 372 | AC_TRY_COMPILE( |
| 373 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 374 | #include <stdlib.h> |
| 375 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 376 | ], |
| 377 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 378 | [AC_MSG_RESULT(no)], |
| 379 | [ |
| 380 | AC_DEFINE(HAVE_OLD_PAM) |
| 381 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 382 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 383 | ] |
| 384 | ) |
| 385 | fi |
| 386 | |
| 387 | # The big search for OpenSSL |
| 388 | AC_ARG_WITH(ssl-dir, |
| 389 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 390 | [ |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 391 | if test "x$withval" != "xno" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 392 | tryssldir=$withval |
| 393 | fi |
| 394 | ] |
| 395 | ) |
| 396 | |
| 397 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 398 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 399 | saved_CFLAGS="$CFLAGS" |
| 400 | if test "x$prefix" != "xNONE" ; then |
| 401 | tryssldir="$tryssldir $prefix" |
| 402 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 403 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 404 | |
Damien Miller | a1b61e1 | 2000-09-16 17:02:16 +1100 | [diff] [blame] | 405 | for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 406 | if test ! -z "$ssldir" ; then |
| 407 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 408 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 409 | if test ! -z "$need_dash_r" ; then |
| 410 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
| 411 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 412 | else |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 413 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 414 | fi |
| 415 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 416 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 417 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 418 | # Basic test to check for compatible version and correct linking |
| 419 | # *does not* test for RSA - that comes later. |
| 420 | AC_TRY_RUN( |
| 421 | [ |
Damien Miller | e59ce62 | 2000-05-01 20:54:17 +1000 | [diff] [blame] | 422 | #include <string.h> |
| 423 | #include <openssl/rand.h> |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 424 | int main(void) |
| 425 | { |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 426 | char a[2048]; |
| 427 | memset(a, 0, sizeof(a)); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 428 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 429 | return(RAND_status() <= 0); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 430 | } |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 431 | ], |
| 432 | [ |
| 433 | found_crypto=1 |
| 434 | break; |
| 435 | ], [] |
| 436 | ) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 437 | |
| 438 | if test ! -z "$found_crypto" ; then |
| 439 | break; |
| 440 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 441 | done |
| 442 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 443 | if test -z "$found_crypto" ; then |
| 444 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 445 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 446 | if test -z "$ssldir" ; then |
| 447 | ssldir="(system)" |
| 448 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 449 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 450 | ac_cv_openssldir=$ssldir |
| 451 | ]) |
| 452 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 453 | if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 454 | AC_DEFINE(HAVE_OPENSSL) |
| 455 | dnl Need to recover ssldir - test above runs in subshell |
| 456 | ssldir=$ac_cv_openssldir |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 457 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 458 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 459 | if test ! -z "$need_dash_r" ; then |
| 460 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 461 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 462 | if test ! -z "$blibpath" ; then |
| 463 | blibpath="$blibpath:$ssldir:$ssldir/lib" |
| 464 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 465 | fi |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 466 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 467 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 468 | # Now test RSA support |
| 469 | saved_LIBS="$LIBS" |
| 470 | AC_MSG_CHECKING([for RSA support]) |
| 471 | for WANTS_RSAREF in "" 1 ; do |
| 472 | if test -z "$WANTS_RSAREF" ; then |
| 473 | LIBS="$saved_LIBS" |
| 474 | else |
| 475 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 476 | fi |
| 477 | AC_TRY_RUN([ |
| 478 | #include <string.h> |
| 479 | #include <openssl/rand.h> |
| 480 | #include <openssl/rsa.h> |
| 481 | #include <openssl/bn.h> |
| 482 | #include <openssl/sha.h> |
| 483 | int main(void) |
| 484 | { |
| 485 | int num; RSA *key; static unsigned char p_in[] = "blahblah"; |
| 486 | unsigned char c[256], p[256]; |
| 487 | memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); |
| 488 | if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); |
| 489 | num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); |
| 490 | return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); |
| 491 | } |
| 492 | ], |
| 493 | [ |
| 494 | rsa_works=1 |
| 495 | break; |
| 496 | ], []) |
| 497 | done |
| 498 | |
| 499 | if test ! -z "$no_rsa" ; then |
| 500 | AC_MSG_RESULT(disabled) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 501 | RSA_MSG="disabled" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 502 | else |
| 503 | if test -z "$rsa_works" ; then |
| 504 | AC_MSG_WARN([*** No RSA support found *** ]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 505 | RSA_MSG="no" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 506 | else |
| 507 | if test -z "$WANTS_RSAREF" ; then |
| 508 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 509 | RSA_MSG="yes" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 510 | else |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 511 | RSA_MSG="yes (using RSAref)" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 512 | AC_MSG_RESULT(using RSAref) |
| 513 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
| 514 | fi |
| 515 | fi |
| 516 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 517 | |
Ben Lindstrom | b562864 | 2000-10-18 00:02:25 +0000 | [diff] [blame] | 518 | # Cheap hack to ensure NEWS-OS libraries are arranged right. |
| 519 | if test ! -z "$SONY" ; then |
| 520 | LIBS="$LIBS -liberty"; |
| 521 | fi |
| 522 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 523 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 524 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 525 | AC_CHECK_SIZEOF(short int, 2) |
| 526 | AC_CHECK_SIZEOF(int, 4) |
| 527 | AC_CHECK_SIZEOF(long int, 4) |
| 528 | AC_CHECK_SIZEOF(long long int, 8) |
| 529 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 530 | # More checks for data types |
Damien Miller | caf6dd6 | 2000-08-29 11:33:50 +1100 | [diff] [blame] | 531 | AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [ |
| 532 | AC_TRY_COMPILE( |
| 533 | [ #include <sys/types.h> ], |
| 534 | [ u_int a; a = 1;], |
| 535 | [ ac_cv_have_u_int="yes" ], |
| 536 | [ ac_cv_have_u_int="no" ] |
| 537 | ) |
| 538 | ]) |
| 539 | if test "x$ac_cv_have_u_int" = "xyes" ; then |
| 540 | AC_DEFINE(HAVE_U_INT) |
| 541 | have_u_int=1 |
| 542 | fi |
| 543 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 544 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 545 | AC_TRY_COMPILE( |
| 546 | [ #include <sys/types.h> ], |
| 547 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 548 | [ ac_cv_have_intxx_t="yes" ], |
| 549 | [ ac_cv_have_intxx_t="no" ] |
| 550 | ) |
| 551 | ]) |
| 552 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 553 | AC_DEFINE(HAVE_INTXX_T) |
| 554 | have_intxx_t=1 |
| 555 | fi |
| 556 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 557 | AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ |
| 558 | AC_TRY_COMPILE( |
| 559 | [ #include <sys/types.h> ], |
| 560 | [ int64_t a; a = 1;], |
| 561 | [ ac_cv_have_int64_t="yes" ], |
| 562 | [ ac_cv_have_int64_t="no" ] |
| 563 | ) |
| 564 | ]) |
| 565 | if test "x$ac_cv_have_int64_t" = "xyes" ; then |
| 566 | AC_DEFINE(HAVE_INT64_T) |
| 567 | have_int64_t=1 |
| 568 | fi |
| 569 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 570 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 571 | AC_TRY_COMPILE( |
| 572 | [ #include <sys/types.h> ], |
| 573 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 574 | [ ac_cv_have_u_intxx_t="yes" ], |
| 575 | [ ac_cv_have_u_intxx_t="no" ] |
| 576 | ) |
| 577 | ]) |
| 578 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 579 | AC_DEFINE(HAVE_U_INTXX_T) |
| 580 | have_u_intxx_t=1 |
| 581 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 582 | |
Damien Miller | 578783e | 2000-09-23 14:12:24 +1100 | [diff] [blame] | 583 | AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [ |
| 584 | AC_TRY_COMPILE( |
| 585 | [ #include <sys/types.h> ], |
| 586 | [ u_int64_t a; a = 1;], |
| 587 | [ ac_cv_have_u_int64_t="yes" ], |
| 588 | [ ac_cv_have_u_int64_t="no" ] |
| 589 | ) |
| 590 | ]) |
| 591 | if test "x$ac_cv_have_u_int64_t" = "xyes" ; then |
| 592 | AC_DEFINE(HAVE_U_INT64_T) |
| 593 | have_u_int64_t=1 |
| 594 | fi |
| 595 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 596 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 597 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 598 | then |
| 599 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 600 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 601 | [ |
| 602 | #include <sys/bitypes.h> |
| 603 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 604 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 605 | int8_t a; int16_t b; int32_t c; |
| 606 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 607 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 608 | ], |
| 609 | [ |
| 610 | AC_DEFINE(HAVE_U_INTXX_T) |
| 611 | AC_DEFINE(HAVE_INTXX_T) |
| 612 | AC_MSG_RESULT(yes) |
| 613 | ], |
| 614 | [AC_MSG_RESULT(no)] |
| 615 | ) |
| 616 | fi |
| 617 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 618 | if test -z "$have_u_intxx_t" ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 619 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 620 | AC_TRY_COMPILE( |
| 621 | [ |
| 622 | #include <sys/types.h> |
| 623 | ], |
| 624 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 625 | [ ac_cv_have_uintxx_t="yes" ], |
| 626 | [ ac_cv_have_uintxx_t="no" ] |
| 627 | ) |
| 628 | ]) |
| 629 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 630 | AC_DEFINE(HAVE_UINTXX_T) |
| 631 | fi |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 632 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 633 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 634 | AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [ |
| 635 | AC_TRY_COMPILE( |
| 636 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 637 | #include <sys/types.h> |
| 638 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 639 | ], |
| 640 | [socklen_t foo; foo = 1235;], |
| 641 | [ ac_cv_have_socklen_t="yes" ], |
| 642 | [ ac_cv_have_socklen_t="no" ] |
| 643 | ) |
| 644 | ]) |
| 645 | if test "x$ac_cv_have_socklen_t" = "xyes" ; then |
| 646 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 647 | fi |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 648 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 649 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 650 | AC_TRY_COMPILE( |
| 651 | [ |
| 652 | #include <sys/types.h> |
| 653 | ], |
| 654 | [ size_t foo; foo = 1235; ], |
| 655 | [ ac_cv_have_size_t="yes" ], |
| 656 | [ ac_cv_have_size_t="no" ] |
| 657 | ) |
| 658 | ]) |
| 659 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 660 | AC_DEFINE(HAVE_SIZE_T) |
| 661 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 662 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 663 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 664 | AC_TRY_COMPILE( |
| 665 | [ |
| 666 | #include <sys/types.h> |
| 667 | ], |
| 668 | [ ssize_t foo; foo = 1235; ], |
| 669 | [ ac_cv_have_ssize_t="yes" ], |
| 670 | [ ac_cv_have_ssize_t="no" ] |
| 671 | ) |
| 672 | ]) |
| 673 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 674 | AC_DEFINE(HAVE_SSIZE_T) |
| 675 | fi |
| 676 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 677 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 678 | AC_TRY_COMPILE( |
| 679 | [ |
| 680 | #include <sys/types.h> |
| 681 | #include <sys/socket.h> |
| 682 | ], |
| 683 | [ sa_family_t foo; foo = 1235; ], |
| 684 | [ ac_cv_have_sa_family_t="yes" ], |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 685 | [ AC_TRY_COMPILE( |
| 686 | [ |
| 687 | #include <sys/types.h> |
| 688 | #include <sys/socket.h> |
| 689 | #include <netinet/in.h> |
| 690 | ], |
| 691 | [ sa_family_t foo; foo = 1235; ], |
| 692 | [ ac_cv_have_sa_family_t="yes" ], |
| 693 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 694 | [ ac_cv_have_sa_family_t="no" ] |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 695 | )] |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 696 | ) |
| 697 | ]) |
| 698 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 699 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 700 | fi |
| 701 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 702 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 703 | AC_TRY_COMPILE( |
| 704 | [ |
| 705 | #include <sys/types.h> |
| 706 | ], |
| 707 | [ pid_t foo; foo = 1235; ], |
| 708 | [ ac_cv_have_pid_t="yes" ], |
| 709 | [ ac_cv_have_pid_t="no" ] |
| 710 | ) |
| 711 | ]) |
| 712 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 713 | AC_DEFINE(HAVE_PID_T) |
| 714 | fi |
| 715 | |
| 716 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 717 | AC_TRY_COMPILE( |
| 718 | [ |
| 719 | #include <sys/types.h> |
| 720 | ], |
| 721 | [ mode_t foo; foo = 1235; ], |
| 722 | [ ac_cv_have_mode_t="yes" ], |
| 723 | [ ac_cv_have_mode_t="no" ] |
| 724 | ) |
| 725 | ]) |
| 726 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 727 | AC_DEFINE(HAVE_MODE_T) |
| 728 | fi |
| 729 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 730 | |
| 731 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 732 | AC_TRY_COMPILE( |
| 733 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 734 | #include <sys/types.h> |
| 735 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 736 | ], |
| 737 | [ struct sockaddr_storage s; ], |
| 738 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 739 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 740 | ) |
| 741 | ]) |
| 742 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 743 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 744 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 745 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 746 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 747 | AC_TRY_COMPILE( |
| 748 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 749 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 750 | #include <netinet/in.h> |
| 751 | ], |
| 752 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 753 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 754 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 755 | ) |
| 756 | ]) |
| 757 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 758 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 759 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 760 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 761 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 762 | AC_TRY_COMPILE( |
| 763 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 764 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 765 | #include <netinet/in.h> |
| 766 | ], |
| 767 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 768 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 769 | [ ac_cv_have_struct_in6_addr="no" ] |
| 770 | ) |
| 771 | ]) |
| 772 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 773 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 774 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 775 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 776 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 777 | AC_TRY_COMPILE( |
| 778 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 779 | #include <sys/types.h> |
| 780 | #include <sys/socket.h> |
| 781 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 782 | ], |
| 783 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 784 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 785 | [ ac_cv_have_struct_addrinfo="no" ] |
| 786 | ) |
| 787 | ]) |
| 788 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 789 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 790 | fi |
| 791 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 792 | dnl Checks for structure members |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 793 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 794 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 795 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 796 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 797 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP) |
Damien Miller | ad1bc5f | 2000-05-20 14:53:09 +1000 | [diff] [blame] | 798 | OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 799 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 800 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP) |
Damien Miller | 8e81ed3 | 2000-07-01 13:17:42 +1000 | [diff] [blame] | 801 | OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 802 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 803 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 804 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 805 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 806 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 807 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 808 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 809 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 810 | AC_STRUCT_ST_BLKSIZE |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 811 | |
Damien Miller | 942da03 | 2000-08-18 13:59:06 +1000 | [diff] [blame] | 812 | AC_CACHE_CHECK([for sun_len field in struct sockaddr_un], |
| 813 | ac_cv_have_sun_len_in_struct_sockaddr_un, [ |
| 814 | AC_TRY_COMPILE( |
| 815 | [ |
| 816 | #include <sys/types.h> |
| 817 | #include <sys/socket.h> |
| 818 | ], |
| 819 | [ struct sockaddr_un s; s.sun_len = 1; ], |
| 820 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="yes" ], |
| 821 | [ ac_cv_have_sun_len_in_struct_sockaddr_un="no" ], |
| 822 | ) |
| 823 | ]) |
| 824 | if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then |
| 825 | AC_DEFINE(HAVE_SUN_LEN_IN_SOCKADDR_UN) |
| 826 | fi |
| 827 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 828 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 829 | ac_cv_have_ss_family_in_struct_ss, [ |
| 830 | AC_TRY_COMPILE( |
| 831 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 832 | #include <sys/types.h> |
| 833 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 834 | ], |
| 835 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 836 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 837 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 838 | ) |
| 839 | ]) |
| 840 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 841 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 842 | fi |
| 843 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 844 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 845 | ac_cv_have___ss_family_in_struct_ss, [ |
| 846 | AC_TRY_COMPILE( |
| 847 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 848 | #include <sys/types.h> |
| 849 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 850 | ], |
| 851 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 852 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 853 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 854 | ) |
| 855 | ]) |
| 856 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 857 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 858 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 859 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 860 | AC_CACHE_CHECK([for pw_class field in struct passwd], |
| 861 | ac_cv_have_pw_class_in_struct_passwd, [ |
| 862 | AC_TRY_COMPILE( |
| 863 | [ |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 864 | #include <pwd.h> |
| 865 | ], |
Kevin Steves | 48b7cc0 | 2000-10-07 13:24:00 +0000 | [diff] [blame] | 866 | [ struct passwd p; p.pw_class = 0; ], |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 867 | [ ac_cv_have_pw_class_in_struct_passwd="yes" ], |
| 868 | [ ac_cv_have_pw_class_in_struct_passwd="no" ] |
| 869 | ) |
| 870 | ]) |
| 871 | if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then |
| 872 | AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD) |
| 873 | fi |
| 874 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 875 | |
| 876 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 877 | AC_TRY_LINK([], |
| 878 | [ extern char *__progname; printf("%s", __progname); ], |
| 879 | [ ac_cv_libc_defines___progname="yes" ], |
| 880 | [ ac_cv_libc_defines___progname="no" ] |
| 881 | ) |
| 882 | ]) |
| 883 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 884 | AC_DEFINE(HAVE___PROGNAME) |
| 885 | fi |
| 886 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 887 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 888 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 889 | AC_TRY_LINK([], |
| 890 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 891 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 892 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 893 | ) |
| 894 | ]) |
| 895 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 896 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 897 | fi |
| 898 | |
| 899 | |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 900 | AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [ |
| 901 | AC_TRY_LINK([], |
| 902 | [ extern int sys_nerr; printf("%i", sys_nerr);], |
| 903 | [ ac_cv_libc_defines_sys_nerr="yes" ], |
| 904 | [ ac_cv_libc_defines_sys_nerr="no" ] |
| 905 | ) |
| 906 | ]) |
| 907 | if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then |
| 908 | AC_DEFINE(HAVE_SYS_NERR) |
| 909 | fi |
| 910 | |
| 911 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 912 | # Looking for programs, paths and files |
| 913 | AC_ARG_WITH(rsh, |
| 914 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 915 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 916 | if test "x$withval" != "$no" ; then |
Damien Miller | 90dcc05 | 2000-07-08 10:17:40 +1000 | [diff] [blame] | 917 | rsh_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 918 | fi |
| 919 | ], |
| 920 | [ |
| 921 | AC_PATH_PROG(rsh_path, rsh) |
| 922 | ] |
| 923 | ) |
| 924 | |
| 925 | AC_ARG_WITH(xauth, |
| 926 | [ --with-xauth=PATH Specify path to xauth program ], |
| 927 | [ |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 928 | if test "x$withval" != "xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 929 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 930 | fi |
| 931 | ], |
| 932 | [ |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 933 | AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 934 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 935 | xauth_path="/usr/openwin/bin/xauth" |
| 936 | fi |
| 937 | ] |
| 938 | ) |
| 939 | |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 940 | if test -z "$xauth_path" ; then |
| 941 | XAUTH_PATH="undefined" |
| 942 | AC_SUBST(XAUTH_PATH) |
| 943 | else |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 944 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
Damien Miller | a19cf47 | 2000-11-29 13:28:50 +1100 | [diff] [blame] | 945 | XAUTH_PATH=$xauth_path |
| 946 | AC_SUBST(XAUTH_PATH) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 947 | fi |
| 948 | if test ! -z "$rsh_path" ; then |
| 949 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 950 | fi |
| 951 | |
| 952 | # Check for mail directory (last resort if we cannot get it from headers) |
| 953 | if test ! -z "$MAIL" ; then |
| 954 | maildir=`dirname $MAIL` |
| 955 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 956 | fi |
| 957 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 958 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 959 | AC_CHECK_FILE("/dev/ptmx", |
| 960 | [ |
| 961 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 962 | have_dev_ptmx=1 |
| 963 | ] |
| 964 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 965 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 966 | AC_CHECK_FILE("/dev/ptc", |
| 967 | [ |
| 968 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 969 | have_dev_ptc=1 |
| 970 | ] |
| 971 | ) |
| 972 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 973 | # Options from here on. Some of these are preset by platform above |
| 974 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 975 | # Check for user-specified random device, otherwise check /dev/urandom |
| 976 | AC_ARG_WITH(random, |
| 977 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 978 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 979 | if test "x$withval" != "xno" ; then |
| 980 | RANDOM_POOL="$withval"; |
| 981 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 982 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 983 | ], |
| 984 | [ |
| 985 | # Check for random device |
| 986 | AC_CHECK_FILE("/dev/urandom", |
| 987 | [ |
| 988 | RANDOM_POOL="/dev/urandom"; |
| 989 | AC_SUBST(RANDOM_POOL) |
| 990 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 991 | ] |
| 992 | ) |
| 993 | ] |
| 994 | ) |
| 995 | |
| 996 | # Check for EGD pool file |
| 997 | AC_ARG_WITH(egd-pool, |
| 998 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 999 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 1000 | if test "x$withval" != "xno" ; then |
| 1001 | EGD_SOCKET="$withval"; |
| 1002 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 1003 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1004 | ] |
| 1005 | ) |
| 1006 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1007 | # detect pathnames for entropy gathering commands, if we need them |
| 1008 | INSTALL_SSH_PRNG_CMDS="" |
| 1009 | rm -f prng_commands |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1010 | if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1011 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1012 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 1013 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 1014 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 1015 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 1016 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 1017 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 1018 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 1019 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 1020 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 1021 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 1022 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 1023 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 1024 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 1025 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
| 1026 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1027 | |
| 1028 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1029 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1030 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 1031 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 1032 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 1033 | AC_ARG_WITH(catman, |
| 1034 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 1035 | [ |
| 1036 | MANTYPE='$(CATMAN)' |
| 1037 | if test x"$withval" != x"yes" ; then |
| 1038 | mansubdir=$withval |
| 1039 | else |
| 1040 | mansubdir=cat |
| 1041 | fi |
| 1042 | ], [ |
| 1043 | if test -z "$MANTYPE" ; then |
| 1044 | MANTYPE='$(TROFFMAN)' |
| 1045 | mansubdir=man |
| 1046 | fi |
| 1047 | ] |
| 1048 | ) |
| 1049 | AC_SUBST(MANTYPE) |
| 1050 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1051 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1052 | # Check whether user wants Kerberos support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1053 | KRB4_MSG="no" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1054 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1055 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1056 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1057 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1058 | |
Ben Lindstrom | 23e1371 | 2000-10-29 22:49:19 +0000 | [diff] [blame] | 1059 | if test "x$withval" != "xyes" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1060 | CFLAGS="$CFLAGS -I${withval}/include" |
| 1061 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1062 | if test ! -z "$need_dash_r" ; then |
| 1063 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 1064 | fi |
| 1065 | if test ! -z "$blibpath" ; then |
| 1066 | blibpath="$blibpath:${withval}/lib" |
| 1067 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1068 | else |
| 1069 | if test -d /usr/include/kerberosIV ; then |
| 1070 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 1071 | fi |
| 1072 | fi |
| 1073 | |
| 1074 | AC_CHECK_HEADERS(krb.h) |
| 1075 | AC_CHECK_LIB(krb, main) |
| 1076 | if test "$ac_cv_header_krb_h" != yes; then |
| 1077 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 1078 | fi |
| 1079 | if test "$ac_cv_lib_krb_main" != yes; then |
| 1080 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 1081 | fi |
| 1082 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 1083 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1084 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 1085 | KRB4=yes |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1086 | KRB4_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1087 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1088 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1089 | ] |
| 1090 | ) |
| 1091 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1092 | # Check whether user wants AFS support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1093 | AFS_MSG="no" |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 1094 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1095 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1096 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1097 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1098 | |
Ben Lindstrom | 76020ba | 2000-10-25 16:55:00 +0000 | [diff] [blame] | 1099 | if test "x$withval" != "xyes" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1100 | CFLAGS="$CFLAGS -I${withval}/include" |
Ben Lindstrom | 305fb00 | 2000-11-10 02:41:30 +0000 | [diff] [blame] | 1101 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1102 | fi |
| 1103 | |
| 1104 | if test -z "$KRB4" ; then |
| 1105 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 1106 | fi |
| 1107 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1108 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1109 | if test ! -z "$AFS_LIBS" ; then |
| 1110 | LIBS="$LIBS $AFS_LIBS" |
| 1111 | fi |
| 1112 | AC_DEFINE(AFS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1113 | AFS_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1114 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1115 | ] |
| 1116 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 1117 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1118 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1119 | # Check whether user wants S/Key support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1120 | SKEY_MSG="no" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1121 | AC_ARG_WITH(skey, |
Ben Lindstrom | 305fb00 | 2000-11-10 02:41:30 +0000 | [diff] [blame] | 1122 | [ --with-skey=PATH Enable S/Key support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1123 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1124 | if test "x$withval" != "xno" ; then |
Ben Lindstrom | 305fb00 | 2000-11-10 02:41:30 +0000 | [diff] [blame] | 1125 | |
| 1126 | if test "x$withval" != "xyes" ; then |
| 1127 | CFLAGS="$CFLAGS -I${withval}/include" |
| 1128 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
| 1129 | fi |
| 1130 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1131 | AC_DEFINE(SKEY) |
| 1132 | LIBS="$LIBS -lskey" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1133 | SKEY_MSG="yes" |
Ben Lindstrom | 305fb00 | 2000-11-10 02:41:30 +0000 | [diff] [blame] | 1134 | |
| 1135 | AC_CHECK_FUNC(skey_keyinfo, |
| 1136 | [], |
| 1137 | [ |
| 1138 | AC_MSG_ERROR([** Incomplete or missing s/key libraries.]) |
| 1139 | ]) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1140 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1141 | ] |
| 1142 | ) |
| 1143 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1144 | # Check whether user wants TCP wrappers support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1145 | TCPW_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 1146 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1147 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 1148 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1149 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 1150 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 1151 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 1152 | AC_MSG_CHECKING(for libwrap) |
| 1153 | AC_TRY_LINK( |
| 1154 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 1155 | #include <tcpd.h> |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 1156 | int deny_severity = 0, allow_severity = 0; |
| 1157 | ], |
| 1158 | [hosts_access(0);], |
| 1159 | [ |
| 1160 | AC_MSG_RESULT(yes) |
| 1161 | AC_DEFINE(LIBWRAP) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1162 | TCPW_MSG="yes" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 1163 | ], |
| 1164 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1165 | AC_MSG_ERROR([*** libwrap missing]) |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 1166 | ] |
| 1167 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1168 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 1169 | ] |
| 1170 | ) |
| 1171 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1172 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1173 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 1174 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1175 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1176 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 1177 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1178 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1179 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 1180 | fi |
| 1181 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 1182 | ) |
| 1183 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1184 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1185 | AC_ARG_WITH(shadow, |
| 1186 | [ --without-shadow Disable shadow password support], |
| 1187 | [ |
| 1188 | if test "x$withval" = "xno" ; then |
| 1189 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1190 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1191 | fi |
| 1192 | ] |
| 1193 | ) |
| 1194 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1195 | if test -z "$disable_shadow" ; then |
| 1196 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 1197 | AC_TRY_COMPILE( |
| 1198 | [ |
| 1199 | #include <sys/types.h> |
| 1200 | #include <shadow.h> |
| 1201 | struct spwd sp; |
| 1202 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 1203 | [ sp_expire_available=yes ], [] |
| 1204 | ) |
| 1205 | |
| 1206 | if test "x$sp_expire_available" = "xyes" ; then |
| 1207 | AC_MSG_RESULT(yes) |
| 1208 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 1209 | else |
| 1210 | AC_MSG_RESULT(no) |
| 1211 | fi |
| 1212 | fi |
| 1213 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1214 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 1215 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 1216 | DISPLAY_HACK_MSG="yes" |
| 1217 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1218 | else |
| 1219 | DISPLAY_HACK_MSG="no" |
| 1220 | AC_ARG_WITH(ipaddr-display, |
| 1221 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1222 | [ |
| 1223 | if test "x$withval" != "xno" ; then |
| 1224 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1225 | DISPLAY_HACK_MSG="yes" |
| 1226 | fi |
| 1227 | ] |
| 1228 | ) |
| 1229 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1230 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1231 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1232 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1233 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1234 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 1235 | [ |
| 1236 | if test "x$withval" != "xno" ; then |
Damien Miller | e68f92b | 2000-10-02 21:42:15 +1100 | [diff] [blame] | 1237 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1238 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1239 | fi |
| 1240 | ] |
| 1241 | ) |
| 1242 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1243 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1244 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1245 | AC_ARG_WITH(ipv4-default, |
| 1246 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 1247 | [ |
| 1248 | if test "x$withval" != "xno" ; then |
| 1249 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1250 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1251 | fi |
| 1252 | ] |
| 1253 | ) |
| 1254 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1255 | AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1256 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1257 | AC_ARG_WITH(4in6, |
| 1258 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 1259 | [ |
| 1260 | if test "x$withval" != "xno" ; then |
| 1261 | AC_MSG_RESULT(yes) |
| 1262 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1263 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1264 | else |
| 1265 | AC_MSG_RESULT(no) |
| 1266 | fi |
| 1267 | ],[ |
| 1268 | if test "x$inet6_default_4in6" = "xyes"; then |
| 1269 | AC_MSG_RESULT([yes (default)]) |
| 1270 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1271 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1272 | else |
| 1273 | AC_MSG_RESULT([no (default)]) |
| 1274 | fi |
| 1275 | ] |
| 1276 | ) |
| 1277 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1278 | AC_MSG_CHECKING(whether to install ssh as suid root) |
| 1279 | AC_ARG_ENABLE(suid-ssh, |
| 1280 | [ --enable-suid-ssh Install ssh as suid root (default) |
| 1281 | --disable-suid-ssh Install ssh without suid bit], |
| 1282 | [ case "$enableval" in |
| 1283 | no) |
| 1284 | AC_MSG_RESULT(no) |
| 1285 | SSHMODE=0711 |
| 1286 | ;; |
| 1287 | *) AC_MSG_RESULT(yes) |
| 1288 | SSHMODE=04711 |
| 1289 | ;; |
| 1290 | esac ], |
| 1291 | AC_MSG_RESULT(yes) |
| 1292 | SSHMODE=04711 |
| 1293 | ) |
| 1294 | AC_SUBST(SSHMODE) |
| 1295 | |
| 1296 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1297 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1298 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1299 | AC_ARG_WITH(pid-dir, |
| 1300 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 1301 | [ |
| 1302 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1303 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1304 | fi |
| 1305 | ] |
| 1306 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1307 | |
Damien Miller | 78315eb | 2000-09-29 23:01:36 +1100 | [diff] [blame] | 1308 | # make sure the directory exists |
| 1309 | if test ! -d $piddir ; then |
| 1310 | piddir=`eval echo ${sysconfdir}` |
| 1311 | case $piddir in |
| 1312 | NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; |
| 1313 | esac |
| 1314 | fi |
| 1315 | |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 1316 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1317 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1318 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1319 | dnl allow user to disable some login recording features |
| 1320 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1321 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1322 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 1323 | ) |
| 1324 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1325 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1326 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 1327 | ) |
| 1328 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1329 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1330 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 1331 | ) |
| 1332 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1333 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1334 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 1335 | ) |
| 1336 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1337 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1338 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 1339 | ) |
| 1340 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1341 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1342 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 1343 | ) |
| 1344 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1345 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1346 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 1347 | ) |
| 1348 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1349 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1350 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 1351 | ) |
| 1352 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1353 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1354 | [ conf_lastlog_location="$withval"; ],) |
| 1355 | |
| 1356 | dnl lastlog, [uw]tmpx? detection |
| 1357 | dnl NOTE: set the paths in the platform section to avoid the |
| 1358 | dnl need for command-line parameters |
| 1359 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 1360 | |
| 1361 | dnl lastlog detection |
| 1362 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 1363 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 1364 | AC_TRY_COMPILE([ |
| 1365 | #include <sys/types.h> |
| 1366 | #include <utmp.h> |
| 1367 | #ifdef HAVE_LASTLOG_H |
| 1368 | # include <lastlog.h> |
| 1369 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1370 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1371 | # include <paths.h> |
| 1372 | #endif |
| 1373 | ], |
| 1374 | [ char *lastlog = LASTLOG_FILE; ], |
| 1375 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1376 | [ |
| 1377 | AC_MSG_RESULT(no) |
| 1378 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 1379 | AC_TRY_COMPILE([ |
| 1380 | #include <sys/types.h> |
| 1381 | #include <utmp.h> |
| 1382 | #ifdef HAVE_LASTLOG_H |
| 1383 | # include <lastlog.h> |
| 1384 | #endif |
| 1385 | #ifdef HAVE_PATHS_H |
| 1386 | # include <paths.h> |
| 1387 | #endif |
| 1388 | ], |
| 1389 | [ char *lastlog = _PATH_LASTLOG; ], |
| 1390 | [ AC_MSG_RESULT(yes) ], |
| 1391 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 1392 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1393 | system_lastlog_path=no |
| 1394 | ]) |
| 1395 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1396 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1397 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1398 | if test -z "$conf_lastlog_location"; then |
| 1399 | if test x"$system_lastlog_path" = x"no" ; then |
| 1400 | for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 1401 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1402 | conf_lastlog_location=$f |
| 1403 | fi |
| 1404 | done |
| 1405 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 1406 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 1407 | dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1408 | fi |
| 1409 | fi |
| 1410 | fi |
| 1411 | |
| 1412 | if test -n "$conf_lastlog_location"; then |
| 1413 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 1414 | fi |
| 1415 | |
| 1416 | dnl utmp detection |
| 1417 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 1418 | AC_TRY_COMPILE([ |
| 1419 | #include <sys/types.h> |
| 1420 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1421 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1422 | # include <paths.h> |
| 1423 | #endif |
| 1424 | ], |
| 1425 | [ char *utmp = UTMP_FILE; ], |
| 1426 | [ AC_MSG_RESULT(yes) ], |
| 1427 | [ AC_MSG_RESULT(no) |
| 1428 | system_utmp_path=no ] |
| 1429 | ) |
| 1430 | if test -z "$conf_utmp_location"; then |
| 1431 | if test x"$system_utmp_path" = x"no" ; then |
| 1432 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 1433 | if test -f $f ; then |
| 1434 | conf_utmp_location=$f |
| 1435 | fi |
| 1436 | done |
| 1437 | if test -z "$conf_utmp_location"; then |
| 1438 | AC_DEFINE(DISABLE_UTMP) |
| 1439 | fi |
| 1440 | fi |
| 1441 | fi |
| 1442 | if test -n "$conf_utmp_location"; then |
| 1443 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 1444 | fi |
| 1445 | |
| 1446 | dnl wtmp detection |
| 1447 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 1448 | AC_TRY_COMPILE([ |
| 1449 | #include <sys/types.h> |
| 1450 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1451 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1452 | # include <paths.h> |
| 1453 | #endif |
| 1454 | ], |
| 1455 | [ char *wtmp = WTMP_FILE; ], |
| 1456 | [ AC_MSG_RESULT(yes) ], |
| 1457 | [ AC_MSG_RESULT(no) |
| 1458 | system_wtmp_path=no ] |
| 1459 | ) |
| 1460 | if test -z "$conf_wtmp_location"; then |
| 1461 | if test x"$system_wtmp_path" = x"no" ; then |
| 1462 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1463 | if test -f $f ; then |
| 1464 | conf_wtmp_location=$f |
| 1465 | fi |
| 1466 | done |
| 1467 | if test -z "$conf_wtmp_location"; then |
| 1468 | AC_DEFINE(DISABLE_WTMP) |
| 1469 | fi |
| 1470 | fi |
| 1471 | fi |
| 1472 | if test -n "$conf_wtmp_location"; then |
| 1473 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1474 | fi |
| 1475 | |
| 1476 | |
| 1477 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1478 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1479 | dnl there, though. |
| 1480 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1481 | AC_TRY_COMPILE([ |
| 1482 | #include <sys/types.h> |
| 1483 | #include <utmp.h> |
| 1484 | #ifdef HAVE_UTMPX_H |
| 1485 | #include <utmpx.h> |
| 1486 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1487 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1488 | # include <paths.h> |
| 1489 | #endif |
| 1490 | ], |
| 1491 | [ char *utmpx = UTMPX_FILE; ], |
| 1492 | [ AC_MSG_RESULT(yes) ], |
| 1493 | [ AC_MSG_RESULT(no) |
| 1494 | system_utmpx_path=no ] |
| 1495 | ) |
| 1496 | if test -z "$conf_utmpx_location"; then |
| 1497 | if test x"$system_utmpx_path" = x"no" ; then |
| 1498 | AC_DEFINE(DISABLE_UTMPX) |
| 1499 | fi |
| 1500 | else |
| 1501 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1502 | fi |
| 1503 | |
| 1504 | dnl wtmpx detection |
| 1505 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1506 | AC_TRY_COMPILE([ |
| 1507 | #include <sys/types.h> |
| 1508 | #include <utmp.h> |
| 1509 | #ifdef HAVE_UTMPX_H |
| 1510 | #include <utmpx.h> |
| 1511 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1512 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1513 | # include <paths.h> |
| 1514 | #endif |
| 1515 | ], |
| 1516 | [ char *wtmpx = WTMPX_FILE; ], |
| 1517 | [ AC_MSG_RESULT(yes) ], |
| 1518 | [ AC_MSG_RESULT(no) |
| 1519 | system_wtmpx_path=no ] |
| 1520 | ) |
| 1521 | if test -z "$conf_wtmpx_location"; then |
| 1522 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1523 | AC_DEFINE(DISABLE_WTMPX) |
| 1524 | fi |
| 1525 | else |
| 1526 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1527 | fi |
| 1528 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1529 | |
| 1530 | # Change default command timeout for builtin PRNG |
Damien Miller | 14c12cb | 2000-06-07 22:20:23 +1000 | [diff] [blame] | 1531 | entropy_timeout=200 |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1532 | AC_ARG_WITH(entropy-timeout, |
| 1533 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1534 | [ |
| 1535 | if test "x$withval" != "xno" ; then |
| 1536 | entropy_timeout=$withval |
| 1537 | fi |
| 1538 | ] |
| 1539 | ) |
| 1540 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1541 | |
| 1542 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1543 | if test ! -z "$blibpath" ; then |
| 1544 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 1545 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 1546 | fi |
| 1547 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 1548 | AC_EXEEXT |
| 1549 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1550 | AC_OUTPUT(Makefile ssh_prng_cmds) |
| 1551 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1552 | # Print summary of options |
| 1553 | |
| 1554 | if test x$MANTYPE = x'$(CATMAN)' ; then |
| 1555 | MAN_MSG=cat |
| 1556 | else |
| 1557 | MAN_MSG=man |
| 1558 | fi |
| 1559 | if test ! -z "$RANDOM_POOL" ; then |
| 1560 | RAND_MSG="Device ($RANDOM_POOL)" |
| 1561 | else |
| 1562 | if test ! -z "$EGD_SOCKET" ; then |
| 1563 | RAND_MSG="EGD ($EGD_SOCKET)" |
| 1564 | else |
| 1565 | RAND_MSG="Builtin (timeout $entropy_timeout)" |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1566 | BUILTIN_RNG=1 |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1567 | fi |
| 1568 | fi |
| 1569 | |
| 1570 | # Someone please show me a better way :) |
| 1571 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 1572 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 1573 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 1574 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
Kevin Steves | e0f4914 | 2000-10-14 17:51:48 +0000 | [diff] [blame] | 1575 | E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1576 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
| 1577 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
| 1578 | |
| 1579 | echo "" |
| 1580 | echo "OpenSSH configured has been configured with the following options." |
| 1581 | echo " User binaries: $B" |
Damien Miller | e68f92b | 2000-10-02 21:42:15 +1100 | [diff] [blame] | 1582 | echo " User binaries: $B" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1583 | echo " System binaries: $C" |
| 1584 | echo " Configuration files: $D" |
| 1585 | echo " Askpass program: $E" |
| 1586 | echo " Manual pages: $F" |
| 1587 | echo " PID file: $G" |
| 1588 | echo " Random number collection: $RAND_MSG" |
| 1589 | echo " Manpage format: $MAN_MSG" |
| 1590 | echo " PAM support: ${PAM_MSG}" |
| 1591 | echo " KerberosIV support: $KRB4_MSG" |
| 1592 | echo " AFS support: $AFS_MSG" |
| 1593 | echo " S/KEY support: $SKEY_MSG" |
| 1594 | echo " TCP Wrappers support: $TCPW_MSG" |
| 1595 | echo " MD5 password support: $MD5_MSG" |
| 1596 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
| 1597 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 1598 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 1599 | |
| 1600 | echo "" |
| 1601 | |
Damien Miller | e68f92b | 2000-10-02 21:42:15 +1100 | [diff] [blame] | 1602 | echo " Host: ${host}" |
| 1603 | echo " Compiler: ${CC}" |
| 1604 | echo " Compiler flags: ${CFLAGS}" |
| 1605 | echo " Linker flags: ${LDFLAGS}" |
| 1606 | echo " Libraries: ${LIBS}" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1607 | |
| 1608 | echo "" |
| 1609 | |
Damien Miller | 6f9c337 | 2000-10-25 10:06:04 +1100 | [diff] [blame] | 1610 | if test ! -z "$BUILTIN_RNG" ; then |
| 1611 | echo "WARNING: you are using the builtin random number collection service." |
| 1612 | echo "Please read WARNING.RNG and request that your OS vendor includes" |
| 1613 | echo "/dev/random in future versions of their OS." |
| 1614 | echo "" |
| 1615 | fi |