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 | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 57 | *-*-cygwin*) |
| 58 | LIBS="$LIBS /usr/lib/textmode.o" |
| 59 | AC_DEFINE(HAVE_CYGWIN) |
| 60 | AC_DEFINE(DISABLE_PAM) |
| 61 | AC_DEFINE(DISABLE_SHADOW) |
| 62 | AC_DEFINE(IPV4_DEFAULT) |
| 63 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 64 | AC_DEFINE(BROKEN_VHANGUP) |
| 65 | no_pam=1 |
| 66 | no_libsocket=1 |
| 67 | no_libnsl=1 |
| 68 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 69 | *-*-hpux10*) |
| 70 | if test -z "$GCC"; then |
Damien Miller | fda78d9 | 2000-05-20 15:33:44 +1000 | [diff] [blame] | 71 | CFLAGS="$CFLAGS -Ae" |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 72 | fi |
| 73 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 74 | IPADDR_IN_DISPLAY=yes |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 75 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 76 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame^] | 77 | AC_DEFINE(DISABLE_UTMP) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 78 | LIBS="$LIBS -lsec" |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 79 | MANTYPE='$(CATMAN)' |
| 80 | mansubdir=cat |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 81 | ;; |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 82 | *-*-hpux11*) |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 83 | CFLAGS="$CFLAGS -D_HPUX_SOURCE" |
Damien Miller | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 84 | IPADDR_IN_DISPLAY=yes |
Damien Miller | 5552d7a | 2000-08-30 09:53:24 +1100 | [diff] [blame] | 85 | AC_DEFINE(USE_PIPES) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 86 | AC_DEFINE(DISABLE_SHADOW) |
Damien Miller | d6f204d | 2000-09-23 13:57:27 +1100 | [diff] [blame^] | 87 | AC_DEFINE(DISABLE_UTMP) |
Damien Miller | 8a1e6a6 | 2000-09-16 15:55:52 +1100 | [diff] [blame] | 88 | LIBS="$LIBS -lsec" |
Damien Miller | 1bead33 | 2000-04-30 00:47:29 +1000 | [diff] [blame] | 89 | MANTYPE='$(CATMAN)' |
| 90 | mansubdir=cat |
| 91 | ;; |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 92 | *-*-irix5*) |
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 | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 96 | no_libsocket=1 |
| 97 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 98 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | 1808f38 | 2000-01-06 12:03:12 +1100 | [diff] [blame] | 99 | ;; |
| 100 | *-*-irix6*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 101 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 9e11089 | 2000-06-07 21:05:46 +1000 | [diff] [blame] | 102 | LDFLAGS="$LDFLAGS" |
Damien Miller | 0727893 | 2000-01-22 14:05:37 +1100 | [diff] [blame] | 103 | MANTYPE='$(CATMAN)' |
Damien Miller | 91606b1 | 2000-06-28 08:22:29 +1000 | [diff] [blame] | 104 | AC_DEFINE(WITH_IRIX_ARRAY) |
| 105 | AC_DEFINE(WITH_IRIX_PROJECT) |
| 106 | AC_DEFINE(WITH_IRIX_AUDIT) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 107 | no_libsocket=1 |
| 108 | no_libnsl=1 |
Damien Miller | 11fa2cc | 2000-08-16 10:35:58 +1000 | [diff] [blame] | 109 | AC_DEFINE(BROKEN_INET_NTOA) |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 110 | ;; |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 111 | *-*-linux*) |
| 112 | no_dev_ptmx=1 |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 113 | AC_DEFINE(DONT_TRY_OTHER_AF) |
Damien Miller | 4e99720 | 2000-07-09 21:21:52 +1000 | [diff] [blame] | 114 | AC_DEFINE(PAM_TTY_KLUDGE) |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 115 | inet6_default_4in6=yes |
Damien Miller | b29ea91 | 2000-01-15 14:12:03 +1100 | [diff] [blame] | 116 | ;; |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 117 | *-*-netbsd*) |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 118 | need_dash_r=1 |
Damien Miller | ee1c0b3 | 2000-01-21 00:18:15 +1100 | [diff] [blame] | 119 | ;; |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 120 | *-next-*) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 121 | conf_lastlog_location="/usr/adm/lastlog" |
Damien Miller | e5192fa | 2000-08-29 14:30:37 +1100 | [diff] [blame] | 122 | conf_utmp_location=/etc/utmp |
| 123 | conf_wtmp_location=/usr/adm/wtmp |
| 124 | MAIL=/usr/spool/mail |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 125 | AC_DEFINE(HAVE_NEXT) |
| 126 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 127 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 128 | *-*-solaris*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 129 | CFLAGS="$CFLAGS -I/usr/local/include" |
Damien Miller | 08c788a | 2000-03-16 07:52:29 +1100 | [diff] [blame] | 130 | 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] | 131 | need_dash_r=1 |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 132 | # hardwire lastlog location (can't detect it on some versions) |
| 133 | conf_lastlog_location="/var/adm/lastlog" |
Damien Miller | a1cb644 | 2000-06-09 11:58:35 +1000 | [diff] [blame] | 134 | AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) |
| 135 | sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'` |
| 136 | if test "$sol2ver" -ge 8; then |
| 137 | AC_MSG_RESULT(yes) |
| 138 | AC_DEFINE(DISABLE_UTMP) |
| 139 | AC_DEFINE(DISABLE_WTMP) |
| 140 | else |
| 141 | AC_MSG_RESULT(no) |
| 142 | fi |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 143 | ;; |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 144 | *-*-sunos4*) |
| 145 | CFLAGS="$CFLAGS -DSUNOS4" |
| 146 | AC_CHECK_FUNCS(getpwanam) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 147 | conf_utmp_location=/etc/utmp |
| 148 | conf_wtmp_location=/var/adm/wtmp |
| 149 | conf_lastlog_location=/var/adm/lastlog |
Damien Miller | b078567 | 2000-08-23 09:10:39 +1000 | [diff] [blame] | 150 | AC_DEFINE(USE_PIPES) |
Damien Miller | 36ccb5c | 2000-08-09 16:34:27 +1000 | [diff] [blame] | 151 | MANTYPE='$(CATMAN)' |
| 152 | mansubdir=cat |
Damien Miller | dfc83f4 | 2000-05-20 15:02:59 +1000 | [diff] [blame] | 153 | ;; |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 154 | *-sni-sysv*) |
| 155 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 156 | LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" |
| 157 | MANTYPE='$(CATMAN)' |
| 158 | AC_DEFINE(IP_TOS_IS_BROKEN) |
| 159 | mansubdir=cat |
Damien Miller | b2dc28e | 2000-07-12 09:18:33 +1000 | [diff] [blame] | 160 | LIBS="$LIBS -lgen -lnsl -lucb" |
Damien Miller | 2ae714f | 2000-07-11 09:29:50 +1000 | [diff] [blame] | 161 | ;; |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 162 | *-*-sysv*) |
Damien Miller | db81959 | 2000-03-14 13:44:01 +1100 | [diff] [blame] | 163 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 164 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
Damien Miller | 0e1cf7c | 2000-01-26 12:15:30 +1100 | [diff] [blame] | 165 | MANTYPE='$(CATMAN)' |
| 166 | mansubdir=cat |
Damien Miller | 75b1d10 | 2000-01-07 14:01:41 +1100 | [diff] [blame] | 167 | LIBS="$LIBS -lgen -lsocket" |
| 168 | ;; |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 169 | *-*-sco3*) |
Damien Miller | 238a9fa | 2000-08-31 09:20:05 +1100 | [diff] [blame] | 170 | AC_DEFINE(USE_PIPES) |
Damien Miller | a66626b | 2000-06-13 18:57:53 +1000 | [diff] [blame] | 171 | CFLAGS="$CFLAGS -I/usr/local/include" |
| 172 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
| 173 | MANTYPE='$(CATMAN)' |
| 174 | mansubdir=cat |
| 175 | LIBS="$LIBS -lgen -lsocket" |
| 176 | no_dev_ptmx=1 |
| 177 | ;; |
Damien Miller | b8c656e | 2000-06-28 15:22:41 +1000 | [diff] [blame] | 178 | *-dec-osf*) |
| 179 | # This is untested |
| 180 | if test ! -z "USE_SIA" ; then |
| 181 | AC_MSG_CHECKING(for Digital Unix Security Integration Architecture) |
| 182 | if test -f /etc/sia/matrix.conf; then |
| 183 | AC_MSG_RESULT(yes) |
| 184 | AC_DEFINE(HAVE_OSF_SIA) |
| 185 | AC_DEFINE(DISABLE_LOGIN) |
| 186 | LIBS="$LIBS -lsecurity -ldb -lm -laud" |
| 187 | else |
| 188 | AC_MSG_RESULT(no) |
| 189 | fi |
| 190 | fi |
| 191 | ;; |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 192 | esac |
| 193 | |
Damien Miller | e37bfc1 | 2000-06-05 09:37:43 +1000 | [diff] [blame] | 194 | # Allow user to specify flags |
| 195 | AC_ARG_WITH(cflags, |
| 196 | [ --with-cflags Specify additional flags to pass to compiler], |
| 197 | [ |
| 198 | if test "x$withval" != "xno" ; then |
| 199 | CFLAGS="$CFLAGS $withval" |
| 200 | fi |
| 201 | ] |
| 202 | ) |
| 203 | AC_ARG_WITH(ldflags, |
| 204 | [ --with-ldlags Specify additional flags to pass to linker], |
| 205 | [ |
| 206 | if test "x$withval" != "xno" ; then |
| 207 | LDFLAGS="$LDFLAGS $withval" |
| 208 | fi |
| 209 | ] |
| 210 | ) |
| 211 | AC_ARG_WITH(libs, |
| 212 | [ --with-libs Specify additional libraries to link with], |
| 213 | [ |
| 214 | if test "x$withval" != "xno" ; then |
| 215 | LIBS="$LIBS $withval" |
| 216 | fi |
| 217 | ] |
| 218 | ) |
| 219 | |
| 220 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 221 | # Checks for libraries. |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 222 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
| 223 | 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] | 224 | |
Damien Miller | beb4ba5 | 1999-12-28 15:09:35 +1100 | [diff] [blame] | 225 | if test -z "$no_libsocket" ; then |
| 226 | AC_CHECK_LIB(nsl, yp_match, , ) |
| 227 | fi |
| 228 | if test -z "$no_libnsl" ; then |
| 229 | AC_CHECK_LIB(socket, main, , ) |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 230 | fi |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 231 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 232 | # Checks for header files. |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 233 | 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] | 234 | |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 235 | dnl Checks for library functions. |
Damien Miller | 7b28dc5 | 2000-09-05 13:34:53 +1100 | [diff] [blame] | 236 | AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo futimes 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) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 237 | dnl Checks for time functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 238 | AC_CHECK_FUNCS(gettimeofday time) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 239 | dnl Checks for libutil functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 240 | AC_CHECK_FUNCS(login logout updwtmp logwtmp) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 241 | dnl Checks for utmp functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 242 | AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent) |
| 243 | AC_CHECK_FUNCS(utmpname) |
Damien Miller | ad833b3 | 2000-08-23 10:46:23 +1000 | [diff] [blame] | 244 | dnl Checks for utmpx functions |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 245 | AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline ) |
| 246 | AC_CHECK_FUNCS(setutxent utmpxname) |
Damien Miller | cedfecc | 1999-11-15 14:36:53 +1100 | [diff] [blame] | 247 | |
Damien Miller | 5fc8565 | 2000-07-09 23:53:07 +1000 | [diff] [blame] | 248 | AC_CHECK_FUNC(getuserattr, |
| 249 | [AC_DEFINE(HAVE_GETUSERATTR)], |
| 250 | [AC_CHECK_LIB(s, getuserattr, [LIBS="$LIBS -ls"; AC_DEFINE(HAVE_GETUSERATTR)])] |
| 251 | ) |
| 252 | |
Damien Miller | 04f8014 | 1999-11-19 15:32:34 +1100 | [diff] [blame] | 253 | AC_CHECK_FUNC(login, |
| 254 | [AC_DEFINE(HAVE_LOGIN)], |
| 255 | [AC_CHECK_LIB(bsd, login, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_LOGIN)])] |
| 256 | ) |
| 257 | |
| 258 | AC_CHECK_FUNC(daemon, |
| 259 | [AC_DEFINE(HAVE_DAEMON)], |
| 260 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
| 261 | ) |
| 262 | |
Damien Miller | 9fb07e4 | 2000-03-05 16:22:59 +1100 | [diff] [blame] | 263 | AC_CHECK_FUNC(getpagesize, |
| 264 | [AC_DEFINE(HAVE_GETPAGESIZE)], |
| 265 | [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])] |
| 266 | ) |
| 267 | |
Damien Miller | cb170cb | 2000-07-01 16:52:55 +1000 | [diff] [blame] | 268 | # Check for broken snprintf |
| 269 | if test "x$ac_cv_func_snprintf" = "xyes" ; then |
| 270 | AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) |
| 271 | AC_TRY_RUN( |
| 272 | [ |
| 273 | #include <stdio.h> |
| 274 | int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} |
| 275 | ], |
| 276 | [AC_MSG_RESULT(yes)], |
| 277 | [ |
| 278 | AC_MSG_RESULT(no) |
| 279 | AC_DEFINE(BROKEN_SNPRINTF) |
| 280 | AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) |
| 281 | ] |
| 282 | ) |
| 283 | fi |
| 284 | |
Damien Miller | 606f880 | 2000-09-16 15:39:56 +1100 | [diff] [blame] | 285 | AC_FUNC_GETPGRP |
| 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 | a1b61e1 | 2000-09-16 17:02:16 +1100 | [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 |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 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 | 9a94734 | 2000-08-30 10:03:33 +1100 | [diff] [blame] | 1097 | if test ! -z "$IPADDR_IN_DISPLAY" ; then |
| 1098 | DISPLAY_HACK_MSG="yes" |
| 1099 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1100 | else |
| 1101 | DISPLAY_HACK_MSG="no" |
| 1102 | AC_ARG_WITH(ipaddr-display, |
| 1103 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
| 1104 | [ |
| 1105 | if test "x$withval" != "xno" ; then |
| 1106 | AC_DEFINE(IPADDR_IN_DISPLAY) |
| 1107 | DISPLAY_HACK_MSG="yes" |
| 1108 | fi |
| 1109 | ] |
| 1110 | ) |
| 1111 | fi |
Damien Miller | 76112de | 1999-12-21 11:18:08 +1100 | [diff] [blame] | 1112 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1113 | # Whether to mess with the default path |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1114 | SERVER_PATH_MSG="(default)" |
Damien Miller | e7f626c | 1999-12-31 09:49:44 +1100 | [diff] [blame] | 1115 | AC_ARG_WITH(default-path, |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1116 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
| 1117 | [ |
| 1118 | if test "x$withval" != "xno" ; then |
Damien Miller | 9550a76 | 1999-12-29 02:32:22 +1100 | [diff] [blame] | 1119 | AC_DEFINE_UNQUOTED(USER_PATH, "$withval") |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1120 | SERVER_PATH_MSG="$withval" |
Damien Miller | 5a3e683 | 1999-12-27 09:48:56 +1100 | [diff] [blame] | 1121 | fi |
| 1122 | ] |
| 1123 | ) |
| 1124 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1125 | # Whether to force IPv4 by default (needed on broken glibc Linux) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1126 | IPV4_HACK_MSG="no" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1127 | AC_ARG_WITH(ipv4-default, |
| 1128 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
| 1129 | [ |
| 1130 | if test "x$withval" != "xno" ; then |
| 1131 | AC_DEFINE(IPV4_DEFAULT) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1132 | IPV4_HACK_MSG="yes" |
Damien Miller | 7d80e34 | 2000-01-19 14:36:49 +1100 | [diff] [blame] | 1133 | fi |
| 1134 | ] |
| 1135 | ) |
| 1136 | |
Damien Miller | 61e50f1 | 2000-05-08 20:49:37 +1000 | [diff] [blame] | 1137 | 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] | 1138 | IPV4_IN6_HACK_MSG="no" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1139 | AC_ARG_WITH(4in6, |
| 1140 | [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses], |
| 1141 | [ |
| 1142 | if test "x$withval" != "xno" ; then |
| 1143 | AC_MSG_RESULT(yes) |
| 1144 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1145 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1146 | else |
| 1147 | AC_MSG_RESULT(no) |
| 1148 | fi |
| 1149 | ],[ |
| 1150 | if test "x$inet6_default_4in6" = "xyes"; then |
| 1151 | AC_MSG_RESULT([yes (default)]) |
| 1152 | AC_DEFINE(IPV4_IN_IPV6) |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1153 | IPV4_IN6_HACK_MSG="yes" |
Damien Miller | 7bcb089 | 2000-03-11 20:45:40 +1100 | [diff] [blame] | 1154 | else |
| 1155 | AC_MSG_RESULT([no (default)]) |
| 1156 | fi |
| 1157 | ] |
| 1158 | ) |
| 1159 | |
Damien Miller | a22ba01 | 2000-03-02 23:09:20 +1100 | [diff] [blame] | 1160 | # Where to place sshd.pid |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1161 | piddir=/var/run |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1162 | AC_ARG_WITH(pid-dir, |
| 1163 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
| 1164 | [ |
| 1165 | if test "x$withval" != "xno" ; then |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1166 | piddir=$withval |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1167 | fi |
| 1168 | ] |
| 1169 | ) |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1170 | |
Damien Miller | dbd250f | 2000-01-18 08:57:14 +1100 | [diff] [blame] | 1171 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 1172 | AC_SUBST(piddir) |
Damien Miller | 5eed6a2 | 2000-01-16 12:05:18 +1100 | [diff] [blame] | 1173 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1174 | dnl allow user to disable some login recording features |
| 1175 | AC_ARG_ENABLE(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1176 | [ --disable-lastlog disable use of lastlog even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1177 | [ AC_DEFINE(DISABLE_LASTLOG) ] |
| 1178 | ) |
| 1179 | AC_ARG_ENABLE(utmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1180 | [ --disable-utmp disable use of utmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1181 | [ AC_DEFINE(DISABLE_UTMP) ] |
| 1182 | ) |
| 1183 | AC_ARG_ENABLE(utmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1184 | [ --disable-utmpx disable use of utmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1185 | [ AC_DEFINE(DISABLE_UTMPX) ] |
| 1186 | ) |
| 1187 | AC_ARG_ENABLE(wtmp, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1188 | [ --disable-wtmp disable use of wtmp even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1189 | [ AC_DEFINE(DISABLE_WTMP) ] |
| 1190 | ) |
| 1191 | AC_ARG_ENABLE(wtmpx, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1192 | [ --disable-wtmpx disable use of wtmpx even if detected [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1193 | [ AC_DEFINE(DISABLE_WTMPX) ] |
| 1194 | ) |
| 1195 | AC_ARG_ENABLE(libutil, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1196 | [ --disable-libutil disable use of libutil (login() etc.) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1197 | [ AC_DEFINE(DISABLE_LOGIN) ] |
| 1198 | ) |
| 1199 | AC_ARG_ENABLE(pututline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1200 | [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1201 | [ AC_DEFINE(DISABLE_PUTUTLINE) ] |
| 1202 | ) |
| 1203 | AC_ARG_ENABLE(pututxline, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1204 | [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1205 | [ AC_DEFINE(DISABLE_PUTUTXLINE) ] |
| 1206 | ) |
| 1207 | AC_ARG_WITH(lastlog, |
andre | 43ca7e2 | 2000-06-19 08:23:46 +0000 | [diff] [blame] | 1208 | [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1209 | [ conf_lastlog_location="$withval"; ],) |
| 1210 | |
| 1211 | dnl lastlog, [uw]tmpx? detection |
| 1212 | dnl NOTE: set the paths in the platform section to avoid the |
| 1213 | dnl need for command-line parameters |
| 1214 | dnl lastlog and [uw]tmp are subject to a file search if all else fails |
| 1215 | |
| 1216 | dnl lastlog detection |
| 1217 | dnl NOTE: the code itself will detect if lastlog is a directory |
| 1218 | AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) |
| 1219 | AC_TRY_COMPILE([ |
| 1220 | #include <sys/types.h> |
| 1221 | #include <utmp.h> |
| 1222 | #ifdef HAVE_LASTLOG_H |
| 1223 | # include <lastlog.h> |
| 1224 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1225 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1226 | # include <paths.h> |
| 1227 | #endif |
| 1228 | ], |
| 1229 | [ char *lastlog = LASTLOG_FILE; ], |
| 1230 | [ AC_MSG_RESULT(yes) ], |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1231 | [ |
| 1232 | AC_MSG_RESULT(no) |
| 1233 | AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) |
| 1234 | AC_TRY_COMPILE([ |
| 1235 | #include <sys/types.h> |
| 1236 | #include <utmp.h> |
| 1237 | #ifdef HAVE_LASTLOG_H |
| 1238 | # include <lastlog.h> |
| 1239 | #endif |
| 1240 | #ifdef HAVE_PATHS_H |
| 1241 | # include <paths.h> |
| 1242 | #endif |
| 1243 | ], |
| 1244 | [ char *lastlog = _PATH_LASTLOG; ], |
| 1245 | [ AC_MSG_RESULT(yes) ], |
| 1246 | [ |
andre | e441aa3 | 2000-06-12 22:34:38 +0000 | [diff] [blame] | 1247 | AC_MSG_RESULT(no) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1248 | system_lastlog_path=no |
| 1249 | ]) |
| 1250 | ] |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1251 | ) |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1252 | |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1253 | if test -z "$conf_lastlog_location"; then |
| 1254 | if test x"$system_lastlog_path" = x"no" ; then |
| 1255 | 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] | 1256 | if (test -d "$f" || test -f "$f") ; then |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1257 | conf_lastlog_location=$f |
| 1258 | fi |
| 1259 | done |
| 1260 | if test -z "$conf_lastlog_location"; then |
andre | 45cad51 | 2000-06-12 23:27:31 +0000 | [diff] [blame] | 1261 | AC_MSG_WARN([** Cannot find lastlog **]) |
| 1262 | 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] | 1263 | fi |
| 1264 | fi |
| 1265 | fi |
| 1266 | |
| 1267 | if test -n "$conf_lastlog_location"; then |
| 1268 | AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") |
| 1269 | fi |
| 1270 | |
| 1271 | dnl utmp detection |
| 1272 | AC_MSG_CHECKING([if your system defines UTMP_FILE]) |
| 1273 | AC_TRY_COMPILE([ |
| 1274 | #include <sys/types.h> |
| 1275 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1276 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1277 | # include <paths.h> |
| 1278 | #endif |
| 1279 | ], |
| 1280 | [ char *utmp = UTMP_FILE; ], |
| 1281 | [ AC_MSG_RESULT(yes) ], |
| 1282 | [ AC_MSG_RESULT(no) |
| 1283 | system_utmp_path=no ] |
| 1284 | ) |
| 1285 | if test -z "$conf_utmp_location"; then |
| 1286 | if test x"$system_utmp_path" = x"no" ; then |
| 1287 | for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do |
| 1288 | if test -f $f ; then |
| 1289 | conf_utmp_location=$f |
| 1290 | fi |
| 1291 | done |
| 1292 | if test -z "$conf_utmp_location"; then |
| 1293 | AC_DEFINE(DISABLE_UTMP) |
| 1294 | fi |
| 1295 | fi |
| 1296 | fi |
| 1297 | if test -n "$conf_utmp_location"; then |
| 1298 | AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") |
| 1299 | fi |
| 1300 | |
| 1301 | dnl wtmp detection |
| 1302 | AC_MSG_CHECKING([if your system defines WTMP_FILE]) |
| 1303 | AC_TRY_COMPILE([ |
| 1304 | #include <sys/types.h> |
| 1305 | #include <utmp.h> |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1306 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1307 | # include <paths.h> |
| 1308 | #endif |
| 1309 | ], |
| 1310 | [ char *wtmp = WTMP_FILE; ], |
| 1311 | [ AC_MSG_RESULT(yes) ], |
| 1312 | [ AC_MSG_RESULT(no) |
| 1313 | system_wtmp_path=no ] |
| 1314 | ) |
| 1315 | if test -z "$conf_wtmp_location"; then |
| 1316 | if test x"$system_wtmp_path" = x"no" ; then |
| 1317 | for f in /usr/adm/wtmp /var/log/wtmp; do |
| 1318 | if test -f $f ; then |
| 1319 | conf_wtmp_location=$f |
| 1320 | fi |
| 1321 | done |
| 1322 | if test -z "$conf_wtmp_location"; then |
| 1323 | AC_DEFINE(DISABLE_WTMP) |
| 1324 | fi |
| 1325 | fi |
| 1326 | fi |
| 1327 | if test -n "$conf_wtmp_location"; then |
| 1328 | AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") |
| 1329 | fi |
| 1330 | |
| 1331 | |
| 1332 | dnl utmpx detection - I don't know any system so perverse as to require |
| 1333 | dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out |
| 1334 | dnl there, though. |
| 1335 | AC_MSG_CHECKING([if your system defines UTMPX_FILE]) |
| 1336 | AC_TRY_COMPILE([ |
| 1337 | #include <sys/types.h> |
| 1338 | #include <utmp.h> |
| 1339 | #ifdef HAVE_UTMPX_H |
| 1340 | #include <utmpx.h> |
| 1341 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1342 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1343 | # include <paths.h> |
| 1344 | #endif |
| 1345 | ], |
| 1346 | [ char *utmpx = UTMPX_FILE; ], |
| 1347 | [ AC_MSG_RESULT(yes) ], |
| 1348 | [ AC_MSG_RESULT(no) |
| 1349 | system_utmpx_path=no ] |
| 1350 | ) |
| 1351 | if test -z "$conf_utmpx_location"; then |
| 1352 | if test x"$system_utmpx_path" = x"no" ; then |
| 1353 | AC_DEFINE(DISABLE_UTMPX) |
| 1354 | fi |
| 1355 | else |
| 1356 | AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") |
| 1357 | fi |
| 1358 | |
| 1359 | dnl wtmpx detection |
| 1360 | AC_MSG_CHECKING([if your system defines WTMPX_FILE]) |
| 1361 | AC_TRY_COMPILE([ |
| 1362 | #include <sys/types.h> |
| 1363 | #include <utmp.h> |
| 1364 | #ifdef HAVE_UTMPX_H |
| 1365 | #include <utmpx.h> |
| 1366 | #endif |
Damien Miller | 2994e08 | 2000-06-04 15:51:47 +1000 | [diff] [blame] | 1367 | #ifdef HAVE_PATHS_H |
andre | 2ff7b5d | 2000-06-03 14:57:40 +0000 | [diff] [blame] | 1368 | # include <paths.h> |
| 1369 | #endif |
| 1370 | ], |
| 1371 | [ char *wtmpx = WTMPX_FILE; ], |
| 1372 | [ AC_MSG_RESULT(yes) ], |
| 1373 | [ AC_MSG_RESULT(no) |
| 1374 | system_wtmpx_path=no ] |
| 1375 | ) |
| 1376 | if test -z "$conf_wtmpx_location"; then |
| 1377 | if test x"$system_wtmpx_path" = x"no" ; then |
| 1378 | AC_DEFINE(DISABLE_WTMPX) |
| 1379 | fi |
| 1380 | else |
| 1381 | AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") |
| 1382 | fi |
| 1383 | |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1384 | |
| 1385 | # Change default command timeout for builtin PRNG |
Damien Miller | 14c12cb | 2000-06-07 22:20:23 +1000 | [diff] [blame] | 1386 | entropy_timeout=200 |
Damien Miller | 4018c19 | 2000-04-30 09:30:44 +1000 | [diff] [blame] | 1387 | AC_ARG_WITH(entropy-timeout, |
| 1388 | [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], |
| 1389 | [ |
| 1390 | if test "x$withval" != "xno" ; then |
| 1391 | entropy_timeout=$withval |
| 1392 | fi |
| 1393 | ] |
| 1394 | ) |
| 1395 | AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) |
| 1396 | |
| 1397 | |
Damien Miller | 29ea30d | 2000-03-17 10:54:15 +1100 | [diff] [blame] | 1398 | if test ! -z "$blibpath" ; then |
| 1399 | LDFLAGS="$LDFLAGS -blibpath:$blibpath" |
| 1400 | AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile]) |
| 1401 | fi |
| 1402 | |
Damien Miller | bac2d8a | 2000-09-05 16:13:06 +1100 | [diff] [blame] | 1403 | AC_EXEEXT |
| 1404 | |
Damien Miller | 0437b33 | 2000-05-02 09:56:41 +1000 | [diff] [blame] | 1405 | AC_OUTPUT(Makefile ssh_prng_cmds) |
| 1406 | |
Damien Miller | 7b22d65 | 2000-06-18 14:07:04 +1000 | [diff] [blame] | 1407 | # Print summary of options |
| 1408 | |
| 1409 | if test x$MANTYPE = x'$(CATMAN)' ; then |
| 1410 | MAN_MSG=cat |
| 1411 | else |
| 1412 | MAN_MSG=man |
| 1413 | fi |
| 1414 | if test ! -z "$RANDOM_POOL" ; then |
| 1415 | RAND_MSG="Device ($RANDOM_POOL)" |
| 1416 | else |
| 1417 | if test ! -z "$EGD_SOCKET" ; then |
| 1418 | RAND_MSG="EGD ($EGD_SOCKET)" |
| 1419 | else |
| 1420 | RAND_MSG="Builtin (timeout $entropy_timeout)" |
| 1421 | fi |
| 1422 | fi |
| 1423 | |
| 1424 | # Someone please show me a better way :) |
| 1425 | A=`eval echo ${prefix}` ; A=`eval echo ${A}` |
| 1426 | B=`eval echo ${bindir}` ; B=`eval echo ${B}` |
| 1427 | C=`eval echo ${sbindir}` ; C=`eval echo ${C}` |
| 1428 | D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` |
| 1429 | E=`eval echo ${libexecdir}/ssh/ssh-askpass` ; E=`eval echo ${E}` |
| 1430 | F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` |
| 1431 | G=`eval echo ${piddir}` ; G=`eval echo ${G}` |
| 1432 | |
| 1433 | echo "" |
| 1434 | echo "OpenSSH configured has been configured with the following options." |
| 1435 | echo " User binaries: $B" |
| 1436 | echo " System binaries: $C" |
| 1437 | echo " Configuration files: $D" |
| 1438 | echo " Askpass program: $E" |
| 1439 | echo " Manual pages: $F" |
| 1440 | echo " PID file: $G" |
| 1441 | echo " Random number collection: $RAND_MSG" |
| 1442 | echo " Manpage format: $MAN_MSG" |
| 1443 | echo " PAM support: ${PAM_MSG}" |
| 1444 | echo " KerberosIV support: $KRB4_MSG" |
| 1445 | echo " AFS support: $AFS_MSG" |
| 1446 | echo " S/KEY support: $SKEY_MSG" |
| 1447 | echo " TCP Wrappers support: $TCPW_MSG" |
| 1448 | echo " MD5 password support: $MD5_MSG" |
| 1449 | echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" |
| 1450 | echo " Use IPv4 by default hack: $IPV4_HACK_MSG" |
| 1451 | echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" |
| 1452 | |
| 1453 | echo "" |
| 1454 | |
| 1455 | echo "Compiler flags: ${CFLAGS}" |
| 1456 | echo "Linker flags: ${LDFLAGS}" |
| 1457 | echo "Libraries: ${LIBS}" |
| 1458 | |
| 1459 | echo "" |
| 1460 | |