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