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