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