summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac644
1 files changed, 429 insertions, 215 deletions
diff --git a/configure.ac b/configure.ac
index ff1972ed6..a2b236355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.322.2.6 2006/02/08 11:11:06 dtucker Exp $ 1# $Id: configure.ac,v 1.372 2007/03/05 00:51:27 djm Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) 17AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
18AC_REVISION($Revision: 1.322.2.6 $) 18AC_REVISION($Revision: 1.372 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20 20
21AC_CONFIG_HEADER(config.h) 21AC_CONFIG_HEADER(config.h)
@@ -127,15 +127,175 @@ AC_ARG_WITH(rpath,
127 ] 127 ]
128) 128)
129 129
130# Allow user to specify flags
131AC_ARG_WITH(cflags,
132 [ --with-cflags Specify additional flags to pass to compiler],
133 [
134 if test -n "$withval" && test "x$withval" != "xno" && \
135 test "x${withval}" != "xyes"; then
136 CFLAGS="$CFLAGS $withval"
137 fi
138 ]
139)
140AC_ARG_WITH(cppflags,
141 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
142 [
143 if test -n "$withval" && test "x$withval" != "xno" && \
144 test "x${withval}" != "xyes"; then
145 CPPFLAGS="$CPPFLAGS $withval"
146 fi
147 ]
148)
149AC_ARG_WITH(ldflags,
150 [ --with-ldflags Specify additional flags to pass to linker],
151 [
152 if test -n "$withval" && test "x$withval" != "xno" && \
153 test "x${withval}" != "xyes"; then
154 LDFLAGS="$LDFLAGS $withval"
155 fi
156 ]
157)
158AC_ARG_WITH(libs,
159 [ --with-libs Specify additional libraries to link with],
160 [
161 if test -n "$withval" && test "x$withval" != "xno" && \
162 test "x${withval}" != "xyes"; then
163 LIBS="$LIBS $withval"
164 fi
165 ]
166)
167AC_ARG_WITH(Werror,
168 [ --with-Werror Build main code with -Werror],
169 [
170 if test -n "$withval" && test "x$withval" != "xno"; then
171 werror_flags="-Werror"
172 if test "x${withval}" != "xyes"; then
173 werror_flags="$withval"
174 fi
175 fi
176 ]
177)
178
179AC_CHECK_HEADERS( \
180 bstring.h \
181 crypt.h \
182 crypto/sha2.h \
183 dirent.h \
184 endian.h \
185 features.h \
186 fcntl.h \
187 floatingpoint.h \
188 getopt.h \
189 glob.h \
190 ia.h \
191 iaf.h \
192 limits.h \
193 login.h \
194 maillock.h \
195 ndir.h \
196 net/if_tun.h \
197 netdb.h \
198 netgroup.h \
199 pam/pam_appl.h \
200 paths.h \
201 pty.h \
202 readpassphrase.h \
203 rpc/types.h \
204 security/pam_appl.h \
205 sha2.h \
206 shadow.h \
207 stddef.h \
208 stdint.h \
209 string.h \
210 strings.h \
211 sys/audit.h \
212 sys/bitypes.h \
213 sys/bsdtty.h \
214 sys/cdefs.h \
215 sys/dir.h \
216 sys/mman.h \
217 sys/ndir.h \
218 sys/prctl.h \
219 sys/pstat.h \
220 sys/select.h \
221 sys/stat.h \
222 sys/stream.h \
223 sys/stropts.h \
224 sys/strtio.h \
225 sys/sysmacros.h \
226 sys/time.h \
227 sys/timers.h \
228 sys/un.h \
229 time.h \
230 tmpdir.h \
231 ttyent.h \
232 unistd.h \
233 usersec.h \
234 util.h \
235 utime.h \
236 utmp.h \
237 utmpx.h \
238 vis.h \
239)
240
241# lastlog.h requires sys/time.h to be included first on Solaris
242AC_CHECK_HEADERS(lastlog.h, [], [], [
243#ifdef HAVE_SYS_TIME_H
244# include <sys/time.h>
245#endif
246])
247
248# sys/ptms.h requires sys/stream.h to be included first on Solaris
249AC_CHECK_HEADERS(sys/ptms.h, [], [], [
250#ifdef HAVE_SYS_STREAM_H
251# include <sys/stream.h>
252#endif
253])
254
255# login_cap.h requires sys/types.h on NetBSD
256AC_CHECK_HEADERS(login_cap.h, [], [], [
257#include <sys/types.h>
258])
259
260# Messages for features tested for in target-specific section
261SIA_MSG="no"
262SPC_MSG="no"
263
130# Check for some target-specific stuff 264# Check for some target-specific stuff
131case "$host" in 265case "$host" in
132*-*-aix*) 266*-*-aix*)
267 # Some versions of VAC won't allow macro redefinitions at
268 # -qlanglevel=ansi, and autoconf 2.60 sometimes insists on using that
269 # particularly with older versions of vac or xlc.
270 # It also throws errors about null macro argments, but these are
271 # not fatal.
272 AC_MSG_CHECKING(if compiler allows macro redefinitions)
273 AC_COMPILE_IFELSE(
274 [AC_LANG_SOURCE([[
275#define testmacro foo
276#define testmacro bar
277int main(void) { exit(0); }
278 ]])],
279 [ AC_MSG_RESULT(yes) ],
280 [ AC_MSG_RESULT(no)
281 CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
282 LD="`echo $LD | sed 's/-qlanglvl\=ansi//g'`"
283 CFLAGS="`echo $CFLAGS | sed 's/-qlanglvl\=ansi//g'`"
284 CPPFLAGS="`echo $CPPFLAGS | sed 's/-qlanglvl\=ansi//g'`"
285 ]
286 )
287
133 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) 288 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
134 if (test -z "$blibpath"); then 289 if (test -z "$blibpath"); then
135 blibpath="/usr/lib:/lib" 290 blibpath="/usr/lib:/lib"
136 fi 291 fi
137 saved_LDFLAGS="$LDFLAGS" 292 saved_LDFLAGS="$LDFLAGS"
138 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do 293 if test "$GCC" = "yes"; then
294 flags="-Wl,-blibpath: -Wl,-rpath, -blibpath:"
295 else
296 flags="-blibpath: -Wl,-blibpath: -Wl,-rpath,"
297 fi
298 for tryflags in $flags ;do
139 if (test -z "$blibflags"); then 299 if (test -z "$blibflags"); then
140 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" 300 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
141 AC_TRY_LINK([], [], [blibflags=$tryflags]) 301 AC_TRY_LINK([], [], [blibflags=$tryflags])
@@ -175,6 +335,12 @@ case "$host" in
175 [#include <usersec.h>] 335 [#include <usersec.h>]
176 ) 336 )
177 AC_CHECK_FUNCS(setauthdb) 337 AC_CHECK_FUNCS(setauthdb)
338 AC_CHECK_DECL(F_CLOSEM,
339 AC_DEFINE(HAVE_FCNTL_CLOSEM, 1, [Use F_CLOSEM fcntl for closefrom]),
340 [],
341 [ #include <limits.h>
342 #include <fcntl.h> ]
343 )
178 check_for_aix_broken_getaddrinfo=1 344 check_for_aix_broken_getaddrinfo=1
179 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.]) 345 AC_DEFINE(BROKEN_REALPATH, 1, [Define if you have a broken realpath.])
180 AC_DEFINE(SETEUID_BREAKS_SETUID, 1, 346 AC_DEFINE(SETEUID_BREAKS_SETUID, 1,
@@ -190,10 +356,11 @@ case "$host" in
190 supported by bsd-setproctitle.c]) 356 supported by bsd-setproctitle.c])
191 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1, 357 AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
192 [AIX 5.2 and 5.3 (and presumably newer) require this]) 358 [AIX 5.2 and 5.3 (and presumably newer) require this])
359 AC_DEFINE(PTY_ZEROREAD, 1, [read(1) can return 0 for a non-closed fd])
193 ;; 360 ;;
194*-*-cygwin*) 361*-*-cygwin*)
195 check_for_libcrypt_later=1 362 check_for_libcrypt_later=1
196 LIBS="$LIBS /usr/lib/textmode.o" 363 LIBS="$LIBS /usr/lib/textreadmode.o"
197 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin]) 364 AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
198 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()]) 365 AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
199 AC_DEFINE(DISABLE_SHADOW, 1, 366 AC_DEFINE(DISABLE_SHADOW, 1,
@@ -231,6 +398,14 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
231 AC_DEFINE(BROKEN_SETREGID) 398 AC_DEFINE(BROKEN_SETREGID)
232 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1, 399 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1,
233 [Define if your resolver libs need this for getrrsetbyname]) 400 [Define if your resolver libs need this for getrrsetbyname])
401 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
402 AC_DEFINE(SSH_TUN_COMPAT_AF, 1,
403 [Use tunnel device compatibility to OpenBSD])
404 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
405 [Prepend the address family to IP tunnel traffic])
406 ;;
407*-*-dragonfly*)
408 SSHDLIBS="$SSHDLIBS -lcrypt"
234 ;; 409 ;;
235*-*-hpux*) 410*-*-hpux*)
236 # first we define all of the options common to all HP-UX releases 411 # first we define all of the options common to all HP-UX releases
@@ -385,6 +560,8 @@ mips-sony-bsd|mips-sony-newsos4)
385 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) 560 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
386 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded]) 561 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
387 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way]) 562 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
563 AC_DEFINE(SYSLOG_R_SAFE_IN_SIGHAND, 1,
564 [syslog_r function is safe to use in in a signal handler])
388 ;; 565 ;;
389*-*-solaris*) 566*-*-solaris*)
390 if test "x$withval" != "xno" ; then 567 if test "x$withval" != "xno" ; then
@@ -404,6 +581,8 @@ mips-sony-bsd|mips-sony-newsos4)
404 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1, 581 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
405 [Define if sshd somehow reacquires a controlling TTY 582 [Define if sshd somehow reacquires a controlling TTY
406 after setsid()]) 583 after setsid()])
584 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd
585 in case the name is longer than 8 chars])
407 external_path_file=/etc/default/login 586 external_path_file=/etc/default/login
408 # hardwire lastlog location (can't detect it on some versions) 587 # hardwire lastlog location (can't detect it on some versions)
409 conf_lastlog_location="/var/adm/lastlog" 588 conf_lastlog_location="/var/adm/lastlog"
@@ -417,6 +596,17 @@ mips-sony-bsd|mips-sony-newsos4)
417 else 596 else
418 AC_MSG_RESULT(no) 597 AC_MSG_RESULT(no)
419 fi 598 fi
599 AC_ARG_WITH(solaris-contracts,
600 [ --with-solaris-contracts Enable Solaris process contracts (experimental)],
601 [
602 AC_CHECK_LIB(contract, ct_tmpl_activate,
603 [ AC_DEFINE(USE_SOLARIS_PROCESS_CONTRACTS, 1,
604 [Define if you have Solaris process contracts])
605 SSHDLIBS="$SSHDLIBS -lcontract"
606 AC_SUBST(SSHDLIBS)
607 SPC_MSG="yes" ], )
608 ],
609 )
420 ;; 610 ;;
421*-*-sunos4*) 611*-*-sunos4*)
422 CPPFLAGS="$CPPFLAGS -DSUNOS4" 612 CPPFLAGS="$CPPFLAGS -DSUNOS4"
@@ -454,7 +644,6 @@ mips-sony-bsd|mips-sony-newsos4)
454 ;; 644 ;;
455# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel. 645# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
456*-*-sysv4.2*) 646*-*-sysv4.2*)
457 CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
458 AC_DEFINE(USE_PIPES) 647 AC_DEFINE(USE_PIPES)
459 AC_DEFINE(SETEUID_BREAKS_SETUID) 648 AC_DEFINE(SETEUID_BREAKS_SETUID)
460 AC_DEFINE(BROKEN_SETREUID) 649 AC_DEFINE(BROKEN_SETREUID)
@@ -476,6 +665,7 @@ mips-sony-bsd|mips-sony-newsos4)
476 TEST_SHELL=/u95/bin/sh 665 TEST_SHELL=/u95/bin/sh
477 AC_DEFINE(BROKEN_LIBIAF, 1, 666 AC_DEFINE(BROKEN_LIBIAF, 1,
478 [ia_uinfo routines not supported by OS yet]) 667 [ia_uinfo routines not supported by OS yet])
668 AC_DEFINE(BROKEN_UPDWTMPX)
479 ;; 669 ;;
480 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 670 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
481 ;; 671 ;;
@@ -565,6 +755,7 @@ mips-sony-bsd|mips-sony-newsos4)
565 system's login() call]) 755 system's login() call])
566 AC_DEFINE(DISABLE_FD_PASSING) 756 AC_DEFINE(DISABLE_FD_PASSING)
567 LIBS="$LIBS -lsecurity -ldb -lm -laud" 757 LIBS="$LIBS -lsecurity -ldb -lm -laud"
758 SIA_MSG="yes"
568 else 759 else
569 AC_MSG_RESULT(no) 760 AC_MSG_RESULT(no)
570 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin", 761 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
@@ -584,6 +775,8 @@ mips-sony-bsd|mips-sony-newsos4)
584 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems]) 775 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
585 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) 776 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
586 AC_DEFINE(DISABLE_LASTLOG) 777 AC_DEFINE(DISABLE_LASTLOG)
778 AC_DEFINE(SSHD_ACQUIRES_CTTY)
779 enable_etc_default_login=no # has incompatible /etc/default/login
587 ;; 780 ;;
588 781
589*-*-ultrix*) 782*-*-ultrix*)
@@ -600,55 +793,6 @@ mips-sony-bsd|mips-sony-newsos4)
600 ;; 793 ;;
601esac 794esac
602 795
603# Allow user to specify flags
604AC_ARG_WITH(cflags,
605 [ --with-cflags Specify additional flags to pass to compiler],
606 [
607 if test -n "$withval" && test "x$withval" != "xno" && \
608 test "x${withval}" != "xyes"; then
609 CFLAGS="$CFLAGS $withval"
610 fi
611 ]
612)
613AC_ARG_WITH(cppflags,
614 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
615 [
616 if test -n "$withval" && test "x$withval" != "xno" && \
617 test "x${withval}" != "xyes"; then
618 CPPFLAGS="$CPPFLAGS $withval"
619 fi
620 ]
621)
622AC_ARG_WITH(ldflags,
623 [ --with-ldflags Specify additional flags to pass to linker],
624 [
625 if test -n "$withval" && test "x$withval" != "xno" && \
626 test "x${withval}" != "xyes"; then
627 LDFLAGS="$LDFLAGS $withval"
628 fi
629 ]
630)
631AC_ARG_WITH(libs,
632 [ --with-libs Specify additional libraries to link with],
633 [
634 if test -n "$withval" && test "x$withval" != "xno" && \
635 test "x${withval}" != "xyes"; then
636 LIBS="$LIBS $withval"
637 fi
638 ]
639)
640AC_ARG_WITH(Werror,
641 [ --with-Werror Build main code with -Werror],
642 [
643 if test -n "$withval" && test "x$withval" != "xno"; then
644 werror_flags="-Werror"
645 if test "x${withval}" != "xyes"; then
646 werror_flags="$withval"
647 fi
648 fi
649 ]
650)
651
652AC_MSG_CHECKING(compiler and flags for sanity) 796AC_MSG_CHECKING(compiler and flags for sanity)
653AC_RUN_IFELSE( 797AC_RUN_IFELSE(
654 [AC_LANG_SOURCE([ 798 [AC_LANG_SOURCE([
@@ -664,79 +808,6 @@ int main(){exit(0);}
664) 808)
665 809
666dnl Checks for header files. 810dnl Checks for header files.
667AC_CHECK_HEADERS( \
668 bstring.h \
669 crypt.h \
670 dirent.h \
671 endian.h \
672 features.h \
673 floatingpoint.h \
674 getopt.h \
675 glob.h \
676 ia.h \
677 iaf.h \
678 limits.h \
679 login.h \
680 login_cap.h \
681 maillock.h \
682 ndir.h \
683 netdb.h \
684 netgroup.h \
685 pam/pam_appl.h \
686 paths.h \
687 pty.h \
688 readpassphrase.h \
689 rpc/types.h \
690 security/pam_appl.h \
691 shadow.h \
692 stddef.h \
693 stdint.h \
694 string.h \
695 strings.h \
696 sys/audit.h \
697 sys/bitypes.h \
698 sys/bsdtty.h \
699 sys/cdefs.h \
700 sys/dir.h \
701 sys/mman.h \
702 sys/ndir.h \
703 sys/prctl.h \
704 sys/pstat.h \
705 sys/select.h \
706 sys/stat.h \
707 sys/stream.h \
708 sys/stropts.h \
709 sys/strtio.h \
710 sys/sysmacros.h \
711 sys/time.h \
712 sys/timers.h \
713 sys/un.h \
714 time.h \
715 tmpdir.h \
716 ttyent.h \
717 unistd.h \
718 usersec.h \
719 util.h \
720 utime.h \
721 utmp.h \
722 utmpx.h \
723 vis.h \
724)
725
726# lastlog.h requires sys/time.h to be included first on Solaris
727AC_CHECK_HEADERS(lastlog.h, [], [], [
728#ifdef HAVE_SYS_TIME_H
729# include <sys/time.h>
730#endif
731])
732
733# sys/ptms.h requires sys/stream.h to be included first on Solaris
734AC_CHECK_HEADERS(sys/ptms.h, [], [], [
735#ifdef HAVE_SYS_STREAM_H
736# include <sys/stream.h>
737#endif
738])
739
740# Checks for libraries. 811# Checks for libraries.
741AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) 812AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
742AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 813AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
@@ -921,11 +992,9 @@ AC_EGREP_CPP(FOUNDIT,
921 992
922# Check for g.gl_matchc glob() extension 993# Check for g.gl_matchc glob() extension
923AC_MSG_CHECKING(for gl_matchc field in glob_t) 994AC_MSG_CHECKING(for gl_matchc field in glob_t)
924AC_EGREP_CPP(FOUNDIT, 995AC_TRY_COMPILE(
925 [ 996 [ #include <glob.h> ],
926 #include <glob.h> 997 [glob_t g; g.gl_matchc = 1;],
927 int main(void){glob_t g; g.gl_matchc = 1;}
928 ],
929 [ 998 [
930 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1, 999 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
931 [Define if your system glob() function has 1000 [Define if your system glob() function has
@@ -937,6 +1006,8 @@ AC_EGREP_CPP(FOUNDIT,
937 ] 1006 ]
938) 1007)
939 1008
1009AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>])
1010
940AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) 1011AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
941AC_RUN_IFELSE( 1012AC_RUN_IFELSE(
942 [AC_LANG_SOURCE([[ 1013 [AC_LANG_SOURCE([[
@@ -1118,7 +1189,13 @@ AC_ARG_WITH(audit,
1118 AUDIT_MODULE=bsm 1189 AUDIT_MODULE=bsm
1119 dnl Checks for headers, libs and functions 1190 dnl Checks for headers, libs and functions
1120 AC_CHECK_HEADERS(bsm/audit.h, [], 1191 AC_CHECK_HEADERS(bsm/audit.h, [],
1121 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)]) 1192 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)],
1193 [
1194#ifdef HAVE_TIME_H
1195# include <time.h>
1196#endif
1197 ]
1198)
1122 AC_CHECK_LIB(bsm, getaudit, [], 1199 AC_CHECK_LIB(bsm, getaudit, [],
1123 [AC_MSG_ERROR(BSM enabled and required library not found)]) 1200 [AC_MSG_ERROR(BSM enabled and required library not found)])
1124 AC_CHECK_FUNCS(getaudit, [], 1201 AC_CHECK_FUNCS(getaudit, [],
@@ -1264,6 +1341,29 @@ AC_CHECK_DECL(tcsendbreak,
1264 1341
1265AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>]) 1342AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1266 1343
1344AC_CHECK_DECLS(SHUT_RD, , ,
1345 [
1346#include <sys/types.h>
1347#include <sys/socket.h>
1348 ])
1349
1350AC_CHECK_DECLS(O_NONBLOCK, , ,
1351 [
1352#include <sys/types.h>
1353#ifdef HAVE_SYS_STAT_H
1354# include <sys/stat.h>
1355#endif
1356#ifdef HAVE_FCNTL_H
1357# include <fcntl.h>
1358#endif
1359 ])
1360
1361AC_CHECK_DECLS(writev, , , [
1362#include <sys/types.h>
1363#include <sys/uio.h>
1364#include <unistd.h>
1365 ])
1366
1267AC_CHECK_FUNCS(setresuid, [ 1367AC_CHECK_FUNCS(setresuid, [
1268 dnl Some platorms have setresuid that isn't implemented, test for this 1368 dnl Some platorms have setresuid that isn't implemented, test for this
1269 AC_MSG_CHECKING(if setresuid seems to work) 1369 AC_MSG_CHECKING(if setresuid seems to work)
@@ -1608,6 +1708,7 @@ main(void)
1608 AC_MSG_RESULT(no) 1708 AC_MSG_RESULT(no)
1609 AC_DEFINE(BROKEN_GETADDRINFO) 1709 AC_DEFINE(BROKEN_GETADDRINFO)
1610 ], 1710 ],
1711 [
1611 AC_MSG_RESULT(cross-compiling, assuming no) 1712 AC_MSG_RESULT(cross-compiling, assuming no)
1612 ] 1713 ]
1613 ) 1714 )
@@ -1633,61 +1734,6 @@ fi
1633 1734
1634AC_FUNC_GETPGRP 1735AC_FUNC_GETPGRP
1635 1736
1636# Check for PAM libs
1637PAM_MSG="no"
1638AC_ARG_WITH(pam,
1639 [ --with-pam Enable PAM support ],
1640 [
1641 if test "x$withval" != "xno" ; then
1642 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1643 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
1644 AC_MSG_ERROR([PAM headers not found])
1645 fi
1646
1647 AC_CHECK_LIB(dl, dlopen, , )
1648 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1649 AC_CHECK_FUNCS(pam_getenvlist)
1650 AC_CHECK_FUNCS(pam_putenv)
1651
1652 PAM_MSG="yes"
1653
1654 AC_DEFINE(USE_PAM, 1,
1655 [Define if you want to enable PAM support])
1656 if test $ac_cv_lib_dl_dlopen = yes; then
1657 LIBPAM="-lpam -ldl"
1658 else
1659 LIBPAM="-lpam"
1660 fi
1661 AC_SUBST(LIBPAM)
1662 fi
1663 ]
1664)
1665
1666# Check for older PAM
1667if test "x$PAM_MSG" = "xyes" ; then
1668 # Check PAM strerror arguments (old PAM)
1669 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1670 AC_TRY_COMPILE(
1671 [
1672#include <stdlib.h>
1673#if defined(HAVE_SECURITY_PAM_APPL_H)
1674#include <security/pam_appl.h>
1675#elif defined (HAVE_PAM_PAM_APPL_H)
1676#include <pam/pam_appl.h>
1677#endif
1678 ],
1679 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
1680 [AC_MSG_RESULT(no)],
1681 [
1682 AC_DEFINE(HAVE_OLD_PAM, 1,
1683 [Define if you have an old version of PAM
1684 which takes only one argument to pam_strerror])
1685 AC_MSG_RESULT(yes)
1686 PAM_MSG="yes (old library)"
1687 ]
1688 )
1689fi
1690
1691# Search for OpenSSL 1737# Search for OpenSSL
1692saved_CPPFLAGS="$CPPFLAGS" 1738saved_CPPFLAGS="$CPPFLAGS"
1693saved_LDFLAGS="$LDFLAGS" 1739saved_LDFLAGS="$LDFLAGS"
@@ -1811,6 +1857,14 @@ int main(void) {
1811 ] 1857 ]
1812) 1858)
1813 1859
1860AC_ARG_WITH(openssl-header-check,
1861 [ --without-openssl-header-check Disable OpenSSL version consistency check],
1862 [ if test "x$withval" = "xno" ; then
1863 openssl_check_nonfatal=1
1864 fi
1865 ]
1866)
1867
1814# Sanity check OpenSSL headers 1868# Sanity check OpenSSL headers
1815AC_MSG_CHECKING([whether OpenSSL's headers match the library]) 1869AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1816AC_RUN_IFELSE( 1870AC_RUN_IFELSE(
@@ -1824,18 +1878,75 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1824 ], 1878 ],
1825 [ 1879 [
1826 AC_MSG_RESULT(no) 1880 AC_MSG_RESULT(no)
1827 AC_MSG_ERROR([Your OpenSSL headers do not match your library. 1881 if test "x$openssl_check_nonfatal" = "x"; then
1828Check config.log for details. 1882 AC_MSG_ERROR([Your OpenSSL headers do not match your
1883library. Check config.log for details.
1884If you are sure your installation is consistent, you can disable the check
1885by running "./configure --without-openssl-header-check".
1886Also see contrib/findssl.sh for help identifying header/library mismatches.
1887])
1888 else
1889 AC_MSG_WARN([Your OpenSSL headers do not match your
1890library. Check config.log for details.
1829Also see contrib/findssl.sh for help identifying header/library mismatches.]) 1891Also see contrib/findssl.sh for help identifying header/library mismatches.])
1892 fi
1830 ], 1893 ],
1831 [ 1894 [
1832 AC_MSG_WARN([cross compiling: not checking]) 1895 AC_MSG_WARN([cross compiling: not checking])
1833 ] 1896 ]
1834) 1897)
1835 1898
1899AC_MSG_CHECKING([if programs using OpenSSL functions will link])
1900AC_LINK_IFELSE(
1901 [AC_LANG_SOURCE([[
1902#include <openssl/evp.h>
1903int main(void) { SSLeay_add_all_algorithms(); }
1904 ]])],
1905 [
1906 AC_MSG_RESULT(yes)
1907 ],
1908 [
1909 AC_MSG_RESULT(no)
1910 saved_LIBS="$LIBS"
1911 LIBS="$LIBS -ldl"
1912 AC_MSG_CHECKING([if programs using OpenSSL need -ldl])
1913 AC_LINK_IFELSE(
1914 [AC_LANG_SOURCE([[
1915#include <openssl/evp.h>
1916int main(void) { SSLeay_add_all_algorithms(); }
1917 ]])],
1918 [
1919 AC_MSG_RESULT(yes)
1920 ],
1921 [
1922 AC_MSG_RESULT(no)
1923 LIBS="$saved_LIBS"
1924 ]
1925 )
1926 ]
1927)
1928
1929AC_ARG_WITH(ssl-engine,
1930 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
1931 [ if test "x$withval" != "xno" ; then
1932 AC_MSG_CHECKING(for OpenSSL ENGINE support)
1933 AC_TRY_COMPILE(
1934 [ #include <openssl/engine.h>],
1935 [
1936ENGINE_load_builtin_engines();ENGINE_register_all_complete();
1937 ],
1938 [ AC_MSG_RESULT(yes)
1939 AC_DEFINE(USE_OPENSSL_ENGINE, 1,
1940 [Enable OpenSSL engine support])
1941 ],
1942 [ AC_MSG_ERROR(OpenSSL ENGINE support not found)]
1943 )
1944 fi ]
1945)
1946
1836# Check for OpenSSL without EVP_aes_{192,256}_cbc 1947# Check for OpenSSL without EVP_aes_{192,256}_cbc
1837AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) 1948AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
1838AC_COMPILE_IFELSE( 1949AC_LINK_IFELSE(
1839 [AC_LANG_SOURCE([[ 1950 [AC_LANG_SOURCE([[
1840#include <string.h> 1951#include <string.h>
1841#include <openssl/evp.h> 1952#include <openssl/evp.h>
@@ -1863,6 +1974,9 @@ if test "x$check_for_libcrypt_later" = "x1"; then
1863 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") 1974 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1864fi 1975fi
1865 1976
1977# Search for SHA256 support in libc and/or OpenSSL
1978AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
1979
1866AC_CHECK_LIB(iaf, ia_openinfo) 1980AC_CHECK_LIB(iaf, ia_openinfo)
1867 1981
1868### Configure cryptographic random number support 1982### Configure cryptographic random number support
@@ -1893,6 +2007,69 @@ int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1893 ] 2007 ]
1894) 2008)
1895 2009
2010# Check for PAM libs
2011PAM_MSG="no"
2012AC_ARG_WITH(pam,
2013 [ --with-pam Enable PAM support ],
2014 [
2015 if test "x$withval" != "xno" ; then
2016 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
2017 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
2018 AC_MSG_ERROR([PAM headers not found])
2019 fi
2020
2021 saved_LIBS="$LIBS"
2022 AC_CHECK_LIB(dl, dlopen, , )
2023 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
2024 AC_CHECK_FUNCS(pam_getenvlist)
2025 AC_CHECK_FUNCS(pam_putenv)
2026 LIBS="$saved_LIBS"
2027
2028 PAM_MSG="yes"
2029
2030 LIBPAM="-lpam"
2031 AC_DEFINE(USE_PAM, 1,
2032 [Define if you want to enable PAM support])
2033
2034 if test $ac_cv_lib_dl_dlopen = yes; then
2035 case "$LIBS" in
2036 *-ldl*)
2037 # libdl already in LIBS
2038 ;;
2039 *)
2040 LIBPAM="$LIBPAM -ldl"
2041 ;;
2042 esac
2043 fi
2044 AC_SUBST(LIBPAM)
2045 fi
2046 ]
2047)
2048
2049# Check for older PAM
2050if test "x$PAM_MSG" = "xyes" ; then
2051 # Check PAM strerror arguments (old PAM)
2052 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
2053 AC_TRY_COMPILE(
2054 [
2055#include <stdlib.h>
2056#if defined(HAVE_SECURITY_PAM_APPL_H)
2057#include <security/pam_appl.h>
2058#elif defined (HAVE_PAM_PAM_APPL_H)
2059#include <pam/pam_appl.h>
2060#endif
2061 ],
2062 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
2063 [AC_MSG_RESULT(no)],
2064 [
2065 AC_DEFINE(HAVE_OLD_PAM, 1,
2066 [Define if you have an old version of PAM
2067 which takes only one argument to pam_strerror])
2068 AC_MSG_RESULT(yes)
2069 PAM_MSG="yes (old library)"
2070 ]
2071 )
2072fi
1896 2073
1897# Do we want to force the use of the rand helper? 2074# Do we want to force the use of the rand helper?
1898AC_ARG_WITH(rand-helper, 2075AC_ARG_WITH(rand-helper,
@@ -2112,6 +2289,34 @@ if test -z "$have_llong_max"; then
2112#define __USE_ISOC99 2289#define __USE_ISOC99
2113#include <limits.h> 2290#include <limits.h>
2114#define DATA "conftest.llminmax" 2291#define DATA "conftest.llminmax"
2292#define my_abs(a) ((a) < 0 ? ((a) * -1) : (a))
2293
2294/*
2295 * printf in libc on some platforms (eg old Tru64) does not understand %lld so
2296 * we do this the hard way.
2297 */
2298static int
2299fprint_ll(FILE *f, long long n)
2300{
2301 unsigned int i;
2302 int l[sizeof(long long) * 8];
2303
2304 if (n < 0)
2305 if (fprintf(f, "-") < 0)
2306 return -1;
2307 for (i = 0; n != 0; i++) {
2308 l[i] = my_abs(n % 10);
2309 n /= 10;
2310 }
2311 do {
2312 if (fprintf(f, "%d", l[--i]) < 0)
2313 return -1;
2314 } while (i != 0);
2315 if (fprintf(f, " ") < 0)
2316 return -1;
2317 return 0;
2318}
2319
2115int main(void) { 2320int main(void) {
2116 FILE *f; 2321 FILE *f;
2117 long long i, llmin, llmax = 0; 2322 long long i, llmin, llmax = 0;
@@ -2133,14 +2338,18 @@ int main(void) {
2133 2338
2134 /* Sanity check */ 2339 /* Sanity check */
2135 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax 2340 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2136 || llmax - 1 > llmax) { 2341 || llmax - 1 > llmax || llmin == llmax || llmin == 0
2342 || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
2137 fprintf(f, "unknown unknown\n"); 2343 fprintf(f, "unknown unknown\n");
2138 exit(2); 2344 exit(2);
2139 } 2345 }
2140 2346
2141 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) 2347 if (fprint_ll(f, llmin) < 0)
2142 exit(3); 2348 exit(3);
2143 2349 if (fprint_ll(f, llmax) < 0)
2350 exit(4);
2351 if (fclose(f) < 0)
2352 exit(5);
2144 exit(0); 2353 exit(0);
2145} 2354}
2146 ]])], 2355 ]])],
@@ -2148,17 +2357,6 @@ int main(void) {
2148 llong_min=`$AWK '{print $1}' conftest.llminmax` 2357 llong_min=`$AWK '{print $1}' conftest.llminmax`
2149 llong_max=`$AWK '{print $2}' conftest.llminmax` 2358 llong_max=`$AWK '{print $2}' conftest.llminmax`
2150 2359
2151 # snprintf on some Tru64s doesn't understand "%lld"
2152 case "$host" in
2153 alpha-dec-osf*)
2154 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2155 test "x$llong_max" = "xld"; then
2156 llong_min="-9223372036854775808"
2157 llong_max="9223372036854775807"
2158 fi
2159 ;;
2160 esac
2161
2162 AC_MSG_RESULT($llong_max) 2360 AC_MSG_RESULT($llong_max)
2163 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], 2361 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2164 [max value of long long calculated by configure]) 2362 [max value of long long calculated by configure])
@@ -2904,7 +3102,7 @@ AC_ARG_WITH(opensc,
2904 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` 3102 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2905 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` 3103 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2906 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" 3104 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2907 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" 3105 LIBS="$LIBS $LIBOPENSC_LIBS"
2908 AC_DEFINE(SMARTCARD) 3106 AC_DEFINE(SMARTCARD)
2909 AC_DEFINE(USE_OPENSC, 1, 3107 AC_DEFINE(USE_OPENSC, 1,
2910 [Define if you want smartcard support 3108 [Define if you want smartcard support
@@ -2952,6 +3150,26 @@ int main()
2952 [#include <arpa/nameser.h>]) 3150 [#include <arpa/nameser.h>])
2953 ]) 3151 ])
2954 3152
3153# Check whether user wants SELinux support
3154SELINUX_MSG="no"
3155LIBSELINUX=""
3156AC_ARG_WITH(selinux,
3157 [ --with-selinux Enable SELinux support],
3158 [ if test "x$withval" != "xno" ; then
3159 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
3160 SELINUX_MSG="yes"
3161 AC_CHECK_HEADER([selinux/selinux.h], ,
3162 AC_MSG_ERROR(SELinux support requires selinux.h header))
3163 AC_CHECK_LIB(selinux, setexeccon, [ LIBSELINUX="-lselinux" ],
3164 AC_MSG_ERROR(SELinux support requires libselinux library))
3165 save_LIBS="$LIBS"
3166 LIBS="$LIBS $LIBSELINUX"
3167 AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level)
3168 LIBS="$save_LIBS"
3169 fi ]
3170)
3171AC_SUBST(LIBSELINUX)
3172
2955# Check whether user wants Kerberos 5 support 3173# Check whether user wants Kerberos 5 support
2956KRB5_MSG="no" 3174KRB5_MSG="no"
2957AC_ARG_WITH(kerberos5, 3175AC_ARG_WITH(kerberos5,
@@ -3714,20 +3932,13 @@ if test ! -z "$blibpath" ; then
3714 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) 3932 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3715fi 3933fi
3716 3934
3717dnl remove pam and dl because they are in $LIBPAM
3718if test "$PAM_MSG" = yes ; then
3719 LIBS=`echo $LIBS | sed 's/-lpam //'`
3720fi
3721if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3722 LIBS=`echo $LIBS | sed 's/-ldl //'`
3723fi
3724
3725dnl Adding -Werror to CFLAGS early prevents configure tests from running. 3935dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3726dnl Add now. 3936dnl Add now.
3727CFLAGS="$CFLAGS $werror_flags" 3937CFLAGS="$CFLAGS $werror_flags"
3728 3938
3729AC_EXEEXT 3939AC_EXEEXT
3730AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \ 3940AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
3941 openbsd-compat/Makefile openbsd-compat/regress/Makefile \
3731 scard/Makefile ssh_prng_cmds survey.sh]) 3942 scard/Makefile ssh_prng_cmds survey.sh])
3732AC_OUTPUT 3943AC_OUTPUT
3733 3944
@@ -3769,12 +3980,15 @@ echo " sshd superuser user PATH: $J"
3769fi 3980fi
3770echo " Manpage format: $MANTYPE" 3981echo " Manpage format: $MANTYPE"
3771echo " PAM support: $PAM_MSG" 3982echo " PAM support: $PAM_MSG"
3983echo " OSF SIA support: $SIA_MSG"
3772echo " KerberosV support: $KRB5_MSG" 3984echo " KerberosV support: $KRB5_MSG"
3985echo " SELinux support: $SELINUX_MSG"
3773echo " Smartcard support: $SCARD_MSG" 3986echo " Smartcard support: $SCARD_MSG"
3774echo " S/KEY support: $SKEY_MSG" 3987echo " S/KEY support: $SKEY_MSG"
3775echo " TCP Wrappers support: $TCPW_MSG" 3988echo " TCP Wrappers support: $TCPW_MSG"
3776echo " MD5 password support: $MD5_MSG" 3989echo " MD5 password support: $MD5_MSG"
3777echo " libedit support: $LIBEDIT_MSG" 3990echo " libedit support: $LIBEDIT_MSG"
3991echo " Solaris process contract support: $SPC_MSG"
3778echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 3992echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
3779echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 3993echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3780echo " BSD Auth support: $BSD_AUTH_MSG" 3994echo " BSD Auth support: $BSD_AUTH_MSG"