summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac688
1 files changed, 451 insertions, 237 deletions
diff --git a/configure.ac b/configure.ac
index cfaaca92d..18c7ca896 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,30 +398,38 @@ 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])
234 AC_MSG_CHECKING(if we have the Security Authorization Session API) 401 AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
235 AC_TRY_COMPILE([#include <Security/AuthSession.h>], 402 AC_DEFINE(SSH_TUN_COMPAT_AF, 1,
236 [SessionCreate(0, 0);], 403 [Use tunnel device compatibility to OpenBSD])
237 [ac_cv_use_security_session_api="yes" 404 AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
238 AC_DEFINE(USE_SECURITY_SESSION_API, 1, 405 [Prepend the address family to IP tunnel traffic])
406 AC_MSG_CHECKING(if we have the Security Authorization Session API)
407 AC_TRY_COMPILE([#include <Security/AuthSession.h>],
408 [SessionCreate(0, 0);],
409 [ac_cv_use_security_session_api="yes"
410 AC_DEFINE(USE_SECURITY_SESSION_API, 1,
239 [platform has the Security Authorization Session API]) 411 [platform has the Security Authorization Session API])
240 LIBS="$LIBS -framework Security" 412 LIBS="$LIBS -framework Security"
241 AC_MSG_RESULT(yes)], 413 AC_MSG_RESULT(yes)],
242 [ac_cv_use_security_session_api="no" 414 [ac_cv_use_security_session_api="no"
243 AC_MSG_RESULT(no)]) 415 AC_MSG_RESULT(no)])
244 AC_MSG_CHECKING(if we have an in-memory credentials cache) 416 AC_MSG_CHECKING(if we have an in-memory credentials cache)
245 AC_TRY_COMPILE( 417 AC_TRY_COMPILE(
246 [#include <Kerberos/Kerberos.h>], 418 [#include <Kerberos/Kerberos.h>],
247 [cc_context_t c; 419 [cc_context_t c;
248 (void) cc_initialize (&c, 0, NULL, NULL);], 420 (void) cc_initialize (&c, 0, NULL, NULL);],
249 [AC_DEFINE(USE_CCAPI, 1, 421 [AC_DEFINE(USE_CCAPI, 1,
250 [platform uses an in-memory credentials cache]) 422 [platform uses an in-memory credentials cache])
251 LIBS="$LIBS -framework Security" 423 LIBS="$LIBS -framework Security"
252 AC_MSG_RESULT(yes) 424 AC_MSG_RESULT(yes)
253 if test "x$ac_cv_use_security_session_api" = "xno"; then 425 if test "x$ac_cv_use_security_session_api" = "xno"; then
254 AC_MSG_ERROR(*** Need a security framework to use the credentials cache API ***) 426 AC_MSG_ERROR(*** Need a security framework to use the credentials cache API ***)
255 fi], 427 fi],
256 [AC_MSG_RESULT(no)] 428 [AC_MSG_RESULT(no)]
257 ) 429 )
430 ;;
431*-*-dragonfly*)
432 SSHDLIBS="$SSHDLIBS -lcrypt"
258 ;; 433 ;;
259*-*-hpux*) 434*-*-hpux*)
260 # first we define all of the options common to all HP-UX releases 435 # first we define all of the options common to all HP-UX releases
@@ -409,6 +584,8 @@ mips-sony-bsd|mips-sony-newsos4)
409 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) 584 AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
410 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded]) 585 AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
411 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way]) 586 AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
587 AC_DEFINE(SYSLOG_R_SAFE_IN_SIGHAND, 1,
588 [syslog_r function is safe to use in in a signal handler])
412 ;; 589 ;;
413*-*-solaris*) 590*-*-solaris*)
414 if test "x$withval" != "xno" ; then 591 if test "x$withval" != "xno" ; then
@@ -428,6 +605,8 @@ mips-sony-bsd|mips-sony-newsos4)
428 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1, 605 AC_DEFINE(SSHD_ACQUIRES_CTTY, 1,
429 [Define if sshd somehow reacquires a controlling TTY 606 [Define if sshd somehow reacquires a controlling TTY
430 after setsid()]) 607 after setsid()])
608 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd
609 in case the name is longer than 8 chars])
431 external_path_file=/etc/default/login 610 external_path_file=/etc/default/login
432 # hardwire lastlog location (can't detect it on some versions) 611 # hardwire lastlog location (can't detect it on some versions)
433 conf_lastlog_location="/var/adm/lastlog" 612 conf_lastlog_location="/var/adm/lastlog"
@@ -441,6 +620,17 @@ mips-sony-bsd|mips-sony-newsos4)
441 else 620 else
442 AC_MSG_RESULT(no) 621 AC_MSG_RESULT(no)
443 fi 622 fi
623 AC_ARG_WITH(solaris-contracts,
624 [ --with-solaris-contracts Enable Solaris process contracts (experimental)],
625 [
626 AC_CHECK_LIB(contract, ct_tmpl_activate,
627 [ AC_DEFINE(USE_SOLARIS_PROCESS_CONTRACTS, 1,
628 [Define if you have Solaris process contracts])
629 SSHDLIBS="$SSHDLIBS -lcontract"
630 AC_SUBST(SSHDLIBS)
631 SPC_MSG="yes" ], )
632 ],
633 )
444 ;; 634 ;;
445*-*-sunos4*) 635*-*-sunos4*)
446 CPPFLAGS="$CPPFLAGS -DSUNOS4" 636 CPPFLAGS="$CPPFLAGS -DSUNOS4"
@@ -478,7 +668,6 @@ mips-sony-bsd|mips-sony-newsos4)
478 ;; 668 ;;
479# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel. 669# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
480*-*-sysv4.2*) 670*-*-sysv4.2*)
481 CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
482 AC_DEFINE(USE_PIPES) 671 AC_DEFINE(USE_PIPES)
483 AC_DEFINE(SETEUID_BREAKS_SETUID) 672 AC_DEFINE(SETEUID_BREAKS_SETUID)
484 AC_DEFINE(BROKEN_SETREUID) 673 AC_DEFINE(BROKEN_SETREUID)
@@ -500,6 +689,7 @@ mips-sony-bsd|mips-sony-newsos4)
500 TEST_SHELL=/u95/bin/sh 689 TEST_SHELL=/u95/bin/sh
501 AC_DEFINE(BROKEN_LIBIAF, 1, 690 AC_DEFINE(BROKEN_LIBIAF, 1,
502 [ia_uinfo routines not supported by OS yet]) 691 [ia_uinfo routines not supported by OS yet])
692 AC_DEFINE(BROKEN_UPDWTMPX)
503 ;; 693 ;;
504 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*") 694 *) AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
505 ;; 695 ;;
@@ -589,6 +779,7 @@ mips-sony-bsd|mips-sony-newsos4)
589 system's login() call]) 779 system's login() call])
590 AC_DEFINE(DISABLE_FD_PASSING) 780 AC_DEFINE(DISABLE_FD_PASSING)
591 LIBS="$LIBS -lsecurity -ldb -lm -laud" 781 LIBS="$LIBS -lsecurity -ldb -lm -laud"
782 SIA_MSG="yes"
592 else 783 else
593 AC_MSG_RESULT(no) 784 AC_MSG_RESULT(no)
594 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin", 785 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin",
@@ -608,6 +799,8 @@ mips-sony-bsd|mips-sony-newsos4)
608 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems]) 799 AC_DEFINE(MISSING_HOWMANY, 1, [Define on *nto-qnx systems])
609 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems]) 800 AC_DEFINE(MISSING_FD_MASK, 1, [Define on *nto-qnx systems])
610 AC_DEFINE(DISABLE_LASTLOG) 801 AC_DEFINE(DISABLE_LASTLOG)
802 AC_DEFINE(SSHD_ACQUIRES_CTTY)
803 enable_etc_default_login=no # has incompatible /etc/default/login
611 ;; 804 ;;
612 805
613*-*-ultrix*) 806*-*-ultrix*)
@@ -624,55 +817,6 @@ mips-sony-bsd|mips-sony-newsos4)
624 ;; 817 ;;
625esac 818esac
626 819
627# Allow user to specify flags
628AC_ARG_WITH(cflags,
629 [ --with-cflags Specify additional flags to pass to compiler],
630 [
631 if test -n "$withval" && test "x$withval" != "xno" && \
632 test "x${withval}" != "xyes"; then
633 CFLAGS="$CFLAGS $withval"
634 fi
635 ]
636)
637AC_ARG_WITH(cppflags,
638 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
639 [
640 if test -n "$withval" && test "x$withval" != "xno" && \
641 test "x${withval}" != "xyes"; then
642 CPPFLAGS="$CPPFLAGS $withval"
643 fi
644 ]
645)
646AC_ARG_WITH(ldflags,
647 [ --with-ldflags Specify additional flags to pass to linker],
648 [
649 if test -n "$withval" && test "x$withval" != "xno" && \
650 test "x${withval}" != "xyes"; then
651 LDFLAGS="$LDFLAGS $withval"
652 fi
653 ]
654)
655AC_ARG_WITH(libs,
656 [ --with-libs Specify additional libraries to link with],
657 [
658 if test -n "$withval" && test "x$withval" != "xno" && \
659 test "x${withval}" != "xyes"; then
660 LIBS="$LIBS $withval"
661 fi
662 ]
663)
664AC_ARG_WITH(Werror,
665 [ --with-Werror Build main code with -Werror],
666 [
667 if test -n "$withval" && test "x$withval" != "xno"; then
668 werror_flags="-Werror"
669 if test "x${withval}" != "xyes"; then
670 werror_flags="$withval"
671 fi
672 fi
673 ]
674)
675
676AC_MSG_CHECKING(compiler and flags for sanity) 820AC_MSG_CHECKING(compiler and flags for sanity)
677AC_RUN_IFELSE( 821AC_RUN_IFELSE(
678 [AC_LANG_SOURCE([ 822 [AC_LANG_SOURCE([
@@ -688,79 +832,6 @@ int main(){exit(0);}
688) 832)
689 833
690dnl Checks for header files. 834dnl Checks for header files.
691AC_CHECK_HEADERS( \
692 bstring.h \
693 crypt.h \
694 dirent.h \
695 endian.h \
696 features.h \
697 floatingpoint.h \
698 getopt.h \
699 glob.h \
700 ia.h \
701 iaf.h \
702 limits.h \
703 login.h \
704 login_cap.h \
705 maillock.h \
706 ndir.h \
707 netdb.h \
708 netgroup.h \
709 pam/pam_appl.h \
710 paths.h \
711 pty.h \
712 readpassphrase.h \
713 rpc/types.h \
714 security/pam_appl.h \
715 shadow.h \
716 stddef.h \
717 stdint.h \
718 string.h \
719 strings.h \
720 sys/audit.h \
721 sys/bitypes.h \
722 sys/bsdtty.h \
723 sys/cdefs.h \
724 sys/dir.h \
725 sys/mman.h \
726 sys/ndir.h \
727 sys/prctl.h \
728 sys/pstat.h \
729 sys/select.h \
730 sys/stat.h \
731 sys/stream.h \
732 sys/stropts.h \
733 sys/strtio.h \
734 sys/sysmacros.h \
735 sys/time.h \
736 sys/timers.h \
737 sys/un.h \
738 time.h \
739 tmpdir.h \
740 ttyent.h \
741 unistd.h \
742 usersec.h \
743 util.h \
744 utime.h \
745 utmp.h \
746 utmpx.h \
747 vis.h \
748)
749
750# lastlog.h requires sys/time.h to be included first on Solaris
751AC_CHECK_HEADERS(lastlog.h, [], [], [
752#ifdef HAVE_SYS_TIME_H
753# include <sys/time.h>
754#endif
755])
756
757# sys/ptms.h requires sys/stream.h to be included first on Solaris
758AC_CHECK_HEADERS(sys/ptms.h, [], [], [
759#ifdef HAVE_SYS_STREAM_H
760# include <sys/stream.h>
761#endif
762])
763
764# Checks for libraries. 835# Checks for libraries.
765AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) 836AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
766AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 837AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
@@ -945,11 +1016,9 @@ AC_EGREP_CPP(FOUNDIT,
945 1016
946# Check for g.gl_matchc glob() extension 1017# Check for g.gl_matchc glob() extension
947AC_MSG_CHECKING(for gl_matchc field in glob_t) 1018AC_MSG_CHECKING(for gl_matchc field in glob_t)
948AC_EGREP_CPP(FOUNDIT, 1019AC_TRY_COMPILE(
949 [ 1020 [ #include <glob.h> ],
950 #include <glob.h> 1021 [glob_t g; g.gl_matchc = 1;],
951 int main(void){glob_t g; g.gl_matchc = 1;}
952 ],
953 [ 1022 [
954 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1, 1023 AC_DEFINE(GLOB_HAS_GL_MATCHC, 1,
955 [Define if your system glob() function has 1024 [Define if your system glob() function has
@@ -961,6 +1030,8 @@ AC_EGREP_CPP(FOUNDIT,
961 ] 1030 ]
962) 1031)
963 1032
1033AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>])
1034
964AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) 1035AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
965AC_RUN_IFELSE( 1036AC_RUN_IFELSE(
966 [AC_LANG_SOURCE([[ 1037 [AC_LANG_SOURCE([[
@@ -1142,7 +1213,13 @@ AC_ARG_WITH(audit,
1142 AUDIT_MODULE=bsm 1213 AUDIT_MODULE=bsm
1143 dnl Checks for headers, libs and functions 1214 dnl Checks for headers, libs and functions
1144 AC_CHECK_HEADERS(bsm/audit.h, [], 1215 AC_CHECK_HEADERS(bsm/audit.h, [],
1145 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)]) 1216 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)],
1217 [
1218#ifdef HAVE_TIME_H
1219# include <time.h>
1220#endif
1221 ]
1222)
1146 AC_CHECK_LIB(bsm, getaudit, [], 1223 AC_CHECK_LIB(bsm, getaudit, [],
1147 [AC_MSG_ERROR(BSM enabled and required library not found)]) 1224 [AC_MSG_ERROR(BSM enabled and required library not found)])
1148 AC_CHECK_FUNCS(getaudit, [], 1225 AC_CHECK_FUNCS(getaudit, [],
@@ -1288,6 +1365,29 @@ AC_CHECK_DECL(tcsendbreak,
1288 1365
1289AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>]) 1366AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
1290 1367
1368AC_CHECK_DECLS(SHUT_RD, , ,
1369 [
1370#include <sys/types.h>
1371#include <sys/socket.h>
1372 ])
1373
1374AC_CHECK_DECLS(O_NONBLOCK, , ,
1375 [
1376#include <sys/types.h>
1377#ifdef HAVE_SYS_STAT_H
1378# include <sys/stat.h>
1379#endif
1380#ifdef HAVE_FCNTL_H
1381# include <fcntl.h>
1382#endif
1383 ])
1384
1385AC_CHECK_DECLS(writev, , , [
1386#include <sys/types.h>
1387#include <sys/uio.h>
1388#include <unistd.h>
1389 ])
1390
1291AC_CHECK_FUNCS(setresuid, [ 1391AC_CHECK_FUNCS(setresuid, [
1292 dnl Some platorms have setresuid that isn't implemented, test for this 1392 dnl Some platorms have setresuid that isn't implemented, test for this
1293 AC_MSG_CHECKING(if setresuid seems to work) 1393 AC_MSG_CHECKING(if setresuid seems to work)
@@ -1632,6 +1732,7 @@ main(void)
1632 AC_MSG_RESULT(no) 1732 AC_MSG_RESULT(no)
1633 AC_DEFINE(BROKEN_GETADDRINFO) 1733 AC_DEFINE(BROKEN_GETADDRINFO)
1634 ], 1734 ],
1735 [
1635 AC_MSG_RESULT(cross-compiling, assuming no) 1736 AC_MSG_RESULT(cross-compiling, assuming no)
1636 ] 1737 ]
1637 ) 1738 )
@@ -1657,61 +1758,6 @@ fi
1657 1758
1658AC_FUNC_GETPGRP 1759AC_FUNC_GETPGRP
1659 1760
1660# Check for PAM libs
1661PAM_MSG="no"
1662AC_ARG_WITH(pam,
1663 [ --with-pam Enable PAM support ],
1664 [
1665 if test "x$withval" != "xno" ; then
1666 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1667 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
1668 AC_MSG_ERROR([PAM headers not found])
1669 fi
1670
1671 AC_CHECK_LIB(dl, dlopen, , )
1672 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1673 AC_CHECK_FUNCS(pam_getenvlist)
1674 AC_CHECK_FUNCS(pam_putenv)
1675
1676 PAM_MSG="yes"
1677
1678 AC_DEFINE(USE_PAM, 1,
1679 [Define if you want to enable PAM support])
1680 if test $ac_cv_lib_dl_dlopen = yes; then
1681 LIBPAM="-lpam -ldl"
1682 else
1683 LIBPAM="-lpam"
1684 fi
1685 AC_SUBST(LIBPAM)
1686 fi
1687 ]
1688)
1689
1690# Check for older PAM
1691if test "x$PAM_MSG" = "xyes" ; then
1692 # Check PAM strerror arguments (old PAM)
1693 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1694 AC_TRY_COMPILE(
1695 [
1696#include <stdlib.h>
1697#if defined(HAVE_SECURITY_PAM_APPL_H)
1698#include <security/pam_appl.h>
1699#elif defined (HAVE_PAM_PAM_APPL_H)
1700#include <pam/pam_appl.h>
1701#endif
1702 ],
1703 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
1704 [AC_MSG_RESULT(no)],
1705 [
1706 AC_DEFINE(HAVE_OLD_PAM, 1,
1707 [Define if you have an old version of PAM
1708 which takes only one argument to pam_strerror])
1709 AC_MSG_RESULT(yes)
1710 PAM_MSG="yes (old library)"
1711 ]
1712 )
1713fi
1714
1715# Search for OpenSSL 1761# Search for OpenSSL
1716saved_CPPFLAGS="$CPPFLAGS" 1762saved_CPPFLAGS="$CPPFLAGS"
1717saved_LDFLAGS="$LDFLAGS" 1763saved_LDFLAGS="$LDFLAGS"
@@ -1835,6 +1881,14 @@ int main(void) {
1835 ] 1881 ]
1836) 1882)
1837 1883
1884AC_ARG_WITH(openssl-header-check,
1885 [ --without-openssl-header-check Disable OpenSSL version consistency check],
1886 [ if test "x$withval" = "xno" ; then
1887 openssl_check_nonfatal=1
1888 fi
1889 ]
1890)
1891
1838# Sanity check OpenSSL headers 1892# Sanity check OpenSSL headers
1839AC_MSG_CHECKING([whether OpenSSL's headers match the library]) 1893AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1840AC_RUN_IFELSE( 1894AC_RUN_IFELSE(
@@ -1848,18 +1902,75 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1848 ], 1902 ],
1849 [ 1903 [
1850 AC_MSG_RESULT(no) 1904 AC_MSG_RESULT(no)
1851 AC_MSG_ERROR([Your OpenSSL headers do not match your library. 1905 if test "x$openssl_check_nonfatal" = "x"; then
1852Check config.log for details. 1906 AC_MSG_ERROR([Your OpenSSL headers do not match your
1907library. Check config.log for details.
1908If you are sure your installation is consistent, you can disable the check
1909by running "./configure --without-openssl-header-check".
1910Also see contrib/findssl.sh for help identifying header/library mismatches.
1911])
1912 else
1913 AC_MSG_WARN([Your OpenSSL headers do not match your
1914library. Check config.log for details.
1853Also see contrib/findssl.sh for help identifying header/library mismatches.]) 1915Also see contrib/findssl.sh for help identifying header/library mismatches.])
1916 fi
1854 ], 1917 ],
1855 [ 1918 [
1856 AC_MSG_WARN([cross compiling: not checking]) 1919 AC_MSG_WARN([cross compiling: not checking])
1857 ] 1920 ]
1858) 1921)
1859 1922
1923AC_MSG_CHECKING([if programs using OpenSSL functions will link])
1924AC_LINK_IFELSE(
1925 [AC_LANG_SOURCE([[
1926#include <openssl/evp.h>
1927int main(void) { SSLeay_add_all_algorithms(); }
1928 ]])],
1929 [
1930 AC_MSG_RESULT(yes)
1931 ],
1932 [
1933 AC_MSG_RESULT(no)
1934 saved_LIBS="$LIBS"
1935 LIBS="$LIBS -ldl"
1936 AC_MSG_CHECKING([if programs using OpenSSL need -ldl])
1937 AC_LINK_IFELSE(
1938 [AC_LANG_SOURCE([[
1939#include <openssl/evp.h>
1940int main(void) { SSLeay_add_all_algorithms(); }
1941 ]])],
1942 [
1943 AC_MSG_RESULT(yes)
1944 ],
1945 [
1946 AC_MSG_RESULT(no)
1947 LIBS="$saved_LIBS"
1948 ]
1949 )
1950 ]
1951)
1952
1953AC_ARG_WITH(ssl-engine,
1954 [ --with-ssl-engine Enable OpenSSL (hardware) ENGINE support ],
1955 [ if test "x$withval" != "xno" ; then
1956 AC_MSG_CHECKING(for OpenSSL ENGINE support)
1957 AC_TRY_COMPILE(
1958 [ #include <openssl/engine.h>],
1959 [
1960ENGINE_load_builtin_engines();ENGINE_register_all_complete();
1961 ],
1962 [ AC_MSG_RESULT(yes)
1963 AC_DEFINE(USE_OPENSSL_ENGINE, 1,
1964 [Enable OpenSSL engine support])
1965 ],
1966 [ AC_MSG_ERROR(OpenSSL ENGINE support not found)]
1967 )
1968 fi ]
1969)
1970
1860# Check for OpenSSL without EVP_aes_{192,256}_cbc 1971# Check for OpenSSL without EVP_aes_{192,256}_cbc
1861AC_MSG_CHECKING([whether OpenSSL has crippled AES support]) 1972AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
1862AC_COMPILE_IFELSE( 1973AC_LINK_IFELSE(
1863 [AC_LANG_SOURCE([[ 1974 [AC_LANG_SOURCE([[
1864#include <string.h> 1975#include <string.h>
1865#include <openssl/evp.h> 1976#include <openssl/evp.h>
@@ -1887,6 +1998,9 @@ if test "x$check_for_libcrypt_later" = "x1"; then
1887 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") 1998 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1888fi 1999fi
1889 2000
2001# Search for SHA256 support in libc and/or OpenSSL
2002AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
2003
1890AC_CHECK_LIB(iaf, ia_openinfo) 2004AC_CHECK_LIB(iaf, ia_openinfo)
1891 2005
1892### Configure cryptographic random number support 2006### Configure cryptographic random number support
@@ -1917,6 +2031,69 @@ int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1917 ] 2031 ]
1918) 2032)
1919 2033
2034# Check for PAM libs
2035PAM_MSG="no"
2036AC_ARG_WITH(pam,
2037 [ --with-pam Enable PAM support ],
2038 [
2039 if test "x$withval" != "xno" ; then
2040 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
2041 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
2042 AC_MSG_ERROR([PAM headers not found])
2043 fi
2044
2045 saved_LIBS="$LIBS"
2046 AC_CHECK_LIB(dl, dlopen, , )
2047 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
2048 AC_CHECK_FUNCS(pam_getenvlist)
2049 AC_CHECK_FUNCS(pam_putenv)
2050 LIBS="$saved_LIBS"
2051
2052 PAM_MSG="yes"
2053
2054 LIBPAM="-lpam"
2055 AC_DEFINE(USE_PAM, 1,
2056 [Define if you want to enable PAM support])
2057
2058 if test $ac_cv_lib_dl_dlopen = yes; then
2059 case "$LIBS" in
2060 *-ldl*)
2061 # libdl already in LIBS
2062 ;;
2063 *)
2064 LIBPAM="$LIBPAM -ldl"
2065 ;;
2066 esac
2067 fi
2068 AC_SUBST(LIBPAM)
2069 fi
2070 ]
2071)
2072
2073# Check for older PAM
2074if test "x$PAM_MSG" = "xyes" ; then
2075 # Check PAM strerror arguments (old PAM)
2076 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
2077 AC_TRY_COMPILE(
2078 [
2079#include <stdlib.h>
2080#if defined(HAVE_SECURITY_PAM_APPL_H)
2081#include <security/pam_appl.h>
2082#elif defined (HAVE_PAM_PAM_APPL_H)
2083#include <pam/pam_appl.h>
2084#endif
2085 ],
2086 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
2087 [AC_MSG_RESULT(no)],
2088 [
2089 AC_DEFINE(HAVE_OLD_PAM, 1,
2090 [Define if you have an old version of PAM
2091 which takes only one argument to pam_strerror])
2092 AC_MSG_RESULT(yes)
2093 PAM_MSG="yes (old library)"
2094 ]
2095 )
2096fi
1920 2097
1921# Do we want to force the use of the rand helper? 2098# Do we want to force the use of the rand helper?
1922AC_ARG_WITH(rand-helper, 2099AC_ARG_WITH(rand-helper,
@@ -2136,6 +2313,34 @@ if test -z "$have_llong_max"; then
2136#define __USE_ISOC99 2313#define __USE_ISOC99
2137#include <limits.h> 2314#include <limits.h>
2138#define DATA "conftest.llminmax" 2315#define DATA "conftest.llminmax"
2316#define my_abs(a) ((a) < 0 ? ((a) * -1) : (a))
2317
2318/*
2319 * printf in libc on some platforms (eg old Tru64) does not understand %lld so
2320 * we do this the hard way.
2321 */
2322static int
2323fprint_ll(FILE *f, long long n)
2324{
2325 unsigned int i;
2326 int l[sizeof(long long) * 8];
2327
2328 if (n < 0)
2329 if (fprintf(f, "-") < 0)
2330 return -1;
2331 for (i = 0; n != 0; i++) {
2332 l[i] = my_abs(n % 10);
2333 n /= 10;
2334 }
2335 do {
2336 if (fprintf(f, "%d", l[--i]) < 0)
2337 return -1;
2338 } while (i != 0);
2339 if (fprintf(f, " ") < 0)
2340 return -1;
2341 return 0;
2342}
2343
2139int main(void) { 2344int main(void) {
2140 FILE *f; 2345 FILE *f;
2141 long long i, llmin, llmax = 0; 2346 long long i, llmin, llmax = 0;
@@ -2157,14 +2362,18 @@ int main(void) {
2157 2362
2158 /* Sanity check */ 2363 /* Sanity check */
2159 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax 2364 if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
2160 || llmax - 1 > llmax) { 2365 || llmax - 1 > llmax || llmin == llmax || llmin == 0
2366 || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
2161 fprintf(f, "unknown unknown\n"); 2367 fprintf(f, "unknown unknown\n");
2162 exit(2); 2368 exit(2);
2163 } 2369 }
2164 2370
2165 if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) 2371 if (fprint_ll(f, llmin) < 0)
2166 exit(3); 2372 exit(3);
2167 2373 if (fprint_ll(f, llmax) < 0)
2374 exit(4);
2375 if (fclose(f) < 0)
2376 exit(5);
2168 exit(0); 2377 exit(0);
2169} 2378}
2170 ]])], 2379 ]])],
@@ -2172,17 +2381,6 @@ int main(void) {
2172 llong_min=`$AWK '{print $1}' conftest.llminmax` 2381 llong_min=`$AWK '{print $1}' conftest.llminmax`
2173 llong_max=`$AWK '{print $2}' conftest.llminmax` 2382 llong_max=`$AWK '{print $2}' conftest.llminmax`
2174 2383
2175 # snprintf on some Tru64s doesn't understand "%lld"
2176 case "$host" in
2177 alpha-dec-osf*)
2178 if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
2179 test "x$llong_max" = "xld"; then
2180 llong_min="-9223372036854775808"
2181 llong_max="9223372036854775807"
2182 fi
2183 ;;
2184 esac
2185
2186 AC_MSG_RESULT($llong_max) 2384 AC_MSG_RESULT($llong_max)
2187 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], 2385 AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
2188 [max value of long long calculated by configure]) 2386 [max value of long long calculated by configure])
@@ -2928,7 +3126,7 @@ AC_ARG_WITH(opensc,
2928 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` 3126 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2929 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` 3127 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2930 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" 3128 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2931 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" 3129 LIBS="$LIBS $LIBOPENSC_LIBS"
2932 AC_DEFINE(SMARTCARD) 3130 AC_DEFINE(SMARTCARD)
2933 AC_DEFINE(USE_OPENSC, 1, 3131 AC_DEFINE(USE_OPENSC, 1,
2934 [Define if you want smartcard support 3132 [Define if you want smartcard support
@@ -2976,6 +3174,26 @@ int main()
2976 [#include <arpa/nameser.h>]) 3174 [#include <arpa/nameser.h>])
2977 ]) 3175 ])
2978 3176
3177# Check whether user wants SELinux support
3178SELINUX_MSG="no"
3179LIBSELINUX=""
3180AC_ARG_WITH(selinux,
3181 [ --with-selinux Enable SELinux support],
3182 [ if test "x$withval" != "xno" ; then
3183 AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
3184 SELINUX_MSG="yes"
3185 AC_CHECK_HEADER([selinux/selinux.h], ,
3186 AC_MSG_ERROR(SELinux support requires selinux.h header))
3187 AC_CHECK_LIB(selinux, setexeccon, [ LIBSELINUX="-lselinux" ],
3188 AC_MSG_ERROR(SELinux support requires libselinux library))
3189 save_LIBS="$LIBS"
3190 LIBS="$LIBS $LIBSELINUX"
3191 AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level)
3192 LIBS="$save_LIBS"
3193 fi ]
3194)
3195AC_SUBST(LIBSELINUX)
3196
2979# Check whether user wants Kerberos 5 support 3197# Check whether user wants Kerberos 5 support
2980KRB5_MSG="no" 3198KRB5_MSG="no"
2981AC_ARG_WITH(kerberos5, 3199AC_ARG_WITH(kerberos5,
@@ -3738,20 +3956,13 @@ if test ! -z "$blibpath" ; then
3738 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile]) 3956 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3739fi 3957fi
3740 3958
3741dnl remove pam and dl because they are in $LIBPAM
3742if test "$PAM_MSG" = yes ; then
3743 LIBS=`echo $LIBS | sed 's/-lpam //'`
3744fi
3745if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3746 LIBS=`echo $LIBS | sed 's/-ldl //'`
3747fi
3748
3749dnl Adding -Werror to CFLAGS early prevents configure tests from running. 3959dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3750dnl Add now. 3960dnl Add now.
3751CFLAGS="$CFLAGS $werror_flags" 3961CFLAGS="$CFLAGS $werror_flags"
3752 3962
3753AC_EXEEXT 3963AC_EXEEXT
3754AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \ 3964AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
3965 openbsd-compat/Makefile openbsd-compat/regress/Makefile \
3755 scard/Makefile ssh_prng_cmds survey.sh]) 3966 scard/Makefile ssh_prng_cmds survey.sh])
3756AC_OUTPUT 3967AC_OUTPUT
3757 3968
@@ -3793,12 +4004,15 @@ echo " sshd superuser user PATH: $J"
3793fi 4004fi
3794echo " Manpage format: $MANTYPE" 4005echo " Manpage format: $MANTYPE"
3795echo " PAM support: $PAM_MSG" 4006echo " PAM support: $PAM_MSG"
4007echo " OSF SIA support: $SIA_MSG"
3796echo " KerberosV support: $KRB5_MSG" 4008echo " KerberosV support: $KRB5_MSG"
4009echo " SELinux support: $SELINUX_MSG"
3797echo " Smartcard support: $SCARD_MSG" 4010echo " Smartcard support: $SCARD_MSG"
3798echo " S/KEY support: $SKEY_MSG" 4011echo " S/KEY support: $SKEY_MSG"
3799echo " TCP Wrappers support: $TCPW_MSG" 4012echo " TCP Wrappers support: $TCPW_MSG"
3800echo " MD5 password support: $MD5_MSG" 4013echo " MD5 password support: $MD5_MSG"
3801echo " libedit support: $LIBEDIT_MSG" 4014echo " libedit support: $LIBEDIT_MSG"
4015echo " Solaris process contract support: $SPC_MSG"
3802echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 4016echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
3803echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 4017echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
3804echo " BSD Auth support: $BSD_AUTH_MSG" 4018echo " BSD Auth support: $BSD_AUTH_MSG"