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