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 | 2e1b082 | 1999-12-25 10:11:29 +1100 | [diff] [blame] | 16 | |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 17 | if test -z "$LD" ; then |
| 18 | LD=$CC |
| 19 | fi |
| 20 | AC_SUBST(LD) |
| 21 | |
| 22 | # C Compiler features |
| 23 | AC_C_INLINE |
| 24 | if test "$GCC" = "yes"; then |
| 25 | CFLAGS="$CFLAGS -Wall" |
| 26 | fi |
| 27 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 28 | # Check for some target-specific stuff |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 29 | case "$host" in |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 30 | *-*-aix*) |
| 31 | AFS_LIBS="-lld" |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 32 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 33 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 34 | if (test "$LD" != "gcc" && test -z "$blibpath"); then |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 35 | blibpath="/usr/lib:/lib:/usr/local/lib" |
| 36 | fi |
Damien Miller | d2c208a | 2000-05-17 22:00:02 +1000 | [diff] [blame] | 37 | AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) |
Damien Miller | eca71f8 | 2000-01-20 22:38:27 +1100 | [diff] [blame] | 38 | AC_DEFINE(BROKEN_GETADDRINFO) |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 39 | MANTYPE='$(CATMAN)' |
| 40 | mansubdir=cat |
andre | 60f3c98 | 2000-06-03 16:18:19 +0000 | [diff] [blame] | 41 | dnl AIX handles lastlog as part of its login message |
| 42 | AC_DEFINE(DISABLE_LASTLOG) |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 43 | MANTYPE='$(CATMAN)' |
| 44 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 45 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 46 | *-*-hpux10*) |
| 47 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 48 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 49 | fi |
| 50 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
| 51 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 52 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 53 | if test -f /tcb/files/auth/system/default; then |
| 54 | AC_MSG_RESULT(yes) |
| 55 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 56 | LIBS="$LIBS -lsec" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 57 | AC_MSG_WARN([This configuration is untested]) |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 58 | else |
| 59 | AC_MSG_RESULT(no) |
| 60 | AC_DEFINE(DISABLE_SHADOW) |
| 61 | fi |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 62 | MANTYPE='$(CATMAN)' |
| 63 | mansubdir=cat |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 64 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 65 | *-*-hpux11*) |
| 66 | if test -z "$GCC"; then |
| 67 | CFLAGS="$CFLAGS -Ae" |
| 68 | fi |
| 69 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 70 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 71 | AC_MSG_CHECKING(for HPUX trusted system password database) |
| 72 | if test -f /tcb/files/auth/system/default; then |
| 73 | AC_MSG_RESULT(yes) |
| 74 | AC_DEFINE(HAVE_HPUX_TRUSTED_SYSTEM_PW) |
| 75 | LIBS="$LIBS -lsec" |
| 76 | AC_MSG_WARN([This configuration is untested]) |
| 77 | else |
| 78 | AC_MSG_RESULT(no) |
| 79 | AC_DEFINE(DISABLE_SHADOW) |
| 80 | fi |
| 81 | MANTYPE='$(CATMAN)' |
| 82 | mansubdir=cat |
| 83 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 84 | *-*-irix5*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 85 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 86 | LDFLAGS="$LDFLAGS" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 87 | MANTYPE='$(CATMAN)' |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 88 | no_libsocket=1 |
| 89 | no_libnsl=1 |
| 90 | ;; |
| 91 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 92 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 93 | LDFLAGS="$LDFLAGS" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 94 | MANTYPE='$(CATMAN)' |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 95 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 96 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 97 | AC_DEFINE(WITH_IRIX_AUDIT) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 98 | no_libsocket=1 |
| 99 | no_libnsl=1 |
| 100 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 101 | *-*-linux*) |
| 102 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 103 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 104 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 105 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 106 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 107 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 108 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 109 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 110 | *-next-*) |
| 111 | # hardwire lastlog location (can't detect it on some versions) |
| 112 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | 31abc9a | 2000-07-09 23:26:27 +1000 | [diff] [blame] | 113 | conf_utmp_location=/etc/utmp |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 114 | AC_DEFINE(HAVE_NEXT) |
| 115 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 116 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 117 | AC_MSG_WARN([*** Tested: PA-RISC/m68k Untested: Sparc/Intel]) |
| 118 | AC_MSG_WARN([*** Expect 'scp' to fail!]) |
| 119 | AC_MSG_WARN([*** Please report any problems, thanks]) |
| 120 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 121 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 122 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 08c788a | 2000-03-16 07:52:29 +1100 | [diff] [blame] | 123 | 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] | 124 | need_dash_r=1 |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 125 | # hardwire lastlog location (can't detect it on some versions) |
| 126 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 127 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 128 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 129 | if test "$sol2ver" -ge 8; then |
| 130 | AC_MSG_RESULT(yes) |
| 131 | AC_DEFINE(DISABLE_UTMP) |
| 132 | AC_DEFINE(DISABLE_WTMP) |
| 133 | else |
| 134 | AC_MSG_RESULT(no) |
| 135 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 136 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 137 | *-*-sunos4*) |
| 138 | CFLAGS="$CFLAGS -DSUNOS4" |
| 139 | AC_CHECK_FUNCS(getpwanam) |
| 140 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 141 | *-sni-sysv*) |
| 142 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 143 | LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" |
| 144 | MANTYPE='$(CATMAN)' |
| 145 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 146 | mansubdir=cat |
Damien Miller | b2dc28e | 2000-07-12 09:18:33 +1000 | [diff] [blame] | 147 | LIBS="$LIBS -lgen -lnsl -lucb" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 148 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 149 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 150 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 151 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 152 | MANTYPE='$(CATMAN)' |
| 153 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 154 | LIBS="$LIBS -lgen -lsocket" |
| 155 | ;; |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 156 | *-*-sco3*) |
| 157 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 158 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 159 | MANTYPE='$(CATMAN)' |
| 160 | mansubdir=cat |
| 161 | LIBS="$LIBS -lgen -lsocket" |
| 162 | no_dev_ptmx=1 |
| 163 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 164 | *-dec-osf*) |
| 165 | # This is untested |
| 166 | if test ! -z "USE_SIA" ; then |
| 167 | AC_MSG_CHECKING(for Digital Unix Security Integration Architecture) |
| 168 | if test -f /etc/sia/matrix.conf; then |
| 169 | AC_MSG_RESULT(yes) |
| 170 | AC_DEFINE(HAVE_OSF_SIA) |
| 171 | AC_DEFINE(DISABLE_LOGIN) |
| 172 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 173 | else |
| 174 | AC_MSG_RESULT(no) |
| 175 | fi |
| 176 | fi |
| 177 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 178 | esac |
| 179 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 180 | # Allow user to specify flags |
| 181 | AC_ARG_WITH(cflags, |
| 182 | [ --with-cflags Specify additional flags to pass to compiler], |
| 183 | [ |
| 184 | if test "x$withval" != "xno" ; then |
| 185 | CFLAGS="$CFLAGS $withval" |
| 186 | fi |
| 187 | ] |
| 188 | ) |
| 189 | AC_ARG_WITH(ldflags, |
| 190 | [ --with-ldlags Specify additional flags to pass to linker], |
| 191 | [ |
| 192 | if test "x$withval" != "xno" ; then |
| 193 | LDFLAGS="$LDFLAGS $withval" |
| 194 | fi |
| 195 | ] |
| 196 | ) |
| 197 | AC_ARG_WITH(libs, |
| 198 | [ --with-libs Specify additional libraries to link with], |
| 199 | [ |
| 200 | if test "x$withval" != "xno" ; then |
| 201 | LIBS="$LIBS $withval" |
| 202 | fi |
| 203 | ] |
| 204 | ) |
| 205 | |
| 206 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 207 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 208 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 209 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 210 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 211 | if test -z "$no_libsocket" ; then |
| 212 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 213 | fi |
| 214 | if test -z "$no_libnsl" ; then |
| 215 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 216 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 217 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 218 | # Checks for header files. |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 219 | AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h lastlog.h limits.h login.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/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h usersec.h util.h utmp.h utmpx.h) |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 220 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 221 | # Checks for library functions. |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 222 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage inet_aton innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid sigaction sigvec snprintf strerror strlcat strlcpy strsep vsnprintf vhangup _getpty __b64_ntop) |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 223 | dnl checks for time functions |
| 224 | AC_CHECK_FUNCS(gettimeofday time) |
| 225 | dnl checks for libutil functions |
| 226 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
| 227 | dnl checks for utmp functions |
| 228 | AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent) |
| 229 | AC_CHECK_FUNCS(utmpname) |
| 230 | dnl checks for utmpx functions |
| 231 | AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline ) |
| 232 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 233 | |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 234 | AC_CHECK_FUNC(getuserattr, |
| 235 | [AC_DEFINE(HAVE_GETUSERATTR)], |
| 236 | [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])] |
| 237 | ) |
| 238 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 239 | AC_CHECK_FUNC(login, |
| 240 | [AC_DEFINE(HAVE_LOGIN)], |
| 241 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 242 | ) |
| 243 | |
| 244 | AC_CHECK_FUNC(daemon, |
| 245 | [AC_DEFINE(HAVE_DAEMON)], |
| 246 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 247 | ) |
| 248 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 249 | AC_CHECK_FUNC(getpagesize, |
| 250 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 251 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 252 | ) |
| 253 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 254 | # Check for broken snprintf |
| 255 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 256 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 257 | AC_TRY_RUN( |
| 258 | [ |
| 259 | #include <stdio.h> |
| 260 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 261 | ], |
| 262 | [AC_MSG_RESULT(yes)], |
| 263 | [ |
| 264 | AC_MSG_RESULT(no) |
| 265 | AC_DEFINE(BROKEN_SNPRINTF) |
| 266 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 267 | ] |
| 268 | ) |
| 269 | fi |
| 270 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 271 | PAM_MSG="no" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 272 | AC_ARG_WITH(pam, |
| 273 | [ --without-pam Disable PAM support ], |
| 274 | [ |
| 275 | if test "x$withval" = "xno" ; then |
| 276 | no_pam=1 |
| 277 | AC_DEFINE(DISABLE_PAM) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 278 | PAM_MSG="disabled" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 279 | fi |
| 280 | ] |
| 281 | ) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 282 | 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] | 283 | AC_CHECK_LIB(dl, dlopen, , ) |
| 284 | LIBS="$LIBS -lpam" |
| 285 | |
Damien Miller | 0e65eed | 2000-05-17 22:16:05 +1000 | [diff] [blame] | 286 | AC_CHECK_FUNCS(pam_getenvlist) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 287 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 288 | disable_shadow=yes |
| 289 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 290 | PAM_MSG="yes" |
| 291 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 292 | # Check PAM strerror arguments (old PAM) |
| 293 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) |
| 294 | AC_TRY_COMPILE( |
| 295 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 296 | #include <stdlib.h> |
| 297 | #include <security/pam_appl.h> |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 298 | ], |
| 299 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], |
| 300 | [AC_MSG_RESULT(no)], |
| 301 | [ |
| 302 | AC_DEFINE(HAVE_OLD_PAM) |
| 303 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 304 | PAM_MSG="yes (old library)" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 305 | ] |
| 306 | ) |
| 307 | fi |
| 308 | |
| 309 | # The big search for OpenSSL |
| 310 | AC_ARG_WITH(ssl-dir, |
| 311 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], |
| 312 | [ |
| 313 | if test "x$withval" != "$xno" ; then |
| 314 | tryssldir=$withval |
| 315 | fi |
| 316 | ] |
| 317 | ) |
| 318 | |
| 319 | saved_LIBS="$LIBS" |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 320 | saved_LDFLAGS="$LDFLAGS" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 321 | saved_CFLAGS="$CFLAGS" |
| 322 | if test "x$prefix" != "xNONE" ; then |
| 323 | tryssldir="$tryssldir $prefix" |
| 324 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 325 | AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [ |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 326 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 327 | for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do |
| 328 | if test ! -z "$ssldir" ; then |
| 329 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 330 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 331 | if test ! -z "$need_dash_r" ; then |
| 332 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
| 333 | fi |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 334 | else |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 335 | LDFLAGS="$saved_LDFLAGS" |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 336 | fi |
| 337 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 338 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 339 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 340 | # Basic test to check for compatible version and correct linking |
| 341 | # *does not* test for RSA - that comes later. |
| 342 | AC_TRY_RUN( |
| 343 | [ |
Damien Miller | e59ce62 | 2000-05-01 20:54:17 +1000 | [diff] [blame] | 344 | #include <string.h> |
| 345 | #include <openssl/rand.h> |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 346 | int main(void) |
| 347 | { |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 348 | char a[2048]; |
| 349 | memset(a, 0, sizeof(a)); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 350 | RAND_add(a, sizeof(a), sizeof(a)); |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 351 | return(RAND_status() <= 0); |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 352 | } |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 353 | ], |
| 354 | [ |
| 355 | found_crypto=1 |
| 356 | break; |
| 357 | ], [] |
| 358 | ) |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 359 | |
| 360 | if test ! -z "$found_crypto" ; then |
| 361 | break; |
| 362 | fi |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 363 | done |
| 364 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 365 | if test -z "$found_crypto" ; then |
| 366 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 367 | fi |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 368 | if test -z "$ssldir" ; then |
| 369 | ssldir="(system)" |
| 370 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 371 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 372 | ac_cv_openssldir=$ssldir |
| 373 | ]) |
| 374 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 375 | 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] | 376 | AC_DEFINE(HAVE_OPENSSL) |
| 377 | dnl Need to recover ssldir - test above runs in subshell |
| 378 | ssldir=$ac_cv_openssldir |
Damien Miller | a1ad480 | 2000-03-15 10:04:54 +1100 | [diff] [blame] | 379 | CFLAGS="$saved_CFLAGS -I$ssldir/include" |
| 380 | LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir" |
| 381 | if test ! -z "$need_dash_r" ; then |
| 382 | LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir" |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 383 | fi |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 384 | if test ! -z "$blibpath" ; then |
| 385 | blibpath="$blibpath:$ssldir:$ssldir/lib" |
| 386 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 387 | fi |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 388 | LIBS="$saved_LIBS -lcrypto" |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 389 | |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 390 | # Now test RSA support |
| 391 | saved_LIBS="$LIBS" |
| 392 | AC_MSG_CHECKING([for RSA support]) |
| 393 | for WANTS_RSAREF in "" 1 ; do |
| 394 | if test -z "$WANTS_RSAREF" ; then |
| 395 | LIBS="$saved_LIBS" |
| 396 | else |
| 397 | LIBS="$saved_LIBS -lRSAglue -lrsaref" |
| 398 | fi |
| 399 | AC_TRY_RUN([ |
| 400 | #include <string.h> |
| 401 | #include <openssl/rand.h> |
| 402 | #include <openssl/rsa.h> |
| 403 | #include <openssl/bn.h> |
| 404 | #include <openssl/sha.h> |
| 405 | int main(void) |
| 406 | { |
| 407 | int num; RSA *key; static unsigned char p_in[] = "blahblah"; |
| 408 | unsigned char c[256], p[256]; |
| 409 | memset(c, 0, sizeof(c)); RAND_add(c, sizeof(c), sizeof(c)); |
| 410 | if ((key=RSA_generate_key(512, 3, NULL, NULL))==NULL) return(1); |
| 411 | num = RSA_public_encrypt(sizeof(p_in) - 1, p_in, c, key, RSA_PKCS1_PADDING); |
| 412 | return(-1 == RSA_private_decrypt(num, c, p, key, RSA_PKCS1_PADDING)); |
| 413 | } |
| 414 | ], |
| 415 | [ |
| 416 | rsa_works=1 |
| 417 | break; |
| 418 | ], []) |
| 419 | done |
| 420 | |
| 421 | if test ! -z "$no_rsa" ; then |
| 422 | AC_MSG_RESULT(disabled) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 423 | RSA_MSG="disabled" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 424 | else |
| 425 | if test -z "$rsa_works" ; then |
| 426 | AC_MSG_WARN([*** No RSA support found *** ]) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 427 | RSA_MSG="no" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 428 | else |
| 429 | if test -z "$WANTS_RSAREF" ; then |
| 430 | AC_MSG_RESULT(yes) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 431 | RSA_MSG="yes" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 432 | else |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 433 | RSA_MSG="yes (using RSAref)" |
Damien Miller | 3b512e1 | 2000-05-17 23:29:18 +1000 | [diff] [blame] | 434 | AC_MSG_RESULT(using RSAref) |
| 435 | LIBS="$saved_LIBS -lcrypto -lRSAglue -lrsaref" |
| 436 | fi |
| 437 | fi |
| 438 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 439 | |
| 440 | # Checks for data types |
Damien Miller | e0f4574 | 2000-01-18 09:12:06 +1100 | [diff] [blame] | 441 | AC_CHECK_SIZEOF(char, 1) |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 442 | AC_CHECK_SIZEOF(short int, 2) |
| 443 | AC_CHECK_SIZEOF(int, 4) |
| 444 | AC_CHECK_SIZEOF(long int, 4) |
| 445 | AC_CHECK_SIZEOF(long long int, 8) |
| 446 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 447 | # More checks for data types |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 448 | AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ |
| 449 | AC_TRY_COMPILE( |
| 450 | [ #include <sys/types.h> ], |
| 451 | [ int8_t a; int16_t b; int32_t c; a = b = c = 1;], |
| 452 | [ ac_cv_have_intxx_t="yes" ], |
| 453 | [ ac_cv_have_intxx_t="no" ] |
| 454 | ) |
| 455 | ]) |
| 456 | if test "x$ac_cv_have_intxx_t" = "xyes" ; then |
| 457 | AC_DEFINE(HAVE_INTXX_T) |
| 458 | have_intxx_t=1 |
| 459 | fi |
| 460 | |
| 461 | AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ |
| 462 | AC_TRY_COMPILE( |
| 463 | [ #include <sys/types.h> ], |
| 464 | [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;], |
| 465 | [ ac_cv_have_u_intxx_t="yes" ], |
| 466 | [ ac_cv_have_u_intxx_t="no" ] |
| 467 | ) |
| 468 | ]) |
| 469 | if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then |
| 470 | AC_DEFINE(HAVE_U_INTXX_T) |
| 471 | have_u_intxx_t=1 |
| 472 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 473 | |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 474 | |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 475 | if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ |
| 476 | test "x$ac_cv_header_sys_bitypes_h" = "xyes") |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 477 | then |
| 478 | AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h]) |
| 479 | AC_TRY_COMPILE( |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 480 | [ |
| 481 | #include <sys/bitypes.h> |
| 482 | ], |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 483 | [ |
Damien Miller | 70494d1 | 2000-04-03 15:57:06 +1000 | [diff] [blame] | 484 | int8_t a; int16_t b; int32_t c; |
| 485 | u_int8_t e; u_int16_t f; u_int32_t g; |
| 486 | a = b = c = e = f = g = 1; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 487 | ], |
| 488 | [ |
| 489 | AC_DEFINE(HAVE_U_INTXX_T) |
| 490 | AC_DEFINE(HAVE_INTXX_T) |
| 491 | AC_MSG_RESULT(yes) |
| 492 | ], |
| 493 | [AC_MSG_RESULT(no)] |
| 494 | ) |
| 495 | fi |
| 496 | |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 497 | if test -z "$have_u_intxx_t" ; then |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 498 | AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [ |
| 499 | AC_TRY_COMPILE( |
| 500 | [ |
| 501 | #include <sys/types.h> |
| 502 | ], |
| 503 | [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ], |
| 504 | [ ac_cv_have_uintxx_t="yes" ], |
| 505 | [ ac_cv_have_uintxx_t="no" ] |
| 506 | ) |
| 507 | ]) |
| 508 | if test "x$ac_cv_have_uintxx_t" = "xyes" ; then |
| 509 | AC_DEFINE(HAVE_UINTXX_T) |
| 510 | fi |
Damien Miller | d6121d2 | 2000-03-17 23:26:46 +1100 | [diff] [blame] | 511 | fi |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 512 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 513 | AC_CACHE_CHECK([for socklen_t], ac_cv_have_socklen_t, [ |
| 514 | AC_TRY_COMPILE( |
| 515 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 516 | #include <sys/types.h> |
| 517 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 518 | ], |
| 519 | [socklen_t foo; foo = 1235;], |
| 520 | [ ac_cv_have_socklen_t="yes" ], |
| 521 | [ ac_cv_have_socklen_t="no" ] |
| 522 | ) |
| 523 | ]) |
| 524 | if test "x$ac_cv_have_socklen_t" = "xyes" ; then |
| 525 | AC_DEFINE(HAVE_SOCKLEN_T) |
| 526 | fi |
Damien Miller | 74d0d4a | 1999-12-29 02:24:35 +1100 | [diff] [blame] | 527 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 528 | AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ |
| 529 | AC_TRY_COMPILE( |
| 530 | [ |
| 531 | #include <sys/types.h> |
| 532 | ], |
| 533 | [ size_t foo; foo = 1235; ], |
| 534 | [ ac_cv_have_size_t="yes" ], |
| 535 | [ ac_cv_have_size_t="no" ] |
| 536 | ) |
| 537 | ]) |
| 538 | if test "x$ac_cv_have_size_t" = "xyes" ; then |
| 539 | AC_DEFINE(HAVE_SIZE_T) |
| 540 | fi |
Damien Miller | 9505851 | 1999-12-29 10:36:45 +1100 | [diff] [blame] | 541 | |
Damien Miller | 615f939 | 2000-05-17 22:53:33 +1000 | [diff] [blame] | 542 | AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ |
| 543 | AC_TRY_COMPILE( |
| 544 | [ |
| 545 | #include <sys/types.h> |
| 546 | ], |
| 547 | [ ssize_t foo; foo = 1235; ], |
| 548 | [ ac_cv_have_ssize_t="yes" ], |
| 549 | [ ac_cv_have_ssize_t="no" ] |
| 550 | ) |
| 551 | ]) |
| 552 | if test "x$ac_cv_have_ssize_t" = "xyes" ; then |
| 553 | AC_DEFINE(HAVE_SSIZE_T) |
| 554 | fi |
| 555 | |
Damien Miller | b54b40e | 2000-06-23 08:23:34 +1000 | [diff] [blame] | 556 | AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [ |
| 557 | AC_TRY_COMPILE( |
| 558 | [ |
| 559 | #include <sys/types.h> |
| 560 | #include <sys/socket.h> |
| 561 | ], |
| 562 | [ sa_family_t foo; foo = 1235; ], |
| 563 | [ ac_cv_have_sa_family_t="yes" ], |
| 564 | [ ac_cv_have_sa_family_t="no" ] |
| 565 | ) |
| 566 | ]) |
| 567 | if test "x$ac_cv_have_sa_family_t" = "xyes" ; then |
| 568 | AC_DEFINE(HAVE_SA_FAMILY_T) |
| 569 | fi |
| 570 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 571 | AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [ |
| 572 | AC_TRY_COMPILE( |
| 573 | [ |
| 574 | #include <sys/types.h> |
| 575 | ], |
| 576 | [ pid_t foo; foo = 1235; ], |
| 577 | [ ac_cv_have_pid_t="yes" ], |
| 578 | [ ac_cv_have_pid_t="no" ] |
| 579 | ) |
| 580 | ]) |
| 581 | if test "x$ac_cv_have_pid_t" = "xyes" ; then |
| 582 | AC_DEFINE(HAVE_PID_T) |
| 583 | fi |
| 584 | |
| 585 | AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [ |
| 586 | AC_TRY_COMPILE( |
| 587 | [ |
| 588 | #include <sys/types.h> |
| 589 | ], |
| 590 | [ mode_t foo; foo = 1235; ], |
| 591 | [ ac_cv_have_mode_t="yes" ], |
| 592 | [ ac_cv_have_mode_t="no" ] |
| 593 | ) |
| 594 | ]) |
| 595 | if test "x$ac_cv_have_mode_t" = "xyes" ; then |
| 596 | AC_DEFINE(HAVE_MODE_T) |
| 597 | fi |
| 598 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 599 | |
| 600 | AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ |
| 601 | AC_TRY_COMPILE( |
| 602 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 603 | #include <sys/types.h> |
| 604 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 605 | ], |
| 606 | [ struct sockaddr_storage s; ], |
| 607 | [ ac_cv_have_struct_sockaddr_storage="yes" ], |
| 608 | [ ac_cv_have_struct_sockaddr_storage="no" ] |
| 609 | ) |
| 610 | ]) |
| 611 | if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then |
| 612 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE) |
| 613 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 614 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 615 | AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ |
| 616 | AC_TRY_COMPILE( |
| 617 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 618 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 619 | #include <netinet/in.h> |
| 620 | ], |
| 621 | [ struct sockaddr_in6 s; s.sin6_family = 0; ], |
| 622 | [ ac_cv_have_struct_sockaddr_in6="yes" ], |
| 623 | [ ac_cv_have_struct_sockaddr_in6="no" ] |
| 624 | ) |
| 625 | ]) |
| 626 | if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then |
| 627 | AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6) |
| 628 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 629 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 630 | AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ |
| 631 | AC_TRY_COMPILE( |
| 632 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 633 | #include <sys/types.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 634 | #include <netinet/in.h> |
| 635 | ], |
| 636 | [ struct in6_addr s; s.s6_addr[0] = 0; ], |
| 637 | [ ac_cv_have_struct_in6_addr="yes" ], |
| 638 | [ ac_cv_have_struct_in6_addr="no" ] |
| 639 | ) |
| 640 | ]) |
| 641 | if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then |
| 642 | AC_DEFINE(HAVE_STRUCT_IN6_ADDR) |
| 643 | fi |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 644 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 645 | AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ |
| 646 | AC_TRY_COMPILE( |
| 647 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 648 | #include <sys/types.h> |
| 649 | #include <sys/socket.h> |
| 650 | #include <netdb.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 651 | ], |
| 652 | [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], |
| 653 | [ ac_cv_have_struct_addrinfo="yes" ], |
| 654 | [ ac_cv_have_struct_addrinfo="no" ] |
| 655 | ) |
| 656 | ]) |
| 657 | if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then |
| 658 | AC_DEFINE(HAVE_STRUCT_ADDRINFO) |
| 659 | fi |
| 660 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 661 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 662 | # Checks for structure members |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 663 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 664 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP) |
| 665 | OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX) |
| 666 | OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX) |
| 667 | OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP) |
| 668 | 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] | 669 | 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] | 670 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP) |
| 671 | 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] | 672 | 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] | 673 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP) |
| 674 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) |
| 675 | OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) |
| 676 | 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] | 677 | OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP) |
| 678 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP) |
| 679 | OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX) |
| 680 | OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX) |
| 681 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 682 | AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], |
| 683 | ac_cv_have_ss_family_in_struct_ss, [ |
| 684 | AC_TRY_COMPILE( |
| 685 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 686 | #include <sys/types.h> |
| 687 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 688 | ], |
| 689 | [ struct sockaddr_storage s; s.ss_family = 1; ], |
| 690 | [ ac_cv_have_ss_family_in_struct_ss="yes" ], |
| 691 | [ ac_cv_have_ss_family_in_struct_ss="no" ], |
| 692 | ) |
| 693 | ]) |
| 694 | if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then |
| 695 | AC_DEFINE(HAVE_SS_FAMILY_IN_SS) |
| 696 | fi |
| 697 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 698 | AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], |
| 699 | ac_cv_have___ss_family_in_struct_ss, [ |
| 700 | AC_TRY_COMPILE( |
| 701 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 702 | #include <sys/types.h> |
| 703 | #include <sys/socket.h> |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 704 | ], |
| 705 | [ struct sockaddr_storage s; s.__ss_family = 1; ], |
| 706 | [ ac_cv_have___ss_family_in_struct_ss="yes" ], |
| 707 | [ ac_cv_have___ss_family_in_struct_ss="no" ] |
| 708 | ) |
| 709 | ]) |
| 710 | if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then |
| 711 | AC_DEFINE(HAVE___SS_FAMILY_IN_SS) |
| 712 | fi |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 713 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 714 | |
| 715 | AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [ |
| 716 | AC_TRY_LINK([], |
| 717 | [ extern char *__progname; printf("%s", __progname); ], |
| 718 | [ ac_cv_libc_defines___progname="yes" ], |
| 719 | [ ac_cv_libc_defines___progname="no" ] |
| 720 | ) |
| 721 | ]) |
| 722 | if test "x$ac_cv_libc_defines___progname" = "xyes" ; then |
| 723 | AC_DEFINE(HAVE___PROGNAME) |
| 724 | fi |
| 725 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 726 | |
Damien Miller | ecbb26d | 2000-07-15 14:59:14 +1000 | [diff] [blame] | 727 | AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [ |
| 728 | AC_TRY_LINK([], |
| 729 | [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);], |
| 730 | [ ac_cv_libc_defines_sys_errlist="yes" ], |
| 731 | [ ac_cv_libc_defines_sys_errlist="no" ] |
| 732 | ) |
| 733 | ]) |
| 734 | if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then |
| 735 | AC_DEFINE(HAVE_SYS_ERRLIST) |
| 736 | fi |
| 737 | |
| 738 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 739 | # Looking for programs, paths and files |
| 740 | AC_ARG_WITH(rsh, |
| 741 | [ --with-rsh=PATH Specify path to remote shell program ], |
| 742 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 743 | if test "x$withval" != "$no" ; then |
Damien Miller | 90dcc05 | 2000-07-08 10:17:40 +1000 | [diff] [blame] | 744 | rsh_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 745 | fi |
| 746 | ], |
| 747 | [ |
| 748 | AC_PATH_PROG(rsh_path, rsh) |
| 749 | ] |
| 750 | ) |
| 751 | |
| 752 | AC_ARG_WITH(xauth, |
| 753 | [ --with-xauth=PATH Specify path to xauth program ], |
| 754 | [ |
| 755 | if test "x$withval" != "$xno" ; then |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 756 | xauth_path=$withval |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 757 | fi |
| 758 | ], |
| 759 | [ |
| 760 | AC_PATH_PROG(xauth_path, xauth) |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 761 | if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 762 | xauth_path="/usr/openwin/bin/xauth" |
| 763 | fi |
| 764 | ] |
| 765 | ) |
| 766 | |
| 767 | if test ! -z "$xauth_path" ; then |
| 768 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") |
| 769 | fi |
| 770 | if test ! -z "$rsh_path" ; then |
| 771 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") |
| 772 | fi |
| 773 | |
| 774 | # Check for mail directory (last resort if we cannot get it from headers) |
| 775 | if test ! -z "$MAIL" ; then |
| 776 | maildir=`dirname $MAIL` |
| 777 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") |
| 778 | fi |
| 779 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 780 | if test -z "$no_dev_ptmx" ; then |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 781 | AC_CHECK_FILE("/dev/ptmx", |
| 782 | [ |
| 783 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
| 784 | have_dev_ptmx=1 |
| 785 | ] |
| 786 | ) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 787 | fi |
Damien Miller | 204ad07 | 2000-03-02 23:56:12 +1100 | [diff] [blame] | 788 | AC_CHECK_FILE("/dev/ptc", |
| 789 | [ |
| 790 | AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
| 791 | have_dev_ptc=1 |
| 792 | ] |
| 793 | ) |
| 794 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 795 | # Options from here on. Some of these are preset by platform above |
| 796 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 797 | # Check for user-specified random device, otherwise check /dev/urandom |
| 798 | AC_ARG_WITH(random, |
| 799 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], |
| 800 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 801 | if test "x$withval" != "xno" ; then |
| 802 | RANDOM_POOL="$withval"; |
| 803 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 804 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 805 | ], |
| 806 | [ |
| 807 | # Check for random device |
| 808 | AC_CHECK_FILE("/dev/urandom", |
| 809 | [ |
| 810 | RANDOM_POOL="/dev/urandom"; |
| 811 | AC_SUBST(RANDOM_POOL) |
| 812 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") |
| 813 | ] |
| 814 | ) |
| 815 | ] |
| 816 | ) |
| 817 | |
| 818 | # Check for EGD pool file |
| 819 | AC_ARG_WITH(egd-pool, |
| 820 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], |
| 821 | [ |
Damien Miller | 040f383 | 2000-04-03 14:50:43 +1000 | [diff] [blame] | 822 | if test "x$withval" != "xno" ; then |
| 823 | EGD_SOCKET="$withval"; |
| 824 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET") |
| 825 | fi |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 826 | ] |
| 827 | ) |
| 828 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 829 | # detect pathnames for entropy gathering commands, if we need them |
| 830 | INSTALL_SSH_PRNG_CMDS="" |
| 831 | rm -f prng_commands |
Damien Miller | edb8292 | 2000-06-20 13:25:52 +1000 | [diff] [blame] | 832 | if (test -z "$RANDOM_POOL" && test -z "$EGD_SOCKET") ; then |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 833 | # Use these commands to collect entropy |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 834 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
| 835 | OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat) |
| 836 | OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp) |
| 837 | OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig) |
| 838 | OSSH_PATH_ENTROPY_PROG(PROG_PS, ps) |
| 839 | OSSH_PATH_ENTROPY_PROG(PROG_W, w) |
| 840 | OSSH_PATH_ENTROPY_PROG(PROG_WHO, who) |
| 841 | OSSH_PATH_ENTROPY_PROG(PROG_LAST, last) |
| 842 | OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog) |
| 843 | OSSH_PATH_ENTROPY_PROG(PROG_DF, df) |
| 844 | OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat) |
| 845 | OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime) |
| 846 | OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs) |
| 847 | OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail) |
| 848 | OSSH_PATH_ENTROPY_PROG(PROG_LS, ls) |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 849 | |
| 850 | INSTALL_SSH_PRNG_CMDS="yes" |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 851 | fi |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 852 | AC_SUBST(INSTALL_SSH_PRNG_CMDS) |
| 853 | |
Damien Miller | 11e37f6 | 2000-04-08 18:23:30 +1000 | [diff] [blame] | 854 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 855 | AC_ARG_WITH(catman, |
| 856 | [ --with-catman=man|cat Install preformatted manpages[no]], |
| 857 | [ |
| 858 | MANTYPE='$(CATMAN)' |
| 859 | if test x"$withval" != x"yes" ; then |
| 860 | mansubdir=$withval |
| 861 | else |
| 862 | mansubdir=cat |
| 863 | fi |
| 864 | ], [ |
| 865 | if test -z "$MANTYPE" ; then |
| 866 | MANTYPE='$(TROFFMAN)' |
| 867 | mansubdir=man |
| 868 | fi |
| 869 | ] |
| 870 | ) |
| 871 | AC_SUBST(MANTYPE) |
| 872 | AC_SUBST(mansubdir) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 873 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 874 | # Check whether user wants Kerberos support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 875 | KRB4_MSG="no" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 876 | AC_ARG_WITH(kerberos4, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 877 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 878 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 879 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 880 | |
| 881 | if test "x$withval" != "$xyes" ; then |
| 882 | CFLAGS="$CFLAGS -I${withval}/include" |
| 883 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 884 | if test ! -z "$need_dash_r" ; then |
| 885 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
| 886 | fi |
| 887 | if test ! -z "$blibpath" ; then |
| 888 | blibpath="$blibpath:${withval}/lib" |
| 889 | fi |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 890 | else |
| 891 | if test -d /usr/include/kerberosIV ; then |
| 892 | CFLAGS="$CFLAGS -I/usr/include/kerberosIV" |
| 893 | fi |
| 894 | fi |
| 895 | |
| 896 | AC_CHECK_HEADERS(krb.h) |
| 897 | AC_CHECK_LIB(krb, main) |
| 898 | if test "$ac_cv_header_krb_h" != yes; then |
| 899 | AC_MSG_WARN([Cannot find krb.h, build may fail]) |
| 900 | fi |
| 901 | if test "$ac_cv_lib_krb_main" != yes; then |
| 902 | AC_MSG_WARN([Cannot find libkrb, build may fail]) |
| 903 | fi |
| 904 | |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 905 | KLIBS="-lkrb -ldes" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 906 | AC_CHECK_LIB(resolv, dn_expand, , ) |
| 907 | KRB4=yes |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 908 | KRB4_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 909 | AC_DEFINE(KRB4) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 910 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 911 | ] |
| 912 | ) |
| 913 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 914 | # Check whether user wants AFS support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 915 | AFS_MSG="no" |
Damien Miller | c6398ef | 1999-11-20 12:18:40 +1100 | [diff] [blame] | 916 | AC_ARG_WITH(afs, |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 917 | [ --with-afs=PATH Enable AFS support], |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 918 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 919 | if test "x$withval" != "xno" ; then |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 920 | |
| 921 | if test "x$withval" != "$xyes" ; then |
| 922 | CFLAGS="$CFLAGS -I${withval}/include" |
| 923 | LFLAGS="$LFLAGS -L${withval}/lib" |
| 924 | fi |
| 925 | |
| 926 | if test -z "$KRB4" ; then |
| 927 | AC_MSG_WARN([AFS requires Kerberos IV support, build may fail]) |
| 928 | fi |
| 929 | |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 930 | LIBS="$LIBS -lkafs" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 931 | if test ! -z "$AFS_LIBS" ; then |
| 932 | LIBS="$LIBS $AFS_LIBS" |
| 933 | fi |
| 934 | AC_DEFINE(AFS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 935 | AFS_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 936 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 937 | ] |
| 938 | ) |
Damien Miller | c85f9b4 | 2000-01-29 10:20:21 +1100 | [diff] [blame] | 939 | LIBS="$LIBS $KLIBS" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 940 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 941 | # Check whether user wants S/Key support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 942 | SKEY_MSG="no" |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 943 | AC_ARG_WITH(skey, |
| 944 | [ --with-skey Enable S/Key support], |
| 945 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 946 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 947 | AC_DEFINE(SKEY) |
| 948 | LIBS="$LIBS -lskey" |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 949 | SKEY_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 950 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 951 | ] |
| 952 | ) |
| 953 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 954 | # Check whether user wants TCP wrappers support |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 955 | TCPW_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 956 | AC_ARG_WITH(tcp-wrappers, |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 957 | [ --with-tcp-wrappers Enable tcpwrappers support], |
| 958 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 959 | if test "x$withval" != "xno" ; then |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 960 | saved_LIBS="$LIBS" |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 961 | LIBS="$LIBS -lwrap" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 962 | AC_MSG_CHECKING(for libwrap) |
| 963 | AC_TRY_LINK( |
| 964 | [ |
Damien Miller | 8117111 | 2000-04-23 11:14:01 +1000 | [diff] [blame] | 965 | #include <tcpd.h> |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 966 | int deny_severity = 0, allow_severity = 0; |
| 967 | ], |
| 968 | [hosts_access(0);], |
| 969 | [ |
| 970 | AC_MSG_RESULT(yes) |
| 971 | AC_DEFINE(LIBWRAP) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 972 | TCPW_MSG="yes" |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 973 | ], |
| 974 | [ |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 975 | AC_MSG_ERROR([*** libwrap missing]) |
Damien Miller | 65165f8 | 2000-03-05 17:02:45 +1100 | [diff] [blame] | 976 | ] |
| 977 | ) |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 978 | fi |
Damien Miller | 8029775 | 1999-11-19 13:03:25 +1100 | [diff] [blame] | 979 | ] |
| 980 | ) |
| 981 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 982 | # Check whether to enable MD5 passwords |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 983 | MD5_MSG="no" |
Damien Miller | f7c0f82 | 1999-11-22 22:31:49 +1100 | [diff] [blame] | 984 | AC_ARG_WITH(md5-passwords, |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 985 | [ --with-md5-passwords Enable use of MD5 passwords], |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 986 | [ |
Damien Miller | b85dcad | 2000-03-11 11:37:00 +1100 | [diff] [blame] | 987 | if test "x$withval" != "xno" ; then |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 988 | AC_DEFINE(HAVE_MD5_PASSWORDS) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 989 | MD5_MSG="yes" |
Damien Miller | 8bdeee2 | 1999-12-30 15:50:54 +1100 | [diff] [blame] | 990 | fi |
| 991 | ] |
Damien Miller | dd1c7ba | 1999-11-19 15:53:20 +1100 | [diff] [blame] | 992 | ) |
| 993 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 994 | # Whether to disable shadow password support |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 995 | AC_ARG_WITH(shadow, |
| 996 | [ --without-shadow Disable shadow password support], |
| 997 | [ |
| 998 | if test "x$withval" = "xno" ; then |
| 999 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1000 | disable_shadow=yes |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1001 | fi |
| 1002 | ] |
| 1003 | ) |
| 1004 | |
Damien Miller | 1f335fb | 2000-06-26 11:31:33 +1000 | [diff] [blame] | 1005 | if test -z "$disable_shadow" ; then |
| 1006 | AC_MSG_CHECKING([if the systems has expire shadow information]) |
| 1007 | AC_TRY_COMPILE( |
| 1008 | [ |
| 1009 | #include <sys/types.h> |
| 1010 | #include <shadow.h> |
| 1011 | struct spwd sp; |
| 1012 | ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ], |
| 1013 | [ sp_expire_available=yes ], [] |
| 1014 | ) |
| 1015 | |
| 1016 | if test "x$sp_expire_available" = "xyes" ; then |
| 1017 | AC_MSG_RESULT(yes) |
| 1018 | AC_DEFINE(HAS_SHADOW_EXPIRE) |
| 1019 | else |
| 1020 | AC_MSG_RESULT(no) |
| 1021 | fi |
| 1022 | fi |
| 1023 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1024 | # Use ip address instead of hostname in $DISPLAY |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1025 | DISPLAY_HACK_MSG="no" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1026 | AC_ARG_WITH(ipaddr-display, |
| 1027 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1028 | [ |
Damien Miller | 6640995 | 2000-01-17 21:40:06 +1100 | [diff] [blame] | 1029 | if test "x$withval" = "xno" ; then |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1030 | AC_DEFINE(IPADDR_IN_DISPLAY) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1031 | DISPLAY_HACK_MSG="yes" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1032 | fi |
| 1033 | ] |
| 1034 | ) |
| 1035 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1036 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1037 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1038 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1039 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 1040 | [ |
| 1041 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 1042 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1043 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1044 | fi |
| 1045 | ] |
| 1046 | ) |
| 1047 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1048 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1049 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1050 | AC_ARG_WITH(ipv4-default, |
| 1051 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 1052 | [ |
| 1053 | if test "x$withval" != "xno" ; then |
| 1054 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1055 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1056 | fi |
| 1057 | ] |
| 1058 | ) |
| 1059 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1060 | 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] | 1061 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1062 | AC_ARG_WITH(4in6, |
| 1063 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 1064 | [ |
| 1065 | if test "x$withval" != "xno" ; then |
| 1066 | AC_MSG_RESULT(yes) |
| 1067 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1068 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1069 | else |
| 1070 | AC_MSG_RESULT(no) |
| 1071 | fi |
| 1072 | ],[ |
| 1073 | if test "x$inet6_default_4in6" = "xyes"; then |
| 1074 | AC_MSG_RESULT([yes (default)]) |
| 1075 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1076 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1077 | else |
| 1078 | AC_MSG_RESULT([no (default)]) |
| 1079 | fi |
| 1080 | ] |
| 1081 | ) |
| 1082 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1083 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1084 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1085 | AC_ARG_WITH(pid-dir, |
| 1086 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 1087 | [ |
| 1088 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1089 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1090 | fi |
| 1091 | ] |
| 1092 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1093 | |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 1094 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1095 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1096 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1097 | dnl allow user to disable some login recording features |
| 1098 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1099 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1100 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 1101 | ) |
| 1102 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1103 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1104 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 1105 | ) |
| 1106 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1107 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1108 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 1109 | ) |
| 1110 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1111 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1112 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 1113 | ) |
| 1114 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1115 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1116 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 1117 | ) |
| 1118 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1119 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1120 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 1121 | ) |
| 1122 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1123 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1124 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 1125 | ) |
| 1126 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1127 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1128 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 1129 | ) |
| 1130 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1131 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1132 | [ conf_lastlog_location="$withval"; ],) |
| 1133 | |
| 1134 | dnl lastlog, [uw]tmpx? detection |
| 1135 | dnl NOTE: set the paths in the platform section to avoid the |
| 1136 | dnl need for command-line parameters |
| 1137 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 1138 | |
| 1139 | dnl lastlog detection |
| 1140 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 1141 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 1142 | AC_TRY_COMPILE([ |
| 1143 | #include <sys/types.h> |
| 1144 | #include <utmp.h> |
| 1145 | #ifdef HAVE_LASTLOG_H |
| 1146 | # include <lastlog.h> |
| 1147 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1148 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1149 | # include <paths.h> |
| 1150 | #endif |
| 1151 | ], |
| 1152 | [ char *lastlog = LASTLOG_FILE; ], |
| 1153 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1154 | [ |
| 1155 | AC_MSG_RESULT(no) |
| 1156 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 1157 | AC_TRY_COMPILE([ |
| 1158 | #include <sys/types.h> |
| 1159 | #include <utmp.h> |
| 1160 | #ifdef HAVE_LASTLOG_H |
| 1161 | # include <lastlog.h> |
| 1162 | #endif |
| 1163 | #ifdef HAVE_PATHS_H |
| 1164 | # include <paths.h> |
| 1165 | #endif |
| 1166 | ], |
| 1167 | [ char *lastlog = _PATH_LASTLOG; ], |
| 1168 | [ AC_MSG_RESULT(yes) ], |
| 1169 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 1170 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1171 | system_lastlog_path=no |
| 1172 | ]) |
| 1173 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1174 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1175 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1176 | if test -z "$conf_lastlog_location"; then |
| 1177 | if test x"$system_lastlog_path" = x"no" ; then |
| 1178 | 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] | 1179 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1180 | conf_lastlog_location=$f |
| 1181 | fi |
| 1182 | done |
| 1183 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 1184 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 1185 | 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] | 1186 | fi |
| 1187 | fi |
| 1188 | fi |
| 1189 | |
| 1190 | if test -n "$conf_lastlog_location"; then |
| 1191 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 1192 | fi |
| 1193 | |
| 1194 | dnl utmp detection |
| 1195 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 1196 | AC_TRY_COMPILE([ |
| 1197 | #include <sys/types.h> |
| 1198 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1199 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1200 | # include <paths.h> |
| 1201 | #endif |
| 1202 | ], |
| 1203 | [ char *utmp = UTMP_FILE; ], |
| 1204 | [ AC_MSG_RESULT(yes) ], |
| 1205 | [ AC_MSG_RESULT(no) |
| 1206 | system_utmp_path=no ] |
| 1207 | ) |
| 1208 | if test -z "$conf_utmp_location"; then |
| 1209 | if test x"$system_utmp_path" = x"no" ; then |
| 1210 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 1211 | if test -f $f ; then |
| 1212 | conf_utmp_location=$f |
| 1213 | fi |
| 1214 | done |
| 1215 | if test -z "$conf_utmp_location"; then |
| 1216 | AC_DEFINE(DISABLE_UTMP) |
| 1217 | fi |
| 1218 | fi |
| 1219 | fi |
| 1220 | if test -n "$conf_utmp_location"; then |
| 1221 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 1222 | fi |
| 1223 | |
| 1224 | dnl wtmp detection |
| 1225 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 1226 | AC_TRY_COMPILE([ |
| 1227 | #include <sys/types.h> |
| 1228 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1229 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1230 | # include <paths.h> |
| 1231 | #endif |
| 1232 | ], |
| 1233 | [ char *wtmp = WTMP_FILE; ], |
| 1234 | [ AC_MSG_RESULT(yes) ], |
| 1235 | [ AC_MSG_RESULT(no) |
| 1236 | system_wtmp_path=no ] |
| 1237 | ) |
| 1238 | if test -z "$conf_wtmp_location"; then |
| 1239 | if test x"$system_wtmp_path" = x"no" ; then |
| 1240 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1241 | if test -f $f ; then |
| 1242 | conf_wtmp_location=$f |
| 1243 | fi |
| 1244 | done |
| 1245 | if test -z "$conf_wtmp_location"; then |
| 1246 | AC_DEFINE(DISABLE_WTMP) |
| 1247 | fi |
| 1248 | fi |
| 1249 | fi |
| 1250 | if test -n "$conf_wtmp_location"; then |
| 1251 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1252 | fi |
| 1253 | |
| 1254 | |
| 1255 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1256 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1257 | dnl there, though. |
| 1258 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1259 | AC_TRY_COMPILE([ |
| 1260 | #include <sys/types.h> |
| 1261 | #include <utmp.h> |
| 1262 | #ifdef HAVE_UTMPX_H |
| 1263 | #include <utmpx.h> |
| 1264 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1265 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1266 | # include <paths.h> |
| 1267 | #endif |
| 1268 | ], |
| 1269 | [ char *utmpx = UTMPX_FILE; ], |
| 1270 | [ AC_MSG_RESULT(yes) ], |
| 1271 | [ AC_MSG_RESULT(no) |
| 1272 | system_utmpx_path=no ] |
| 1273 | ) |
| 1274 | if test -z "$conf_utmpx_location"; then |
| 1275 | if test x"$system_utmpx_path" = x"no" ; then |
| 1276 | AC_DEFINE(DISABLE_UTMPX) |
| 1277 | fi |
| 1278 | else |
| 1279 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1280 | fi |
| 1281 | |
| 1282 | dnl wtmpx detection |
| 1283 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1284 | AC_TRY_COMPILE([ |
| 1285 | #include <sys/types.h> |
| 1286 | #include <utmp.h> |
| 1287 | #ifdef HAVE_UTMPX_H |
| 1288 | #include <utmpx.h> |
| 1289 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1290 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1291 | # include <paths.h> |
| 1292 | #endif |
| 1293 | ], |
| 1294 | [ char *wtmpx = WTMPX_FILE; ], |
| 1295 | [ AC_MSG_RESULT(yes) ], |
| 1296 | [ AC_MSG_RESULT(no) |
| 1297 | system_wtmpx_path=no ] |
| 1298 | ) |
| 1299 | if test -z "$conf_wtmpx_location"; then |
| 1300 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1301 | AC_DEFINE(DISABLE_WTMPX) |
| 1302 | fi |
| 1303 | else |
| 1304 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1305 | fi |
| 1306 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1307 | |
| 1308 | # Change default command timeout for builtin PRNG |
Damien Miller | 14c12cb | 2000-06-07 22:20:23 +1000 | [diff] [blame] | 1309 | entropy_timeout=200 |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1310 | AC_ARG_WITH(entropy-timeout, |
| 1311 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1312 | [ |
| 1313 | if test "x$withval" != "xno" ; then |
| 1314 | entropy_timeout=$withval |
| 1315 | fi |
| 1316 | ] |
| 1317 | ) |
| 1318 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1319 | |
| 1320 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1321 | if test ! -z "$blibpath" ; then |
| 1322 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 1323 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 1324 | fi |
| 1325 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1326 | AC_OUTPUT(Makefile ssh_prng_cmds) |
| 1327 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1328 | # Print summary of options |
| 1329 | |
| 1330 | if test x$MANTYPE = x'$(CATMAN)' ; then |
| 1331 | MAN_MSG=cat |
| 1332 | else |
| 1333 | MAN_MSG=man |
| 1334 | fi |
| 1335 | if test ! -z "$RANDOM_POOL" ; then |
| 1336 | RAND_MSG="Device ($RANDOM_POOL)" |
| 1337 | else |
| 1338 | if test ! -z "$EGD_SOCKET" ; then |
| 1339 | RAND_MSG="EGD ($EGD_SOCKET)" |
| 1340 | else |
| 1341 | RAND_MSG="Builtin (timeout $entropy_timeout)" |
| 1342 | fi |
| 1343 | fi |
| 1344 | |
| 1345 | # Someone please show me a better way :) |
| 1346 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 1347 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 1348 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 1349 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
| 1350 | E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}` |
| 1351 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
| 1352 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
| 1353 | |
| 1354 | echo "" |
| 1355 | echo "OpenSSH configured has been configured with the following options." |
| 1356 | echo " User binaries: $B" |
| 1357 | echo " System binaries: $C" |
| 1358 | echo " Configuration files: $D" |
| 1359 | echo " Askpass program: $E" |
| 1360 | echo " Manual pages: $F" |
| 1361 | echo " PID file: $G" |
| 1362 | echo " Random number collection: $RAND_MSG" |
| 1363 | echo " Manpage format: $MAN_MSG" |
| 1364 | echo " PAM support: ${PAM_MSG}" |
| 1365 | echo " KerberosIV support: $KRB4_MSG" |
| 1366 | echo " AFS support: $AFS_MSG" |
| 1367 | echo " S/KEY support: $SKEY_MSG" |
| 1368 | echo " TCP Wrappers support: $TCPW_MSG" |
| 1369 | echo " MD5 password support: $MD5_MSG" |
| 1370 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
| 1371 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 1372 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 1373 | |
| 1374 | echo "" |
| 1375 | |
| 1376 | echo "Compiler flags: ${CFLAGS}" |
| 1377 | echo "Linker flags: ${LDFLAGS}" |
| 1378 | echo "Libraries: ${LIBS}" |
| 1379 | |
| 1380 | echo "" |
| 1381 | |