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