summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac358
1 files changed, 271 insertions, 87 deletions
diff --git a/configure.ac b/configure.ac
index 36c457728..e48028b7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.226 2004/08/16 13:12:06 dtucker Exp $ 1# $Id: configure.ac,v 1.250 2005/03/07 09:21:37 tim Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -14,7 +14,7 @@
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
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 17AC_INIT(OpenSSH, Portable)
18AC_CONFIG_SRCDIR([ssh.c]) 18AC_CONFIG_SRCDIR([ssh.c])
19 19
20AC_CONFIG_HEADER(config.h) 20AC_CONFIG_HEADER(config.h)
@@ -121,8 +121,11 @@ case "$host" in
121 LIBS="$LIBS -ls" 121 LIBS="$LIBS -ls"
122 ]) 122 ])
123 ]) 123 ])
124 dnl Check for various auth function declarations in headers.
125 AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess,
126 passwdexpired], , , [#include <usersec.h>])
124 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) 127 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
125 AC_CHECK_DECL(loginfailed, 128 AC_CHECK_DECLS(loginfailed,
126 [AC_MSG_CHECKING(if loginfailed takes 4 arguments) 129 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
127 AC_TRY_COMPILE( 130 AC_TRY_COMPILE(
128 [#include <usersec.h>], 131 [#include <usersec.h>],
@@ -135,7 +138,7 @@ case "$host" in
135 [#include <usersec.h>] 138 [#include <usersec.h>]
136 ) 139 )
137 AC_CHECK_FUNCS(setauthdb) 140 AC_CHECK_FUNCS(setauthdb)
138 AC_DEFINE(BROKEN_GETADDRINFO) 141 check_for_aix_broken_getaddrinfo=1
139 AC_DEFINE(BROKEN_REALPATH) 142 AC_DEFINE(BROKEN_REALPATH)
140 AC_DEFINE(SETEUID_BREAKS_SETUID) 143 AC_DEFINE(SETEUID_BREAKS_SETUID)
141 AC_DEFINE(BROKEN_SETREUID) 144 AC_DEFINE(BROKEN_SETREUID)
@@ -155,7 +158,6 @@ case "$host" in
155 AC_DEFINE(NO_X11_UNIX_SOCKETS) 158 AC_DEFINE(NO_X11_UNIX_SOCKETS)
156 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) 159 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
157 AC_DEFINE(DISABLE_FD_PASSING) 160 AC_DEFINE(DISABLE_FD_PASSING)
158 AC_DEFINE(SETGROUPS_NOOP)
159 ;; 161 ;;
160*-*-dgux*) 162*-*-dgux*)
161 AC_DEFINE(IP_TOS_IS_BROKEN) 163 AC_DEFINE(IP_TOS_IS_BROKEN)
@@ -219,7 +221,9 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
219 AC_DEFINE(DISABLE_UTMP) 221 AC_DEFINE(DISABLE_UTMP)
220 AC_DEFINE(LOCKED_PASSWD_STRING, "*") 222 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
221 AC_DEFINE(SPT_TYPE,SPT_PSTAT) 223 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
224 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
222 check_for_hpux_broken_getaddrinfo=1 225 check_for_hpux_broken_getaddrinfo=1
226 check_for_conflicting_getspnam=1
223 LIBS="$LIBS -lsec" 227 LIBS="$LIBS -lsec"
224 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 228 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
225 ;; 229 ;;
@@ -255,6 +259,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
255 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!") 259 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
256 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) 260 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
257 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM) 261 AC_DEFINE(LINK_OPNOTSUPP_ERRNO, EPERM)
262 AC_DEFINE(_PATH_BTMP, "/var/log/btmp", [log for bad login attempts])
263 AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins])
258 inet6_default_4in6=yes 264 inet6_default_4in6=yes
259 case `uname -r` in 265 case `uname -r` in
260 1.*|2.0.*) 266 1.*|2.0.*)
@@ -335,6 +341,8 @@ mips-sony-bsd|mips-sony-newsos4)
335*-sni-sysv*) 341*-sni-sysv*)
336 # /usr/ucblib MUST NOT be searched on ReliantUNIX 342 # /usr/ucblib MUST NOT be searched on ReliantUNIX
337 AC_CHECK_LIB(dl, dlsym, ,) 343 AC_CHECK_LIB(dl, dlsym, ,)
344 # -lresolv needs to be at then end of LIBS or DNS lookups break
345 AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
338 IPADDR_IN_DISPLAY=yes 346 IPADDR_IN_DISPLAY=yes
339 AC_DEFINE(USE_PIPES) 347 AC_DEFINE(USE_PIPES)
340 AC_DEFINE(IP_TOS_IS_BROKEN) 348 AC_DEFINE(IP_TOS_IS_BROKEN)
@@ -347,12 +355,14 @@ mips-sony-bsd|mips-sony-newsos4)
347 # Attention: always take care to bind libsocket and libnsl before libc, 355 # Attention: always take care to bind libsocket and libnsl before libc,
348 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog 356 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
349 ;; 357 ;;
358# UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
350*-*-sysv4.2*) 359*-*-sysv4.2*)
351 AC_DEFINE(USE_PIPES) 360 AC_DEFINE(USE_PIPES)
352 AC_DEFINE(SETEUID_BREAKS_SETUID) 361 AC_DEFINE(SETEUID_BREAKS_SETUID)
353 AC_DEFINE(BROKEN_SETREUID) 362 AC_DEFINE(BROKEN_SETREUID)
354 AC_DEFINE(BROKEN_SETREGID) 363 AC_DEFINE(BROKEN_SETREGID)
355 ;; 364 ;;
365# UnixWare 7.x, OpenUNIX 8
356*-*-sysv5*) 366*-*-sysv5*)
357 AC_DEFINE(USE_PIPES) 367 AC_DEFINE(USE_PIPES)
358 AC_DEFINE(SETEUID_BREAKS_SETUID) 368 AC_DEFINE(SETEUID_BREAKS_SETUID)
@@ -361,25 +371,11 @@ mips-sony-bsd|mips-sony-newsos4)
361 ;; 371 ;;
362*-*-sysv*) 372*-*-sysv*)
363 ;; 373 ;;
374# SCO UNIX and OEM versions of SCO UNIX
364*-*-sco3.2v4*) 375*-*-sco3.2v4*)
365 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize" 376 AC_MSG_ERROR("This Platform is no longer supported.")
366 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
367 RANLIB=true
368 no_dev_ptmx=1
369 AC_DEFINE(BROKEN_SYS_TERMIO_H)
370 AC_DEFINE(USE_PIPES)
371 AC_DEFINE(HAVE_SECUREWARE)
372 AC_DEFINE(DISABLE_SHADOW)
373 AC_DEFINE(BROKEN_SAVED_UIDS)
374 AC_DEFINE(SETEUID_BREAKS_SETUID)
375 AC_DEFINE(BROKEN_SETREUID)
376 AC_DEFINE(BROKEN_SETREGID)
377 AC_DEFINE(WITH_ABBREV_NO_TTY)
378 AC_CHECK_FUNCS(getluid setluid)
379 MANTYPE=man
380 do_sco3_extra_lib_check=yes
381 TEST_SHELL=ksh
382 ;; 377 ;;
378# SCO OpenServer 5.x
383*-*-sco3.2v5*) 379*-*-sco3.2v5*)
384 if test -z "$GCC"; then 380 if test -z "$GCC"; then
385 CFLAGS="$CFLAGS -belf" 381 CFLAGS="$CFLAGS -belf"
@@ -395,6 +391,7 @@ mips-sony-bsd|mips-sony-newsos4)
395 AC_DEFINE(BROKEN_SETREGID) 391 AC_DEFINE(BROKEN_SETREGID)
396 AC_DEFINE(WITH_ABBREV_NO_TTY) 392 AC_DEFINE(WITH_ABBREV_NO_TTY)
397 AC_DEFINE(BROKEN_UPDWTMPX) 393 AC_DEFINE(BROKEN_UPDWTMPX)
394 AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
398 AC_CHECK_FUNCS(getluid setluid) 395 AC_CHECK_FUNCS(getluid setluid)
399 MANTYPE=man 396 MANTYPE=man
400 TEST_SHELL=ksh 397 TEST_SHELL=ksh
@@ -506,15 +503,17 @@ AC_ARG_WITH(libs,
506) 503)
507 504
508AC_MSG_CHECKING(compiler and flags for sanity) 505AC_MSG_CHECKING(compiler and flags for sanity)
509AC_TRY_RUN([ 506AC_RUN_IFELSE(
507 [AC_LANG_SOURCE([
510#include <stdio.h> 508#include <stdio.h>
511int main(){exit(0);} 509int main(){exit(0);}
512 ], 510 ])],
513 [ AC_MSG_RESULT(yes) ], 511 [ AC_MSG_RESULT(yes) ],
514 [ 512 [
515 AC_MSG_RESULT(no) 513 AC_MSG_RESULT(no)
516 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***]) 514 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
517 ] 515 ],
516 [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ]
518) 517)
519 518
520# Checks for header files. 519# Checks for header files.
@@ -525,21 +524,21 @@ AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \
525 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ 524 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
526 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \ 525 strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \
527 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \ 526 sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \
528 sys/pstat.h sys/ptms.h sys/select.h sys/stat.h sys/stream.h \ 527 sys/pstat.h sys/select.h sys/stat.h sys/stream.h \
529 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \ 528 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \
530 time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) 529 time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
531 530
531# sys/ptms.h requires sys/stream.h to be included first on Solaris
532AC_CHECK_HEADERS(sys/ptms.h, [], [], [
533#ifdef HAVE_SYS_STREAM_H
534# include <sys/stream.h>
535#endif
536])
537
532# Checks for libraries. 538# Checks for libraries.
533AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match)) 539AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
534AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) 540AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
535 541
536dnl SCO OS3 needs this for libwrap
537if test "x$with_tcp_wrappers" != "xno" ; then
538 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
539 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
540 fi
541fi
542
543dnl IRIX and Solaris 2.5.1 have dirname() in libgen 542dnl IRIX and Solaris 2.5.1 have dirname() in libgen
544AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ 543AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
545 AC_CHECK_LIB(gen, dirname,[ 544 AC_CHECK_LIB(gen, dirname,[
@@ -640,7 +639,7 @@ AC_ARG_WITH(zlib-version-check,
640) 639)
641 640
642AC_MSG_CHECKING(for zlib 1.1.4 or greater) 641AC_MSG_CHECKING(for zlib 1.1.4 or greater)
643AC_TRY_RUN([ 642AC_RUN_IFELSE([AC_LANG_SOURCE([[
644#include <zlib.h> 643#include <zlib.h>
645int main() 644int main()
646{ 645{
@@ -652,7 +651,7 @@ int main()
652 exit(0); 651 exit(0);
653 exit(2); 652 exit(2);
654} 653}
655 ], 654 ]])],
656 AC_MSG_RESULT(yes), 655 AC_MSG_RESULT(yes),
657 [ AC_MSG_RESULT(no) 656 [ AC_MSG_RESULT(no)
658 if test -z "$zlib_check_nonfatal" ; then 657 if test -z "$zlib_check_nonfatal" ; then
@@ -665,7 +664,8 @@ If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
665 else 664 else
666 AC_MSG_WARN([zlib version may have security problems]) 665 AC_MSG_WARN([zlib version may have security problems])
667 fi 666 fi
668 ] 667 ],
668 [ AC_MSG_WARN([cross compiling: not checking zlib version]) ]
669) 669)
670 670
671dnl UnixWare 2.x 671dnl UnixWare 2.x
@@ -719,16 +719,20 @@ AC_EGREP_CPP(FOUNDIT,
719) 719)
720 720
721AC_MSG_CHECKING([whether struct dirent allocates space for d_name]) 721AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
722AC_TRY_RUN( 722AC_RUN_IFELSE(
723 [ 723 [AC_LANG_SOURCE([[
724#include <sys/types.h> 724#include <sys/types.h>
725#include <dirent.h> 725#include <dirent.h>
726int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} 726int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
727 ], 727 ]])],
728 [AC_MSG_RESULT(yes)], 728 [AC_MSG_RESULT(yes)],
729 [ 729 [
730 AC_MSG_RESULT(no) 730 AC_MSG_RESULT(no)
731 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) 731 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
732 ],
733 [
734 AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
735 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
732 ] 736 ]
733) 737)
734 738
@@ -743,8 +747,7 @@ fi
743# Check whether user wants S/Key support 747# Check whether user wants S/Key support
744SKEY_MSG="no" 748SKEY_MSG="no"
745AC_ARG_WITH(skey, 749AC_ARG_WITH(skey,
746 [ --with-skey[[=PATH]] Enable S/Key support 750 [ --with-skey[[=PATH]] Enable S/Key support (optionally in PATH)],
747 (optionally in PATH)],
748 [ 751 [
749 if test "x$withval" != "xno" ; then 752 if test "x$withval" != "xno" ; then
750 753
@@ -785,8 +788,7 @@ int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
785# Check whether user wants TCP wrappers support 788# Check whether user wants TCP wrappers support
786TCPW_MSG="no" 789TCPW_MSG="no"
787AC_ARG_WITH(tcp-wrappers, 790AC_ARG_WITH(tcp-wrappers,
788 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support 791 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support (optionally in PATH)],
789 (optionally in PATH)],
790 [ 792 [
791 if test "x$withval" != "xno" ; then 793 if test "x$withval" != "xno" ; then
792 saved_LIBS="$LIBS" 794 saved_LIBS="$LIBS"
@@ -839,12 +841,59 @@ AC_ARG_WITH(tcp-wrappers,
839 ] 841 ]
840) 842)
841 843
844# Check whether user wants libedit support
845LIBEDIT_MSG="no"
846AC_ARG_WITH(libedit,
847 [ --with-libedit[[=PATH]] Enable libedit support for sftp],
848 [ if test "x$withval" != "xno" ; then
849 AC_CHECK_LIB(edit, el_init,
850 [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp])
851 LIBEDIT="-ledit -lcurses"
852 LIBEDIT_MSG="yes"
853 AC_SUBST(LIBEDIT)
854 ],
855 [], [-lcurses]
856 )
857 fi ]
858)
859
860AUDIT_MODULE=none
861AC_ARG_WITH(audit,
862 [ --with-audit=module Enable EXPERIMENTAL audit support (modules=debug,bsm)],
863 [
864 AC_MSG_CHECKING(for supported audit module)
865 case "$withval" in
866 bsm)
867 AC_MSG_RESULT(bsm)
868 AUDIT_MODULE=bsm
869 dnl Checks for headers, libs and functions
870 AC_CHECK_HEADERS(bsm/audit.h, [],
871 [AC_MSG_ERROR(BSM enabled and bsm/audit.h not found)])
872 AC_CHECK_LIB(bsm, getaudit, [],
873 [AC_MSG_ERROR(BSM enabled and required library not found)])
874 AC_CHECK_FUNCS(getaudit, [],
875 [AC_MSG_ERROR(BSM enabled and required function not found)])
876 # These are optional
877 AC_CHECK_FUNCS(getaudit_addr)
878 AC_DEFINE(USE_BSM_AUDIT, [], [Use BSM audit module])
879 ;;
880 debug)
881 AUDIT_MODULE=debug
882 AC_MSG_RESULT(debug)
883 AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module)
884 ;;
885 *)
886 AC_MSG_ERROR([Unknown audit module $withval])
887 ;;
888 esac ]
889)
890
842dnl Checks for library functions. Please keep in alphabetical order 891dnl Checks for library functions. Please keep in alphabetical order
843AC_CHECK_FUNCS(\ 892AC_CHECK_FUNCS(\
844 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \ 893 arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \
845 bindresvport_sa clock closefrom dirfd fchmod fchown freeaddrinfo \ 894 bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \
846 futimes getaddrinfo getcwd getgrouplist getnameinfo getopt \ 895 freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \
847 getpeereid _getpty getrlimit getttyent glob inet_aton \ 896 getopt getpeereid _getpty getrlimit getttyent glob inet_aton \
848 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ 897 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
849 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \ 898 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
850 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \ 899 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
@@ -888,28 +937,32 @@ AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
888AC_CHECK_FUNCS(setresuid, [ 937AC_CHECK_FUNCS(setresuid, [
889 dnl Some platorms have setresuid that isn't implemented, test for this 938 dnl Some platorms have setresuid that isn't implemented, test for this
890 AC_MSG_CHECKING(if setresuid seems to work) 939 AC_MSG_CHECKING(if setresuid seems to work)
891 AC_TRY_RUN([ 940 AC_RUN_IFELSE(
941 [AC_LANG_SOURCE([[
892#include <stdlib.h> 942#include <stdlib.h>
893#include <errno.h> 943#include <errno.h>
894int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} 944int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
895 ], 945 ]])],
896 [AC_MSG_RESULT(yes)], 946 [AC_MSG_RESULT(yes)],
897 [AC_DEFINE(BROKEN_SETRESUID) 947 [AC_DEFINE(BROKEN_SETRESUID)
898 AC_MSG_RESULT(not implemented)] 948 AC_MSG_RESULT(not implemented)],
949 [AC_MSG_WARN([cross compiling: not checking setresuid])]
899 ) 950 )
900]) 951])
901 952
902AC_CHECK_FUNCS(setresgid, [ 953AC_CHECK_FUNCS(setresgid, [
903 dnl Some platorms have setresgid that isn't implemented, test for this 954 dnl Some platorms have setresgid that isn't implemented, test for this
904 AC_MSG_CHECKING(if setresgid seems to work) 955 AC_MSG_CHECKING(if setresgid seems to work)
905 AC_TRY_RUN([ 956 AC_RUN_IFELSE(
957 [AC_LANG_SOURCE([[
906#include <stdlib.h> 958#include <stdlib.h>
907#include <errno.h> 959#include <errno.h>
908int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);} 960int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
909 ], 961 ]])],
910 [AC_MSG_RESULT(yes)], 962 [AC_MSG_RESULT(yes)],
911 [AC_DEFINE(BROKEN_SETRESGID) 963 [AC_DEFINE(BROKEN_SETRESGID)
912 AC_MSG_RESULT(not implemented)] 964 AC_MSG_RESULT(not implemented)],
965 [AC_MSG_WARN([cross compiling: not checking setresuid])]
913 ) 966 )
914]) 967])
915 968
@@ -935,17 +988,18 @@ AC_CHECK_FUNC(getpagesize,
935# Check for broken snprintf 988# Check for broken snprintf
936if test "x$ac_cv_func_snprintf" = "xyes" ; then 989if test "x$ac_cv_func_snprintf" = "xyes" ; then
937 AC_MSG_CHECKING([whether snprintf correctly terminates long strings]) 990 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
938 AC_TRY_RUN( 991 AC_RUN_IFELSE(
939 [ 992 [AC_LANG_SOURCE([[
940#include <stdio.h> 993#include <stdio.h>
941int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} 994int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
942 ], 995 ]])],
943 [AC_MSG_RESULT(yes)], 996 [AC_MSG_RESULT(yes)],
944 [ 997 [
945 AC_MSG_RESULT(no) 998 AC_MSG_RESULT(no)
946 AC_DEFINE(BROKEN_SNPRINTF) 999 AC_DEFINE(BROKEN_SNPRINTF)
947 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor]) 1000 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
948 ] 1001 ],
1002 [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
949 ) 1003 )
950fi 1004fi
951 1005
@@ -1104,6 +1158,82 @@ main(void)
1104 ) 1158 )
1105fi 1159fi
1106 1160
1161if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then
1162 AC_MSG_CHECKING(if getaddrinfo seems to work)
1163 AC_TRY_RUN(
1164 [
1165#include <stdio.h>
1166#include <sys/socket.h>
1167#include <netdb.h>
1168#include <errno.h>
1169#include <netinet/in.h>
1170
1171#define TEST_PORT "2222"
1172
1173int
1174main(void)
1175{
1176 int err, sock;
1177 struct addrinfo *gai_ai, *ai, hints;
1178 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1179
1180 memset(&hints, 0, sizeof(hints));
1181 hints.ai_family = PF_UNSPEC;
1182 hints.ai_socktype = SOCK_STREAM;
1183 hints.ai_flags = AI_PASSIVE;
1184
1185 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1186 if (err != 0) {
1187 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1188 exit(1);
1189 }
1190
1191 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1192 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
1193 continue;
1194
1195 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1196 sizeof(ntop), strport, sizeof(strport),
1197 NI_NUMERICHOST|NI_NUMERICSERV);
1198
1199 if (ai->ai_family == AF_INET && err != 0) {
1200 perror("getnameinfo");
1201 exit(2);
1202 }
1203 }
1204 exit(0);
1205}
1206 ],
1207 [
1208 AC_MSG_RESULT(yes)
1209 AC_DEFINE(AIX_GETNAMEINFO_HACK, [],
1210[Define if you have a getaddrinfo that fails for the all-zeros IPv6 address])
1211 ],
1212 [
1213 AC_MSG_RESULT(no)
1214 AC_DEFINE(BROKEN_GETADDRINFO)
1215 ]
1216 )
1217fi
1218
1219if test "x$check_for_conflicting_getspnam" = "x1"; then
1220 AC_MSG_CHECKING(for conflicting getspnam in shadow.h)
1221 AC_COMPILE_IFELSE(
1222 [
1223#include <shadow.h>
1224int main(void) {exit(0);}
1225 ],
1226 [
1227 AC_MSG_RESULT(no)
1228 ],
1229 [
1230 AC_MSG_RESULT(yes)
1231 AC_DEFINE(GETSPNAM_CONFLICTING_DEFS, 1,
1232 [Conflicting defs for getspnam])
1233 ]
1234 )
1235fi
1236
1107AC_FUNC_GETPGRP 1237AC_FUNC_GETPGRP
1108 1238
1109# Check for PAM libs 1239# Check for PAM libs
@@ -1165,6 +1295,10 @@ AC_ARG_WITH(ssl-dir,
1165 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], 1295 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1166 [ 1296 [
1167 if test "x$withval" != "xno" ; then 1297 if test "x$withval" != "xno" ; then
1298 case "$withval" in
1299 # Relative paths
1300 ./*|../*) withval="`pwd`/$withval"
1301 esac
1168 if test -d "$withval/lib"; then 1302 if test -d "$withval/lib"; then
1169 if test -n "${need_dash_r}"; then 1303 if test -n "${need_dash_r}"; then
1170 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" 1304 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
@@ -1206,8 +1340,8 @@ AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1206 1340
1207# Determine OpenSSL header version 1341# Determine OpenSSL header version
1208AC_MSG_CHECKING([OpenSSL header version]) 1342AC_MSG_CHECKING([OpenSSL header version])
1209AC_TRY_RUN( 1343AC_RUN_IFELSE(
1210 [ 1344 [AC_LANG_SOURCE([[
1211#include <stdio.h> 1345#include <stdio.h>
1212#include <string.h> 1346#include <string.h>
1213#include <openssl/opensslv.h> 1347#include <openssl/opensslv.h>
@@ -1225,7 +1359,7 @@ int main(void) {
1225 1359
1226 exit(0); 1360 exit(0);
1227} 1361}
1228 ], 1362 ]])],
1229 [ 1363 [
1230 ssl_header_ver=`cat conftest.sslincver` 1364 ssl_header_ver=`cat conftest.sslincver`
1231 AC_MSG_RESULT($ssl_header_ver) 1365 AC_MSG_RESULT($ssl_header_ver)
@@ -1233,13 +1367,16 @@ int main(void) {
1233 [ 1367 [
1234 AC_MSG_RESULT(not found) 1368 AC_MSG_RESULT(not found)
1235 AC_MSG_ERROR(OpenSSL version header not found.) 1369 AC_MSG_ERROR(OpenSSL version header not found.)
1370 ],
1371 [
1372 AC_MSG_WARN([cross compiling: not checking])
1236 ] 1373 ]
1237) 1374)
1238 1375
1239# Determine OpenSSL library version 1376# Determine OpenSSL library version
1240AC_MSG_CHECKING([OpenSSL library version]) 1377AC_MSG_CHECKING([OpenSSL library version])
1241AC_TRY_RUN( 1378AC_RUN_IFELSE(
1242 [ 1379 [AC_LANG_SOURCE([[
1243#include <stdio.h> 1380#include <stdio.h>
1244#include <string.h> 1381#include <string.h>
1245#include <openssl/opensslv.h> 1382#include <openssl/opensslv.h>
@@ -1258,7 +1395,7 @@ int main(void) {
1258 1395
1259 exit(0); 1396 exit(0);
1260} 1397}
1261 ], 1398 ]])],
1262 [ 1399 [
1263 ssl_library_ver=`cat conftest.ssllibver` 1400 ssl_library_ver=`cat conftest.ssllibver`
1264 AC_MSG_RESULT($ssl_library_ver) 1401 AC_MSG_RESULT($ssl_library_ver)
@@ -1266,17 +1403,20 @@ int main(void) {
1266 [ 1403 [
1267 AC_MSG_RESULT(not found) 1404 AC_MSG_RESULT(not found)
1268 AC_MSG_ERROR(OpenSSL library not found.) 1405 AC_MSG_ERROR(OpenSSL library not found.)
1406 ],
1407 [
1408 AC_MSG_WARN([cross compiling: not checking])
1269 ] 1409 ]
1270) 1410)
1271 1411
1272# Sanity check OpenSSL headers 1412# Sanity check OpenSSL headers
1273AC_MSG_CHECKING([whether OpenSSL's headers match the library]) 1413AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1274AC_TRY_RUN( 1414AC_RUN_IFELSE(
1275 [ 1415 [AC_LANG_SOURCE([[
1276#include <string.h> 1416#include <string.h>
1277#include <openssl/opensslv.h> 1417#include <openssl/opensslv.h>
1278int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } 1418int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1279 ], 1419 ]])],
1280 [ 1420 [
1281 AC_MSG_RESULT(yes) 1421 AC_MSG_RESULT(yes)
1282 ], 1422 ],
@@ -1285,6 +1425,9 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1285 AC_MSG_ERROR([Your OpenSSL headers do not match your library. 1425 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1286Check config.log for details. 1426Check config.log for details.
1287Also see contrib/findssl.sh for help identifying header/library mismatches.]) 1427Also see contrib/findssl.sh for help identifying header/library mismatches.])
1428 ],
1429 [
1430 AC_MSG_WARN([cross compiling: not checking])
1288 ] 1431 ]
1289) 1432)
1290 1433
@@ -1305,12 +1448,12 @@ fi
1305 1448
1306# Check wheter OpenSSL seeds itself 1449# Check wheter OpenSSL seeds itself
1307AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded]) 1450AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1308AC_TRY_RUN( 1451AC_RUN_IFELSE(
1309 [ 1452 [AC_LANG_SOURCE([[
1310#include <string.h> 1453#include <string.h>
1311#include <openssl/rand.h> 1454#include <openssl/rand.h>
1312int main(void) { exit(RAND_status() == 1 ? 0 : 1); } 1455int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1313 ], 1456 ]])],
1314 [ 1457 [
1315 OPENSSL_SEEDS_ITSELF=yes 1458 OPENSSL_SEEDS_ITSELF=yes
1316 AC_MSG_RESULT(yes) 1459 AC_MSG_RESULT(yes)
@@ -1320,6 +1463,12 @@ int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1320 # Default to use of the rand helper if OpenSSL doesn't 1463 # Default to use of the rand helper if OpenSSL doesn't
1321 # seed itself 1464 # seed itself
1322 USE_RAND_HELPER=yes 1465 USE_RAND_HELPER=yes
1466 ],
1467 [
1468 AC_MSG_WARN([cross compiling: assuming yes])
1469 # This is safe, since all recent OpenSSL versions will
1470 # complain at runtime if not seeded correctly.
1471 OPENSSL_SEEDS_ITSELF=yes
1323 ] 1472 ]
1324) 1473)
1325 1474
@@ -1704,6 +1853,10 @@ TYPE_SOCKLEN_T
1704 1853
1705AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>]) 1854AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1706 1855
1856AC_CHECK_TYPES(in_addr_t,,,
1857[#include <sys/types.h>
1858#include <netinet/in.h>])
1859
1707AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [ 1860AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1708 AC_TRY_COMPILE( 1861 AC_TRY_COMPILE(
1709 [ 1862 [
@@ -1886,8 +2039,8 @@ if test "x$ac_cv_have_int64_t" = "xno" -a \
1886 exit 1; 2039 exit 1;
1887else 2040else
1888dnl test snprintf (broken on SCO w/gcc) 2041dnl test snprintf (broken on SCO w/gcc)
1889 AC_TRY_RUN( 2042 AC_RUN_IFELSE(
1890 [ 2043 [AC_LANG_SOURCE([[
1891#include <stdio.h> 2044#include <stdio.h>
1892#include <string.h> 2045#include <string.h>
1893#ifdef HAVE_SNPRINTF 2046#ifdef HAVE_SNPRINTF
@@ -1910,7 +2063,8 @@ main()
1910#else 2063#else
1911main() { exit(0); } 2064main() { exit(0); }
1912#endif 2065#endif
1913 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ] 2066 ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
2067 AC_MSG_WARN([cross compiling: Assuming working snprintf()])
1914 ) 2068 )
1915fi 2069fi
1916 2070
@@ -2015,13 +2169,14 @@ fi
2015dnl make sure we're using the real structure members and not defines 2169dnl make sure we're using the real structure members and not defines
2016AC_CACHE_CHECK([for msg_accrights field in struct msghdr], 2170AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
2017 ac_cv_have_accrights_in_msghdr, [ 2171 ac_cv_have_accrights_in_msghdr, [
2018 AC_TRY_RUN( 2172 AC_COMPILE_IFELSE(
2019 [ 2173 [
2020#include <sys/types.h> 2174#include <sys/types.h>
2021#include <sys/socket.h> 2175#include <sys/socket.h>
2022#include <sys/uio.h> 2176#include <sys/uio.h>
2023int main() { 2177int main() {
2024#ifdef msg_accrights 2178#ifdef msg_accrights
2179#error "msg_accrights is a macro"
2025exit(1); 2180exit(1);
2026#endif 2181#endif
2027struct msghdr m; 2182struct msghdr m;
@@ -2039,13 +2194,14 @@ fi
2039 2194
2040AC_CACHE_CHECK([for msg_control field in struct msghdr], 2195AC_CACHE_CHECK([for msg_control field in struct msghdr],
2041 ac_cv_have_control_in_msghdr, [ 2196 ac_cv_have_control_in_msghdr, [
2042 AC_TRY_RUN( 2197 AC_COMPILE_IFELSE(
2043 [ 2198 [
2044#include <sys/types.h> 2199#include <sys/types.h>
2045#include <sys/socket.h> 2200#include <sys/socket.h>
2046#include <sys/uio.h> 2201#include <sys/uio.h>
2047int main() { 2202int main() {
2048#ifdef msg_control 2203#ifdef msg_control
2204#error "msg_control is a macro"
2049exit(1); 2205exit(1);
2050#endif 2206#endif
2051struct msghdr m; 2207struct msghdr m;
@@ -2379,6 +2535,10 @@ if test ! -z "$MAIL" ; then
2379 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") 2535 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2380fi 2536fi
2381 2537
2538if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
2539 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])
2540 disable_ptmx_check=yes
2541fi
2382if test -z "$no_dev_ptmx" ; then 2542if test -z "$no_dev_ptmx" ; then
2383 if test "x$disable_ptmx_check" != "xyes" ; then 2543 if test "x$disable_ptmx_check" != "xyes" ; then
2384 AC_CHECK_FILE("/dev/ptmx", 2544 AC_CHECK_FILE("/dev/ptmx",
@@ -2389,12 +2549,17 @@ if test -z "$no_dev_ptmx" ; then
2389 ) 2549 )
2390 fi 2550 fi
2391fi 2551fi
2392AC_CHECK_FILE("/dev/ptc", 2552
2393 [ 2553if test ! -z "$cross_compiling" && test "x$cross_compiling" != "xyes"; then
2394 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) 2554 AC_CHECK_FILE("/dev/ptc",
2395 have_dev_ptc=1 2555 [
2396 ] 2556 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2397) 2557 have_dev_ptc=1
2558 ]
2559 )
2560else
2561 AC_MSG_WARN([cross compiling: Disabling /dev/ptc test])
2562fi
2398 2563
2399# Options from here on. Some of these are preset by platform above 2564# Options from here on. Some of these are preset by platform above
2400AC_ARG_WITH(mantype, 2565AC_ARG_WITH(mantype,
@@ -2490,14 +2655,26 @@ fi
2490 2655
2491# check for /etc/default/login and use it if present. 2656# check for /etc/default/login and use it if present.
2492AC_ARG_ENABLE(etc-default-login, 2657AC_ARG_ENABLE(etc-default-login,
2493 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],, 2658 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],
2494[ 2659 [ if test "x$enableval" = "xno"; then
2495AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ]) 2660 AC_MSG_NOTICE([/etc/default/login handling disabled])
2661 etc_default_login=no
2662 else
2663 etc_default_login=yes
2664 fi ],
2665 [ etc_default_login=yes ]
2666)
2496 2667
2497if test "x$external_path_file" = "x/etc/default/login"; then 2668if test "x$etc_default_login" != "xno"; then
2498 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN) 2669 AC_CHECK_FILE("/etc/default/login",
2670 [ external_path_file=/etc/default/login ])
2671 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
2672 then
2673 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
2674 elif test "x$external_path_file" = "x/etc/default/login"; then
2675 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2676 fi
2499fi 2677fi
2500])
2501 2678
2502dnl BSD systems use /etc/login.conf so --with-default-path= has no effect 2679dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2503if test $ac_cv_func_login_getcapbool = "yes" -a \ 2680if test $ac_cv_func_login_getcapbool = "yes" -a \
@@ -2931,7 +3108,8 @@ if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2931fi 3108fi
2932 3109
2933AC_EXEEXT 3110AC_EXEEXT
2934AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile scard/Makefile ssh_prng_cmds]) 3111AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3112 scard/Makefile ssh_prng_cmds survey.sh])
2935AC_OUTPUT 3113AC_OUTPUT
2936 3114
2937# Print summary of options 3115# Print summary of options
@@ -2977,6 +3155,7 @@ echo " Smartcard support: $SCARD_MSG"
2977echo " S/KEY support: $SKEY_MSG" 3155echo " S/KEY support: $SKEY_MSG"
2978echo " TCP Wrappers support: $TCPW_MSG" 3156echo " TCP Wrappers support: $TCPW_MSG"
2979echo " MD5 password support: $MD5_MSG" 3157echo " MD5 password support: $MD5_MSG"
3158echo " libedit support: $LIBEDIT_MSG"
2980echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 3159echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2981echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 3160echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2982echo " BSD Auth support: $BSD_AUTH_MSG" 3161echo " BSD Auth support: $BSD_AUTH_MSG"
@@ -2997,7 +3176,8 @@ echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2997echo "" 3176echo ""
2998 3177
2999if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then 3178if test "x$MAKE_PACKAGE_SUPPORTED" = "xyes" ; then
3000 echo "SVR4 style packages are supported with \"make package\"\n" 3179 echo "SVR4 style packages are supported with \"make package\""
3180 echo ""
3001fi 3181fi
3002 3182
3003if test "x$PAM_MSG" = "xyes" ; then 3183if test "x$PAM_MSG" = "xyes" ; then
@@ -3026,3 +3206,7 @@ if test ! -z "$NO_PEERCHECK" ; then
3026 echo "" 3206 echo ""
3027fi 3207fi
3028 3208
3209if test "$AUDIT_MODULE" = "bsm" ; then
3210 echo "WARNING: BSM audit support is currently considered EXPERIMENTAL."
3211 echo "See the Solaris section in README.platform for details."
3212fi