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