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