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 | ) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 216 | done |
| 217 | |
| 218 | if test ! -z "$found_crypto" ; then |
| 219 | break; |
| 220 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 221 | done |
| 222 | |
| 223 | if test -z "$found_crypto" ; then |
| 224 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
| 225 | fi |
| 226 | if test -z "$ssldir" ; then |
| 227 | ssldir="(system)" |
| 228 | else |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 229 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 230 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 231 | if test ! -z "$need_dash_r" ; then |
| 232 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 233 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 234 | if test ! -z "$blibpath" ; then |
| 235 | blibpath="$blibpath:$ssldir:$ssldir/lib" |
| 236 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 237 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 238 | if test -z "$WANTS_RSAREF" ; then |
| 239 | LIBS="$saved_LIBS -lcrypto" |
| 240 | else |
| 241 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 242 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 243 | AC_MSG_RESULT($ssldir) |
| 244 | |
| 245 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 246 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 247 | AC_CHECK_SIZEOF(short int, 2) |
| 248 | AC_CHECK_SIZEOF(int, 4) |
| 249 | AC_CHECK_SIZEOF(long int, 4) |
| 250 | AC_CHECK_SIZEOF(long long int, 8) |
| 251 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 252 | # More checks for data types |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 253 | AC_MSG_CHECKING([for intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 254 | AC_TRY_COMPILE( |
| 255 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 256 | [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] | 257 | [ |
| 258 | AC_DEFINE(HAVE_INTXX_T) |
| 259 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 260 | have_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 261 | ], |
| 262 | [AC_MSG_RESULT(no)] |
| 263 | ) |
| 264 | |
Damien Miller | 859cec0 | 1999-11-22 14:27:24 +1100 | [diff] [blame] | 265 | AC_MSG_CHECKING([for u_intXX_t types]) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 266 | AC_TRY_COMPILE( |
| 267 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 268 | [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] | 269 | [ |
| 270 | AC_DEFINE(HAVE_U_INTXX_T) |
| 271 | AC_MSG_RESULT(yes) |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 272 | have_u_intxx_t=1 |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 273 | ], |
| 274 | [AC_MSG_RESULT(no)] |
| 275 | ) |
| 276 | |
Damien Miller | eaf9994 | 2000-01-19 13:45:07 +1100 | [diff] [blame] | 277 | 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] | 278 | "x$ac_cv_header_sys_bitypes_h" = "xyes" |
| 279 | then |
| 280 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 281 | AC_TRY_COMPILE( |
| 282 | [#include <sys/bitypes.h>], |
| 283 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 284 | int8_t a; int16_t b; int32_t c; |
| 285 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 286 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 287 | ], |
| 288 | [ |
| 289 | AC_DEFINE(HAVE_U_INTXX_T) |
| 290 | AC_DEFINE(HAVE_INTXX_T) |
| 291 | AC_MSG_RESULT(yes) |
| 292 | ], |
| 293 | [AC_MSG_RESULT(no)] |
| 294 | ) |
| 295 | fi |
| 296 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 297 | if test -z "$have_u_intxx_t" ; then |
| 298 | AC_MSG_CHECKING([for uintXX_t types]) |
| 299 | AC_TRY_COMPILE( |
| 300 | [#include <sys/types.h>], |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 301 | [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] | 302 | [ |
| 303 | AC_DEFINE(HAVE_UINTXX_T) |
| 304 | AC_MSG_RESULT(yes) |
| 305 | ], |
| 306 | [AC_MSG_RESULT(no)] |
| 307 | ) |
| 308 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 309 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 310 | AC_MSG_CHECKING([for socklen_t]) |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 311 | AC_TRY_COMPILE( |
Damien Miller | f3e8be8 | 1999-12-31 08:59:04 +1100 | [diff] [blame] | 312 | [ |
| 313 | #include <sys/types.h> |
| 314 | #include <sys/socket.h> |
| 315 | ], |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 316 | [socklen_t foo; foo = 1235;], |
| 317 | [ |
| 318 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 319 | AC_MSG_RESULT(yes) |
| 320 | ], |
| 321 | [AC_MSG_RESULT(no)] |
| 322 | ) |
| 323 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 324 | AC_MSG_CHECKING([for size_t]) |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 325 | AC_TRY_COMPILE( |
| 326 | [#include <sys/types.h>], |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 327 | [size_t foo; foo = 1235;], |
| 328 | [ |
| 329 | AC_DEFINE(HAVE_SIZE_T) |
| 330 | AC_MSG_RESULT(yes) |
| 331 | ], |
| 332 | [AC_MSG_RESULT(no)] |
| 333 | ) |
| 334 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 335 | AC_MSG_CHECKING([for struct sockaddr_storage]) |
| 336 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 337 | [ |
| 338 | #include <sys/types.h> |
| 339 | #include <sys/socket.h> |
| 340 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 341 | [struct sockaddr_storage s;], |
| 342 | [ |
| 343 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 344 | AC_MSG_RESULT(yes) |
| 345 | ], |
| 346 | [AC_MSG_RESULT(no)] |
| 347 | ) |
| 348 | |
| 349 | AC_MSG_CHECKING([for struct sockaddr_in6]) |
| 350 | AC_TRY_COMPILE( |
| 351 | [#include <netinet/in.h>], |
| 352 | [struct sockaddr_in6 s; s.sin6_family = 0;], |
| 353 | [ |
| 354 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 355 | AC_MSG_RESULT(yes) |
| 356 | ], |
| 357 | [AC_MSG_RESULT(no)] |
| 358 | ) |
| 359 | |
| 360 | AC_MSG_CHECKING([for struct in6_addr]) |
| 361 | AC_TRY_COMPILE( |
| 362 | [#include <netinet/in.h>], |
| 363 | [struct in6_addr s; s.s6_addr[0] = 0;], |
| 364 | [ |
| 365 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 366 | AC_MSG_RESULT(yes) |
| 367 | ], |
| 368 | [AC_MSG_RESULT(no)] |
| 369 | ) |
| 370 | |
| 371 | AC_MSG_CHECKING([for struct addrinfo]) |
| 372 | AC_TRY_COMPILE( |
| 373 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 374 | #include <sys/types.h> |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 375 | #include <sys/socket.h> |
| 376 | #include <netdb.h> |
| 377 | ], |
| 378 | [struct addrinfo s; s.ai_flags = AI_PASSIVE;], |
| 379 | [ |
| 380 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 381 | AC_MSG_RESULT(yes) |
| 382 | ], |
| 383 | [AC_MSG_RESULT(no)] |
| 384 | ) |
| 385 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 386 | # Checks for structure members |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 387 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
| 388 | AC_EGREP_HEADER(ut_host, utmp.h, |
| 389 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 390 | [AC_MSG_RESULT(no)] |
| 391 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 392 | AC_MSG_CHECKING([whether utmpx.h has ut_host field]) |
| 393 | AC_EGREP_HEADER(ut_host, utmpx.h, |
| 394 | [AC_DEFINE(HAVE_HOST_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 395 | [AC_MSG_RESULT(no)] |
| 396 | ) |
Damien Miller | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 397 | AC_MSG_CHECKING([whether utmpx.h has syslen field]) |
| 398 | AC_EGREP_HEADER(syslen, utmpx.h, |
| 399 | [AC_DEFINE(HAVE_SYSLEN_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 400 | [AC_MSG_RESULT(no)] |
| 401 | ) |
Damien Miller | 4ff2b9b | 1999-12-28 10:41:12 +1100 | [diff] [blame] | 402 | AC_MSG_CHECKING([whether utmp.h has ut_pid field]) |
| 403 | AC_EGREP_HEADER(ut_pid, utmp.h, |
| 404 | [AC_DEFINE(HAVE_PID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 405 | [AC_MSG_RESULT(no)] |
| 406 | ) |
| 407 | AC_MSG_CHECKING([whether utmp.h has ut_type field]) |
| 408 | AC_EGREP_HEADER(ut_type, utmp.h, |
| 409 | [AC_DEFINE(HAVE_TYPE_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 410 | [AC_MSG_RESULT(no)] |
| 411 | ) |
| 412 | AC_MSG_CHECKING([whether utmp.h has ut_tv field]) |
| 413 | AC_EGREP_HEADER(ut_tv, utmp.h, |
| 414 | [AC_DEFINE(HAVE_TV_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 415 | [AC_MSG_RESULT(no)] |
| 416 | ) |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 417 | AC_MSG_CHECKING([whether utmp.h has ut_id field]) |
| 418 | AC_EGREP_HEADER(ut_id, utmp.h, |
| 419 | [AC_DEFINE(HAVE_ID_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 420 | [AC_MSG_RESULT(no)] |
| 421 | ) |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 422 | AC_MSG_CHECKING([whether utmp.h has ut_addr field]) |
| 423 | AC_EGREP_HEADER(ut_addr, utmp.h, |
| 424 | [AC_DEFINE(HAVE_ADDR_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 425 | [AC_MSG_RESULT(no)] |
| 426 | ) |
| 427 | AC_MSG_CHECKING([whether utmpx.h has ut_addr field]) |
| 428 | AC_EGREP_HEADER(ut_addr, utmpx.h, |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 429 | [AC_DEFINE(HAVE_ADDR_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 430 | [AC_MSG_RESULT(no)] |
| 431 | ) |
| 432 | AC_MSG_CHECKING([whether utmp.h has ut_addr_v6 field]) |
| 433 | AC_EGREP_HEADER(ut_addr_v6, utmp.h, |
| 434 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMP) AC_MSG_RESULT(yes); ], |
| 435 | [AC_MSG_RESULT(no)] |
| 436 | ) |
| 437 | AC_MSG_CHECKING([whether utmpx.h has ut_addr_v6 field]) |
| 438 | AC_EGREP_HEADER(ut_addr_v6, utmpx.h, |
| 439 | [AC_DEFINE(HAVE_ADDR_V6_IN_UTMPX) AC_MSG_RESULT(yes); ], |
| 440 | [AC_MSG_RESULT(no)] |
| 441 | ) |
| 442 | |
| 443 | AC_MSG_CHECKING([whether struct sockaddr_storage has ss_family field]) |
| 444 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 445 | [ |
| 446 | #include <sys/types.h> |
| 447 | #include <sys/socket.h> |
| 448 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 449 | [struct sockaddr_storage s; s.ss_family = 1;], |
| 450 | [ |
| 451 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 452 | AC_MSG_RESULT(yes) |
| 453 | ], |
| 454 | [AC_MSG_RESULT(no)] |
| 455 | ) |
| 456 | AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family field]) |
| 457 | AC_TRY_COMPILE( |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 458 | [ |
| 459 | #include <sys/types.h> |
| 460 | #include <sys/socket.h> |
| 461 | ], |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 462 | [struct sockaddr_storage s; s.__ss_family = 1;], |
| 463 | [ |
| 464 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 465 | AC_MSG_RESULT(yes) |
| 466 | ], |
Damien Miller | 3131d8b | 1999-12-31 09:42:24 +1100 | [diff] [blame] | 467 | [AC_MSG_RESULT(no)] |
| 468 | ) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 469 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 470 | AC_MSG_CHECKING([whether libc defines __progname]) |
| 471 | AC_TRY_LINK([], |
| 472 | [extern char *__progname; printf("%s", __progname);], |
| 473 | [ |
| 474 | AC_DEFINE(HAVE___PROGNAME) |
| 475 | AC_MSG_RESULT(yes) |
| 476 | ], |
| 477 | [ |
| 478 | AC_MSG_RESULT(no) |
| 479 | ] |
| 480 | ) |
| 481 | |
| 482 | # Looking for programs, paths and files |
| 483 | AC_ARG_WITH(rsh, |
| 484 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 485 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 486 | if test "x$withval" != "$no" ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 487 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") |
| 488 | fi |
| 489 | ], |
| 490 | [ |
| 491 | AC_PATH_PROG(rsh_path, rsh) |
| 492 | ] |
| 493 | ) |
| 494 | |
| 495 | AC_ARG_WITH(xauth, |
| 496 | [ --with-xauth=PATH Specify path to xauth program ], |
| 497 | [ |
| 498 | if test "x$withval" != "$xno" ; then |
| 499 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") |
| 500 | fi |
| 501 | ], |
| 502 | [ |
| 503 | AC_PATH_PROG(xauth_path, xauth) |
| 504 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then |
| 505 | xauth_path="/usr/openwin/bin/xauth" |
| 506 | fi |
| 507 | ] |
| 508 | ) |
| 509 | |
| 510 | if test ! -z "$xauth_path" ; then |
| 511 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 512 | fi |
| 513 | if test ! -z "$rsh_path" ; then |
| 514 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 515 | fi |
| 516 | |
| 517 | # Check for mail directory (last resort if we cannot get it from headers) |
| 518 | if test ! -z "$MAIL" ; then |
| 519 | maildir=`dirname $MAIL` |
| 520 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 521 | fi |
| 522 | |
| 523 | # Look for lastlog location |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 524 | AC_ARG_WITH(lastlog, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 525 | [ --with-lastlog=FILE Location of lastlog file], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 526 | [ |
| 527 | if test "x$withval" = "xno" ; then |
| 528 | AC_DEFINE(DISABLE_LASTLOG) |
| 529 | else |
| 530 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval") |
| 531 | fi |
| 532 | ], |
| 533 | [ |
| 534 | AC_MSG_CHECKING([location of lastlog file]) |
Damien Miller | 27f4c78 | 2000-01-27 18:22:13 +1100 | [diff] [blame] | 535 | 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] | 536 | if test -f $lastlog ; then |
| 537 | gotlastlog="file" |
| 538 | break |
| 539 | fi |
| 540 | if test -d $lastlog ; then |
| 541 | gotlastlog="dir" |
| 542 | break |
| 543 | fi |
| 544 | done |
| 545 | if test -z "$gotlastlog" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 546 | AC_MSG_RESULT(not found) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 547 | nolastlog=1 |
| 548 | else |
| 549 | if test "x$gotlastlog" = "xdir" ; then |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 550 | AC_MSG_RESULT(${lastlog}/) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 551 | AC_DEFINE(LASTLOG_IS_DIR) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 552 | else |
| 553 | AC_MSG_RESULT($lastlog) |
| 554 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 555 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 556 | fi |
| 557 | ] |
| 558 | ) |
| 559 | |
| 560 | if test ! -z "$nolastlog" ; then |
| 561 | AC_MSG_WARN([*** Disabling lastlog support *** ]) |
| 562 | AC_DEFINE(DISABLE_LASTLOG) |
| 563 | fi |
Damien Miller | 3f90587 | 1999-11-15 17:10:57 +1100 | [diff] [blame] | 564 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 565 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 566 | AC_CHECK_FILE("/dev/ptmx", |
| 567 | [ |
| 568 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 569 | have_dev_ptmx=1 |
| 570 | ] |
| 571 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 572 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 573 | AC_CHECK_FILE("/dev/ptc", |
| 574 | [ |
| 575 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 576 | have_dev_ptc=1 |
| 577 | ] |
| 578 | ) |
| 579 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 580 | # Options from here on. Some of these are preset by platform above |
| 581 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 582 | # Check for user-specified random device, otherwise check /dev/urandom |
| 583 | AC_ARG_WITH(random, |
| 584 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 585 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 586 | if test "x$withval" != "xno" ; then |
| 587 | RANDOM_POOL="$withval"; |
| 588 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 589 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 590 | ], |
| 591 | [ |
| 592 | # Check for random device |
| 593 | AC_CHECK_FILE("/dev/urandom", |
| 594 | [ |
| 595 | RANDOM_POOL="/dev/urandom"; |
| 596 | AC_SUBST(RANDOM_POOL) |
| 597 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 598 | ] |
| 599 | ) |
| 600 | ] |
| 601 | ) |
| 602 | |
| 603 | # Check for EGD pool file |
| 604 | AC_ARG_WITH(egd-pool, |
| 605 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 606 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 607 | if test "x$withval" != "xno" ; then |
| 608 | EGD_SOCKET="$withval"; |
| 609 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 610 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 611 | ] |
| 612 | ) |
| 613 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 614 | if test -z "$RANDOM_POOL" -a -z "$EGD_SOCKET" ; then |
| 615 | # Use these commands to collect entropy |
| 616 | AC_PATH_PROG(PROG_LS, ls) |
| 617 | AC_PATH_PROG(PROG_NETSTAT, netstat) |
| 618 | AC_PATH_PROG(PROG_ARP, arp) |
| 619 | AC_PATH_PROG(PROG_IFCONFIG, ifconfig) |
| 620 | AC_PATH_PROG(PROG_PS, ps) |
| 621 | AC_PATH_PROG(PROG_W, w) |
| 622 | AC_PATH_PROG(PROG_WHO, who) |
| 623 | AC_PATH_PROG(PROG_LAST, last) |
| 624 | AC_PATH_PROG(PROG_LASTLOG, lastlog) |
| 625 | AC_PATH_PROG(PROG_DF, df) |
| 626 | AC_PATH_PROG(PROG_VMSTAT, vmstat) |
| 627 | AC_PATH_PROG(PROG_UPTIME, uptime) |
| 628 | AC_PATH_PROG(PROG_IPCS, ipcs) |
| 629 | AC_PATH_PROG(PROG_TAIL, tail) |
| 630 | AC_PATH_PROG(PROG_LS, ls) |
| 631 | if test ! -z "$PROG_LS" ; then |
| 632 | AC_DEFINE_UNQUOTED(PROG_LS, "$PROG_LS") |
| 633 | fi |
| 634 | if test ! -z "$PROG_NETSTAT" ; then |
| 635 | AC_DEFINE_UNQUOTED(PROG_NETSTAT, "$PROG_NETSTAT") |
| 636 | fi |
| 637 | if test ! -z "$PROG_ARP" ; then |
| 638 | AC_DEFINE_UNQUOTED(PROG_ARP, "$PROG_ARP") |
| 639 | fi |
| 640 | if test ! -z "$PROG_IFCONFIG" ; then |
| 641 | AC_DEFINE_UNQUOTED(PROG_IFCONFIG, "$PROG_IFCONFIG") |
| 642 | fi |
| 643 | if test ! -z "$PROG_PS" ; then |
| 644 | AC_DEFINE_UNQUOTED(PROG_PS, "$PROG_PS") |
| 645 | fi |
| 646 | if test ! -z "$PROG_W" ; then |
| 647 | AC_DEFINE_UNQUOTED(PROG_W, "$PROG_W") |
| 648 | fi |
| 649 | if test ! -z "$PROG_WHO" ; then |
| 650 | AC_DEFINE_UNQUOTED(PROG_WHO, "$PROG_WHO") |
| 651 | fi |
| 652 | if test ! -z "$PROG_LAST" ; then |
| 653 | AC_DEFINE_UNQUOTED(PROG_LAST, "$PROG_LAST") |
| 654 | fi |
| 655 | if test ! -z "$PROG_LASTLOG" ; then |
| 656 | AC_DEFINE_UNQUOTED(PROG_LASTLOG, "$PROG_LASTLOG") |
| 657 | fi |
| 658 | if test ! -z "$PROG_DF" ; then |
| 659 | AC_DEFINE_UNQUOTED(PROG_DF, "$PROG_DF") |
| 660 | fi |
| 661 | if test ! -z "$PROG_VMSTAT" ; then |
| 662 | AC_DEFINE_UNQUOTED(PROG_VMSTAT, "$PROG_VMSTAT") |
| 663 | fi |
| 664 | if test ! -z "$PROG_UPTIME" ; then |
| 665 | AC_DEFINE_UNQUOTED(PROG_UPTIME, "$PROG_UPTIME") |
| 666 | fi |
| 667 | if test ! -z "$PROG_UPTIME" ; then |
| 668 | AC_DEFINE_UNQUOTED(PROG_UPTIME, "$PROG_UPTIME") |
| 669 | fi |
| 670 | if test ! -z "$PROG_TAIL" ; then |
| 671 | AC_DEFINE_UNQUOTED(PROG_TAIL, "$PROG_TAIL") |
| 672 | fi |
| 673 | fi |
| 674 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 675 | AC_ARG_WITH(catman, |
| 676 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 677 | [ |
| 678 | MANTYPE='$(CATMAN)' |
| 679 | if test x"$withval" != x"yes" ; then |
| 680 | mansubdir=$withval |
| 681 | else |
| 682 | mansubdir=cat |
| 683 | fi |
| 684 | ], [ |
| 685 | if test -z "$MANTYPE" ; then |
| 686 | MANTYPE='$(TROFFMAN)' |
| 687 | mansubdir=man |
| 688 | fi |
| 689 | ] |
| 690 | ) |
| 691 | AC_SUBST(MANTYPE) |
| 692 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 693 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 694 | # Check whether user wants Kerberos support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 695 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 696 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 697 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 698 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 699 | |
| 700 | if test "x$withval" != "$xyes" ; then |
| 701 | CFLAGS="$CFLAGS -I${withval}/include" |
| 702 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 703 | if test ! -z "$need_dash_r" ; then |
| 704 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 705 | fi |
| 706 | if test ! -z "$blibpath" ; then |
| 707 | blibpath="$blibpath:${withval}/lib" |
| 708 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 709 | else |
| 710 | if test -d /usr/include/kerberosIV ; then |
| 711 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 712 | fi |
| 713 | fi |
| 714 | |
| 715 | AC_CHECK_HEADERS(krb.h) |
| 716 | AC_CHECK_LIB(krb, main) |
| 717 | if test "$ac_cv_header_krb_h" != yes; then |
| 718 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 719 | fi |
| 720 | if test "$ac_cv_lib_krb_main" != yes; then |
| 721 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 722 | fi |
| 723 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 724 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 725 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 726 | KRB4=yes |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 727 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 728 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 729 | ] |
| 730 | ) |
| 731 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 732 | # Check whether user wants AFS support |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 733 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 734 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 735 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 736 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 737 | |
| 738 | if test "x$withval" != "$xyes" ; then |
| 739 | CFLAGS="$CFLAGS -I${withval}/include" |
| 740 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 741 | fi |
| 742 | |
| 743 | if test -z "$KRB4" ; then |
| 744 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 745 | fi |
| 746 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 747 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 748 | if test ! -z "$AFS_LIBS" ; then |
| 749 | LIBS="$LIBS $AFS_LIBS" |
| 750 | fi |
| 751 | AC_DEFINE(AFS) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 752 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 753 | ] |
| 754 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 755 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 756 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 757 | # Check whether user wants S/Key support |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 758 | AC_ARG_WITH(skey, |
| 759 | [ --with-skey Enable S/Key support], |
| 760 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 761 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 762 | AC_DEFINE(SKEY) |
| 763 | LIBS="$LIBS -lskey" |
| 764 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 765 | ] |
| 766 | ) |
| 767 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 768 | # Check whether user wants TCP wrappers support |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 769 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 770 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 771 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 772 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 773 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 774 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 775 | AC_MSG_CHECKING(for libwrap) |
| 776 | AC_TRY_LINK( |
| 777 | [ |
| 778 | #include <tcpd.h> |
| 779 | int deny_severity = 0, allow_severity = 0; |
| 780 | ], |
| 781 | [hosts_access(0);], |
| 782 | [ |
| 783 | AC_MSG_RESULT(yes) |
| 784 | AC_DEFINE(LIBWRAP) |
| 785 | ], |
| 786 | [ |
| 787 | AC_MSG_RESULT(no) |
| 788 | AC_MSG_WARN([*** libwrap missing - tcpwrapper support disabled ***]) |
| 789 | LIBS="$saved_LIBS" |
| 790 | ] |
| 791 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 792 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 793 | ] |
| 794 | ) |
| 795 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 796 | # Check whether to enable MD5 passwords |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 797 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 798 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 799 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 800 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 801 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
| 802 | fi |
| 803 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 804 | ) |
| 805 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 806 | # Check whether to enable utmpx support |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 807 | AC_ARG_WITH(utmpx, |
| 808 | [ --with-utmpx Enable utmpx support], |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 809 | [ |
| 810 | if test "x$withval" != "xno" ; then |
| 811 | AC_DEFINE(USE_UTMPX) |
| 812 | fi |
| 813 | ] |
Damien Miller | 368cf64 | 1999-12-21 09:51:36 +1100 | [diff] [blame] | 814 | ) |
| 815 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 816 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 817 | AC_ARG_WITH(shadow, |
| 818 | [ --without-shadow Disable shadow password support], |
| 819 | [ |
| 820 | if test "x$withval" = "xno" ; then |
| 821 | AC_DEFINE(DISABLE_SHADOW) |
| 822 | fi |
| 823 | ] |
| 824 | ) |
| 825 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 826 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 827 | AC_ARG_WITH(ipaddr-display, |
| 828 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 829 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 830 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 831 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 832 | fi |
| 833 | ] |
| 834 | ) |
| 835 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 836 | # Whether to mess with the default path |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 837 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 838 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 839 | [ |
| 840 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 841 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 842 | fi |
| 843 | ] |
| 844 | ) |
| 845 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 846 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 847 | AC_ARG_WITH(ipv4-default, |
| 848 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 849 | [ |
| 850 | if test "x$withval" != "xno" ; then |
| 851 | AC_DEFINE(IPV4_DEFAULT) |
| 852 | fi |
| 853 | ] |
| 854 | ) |
| 855 | |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 856 | AC_MSG_CHECKING([to convert IPv4 in IPv6-mapped addresses]) |
| 857 | AC_ARG_WITH(4in6, |
| 858 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 859 | [ |
| 860 | if test "x$withval" != "xno" ; then |
| 861 | AC_MSG_RESULT(yes) |
| 862 | AC_DEFINE(IPV4_IN_IPV6) |
| 863 | else |
| 864 | AC_MSG_RESULT(no) |
| 865 | fi |
| 866 | ],[ |
| 867 | if test "x$inet6_default_4in6" = "xyes"; then |
| 868 | AC_MSG_RESULT([yes (default)]) |
| 869 | AC_DEFINE(IPV4_IN_IPV6) |
| 870 | else |
| 871 | AC_MSG_RESULT([no (default)]) |
| 872 | fi |
| 873 | ] |
| 874 | ) |
| 875 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 876 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 877 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 878 | AC_ARG_WITH(pid-dir, |
| 879 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 880 | [ |
| 881 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 882 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 883 | fi |
| 884 | ] |
| 885 | ) |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 886 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 887 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 888 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 889 | if test ! -z "$blibpath" ; then |
| 890 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 891 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 892 | fi |
| 893 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 894 | AC_OUTPUT(Makefile) |