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