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