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