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