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 | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 14 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 15 | if test -z "$LD" ; then |
| 16 | LD=$CC |
| 17 | fi |
| 18 | AC_SUBST(LD) |
| 19 | |
| 20 | # C Compiler features |
| 21 | AC_C_INLINE |
| 22 | if test "$GCC" = "yes"; then |
| 23 | CFLAGS="$CFLAGS -Wall" |
| 24 | fi |
| 25 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 26 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 27 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 28 | *-*-aix*) |
| 29 | AFS_LIBS="-lld" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 30 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 31 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 32 | if test "$LD" != "gcc" -a -z "$blibpath"; then |
| 33 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 34 | fi |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 35 | AC_DEFINE(BROKEN_GETADDRINFO) |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 36 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 37 | *-*-hpux10*) |
| 38 | if test -z "$GCC"; then |
| 39 | CFLAGS="$CFLAGS -Aa" |
| 40 | fi |
| 41 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 42 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 43 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 44 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 45 | AC_DEFINE(USE_UTMPX) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 46 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 47 | if test -f /tcb/files/auth/system/default; then |
| 48 | AC_MSG_RESULT(yes) |
| 49 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 50 | LIBS="$LIBS -lsec" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 51 | AC_MSG_WARN([This configuration is untested]) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 52 | else |
| 53 | AC_MSG_RESULT(no) |
| 54 | AC_DEFINE(DISABLE_SHADOW) |
| 55 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 56 | MANTYPE='$(CATMAN)' |
| 57 | mansubdir=cat |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 58 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 59 | *-*-irix5*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 60 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 61 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 62 | MANTYPE='$(CATMAN)' |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 63 | no_libsocket=1 |
| 64 | no_libnsl=1 |
| 65 | ;; |
| 66 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 67 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 68 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 69 | MANTYPE='$(CATMAN)' |
| 70 | AC_MSG_WARN([*** Irix 6.x is not tested, please report you experiences *** ]) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 71 | no_libsocket=1 |
| 72 | no_libnsl=1 |
| 73 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 74 | *-*-linux*) |
| 75 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 76 | AC_DEFINE(DONT_TRY_OTHER_AF) |
| 77 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 78 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 79 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 80 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 81 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 82 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 83 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 08c788a | 2000-03-16 07:52:29 +1100 | [diff] [blame] | 84 | 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] | 85 | need_dash_r=1 |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 86 | AC_DEFINE(USE_UTMPX) |
| 87 | ;; |
| 88 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 89 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 90 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 91 | AC_DEFINE(USE_UTMPX) |
| 92 | MANTYPE='$(CATMAN)' |
| 93 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 94 | LIBS="$LIBS -lgen -lsocket" |
| 95 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 96 | esac |
| 97 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 98 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 99 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 100 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 101 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 102 | if test -z "$no_libsocket" ; then |
| 103 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 104 | fi |
| 105 | if test -z "$no_libnsl" ; then |
| 106 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 107 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 108 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 109 | # Checks for header files. |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 110 | AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.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/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 111 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 112 | # Checks for library functions. |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 113 | AC_CHECK_FUNCS(arc4random bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 114 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 115 | AC_CHECK_FUNC(login, |
| 116 | [AC_DEFINE(HAVE_LOGIN)], |
| 117 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 118 | ) |
| 119 | |
| 120 | AC_CHECK_FUNC(daemon, |
| 121 | [AC_DEFINE(HAVE_DAEMON)], |
| 122 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 123 | ) |
| 124 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 125 | AC_CHECK_FUNC(getpagesize, |
| 126 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 127 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 128 | ) |
| 129 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 130 | AC_ARG_WITH(pam, |
| 131 | [ --without-pam Disable PAM support ], |
| 132 | [ |
| 133 | if test "x$withval" = "xno" ; then |
| 134 | no_pam=1 |
| 135 | AC_DEFINE(DISABLE_PAM) |
| 136 | fi |
| 137 | ] |
| 138 | ) |
| 139 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then |
| 140 | AC_CHECK_LIB(dl, dlopen, , ) |
| 141 | LIBS="$LIBS -lpam" |
| 142 | |
| 143 | # Check PAM strerror arguments (old PAM) |
| 144 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 145 | AC_TRY_COMPILE( |
| 146 | [ |
| 147 | #include <stdlib.h> |
| 148 | #include <security/pam_appl.h> |
| 149 | ], |
| 150 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 151 | [AC_MSG_RESULT(no)], |
| 152 | [ |
| 153 | AC_DEFINE(HAVE_OLD_PAM) |
| 154 | AC_MSG_RESULT(yes) |
| 155 | ] |
| 156 | ) |
| 157 | fi |
| 158 | |
| 159 | # The big search for OpenSSL |
| 160 | AC_ARG_WITH(ssl-dir, |
| 161 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 162 | [ |
| 163 | if test "x$withval" != "$xno" ; then |
| 164 | tryssldir=$withval |
| 165 | fi |
| 166 | ] |
| 167 | ) |
| 168 | |
| 169 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 170 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 171 | saved_CFLAGS="$CFLAGS" |
| 172 | if test "x$prefix" != "xNONE" ; then |
| 173 | tryssldir="$tryssldir $prefix" |
| 174 | fi |
| 175 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) |
Damien Miller | 086b171 | 2000-03-14 14:52:19 +1100 | [diff] [blame] | 176 | 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 | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 177 | if test ! -z "$ssldir" ; then |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 178 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 179 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 180 | if test ! -z "$need_dash_r" ; then |
| 181 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 182 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 183 | else |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 184 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 185 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 186 | |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 187 | for WANTS_RSAREF in "" 1 ; do |
| 188 | |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 189 | if test -z "$WANTS_RSAREF" ; then |
| 190 | LIBS="$saved_LIBS -lcrypto" |
| 191 | else |
| 192 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 193 | fi |
| 194 | |
| 195 | AC_TRY_RUN( |
| 196 | [ |
| 197 | #include <openssl/rsa.h> |
| 198 | #include <openssl/bn.h> |
| 199 | #include <openssl/sha.h> |
| 200 | int main(void) |
Damien Miller | a208e57 | 2000-03-26 12:07:15 +1000 | [diff] [blame] | 201 | { |
| 202 | RSA *key; char a[2048],b[2048];; |
| 203 | memset(a, 0, sizeof(a));memset(b, 0, sizeof(b)); |
Damien Miller | 193ba88 | 2000-04-04 10:21:09 +1000 | [diff] [blame] | 204 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | a208e57 | 2000-03-26 12:07:15 +1000 | [diff] [blame] | 205 | key=RSA_generate_key(32,3,NULL,NULL); |
| 206 | if (key==NULL) return(1); |
| 207 | return(-1==RSA_private_decrypt(RSA_size(key),a,b,key,RSA_NO_PADDING)); |
| 208 | } |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 209 | ], |
| 210 | [ |
| 211 | AC_DEFINE(HAVE_OPENSSL) |
| 212 | found_crypto=1 |
| 213 | break; |
| 214 | ], [] |
| 215 | ) |
| 216 | AC_TRY_RUN( |
| 217 | [ |
| 218 | #include <ssl/rsa.h> |
| 219 | #include <ssl/bn.h> |
| 220 | #include <ssl/sha.h> |
| 221 | int main(void) |
Damien Miller | a208e57 | 2000-03-26 12:07:15 +1000 | [diff] [blame] | 222 | { |
| 223 | RSA *key; char a[2048],b[2048];; |
| 224 | memset(a, 0, sizeof(a));memset(b, 0, sizeof(b)); |
| 225 | RAND_seed(a, sizeof(a)); |
| 226 | key=RSA_generate_key(32,3,NULL,NULL); |
| 227 | if (key==NULL) return(1); |
| 228 | return(-1==RSA_private_decrypt(RSA_size(key),a,b,key,RSA_NO_PADDING)); |
| 229 | } |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 230 | ], |
| 231 | [ |
| 232 | AC_DEFINE(HAVE_SSL) |
| 233 | found_crypto=1 |
| 234 | break; |
| 235 | ], [] |
| 236 | ) |
| 237 | done |
| 238 | |
| 239 | if test ! -z "$found_crypto" ; then |
| 240 | break; |
| 241 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 242 | done |
| 243 | |
| 244 | if test -z "$found_crypto" ; then |
| 245 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
| 246 | fi |
| 247 | if test -z "$ssldir" ; then |
| 248 | ssldir="(system)" |
| 249 | else |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 250 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 251 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 252 | if test ! -z "$need_dash_r" ; then |
| 253 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 254 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 255 | if test ! -z "$blibpath" ; then |
| 256 | blibpath="$blibpath:$ssldir:$ssldir/lib" |
| 257 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 258 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 259 | if test -z "$WANTS_RSAREF" ; then |
| 260 | LIBS="$saved_LIBS -lcrypto" |
| 261 | else |
| 262 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 263 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 264 | AC_MSG_RESULT($ssldir) |
| 265 | |
| 266 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 267 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 268 | AC_CHECK_SIZEOF(short int, 2) |
| 269 | AC_CHECK_SIZEOF(int, 4) |
| 270 | AC_CHECK_SIZEOF(long int, 4) |
| 271 | AC_CHECK_SIZEOF(long long int, 8) |
| 272 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 273 | # More checks for data types |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 274 | AC_MSG_CHECKING([for intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 275 | AC_TRY_COMPILE( |
| 276 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 277 | [int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 278 | [ |
| 279 | AC_DEFINE(HAVE_INTXX_T) |
| 280 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 281 | have_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 282 | ], |
| 283 | [AC_MSG_RESULT(no)] |
| 284 | ) |
| 285 | |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 286 | AC_MSG_CHECKING([for u_intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 287 | AC_TRY_COMPILE( |
| 288 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 289 | [u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 290 | [ |
| 291 | AC_DEFINE(HAVE_U_INTXX_T) |
| 292 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 293 | have_u_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 294 | ], |
| 295 | [AC_MSG_RESULT(no)] |
| 296 | ) |
| 297 | |
Damien Miller | eaf9994 | 2000-01-19 13:45:07 +1100 | [diff] [blame] | 298 | if test -z "$have_u_intxx_t" -o -z "$have_intxx_t" -a \ |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 299 | "x$ac_cv_header_sys_bitypes_h" = "xyes" |
| 300 | then |
| 301 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 302 | AC_TRY_COMPILE( |
| 303 | [#include <sys/bitypes.h>], |
| 304 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 305 | int8_t a; int16_t b; int32_t c; |
| 306 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 307 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 308 | ], |
| 309 | [ |
| 310 | AC_DEFINE(HAVE_U_INTXX_T) |
| 311 | AC_DEFINE(HAVE_INTXX_T) |
| 312 | AC_MSG_RESULT(yes) |
| 313 | ], |
| 314 | [AC_MSG_RESULT(no)] |
| 315 | ) |
| 316 | fi |
| 317 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 318 | if test -z "$have_u_intxx_t" ; then |
| 319 | AC_MSG_CHECKING([for uintXX_t types]) |
| 320 | AC_TRY_COMPILE( |
| 321 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 322 | [uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;], |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 323 | [ |
| 324 | AC_DEFINE(HAVE_UINTXX_T) |
| 325 | AC_MSG_RESULT(yes) |
| 326 | ], |
| 327 | [AC_MSG_RESULT(no)] |
| 328 | ) |
| 329 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 330 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 331 | AC_MSG_CHECKING([for socklen_t]) |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 332 | AC_TRY_COMPILE( |
Damien Miller | f3e8be8 | 1999-12-31 08:59:04 +1100 | [diff] [blame] | 333 | [ |
| 334 | #include <sys/types.h> |
| 335 | #include <sys/socket.h> |
| 336 | ], |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 337 | [socklen_t foo; foo = 1235;], |
| 338 | [ |
| 339 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 340 | AC_MSG_RESULT(yes) |
| 341 | ], |
| 342 | [AC_MSG_RESULT(no)] |
| 343 | ) |
| 344 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 345 | AC_MSG_CHECKING([for size_t]) |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 346 | AC_TRY_COMPILE( |
| 347 | [#include <sys/types.h>], |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 348 | [size_t foo; foo = 1235;], |
| 349 | [ |
| 350 | AC_DEFINE(HAVE_SIZE_T) |
| 351 | AC_MSG_RESULT(yes) |
| 352 | ], |
| 353 | [AC_MSG_RESULT(no)] |
| 354 | ) |
| 355 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 356 | AC_MSG_CHECKING([for struct sockaddr_storage]) |
| 357 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 358 | [ |
| 359 | #include <sys/types.h> |
| 360 | #include <sys/socket.h> |
| 361 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 362 | [struct sockaddr_storage s;], |
| 363 | [ |
| 364 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 365 | AC_MSG_RESULT(yes) |
| 366 | ], |
| 367 | [AC_MSG_RESULT(no)] |
| 368 | ) |
| 369 | |
| 370 | AC_MSG_CHECKING([for struct sockaddr_in6]) |
| 371 | AC_TRY_COMPILE( |
| 372 | [#include <netinet/in.h>], |
| 373 | [struct sockaddr_in6 s; s.sin6_family = 0;], |
| 374 | [ |
| 375 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 376 | AC_MSG_RESULT(yes) |
| 377 | ], |
| 378 | [AC_MSG_RESULT(no)] |
| 379 | ) |
| 380 | |
| 381 | AC_MSG_CHECKING([for struct in6_addr]) |
| 382 | AC_TRY_COMPILE( |
| 383 | [#include <netinet/in.h>], |
| 384 | [struct in6_addr s; s.s6_addr[0] = 0;], |
| 385 | [ |
| 386 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 387 | AC_MSG_RESULT(yes) |
| 388 | ], |
| 389 | [AC_MSG_RESULT(no)] |
| 390 | ) |
| 391 | |
| 392 | AC_MSG_CHECKING([for struct addrinfo]) |
| 393 | AC_TRY_COMPILE( |
| 394 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 395 | #include <sys/types.h> |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 396 | #include <sys/socket.h> |
| 397 | #include <netdb.h> |
| 398 | ], |
| 399 | [struct addrinfo s; s.ai_flags = AI_PASSIVE;], |
| 400 | [ |
| 401 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 402 | AC_MSG_RESULT(yes) |
| 403 | ], |
| 404 | [AC_MSG_RESULT(no)] |
| 405 | ) |
| 406 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 407 | # Checks for structure members |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 408 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
| 409 | AC_EGREP_HEADER(ut_host, utmp.h, |
| 410 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 411 | [AC_MSG_RESULT(no)] |
| 412 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 413 | AC_MSG_CHECKING([whether utmpx.h has ut_host field]) |
| 414 | AC_EGREP_HEADER(ut_host, utmpx.h, |
| 415 | [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 416 | [AC_MSG_RESULT(no)] |
| 417 | ) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 418 | AC_MSG_CHECKING([whether utmpx.h has syslen field]) |
| 419 | AC_EGREP_HEADER(syslen, utmpx.h, |
| 420 | [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 421 | [AC_MSG_RESULT(no)] |
| 422 | ) |
Damien Miller | 4ff2b9b | 1999-12-28 10:41:12 +1100 | [diff] [blame] | 423 | AC_MSG_CHECKING([whether utmp.h has ut_pid field]) |
| 424 | AC_EGREP_HEADER(ut_pid, utmp.h, |
| 425 | [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 426 | [AC_MSG_RESULT(no)] |
| 427 | ) |
| 428 | AC_MSG_CHECKING([whether utmp.h has ut_type field]) |
| 429 | AC_EGREP_HEADER(ut_type, utmp.h, |
| 430 | [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 431 | [AC_MSG_RESULT(no)] |
| 432 | ) |
| 433 | AC_MSG_CHECKING([whether utmp.h has ut_tv field]) |
| 434 | AC_EGREP_HEADER(ut_tv, utmp.h, |
| 435 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 436 | [AC_MSG_RESULT(no)] |
| 437 | ) |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 438 | AC_MSG_CHECKING([whether utmp.h has ut_id field]) |
| 439 | AC_EGREP_HEADER(ut_id, utmp.h, |
| 440 | [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 441 | [AC_MSG_RESULT(no)] |
| 442 | ) |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 443 | AC_MSG_CHECKING([whether utmp.h has ut_addr field]) |
| 444 | AC_EGREP_HEADER(ut_addr, utmp.h, |
| 445 | [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 446 | [AC_MSG_RESULT(no)] |
| 447 | ) |
| 448 | AC_MSG_CHECKING([whether utmpx.h has ut_addr field]) |
| 449 | AC_EGREP_HEADER(ut_addr, utmpx.h, |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 450 | [AC_DEFINE(HAVE_ADDR_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 451 | [AC_MSG_RESULT(no)] |
| 452 | ) |
| 453 | AC_MSG_CHECKING([whether utmp.h has ut_addr_v6 field]) |
| 454 | AC_EGREP_HEADER(ut_addr_v6, utmp.h, |
| 455 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 456 | [AC_MSG_RESULT(no)] |
| 457 | ) |
| 458 | AC_MSG_CHECKING([whether utmpx.h has ut_addr_v6 field]) |
| 459 | AC_EGREP_HEADER(ut_addr_v6, utmpx.h, |
| 460 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 461 | [AC_MSG_RESULT(no)] |
| 462 | ) |
| 463 | |
| 464 | AC_MSG_CHECKING([whether struct sockaddr_storage has ss_family field]) |
| 465 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 466 | [ |
| 467 | #include <sys/types.h> |
| 468 | #include <sys/socket.h> |
| 469 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 470 | [struct sockaddr_storage s; s.ss_family = 1;], |
| 471 | [ |
| 472 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 473 | AC_MSG_RESULT(yes) |
| 474 | ], |
| 475 | [AC_MSG_RESULT(no)] |
| 476 | ) |
| 477 | AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family field]) |
| 478 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 479 | [ |
| 480 | #include <sys/types.h> |
| 481 | #include <sys/socket.h> |
| 482 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 483 | [struct sockaddr_storage s; s.__ss_family = 1;], |
| 484 | [ |
| 485 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 486 | AC_MSG_RESULT(yes) |
| 487 | ], |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 488 | [AC_MSG_RESULT(no)] |
| 489 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 490 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 491 | AC_MSG_CHECKING([whether libc defines __progname]) |
| 492 | AC_TRY_LINK([], |
| 493 | [extern char *__progname; printf("%s", __progname);], |
| 494 | [ |
| 495 | AC_DEFINE(HAVE___PROGNAME) |
| 496 | AC_MSG_RESULT(yes) |
| 497 | ], |
| 498 | [ |
| 499 | AC_MSG_RESULT(no) |
| 500 | ] |
| 501 | ) |
| 502 | |
| 503 | # Looking for programs, paths and files |
| 504 | AC_ARG_WITH(rsh, |
| 505 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 506 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 507 | if test "x$withval" != "$no" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 508 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 509 | fi |
| 510 | ], |
| 511 | [ |
| 512 | AC_PATH_PROG(rsh_path, rsh) |
| 513 | ] |
| 514 | ) |
| 515 | |
| 516 | AC_ARG_WITH(xauth, |
| 517 | [ --with-xauth=PATH Specify path to xauth program ], |
| 518 | [ |
| 519 | if test "x$withval" != "$xno" ; then |
| 520 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") |
| 521 | fi |
| 522 | ], |
| 523 | [ |
| 524 | AC_PATH_PROG(xauth_path, xauth) |
| 525 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then |
| 526 | xauth_path="/usr/openwin/bin/xauth" |
| 527 | fi |
| 528 | ] |
| 529 | ) |
| 530 | |
| 531 | if test ! -z "$xauth_path" ; then |
| 532 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 533 | fi |
| 534 | if test ! -z "$rsh_path" ; then |
| 535 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 536 | fi |
| 537 | |
| 538 | # Check for mail directory (last resort if we cannot get it from headers) |
| 539 | if test ! -z "$MAIL" ; then |
| 540 | maildir=`dirname $MAIL` |
| 541 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 542 | fi |
| 543 | |
| 544 | # Look for lastlog location |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 545 | AC_ARG_WITH(lastlog, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 546 | [ --with-lastlog=FILE Location of lastlog file], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 547 | [ |
| 548 | if test "x$withval" = "xno" ; then |
| 549 | AC_DEFINE(DISABLE_LASTLOG) |
| 550 | else |
| 551 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval") |
| 552 | fi |
| 553 | ], |
| 554 | [ |
| 555 | AC_MSG_CHECKING([location of lastlog file]) |
Damien Miller | 27f4c78 | 2000-01-27 18:22:13 +1100 | [diff] [blame] | 556 | for lastlog in /var/log/lastlog /var/adm/lastlog /usr/adm/lastlog /etc/security/lastlog ; do |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 557 | if test -f $lastlog ; then |
| 558 | gotlastlog="file" |
| 559 | break |
| 560 | fi |
| 561 | if test -d $lastlog ; then |
| 562 | gotlastlog="dir" |
| 563 | break |
| 564 | fi |
| 565 | done |
| 566 | if test -z "$gotlastlog" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 567 | AC_MSG_RESULT(not found) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 568 | nolastlog=1 |
| 569 | else |
| 570 | if test "x$gotlastlog" = "xdir" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 571 | AC_MSG_RESULT(${lastlog}/) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 572 | AC_DEFINE(LASTLOG_IS_DIR) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 573 | else |
| 574 | AC_MSG_RESULT($lastlog) |
| 575 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 576 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 577 | fi |
| 578 | ] |
| 579 | ) |
| 580 | |
| 581 | if test ! -z "$nolastlog" ; then |
| 582 | AC_MSG_WARN([*** Disabling lastlog support *** ]) |
| 583 | AC_DEFINE(DISABLE_LASTLOG) |
| 584 | fi |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 585 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 586 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 587 | AC_CHECK_FILE("/dev/ptmx", |
| 588 | [ |
| 589 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 590 | have_dev_ptmx=1 |
| 591 | ] |
| 592 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 593 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 594 | AC_CHECK_FILE("/dev/ptc", |
| 595 | [ |
| 596 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 597 | have_dev_ptc=1 |
| 598 | ] |
| 599 | ) |
| 600 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 601 | # Options from here on. Some of these are preset by platform above |
| 602 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 603 | # Check for user-specified random device, otherwise check /dev/urandom |
| 604 | AC_ARG_WITH(random, |
| 605 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 606 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 607 | if test "x$withval" != "xno" ; then |
| 608 | RANDOM_POOL="$withval"; |
| 609 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 610 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 611 | ], |
| 612 | [ |
| 613 | # Check for random device |
| 614 | AC_CHECK_FILE("/dev/urandom", |
| 615 | [ |
| 616 | RANDOM_POOL="/dev/urandom"; |
| 617 | AC_SUBST(RANDOM_POOL) |
| 618 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 619 | ] |
| 620 | ) |
| 621 | ] |
| 622 | ) |
| 623 | |
| 624 | # Check for EGD pool file |
| 625 | AC_ARG_WITH(egd-pool, |
| 626 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 627 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 628 | if test "x$withval" != "xno" ; then |
| 629 | EGD_SOCKET="$withval"; |
| 630 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 631 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 632 | ] |
| 633 | ) |
| 634 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame^] | 635 | if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then |
| 636 | # Use these commands to collect entropy |
| 637 | AC_PATH_PROG(PROG_LS, ls) |
| 638 | AC_PATH_PROG(PROG_NETSTAT, netstat) |
| 639 | AC_PATH_PROG(PROG_ARP, arp) |
| 640 | AC_PATH_PROG(PROG_IFCONFIG, ifconfig) |
| 641 | AC_PATH_PROG(PROG_PS, ps) |
| 642 | AC_PATH_PROG(PROG_W, w) |
| 643 | AC_PATH_PROG(PROG_WHO, who) |
| 644 | AC_PATH_PROG(PROG_LAST, last) |
| 645 | AC_PATH_PROG(PROG_LASTLOG, lastlog) |
| 646 | AC_PATH_PROG(PROG_DF, df) |
| 647 | AC_PATH_PROG(PROG_VMSTAT, vmstat) |
| 648 | AC_PATH_PROG(PROG_UPTIME, uptime) |
| 649 | AC_PATH_PROG(PROG_IPCS, ipcs) |
| 650 | AC_PATH_PROG(PROG_TAIL, tail) |
| 651 | AC_PATH_PROG(PROG_LS, ls) |
| 652 | if test ! -z "$PROG_LS" ; then |
| 653 | AC_DEFINE_UNQUOTED(PROG_LS, "$PROG_LS") |
| 654 | fi |
| 655 | if test ! -z "$PROG_NETSTAT" ; then |
| 656 | AC_DEFINE_UNQUOTED(PROG_NETSTAT, "$PROG_NETSTAT") |
| 657 | fi |
| 658 | if test ! -z "$PROG_ARP" ; then |
| 659 | AC_DEFINE_UNQUOTED(PROG_ARP, "$PROG_ARP") |
| 660 | fi |
| 661 | if test ! -z "$PROG_IFCONFIG" ; then |
| 662 | AC_DEFINE_UNQUOTED(PROG_IFCONFIG, "$PROG_IFCONFIG") |
| 663 | fi |
| 664 | if test ! -z "$PROG_PS" ; then |
| 665 | AC_DEFINE_UNQUOTED(PROG_PS, "$PROG_PS") |
| 666 | fi |
| 667 | if test ! -z "$PROG_W" ; then |
| 668 | AC_DEFINE_UNQUOTED(PROG_W, "$PROG_W") |
| 669 | fi |
| 670 | if test ! -z "$PROG_WHO" ; then |
| 671 | AC_DEFINE_UNQUOTED(PROG_WHO, "$PROG_WHO") |
| 672 | fi |
| 673 | if test ! -z "$PROG_LAST" ; then |
| 674 | AC_DEFINE_UNQUOTED(PROG_LAST, "$PROG_LAST") |
| 675 | fi |
| 676 | if test ! -z "$PROG_LASTLOG" ; then |
| 677 | AC_DEFINE_UNQUOTED(PROG_LASTLOG, "$PROG_LASTLOG") |
| 678 | fi |
| 679 | if test ! -z "$PROG_DF" ; then |
| 680 | AC_DEFINE_UNQUOTED(PROG_DF, "$PROG_DF") |
| 681 | fi |
| 682 | if test ! -z "$PROG_VMSTAT" ; then |
| 683 | AC_DEFINE_UNQUOTED(PROG_VMSTAT, "$PROG_VMSTAT") |
| 684 | fi |
| 685 | if test ! -z "$PROG_UPTIME" ; then |
| 686 | AC_DEFINE_UNQUOTED(PROG_UPTIME, "$PROG_UPTIME") |
| 687 | fi |
| 688 | if test ! -z "$PROG_UPTIME" ; then |
| 689 | AC_DEFINE_UNQUOTED(PROG_UPTIME, "$PROG_UPTIME") |
| 690 | fi |
| 691 | if test ! -z "$PROG_TAIL" ; then |
| 692 | AC_DEFINE_UNQUOTED(PROG_TAIL, "$PROG_TAIL") |
| 693 | fi |
| 694 | fi |
| 695 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 696 | AC_ARG_WITH(catman, |
| 697 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 698 | [ |
| 699 | MANTYPE='$(CATMAN)' |
| 700 | if test x"$withval" != x"yes" ; then |
| 701 | mansubdir=$withval |
| 702 | else |
| 703 | mansubdir=cat |
| 704 | fi |
| 705 | ], [ |
| 706 | if test -z "$MANTYPE" ; then |
| 707 | MANTYPE='$(TROFFMAN)' |
| 708 | mansubdir=man |
| 709 | fi |
| 710 | ] |
| 711 | ) |
| 712 | AC_SUBST(MANTYPE) |
| 713 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 714 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 715 | # Check whether user wants Kerberos support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 716 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 717 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 718 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 719 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 720 | |
| 721 | if test "x$withval" != "$xyes" ; then |
| 722 | CFLAGS="$CFLAGS -I${withval}/include" |
| 723 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 724 | if test ! -z "$need_dash_r" ; then |
| 725 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 726 | fi |
| 727 | if test ! -z "$blibpath" ; then |
| 728 | blibpath="$blibpath:${withval}/lib" |
| 729 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 730 | else |
| 731 | if test -d /usr/include/kerberosIV ; then |
| 732 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 733 | fi |
| 734 | fi |
| 735 | |
| 736 | AC_CHECK_HEADERS(krb.h) |
| 737 | AC_CHECK_LIB(krb, main) |
| 738 | if test "$ac_cv_header_krb_h" != yes; then |
| 739 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 740 | fi |
| 741 | if test "$ac_cv_lib_krb_main" != yes; then |
| 742 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 743 | fi |
| 744 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 745 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 746 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 747 | KRB4=yes |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 748 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 749 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 750 | ] |
| 751 | ) |
| 752 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 753 | # Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 754 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 755 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 756 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 757 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 758 | |
| 759 | if test "x$withval" != "$xyes" ; then |
| 760 | CFLAGS="$CFLAGS -I${withval}/include" |
| 761 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 762 | fi |
| 763 | |
| 764 | if test -z "$KRB4" ; then |
| 765 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 766 | fi |
| 767 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 768 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 769 | if test ! -z "$AFS_LIBS" ; then |
| 770 | LIBS="$LIBS $AFS_LIBS" |
| 771 | fi |
| 772 | AC_DEFINE(AFS) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 773 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 774 | ] |
| 775 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 776 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 777 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 778 | # Check whether user wants S/Key support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 779 | AC_ARG_WITH(skey, |
| 780 | [ --with-skey Enable S/Key support], |
| 781 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 782 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 783 | AC_DEFINE(SKEY) |
| 784 | LIBS="$LIBS -lskey" |
| 785 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 786 | ] |
| 787 | ) |
| 788 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 789 | # Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 790 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 791 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 792 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 793 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 794 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 795 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 796 | AC_MSG_CHECKING(for libwrap) |
| 797 | AC_TRY_LINK( |
| 798 | [ |
| 799 | #include <tcpd.h> |
| 800 | int deny_severity = 0, allow_severity = 0; |
| 801 | ], |
| 802 | [hosts_access(0);], |
| 803 | [ |
| 804 | AC_MSG_RESULT(yes) |
| 805 | AC_DEFINE(LIBWRAP) |
| 806 | ], |
| 807 | [ |
| 808 | AC_MSG_RESULT(no) |
| 809 | AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***]) |
| 810 | LIBS="$saved_LIBS" |
| 811 | ] |
| 812 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 813 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 814 | ] |
| 815 | ) |
| 816 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 817 | # Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 818 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 819 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 820 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 821 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 822 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
| 823 | fi |
| 824 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 825 | ) |
| 826 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 827 | # Check whether to enable utmpx support |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 828 | AC_ARG_WITH(utmpx, |
| 829 | [ --with-utmpx Enable utmpx support], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 830 | [ |
| 831 | if test "x$withval" != "xno" ; then |
| 832 | AC_DEFINE(USE_UTMPX) |
| 833 | fi |
| 834 | ] |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 835 | ) |
| 836 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 837 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 838 | AC_ARG_WITH(shadow, |
| 839 | [ --without-shadow Disable shadow password support], |
| 840 | [ |
| 841 | if test "x$withval" = "xno" ; then |
| 842 | AC_DEFINE(DISABLE_SHADOW) |
| 843 | fi |
| 844 | ] |
| 845 | ) |
| 846 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 847 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 848 | AC_ARG_WITH(ipaddr-display, |
| 849 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 850 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 851 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 852 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 853 | fi |
| 854 | ] |
| 855 | ) |
| 856 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 857 | # Whether to mess with the default path |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 858 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 859 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 860 | [ |
| 861 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 862 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 863 | fi |
| 864 | ] |
| 865 | ) |
| 866 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 867 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 868 | AC_ARG_WITH(ipv4-default, |
| 869 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 870 | [ |
| 871 | if test "x$withval" != "xno" ; then |
| 872 | AC_DEFINE(IPV4_DEFAULT) |
| 873 | fi |
| 874 | ] |
| 875 | ) |
| 876 | |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 877 | AC_MSG_CHECKING([to convert IPv4 in IPv6-mapped addresses]) |
| 878 | AC_ARG_WITH(4in6, |
| 879 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 880 | [ |
| 881 | if test "x$withval" != "xno" ; then |
| 882 | AC_MSG_RESULT(yes) |
| 883 | AC_DEFINE(IPV4_IN_IPV6) |
| 884 | else |
| 885 | AC_MSG_RESULT(no) |
| 886 | fi |
| 887 | ],[ |
| 888 | if test "x$inet6_default_4in6" = "xyes"; then |
| 889 | AC_MSG_RESULT([yes (default)]) |
| 890 | AC_DEFINE(IPV4_IN_IPV6) |
| 891 | else |
| 892 | AC_MSG_RESULT([no (default)]) |
| 893 | fi |
| 894 | ] |
| 895 | ) |
| 896 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 897 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 898 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 899 | AC_ARG_WITH(pid-dir, |
| 900 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 901 | [ |
| 902 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 903 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 904 | fi |
| 905 | ] |
| 906 | ) |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 907 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 908 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 909 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 910 | if test ! -z "$blibpath" ; then |
| 911 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 912 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 913 | fi |
| 914 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 915 | AC_OUTPUT(Makefile) |