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