3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
6 --- openssh-3.8p1/configure.ac~configure 2004-02-24 00:47:04.000000000 -0500
7 +++ openssh-3.8p1/configure.ac 2004-03-17 16:17:16.000000000 -0500
12 -if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
13 +if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
14 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
18 # Check for some target-specific stuff
21 - AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
22 + AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
23 if (test -z "$blibpath"); then
24 blibpath="/usr/lib:/lib"
27 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
28 if (test -z "$blibflags"); then
29 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
30 - AC_TRY_LINK([], [], [blibflags=$tryflags])
31 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[blibflags=$tryflags],[])
34 if (test -z "$blibflags"); then
36 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
37 AC_CHECK_DECL(loginfailed,
38 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
40 - [#include <usersec.h>],
41 - [(void)loginfailed("user","host","tty",0);],
43 - AC_DEFINE(AIX_LOGINFAILED_4ARG)],
46 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <usersec.h>]], [[(void)loginfailed("user","host","tty",0);]])],[AC_MSG_RESULT(yes)
47 + AC_DEFINE(AIX_LOGINFAILED_4ARG)],[AC_MSG_RESULT(no)
50 [#include <usersec.h>]
55 AC_MSG_CHECKING(if we have working getaddrinfo)
56 - AC_TRY_RUN([#include <mach-o/dyld.h>
57 + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mach-o/dyld.h>
58 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
62 -}], [AC_MSG_RESULT(working)],
63 - [AC_MSG_RESULT(buggy)
64 - AC_DEFINE(BROKEN_GETADDRINFO)],
65 - [AC_MSG_RESULT(assume it is working)])
66 +}]])],[AC_MSG_RESULT(working)],[AC_MSG_RESULT(buggy)
67 + AC_DEFINE(BROKEN_GETADDRINFO)],[AC_MSG_RESULT(assume it is working)])
68 AC_DEFINE(SETEUID_BREAKS_SETUID)
69 AC_DEFINE(BROKEN_SETREUID)
70 AC_DEFINE(BROKEN_SETREGID)
73 check_for_libcrypt_before=1
74 if test "x$withval" != "xno" ; then
83 AC_MSG_CHECKING(compiler and flags for sanity)
85 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
89 - [ AC_MSG_RESULT(yes) ],
91 + ]])],[ AC_MSG_RESULT(yes) ],[
93 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
96 + ],[ AC_MSG_RESULT(yes)
99 # Checks for header files.
100 AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
102 ac_cv_have_broken_dirname, [
107 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
116 - [ ac_cv_have_broken_dirname="no" ],
117 - [ ac_cv_have_broken_dirname="yes" ]
119 + ]])],[ ac_cv_have_broken_dirname="no" ],[ ac_cv_have_broken_dirname="yes"
123 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
124 @@ -607,39 +596,36 @@
127 AC_MSG_CHECKING(for zlib 1.1.4 or greater)
133 - if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
135 - v = a*1000000 + b*1000 + c;
141 - AC_MSG_RESULT(yes),
142 - [ AC_MSG_RESULT(no)
143 - if test -z "$zlib_check_nonfatal" ; then
144 +if test "x$zlib_check_nonfatal" = "x1"; then
145 + AC_MSG_WARN([skipping zlib version check])
147 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
152 + if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
154 + v = a*1000000 + b*1000 + c;
159 + ]])],[AC_MSG_RESULT(yes)],[ AC_MSG_RESULT(no)
160 AC_MSG_ERROR([*** zlib too old - check config.log ***
161 -Your reported zlib version has known security problems. It's possible your
162 -vendor has fixed these problems without changing the version number. If you
163 -are sure this is the case, you can disable the check by running
164 -"./configure --without-zlib-version-check".
165 -If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
167 - AC_MSG_WARN([zlib version may have security problems])
171 + Your reported zlib version has known security problems. It's possible your
172 + vendor has fixed these problems without changing the version number. If you
173 + are sure this is the case, you can disable the check by running
174 + "./configure --without-zlib-version-check".
175 + If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
180 -AC_CHECK_FUNC(strcasecmp,
181 +AC_CHECK_FUNC(strcasecmp,
182 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
184 -AC_CHECK_FUNC(utimes,
185 +AC_CHECK_FUNC(utimes,
186 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
187 LIBS="$LIBS -lc89"]) ]
190 #ifdef GLOB_ALTDIRFUNC
196 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
198 @@ -672,38 +658,37 @@
199 # Check for g.gl_matchc glob() extension
200 AC_MSG_CHECKING(for gl_matchc field in glob_t)
201 AC_EGREP_CPP(FOUNDIT,
206 int main(void){glob_t g; g.gl_matchc = 1;}
209 - AC_DEFINE(GLOB_HAS_GL_MATCHC)
217 + AC_DEFINE(GLOB_HAS_GL_MATCHC)
225 -AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
228 -#include <sys/types.h>
230 -int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
232 - [AC_MSG_RESULT(yes)],
235 - AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
238 +AC_CACHE_CHECK([whether struct dirent allocates space for d_name], ac_cv_have_space_d_name_in_struct_dirent, [
239 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
240 + #include <sys/types.h>
241 + #include <dirent.h>
242 + int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
243 + ]])],[ac_cv_have_space_d_name_in_struct_dirent="yes"],[ac_cv_have_space_d_name_in_struct_dirent="no"
247 +if test "x$ac_cv_dirent_have_space_d_name" = "xyes" ; then
248 + AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
251 # Check whether user wants S/Key support
255 [ --with-skey[[=PATH]] Enable S/Key support
256 - (optionally in PATH)],
257 + (optionally in PATH)],
259 if test "x$withval" != "xno" ; then
261 @@ -714,20 +699,17 @@
268 AC_MSG_CHECKING([for s/key support])
271 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
274 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
276 - [AC_MSG_RESULT(yes)],
278 + ]])],[AC_MSG_RESULT(yes)],[
280 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
288 AC_ARG_WITH(tcp-wrappers,
289 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
290 - (optionally in PATH)],
291 + (optionally in PATH)],
293 if test "x$withval" != "xno" ; then
295 @@ -765,22 +747,18 @@
297 LIBS="$LIBWRAP $LIBS"
298 AC_MSG_CHECKING(for libwrap)
301 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
303 int deny_severity = 0, allow_severity = 0;
305 - [hosts_access(0);],
307 + ]], [[hosts_access(0);]])],[
315 AC_MSG_ERROR([*** libwrap missing])
323 @@ -805,17 +783,17 @@
324 # IRIX has a const char return value for gai_strerror()
325 AC_CHECK_FUNCS(gai_strerror,[
326 AC_DEFINE(HAVE_GAI_STRERROR)
328 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
329 #include <sys/types.h>
330 #include <sys/socket.h>
333 -const char *gai_strerror(int);],[
334 +const char *gai_strerror(int);]], [[
337 -str = gai_strerror(0);],[
338 +str = gai_strerror(0);]])],[
339 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
340 - [Define if gai_strerror() returns const char *])])])
341 + [Define if gai_strerror() returns const char *])],[])])
343 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
345 @@ -826,36 +804,32 @@
346 dnl tcsendbreak might be a macro
347 AC_CHECK_DECL(tcsendbreak,
348 [AC_DEFINE(HAVE_TCSENDBREAK)],
349 - [AC_CHECK_FUNCS(tcsendbreak)],
350 + [AC_CHECK_FUNCS(tcsendbreak)],
351 [#include <termios.h>]
354 AC_CHECK_FUNCS(setresuid, [
355 dnl Some platorms have setresuid that isn't implemented, test for this
356 AC_MSG_CHECKING(if setresuid seems to work)
358 + AC_LINK_IFELSE([AC_LANG_SOURCE([[
361 int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
363 - [AC_MSG_RESULT(yes)],
364 - [AC_DEFINE(BROKEN_SETRESUID)
365 - AC_MSG_RESULT(not implemented)]
367 + ]])],[AC_MSG_RESULT(yes)],[AC_DEFINE(BROKEN_SETRESUID)
368 + AC_MSG_RESULT(not implemented)
372 AC_CHECK_FUNCS(setresgid, [
373 dnl Some platorms have setresgid that isn't implemented, test for this
374 AC_MSG_CHECKING(if setresgid seems to work)
376 + AC_LINK_IFELSE([AC_LANG_SOURCE([[
379 int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
381 - [AC_MSG_RESULT(yes)],
382 - [AC_DEFINE(BROKEN_SETRESGID)
383 - AC_MSG_RESULT(not implemented)]
385 + ]])],[AC_MSG_RESULT(yes)],[AC_DEFINE(BROKEN_SETRESGID)
386 + AC_MSG_RESULT(not implemented)
390 dnl Checks for time functions
391 @@ -867,64 +841,59 @@
392 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
393 AC_CHECK_FUNCS(setutxent utmpxname)
395 -AC_CHECK_FUNC(daemon,
396 +AC_CHECK_FUNC(daemon,
397 [AC_DEFINE(HAVE_DAEMON)],
398 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
401 -AC_CHECK_FUNC(getpagesize,
402 +AC_CHECK_FUNC(getpagesize,
403 [AC_DEFINE(HAVE_GETPAGESIZE)],
404 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
407 # Check for broken snprintf
408 if test "x$ac_cv_func_snprintf" = "xyes" ; then
409 - AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
412 +AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
413 + ac_cv_have_broken_snprintf, [
414 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
416 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
418 - [AC_MSG_RESULT(yes)],
421 - AC_DEFINE(BROKEN_SNPRINTF)
422 - AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
425 + ]])],[ ac_cv_have_broken_snprintf="no" ],[ ac_cv_have_broken_snprintf="yes"
428 +if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
429 + AC_DEFINE(BROKEN_SNPRINTF)
430 + AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
434 dnl see whether mkstemp() requires XXXXXX
435 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
436 AC_MSG_CHECKING([for (overly) strict mkstemp])
439 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
441 main() { char template[]="conftest.mkstemp-test";
442 if (mkstemp(template) == -1)
444 unlink(template); exit(0);
454 AC_DEFINE(HAVE_STRICT_MKSTEMP)
459 AC_DEFINE(HAVE_STRICT_MKSTEMP)
466 dnl make sure that openpty does not reacquire controlling terminal
467 if test ! -z "$check_for_openpty_ctty_bug"; then
468 - AC_MSG_CHECKING(if openpty correctly handles controlling tty)
471 +AC_CACHE_CHECK([if openpty acquires controlling terminal],
472 + ac_cv_have_openpty_ctty_bug, [
473 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
475 #include <sys/fcntl.h>
476 #include <sys/types.h>
479 } else if (pid > 0) { /* parent */
480 waitpid(pid, &status, 0);
481 - if (WIFEXITED(status))
482 + if (WIFEXITED(status))
483 exit(WEXITSTATUS(status));
486 @@ -956,15 +925,12 @@
487 exit(0); /* Did not acquire ctty: OK */
496 - AC_DEFINE(SSHD_ACQUIRES_CTTY)
499 + ]])],[ ac_cv_have_openpty_ctty_bug="no" ],[ ac_cv_have_openpty_ctty_bug="yes"
502 +if test "x$ac_cv_have_openpty_ctty_bug" = "xyes" ; then
503 + AC_DEFINE(SSHD_ACQUIRES_CTTY)
508 @@ -1002,23 +968,19 @@
509 if test "x$PAM_MSG" = "xyes" ; then
510 # Check PAM strerror arguments (old PAM)
511 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
514 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
516 #if defined(HAVE_SECURITY_PAM_APPL_H)
517 #include <security/pam_appl.h>
518 #elif defined (HAVE_PAM_PAM_APPL_H)
519 #include <pam/pam_appl.h>
522 - [(void)pam_strerror((pam_handle_t *)NULL, -1);],
523 - [AC_MSG_RESULT(no)],
525 + ]], [[(void)pam_strerror((pam_handle_t *)NULL, -1);]])],[AC_MSG_RESULT(no)],[
526 AC_DEFINE(HAVE_OLD_PAM)
528 PAM_MSG="yes (old library)"
536 @@ -1069,87 +1031,87 @@
538 # Determine OpenSSL header version
539 AC_MSG_CHECKING([OpenSSL header version])
542 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
545 #include <openssl/opensslv.h>
546 #define DATA "conftest.sslincver"
553 - fd = fopen(DATA,"w");
556 + fd = fopen(DATA,"w");
560 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
568 ssl_header_ver=`cat conftest.sslincver`
569 AC_MSG_RESULT($ssl_header_ver)
573 AC_MSG_RESULT(not found)
574 AC_MSG_ERROR(OpenSSL version header not found.)
578 + AC_MSG_RESULT(unknown)
579 + AC_MSG_WARN(Skipping OpenSSL header version check due to crosscompilation.)
583 # Determine OpenSSL library version
584 AC_MSG_CHECKING([OpenSSL library version])
587 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
590 #include <openssl/opensslv.h>
591 #include <openssl/crypto.h>
592 #define DATA "conftest.ssllibver"
599 - fd = fopen(DATA,"w");
602 + fd = fopen(DATA,"w");
606 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
614 ssl_library_ver=`cat conftest.ssllibver`
615 AC_MSG_RESULT($ssl_library_ver)
619 AC_MSG_RESULT(not found)
620 AC_MSG_ERROR(OpenSSL library not found.)
624 + AC_MSG_RESULT(unknown)
625 + AC_MSG_WARN(Skipping OpenSSL library version check due to crosscompilation.)
629 # Sanity check OpenSSL headers
630 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
633 +AC_RUN_IFELSE([AC_LANG_SOURCE([[
635 #include <openssl/opensslv.h>
636 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
645 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
646 Check config.log for details.
647 Also see contrib/findssl.sh for help identifying header/library mismatches.])
651 + AC_MSG_RESULT(unknown)
652 + AC_MSG_WARN(Skipping OpenSSL version comparison due to crosscompilation.)
656 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
657 # because the system crypt() is more featureful.
658 @@ -1157,42 +1119,20 @@
659 AC_CHECK_LIB(crypt, crypt)
662 -# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
663 +# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
664 # version in OpenSSL.
665 if test "x$check_for_libcrypt_later" = "x1"; then
666 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
670 ### Configure cryptographic random number support
672 -# Check wheter OpenSSL seeds itself
673 -AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
677 -#include <openssl/rand.h>
678 -int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
681 - OPENSSL_SEEDS_ITSELF=yes
686 - # Default to use of the rand helper if OpenSSL doesn't
688 - USE_RAND_HELPER=yes
693 # Do we want to force the use of the rand helper?
694 AC_ARG_WITH(rand-helper,
695 [ --with-rand-helper Use subprocess to gather strong randomness ],
697 if test "x$withval" = "xno" ; then
698 - # Force use of OpenSSL's internal RNG, even if
699 + # Force use of OpenSSL's internal RNG, even if
700 # the previous test showed it to be unseeded.
701 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
702 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
703 @@ -1203,6 +1143,24 @@
707 + # Check whether OpenSSL seeds itself
709 + AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
710 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
711 + #include <string.h>
712 + #include <openssl/rand.h>
713 + int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
715 + OPENSSL_SEEDS_ITSELF=yes
719 + # Default to use of the rand helper if OpenSSL doesn't
721 + USE_RAND_HELPER=yes
727 # Which randomness source do we use?
728 @@ -1329,7 +1287,7 @@
729 test -d /usr/sbin && PATH=$PATH:/usr/sbin
730 PATH=$PATH:/etc:$OPATH
732 -# These programs are used by the command hashing source to gather entropy
733 +# These programs are used by the command hashing source to gather entropy
734 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
735 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
736 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
737 @@ -1384,12 +1342,8 @@
739 # More checks for data types
740 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
742 - [ #include <sys/types.h> ],
743 - [ u_int a; a = 1;],
744 - [ ac_cv_have_u_int="yes" ],
745 - [ ac_cv_have_u_int="no" ]
747 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int a; a = 1;]])],[ ac_cv_have_u_int="yes" ],[ ac_cv_have_u_int="no"
750 if test "x$ac_cv_have_u_int" = "xyes" ; then
751 AC_DEFINE(HAVE_U_INT)
752 @@ -1397,12 +1351,8 @@
755 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
757 - [ #include <sys/types.h> ],
758 - [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
759 - [ ac_cv_have_intxx_t="yes" ],
760 - [ ac_cv_have_intxx_t="no" ]
762 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],[ ac_cv_have_intxx_t="yes" ],[ ac_cv_have_intxx_t="no"
765 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
766 AC_DEFINE(HAVE_INTXX_T)
767 @@ -1410,23 +1360,18 @@
770 if (test -z "$have_intxx_t" && \
771 - test "x$ac_cv_header_stdint_h" = "xyes")
772 + test "x$ac_cv_header_stdint_h" = "xyes")
774 AC_MSG_CHECKING([for intXX_t types in stdint.h])
776 - [ #include <stdint.h> ],
777 - [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
779 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], [[ int8_t a; int16_t b; int32_t c; a = b = c = 1;]])],[
780 AC_DEFINE(HAVE_INTXX_T)
783 - [ AC_MSG_RESULT(no) ]
785 + ],[ AC_MSG_RESULT(no)
789 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
792 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
793 #include <sys/types.h>
796 @@ -1435,23 +1380,16 @@
797 #ifdef HAVE_SYS_BITYPES_H
798 # include <sys/bitypes.h>
801 - [ int64_t a; a = 1;],
802 - [ ac_cv_have_int64_t="yes" ],
803 - [ ac_cv_have_int64_t="no" ]
805 + ]], [[ int64_t a; a = 1;]])],[ ac_cv_have_int64_t="yes" ],[ ac_cv_have_int64_t="no"
808 if test "x$ac_cv_have_int64_t" = "xyes" ; then
809 AC_DEFINE(HAVE_INT64_T)
812 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
814 - [ #include <sys/types.h> ],
815 - [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
816 - [ ac_cv_have_u_intxx_t="yes" ],
817 - [ ac_cv_have_u_intxx_t="no" ]
819 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],[ ac_cv_have_u_intxx_t="yes" ],[ ac_cv_have_u_intxx_t="no"
822 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
823 AC_DEFINE(HAVE_U_INTXX_T)
824 @@ -1460,24 +1398,16 @@
826 if test -z "$have_u_intxx_t" ; then
827 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
829 - [ #include <sys/socket.h> ],
830 - [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
832 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/socket.h> ]], [[ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;]])],[
833 AC_DEFINE(HAVE_U_INTXX_T)
836 - [ AC_MSG_RESULT(no) ]
838 + ],[ AC_MSG_RESULT(no)
842 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
844 - [ #include <sys/types.h> ],
845 - [ u_int64_t a; a = 1;],
846 - [ ac_cv_have_u_int64_t="yes" ],
847 - [ ac_cv_have_u_int64_t="no" ]
849 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> ]], [[ u_int64_t a; a = 1;]])],[ ac_cv_have_u_int64_t="yes" ],[ ac_cv_have_u_int64_t="no"
852 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
853 AC_DEFINE(HAVE_U_INT64_T)
854 @@ -1486,27 +1416,19 @@
856 if test -z "$have_u_int64_t" ; then
857 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
859 - [ #include <sys/bitypes.h> ],
860 - [ u_int64_t a; a = 1],
862 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/bitypes.h> ]], [[ u_int64_t a; a = 1]])],[
863 AC_DEFINE(HAVE_U_INT64_T)
866 - [ AC_MSG_RESULT(no) ]
868 + ],[ AC_MSG_RESULT(no)
872 if test -z "$have_u_intxx_t" ; then
873 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
876 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
877 #include <sys/types.h>
879 - [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
880 - [ ac_cv_have_uintxx_t="yes" ],
881 - [ ac_cv_have_uintxx_t="no" ]
883 + ]], [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ]])],[ ac_cv_have_uintxx_t="yes" ],[ ac_cv_have_uintxx_t="no"
886 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
887 AC_DEFINE(HAVE_UINTXX_T)
888 @@ -1515,49 +1437,37 @@
890 if test -z "$have_uintxx_t" ; then
891 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
893 - [ #include <stdint.h> ],
894 - [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
896 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdint.h> ]], [[ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;]])],[
897 AC_DEFINE(HAVE_UINTXX_T)
900 - [ AC_MSG_RESULT(no) ]
902 + ],[ AC_MSG_RESULT(no)
906 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
907 - test "x$ac_cv_header_sys_bitypes_h" = "xyes")
908 + test "x$ac_cv_header_sys_bitypes_h" = "xyes")
910 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
913 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
914 #include <sys/bitypes.h>
918 int8_t a; int16_t b; int32_t c;
919 u_int8_t e; u_int16_t f; u_int32_t g;
920 a = b = c = e = f = g = 1;
924 AC_DEFINE(HAVE_U_INTXX_T)
925 AC_DEFINE(HAVE_INTXX_T)
928 - [AC_MSG_RESULT(no)]
930 + ],[AC_MSG_RESULT(no)
935 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
938 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
939 #include <sys/types.h>
941 - [ u_char foo; foo = 125; ],
942 - [ ac_cv_have_u_char="yes" ],
943 - [ ac_cv_have_u_char="no" ]
945 + ]], [[ u_char foo; foo = 125; ]])],[ ac_cv_have_u_char="yes" ],[ ac_cv_have_u_char="no"
948 if test "x$ac_cv_have_u_char" = "xyes" ; then
949 AC_DEFINE(HAVE_U_CHAR)
950 @@ -1568,95 +1478,66 @@
951 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
953 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
956 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
957 #include <sys/types.h>
959 - [ size_t foo; foo = 1235; ],
960 - [ ac_cv_have_size_t="yes" ],
961 - [ ac_cv_have_size_t="no" ]
963 + ]], [[ size_t foo; foo = 1235; ]])],[ ac_cv_have_size_t="yes" ],[ ac_cv_have_size_t="no"
966 if test "x$ac_cv_have_size_t" = "xyes" ; then
967 AC_DEFINE(HAVE_SIZE_T)
970 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
973 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
974 #include <sys/types.h>
976 - [ ssize_t foo; foo = 1235; ],
977 - [ ac_cv_have_ssize_t="yes" ],
978 - [ ac_cv_have_ssize_t="no" ]
980 + ]], [[ ssize_t foo; foo = 1235; ]])],[ ac_cv_have_ssize_t="yes" ],[ ac_cv_have_ssize_t="no"
983 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
984 AC_DEFINE(HAVE_SSIZE_T)
987 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
990 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
993 - [ clock_t foo; foo = 1235; ],
994 - [ ac_cv_have_clock_t="yes" ],
995 - [ ac_cv_have_clock_t="no" ]
997 + ]], [[ clock_t foo; foo = 1235; ]])],[ ac_cv_have_clock_t="yes" ],[ ac_cv_have_clock_t="no"
1000 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1001 AC_DEFINE(HAVE_CLOCK_T)
1004 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1007 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1008 #include <sys/types.h>
1009 #include <sys/socket.h>
1011 - [ sa_family_t foo; foo = 1235; ],
1012 - [ ac_cv_have_sa_family_t="yes" ],
1015 + ]], [[ sa_family_t foo; foo = 1235; ]])],[ ac_cv_have_sa_family_t="yes" ],[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1016 #include <sys/types.h>
1017 #include <sys/socket.h>
1018 #include <netinet/in.h>
1020 - [ sa_family_t foo; foo = 1235; ],
1021 - [ ac_cv_have_sa_family_t="yes" ],
1023 - [ ac_cv_have_sa_family_t="no" ]
1026 + ]], [[ sa_family_t foo; foo = 1235; ]])],[ ac_cv_have_sa_family_t="yes" ],[ ac_cv_have_sa_family_t="no"
1030 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1031 AC_DEFINE(HAVE_SA_FAMILY_T)
1034 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1037 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1038 #include <sys/types.h>
1040 - [ pid_t foo; foo = 1235; ],
1041 - [ ac_cv_have_pid_t="yes" ],
1042 - [ ac_cv_have_pid_t="no" ]
1044 + ]], [[ pid_t foo; foo = 1235; ]])],[ ac_cv_have_pid_t="yes" ],[ ac_cv_have_pid_t="no"
1047 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1048 AC_DEFINE(HAVE_PID_T)
1051 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1054 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1055 #include <sys/types.h>
1057 - [ mode_t foo; foo = 1235; ],
1058 - [ ac_cv_have_mode_t="yes" ],
1059 - [ ac_cv_have_mode_t="no" ]
1061 + ]], [[ mode_t foo; foo = 1235; ]])],[ ac_cv_have_mode_t="yes" ],[ ac_cv_have_mode_t="no"
1064 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1065 AC_DEFINE(HAVE_MODE_T)
1066 @@ -1664,73 +1545,53 @@
1069 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1072 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1073 #include <sys/types.h>
1074 #include <sys/socket.h>
1076 - [ struct sockaddr_storage s; ],
1077 - [ ac_cv_have_struct_sockaddr_storage="yes" ],
1078 - [ ac_cv_have_struct_sockaddr_storage="no" ]
1080 + ]], [[ struct sockaddr_storage s; ]])],[ ac_cv_have_struct_sockaddr_storage="yes" ],[ ac_cv_have_struct_sockaddr_storage="no"
1083 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1084 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1087 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1090 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1091 #include <sys/types.h>
1092 #include <netinet/in.h>
1094 - [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1095 - [ ac_cv_have_struct_sockaddr_in6="yes" ],
1096 - [ ac_cv_have_struct_sockaddr_in6="no" ]
1098 + ]], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],[ ac_cv_have_struct_sockaddr_in6="yes" ],[ ac_cv_have_struct_sockaddr_in6="no"
1101 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1102 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1105 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1108 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1109 #include <sys/types.h>
1110 #include <netinet/in.h>
1112 - [ struct in6_addr s; s.s6_addr[0] = 0; ],
1113 - [ ac_cv_have_struct_in6_addr="yes" ],
1114 - [ ac_cv_have_struct_in6_addr="no" ]
1116 + ]], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],[ ac_cv_have_struct_in6_addr="yes" ],[ ac_cv_have_struct_in6_addr="no"
1119 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1120 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1123 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1126 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1127 #include <sys/types.h>
1128 #include <sys/socket.h>
1131 - [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1132 - [ ac_cv_have_struct_addrinfo="yes" ],
1133 - [ ac_cv_have_struct_addrinfo="no" ]
1135 + ]], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],[ ac_cv_have_struct_addrinfo="yes" ],[ ac_cv_have_struct_addrinfo="no"
1138 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1139 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1142 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1144 - [ #include <sys/time.h> ],
1145 - [ struct timeval tv; tv.tv_sec = 1;],
1146 - [ ac_cv_have_struct_timeval="yes" ],
1147 - [ ac_cv_have_struct_timeval="no" ]
1149 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/time.h> ]], [[ struct timeval tv; tv.tv_sec = 1;]])],[ ac_cv_have_struct_timeval="yes" ],[ ac_cv_have_struct_timeval="no"
1152 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1153 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1154 @@ -1749,32 +1610,42 @@
1157 dnl test snprintf (broken on SCO w/gcc)
1161 -#include <string.h>
1162 -#ifdef HAVE_SNPRINTF
1166 - char expected_out[50];
1167 - int mazsize = 50 ;
1168 -#if (SIZEOF_LONG_INT == 8)
1169 - long int num = 0x7fffffffffffffff;
1171 - long long num = 0x7fffffffffffffffll;
1173 - strcpy(expected_out, "9223372036854775807");
1174 - snprintf(buf, mazsize, "%lld", num);
1175 - if(strcmp(buf, expected_out) != 0)
1180 -main() { exit(0); }
1182 - ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1184 + if test "x$ac_cv_have_broken_snprintf" != "xyes" ; then
1185 +# no need to test again if we already know its broken :)
1186 + AC_CACHE_CHECK([whether snprintf is broken],
1187 + ac_cv_have_broken_snprintf, [
1188 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
1189 + #include <stdio.h>
1190 + #include <string.h>
1191 + #ifdef HAVE_SNPRINTF
1195 + char expected_out[50];
1196 + int mazsize = 50 ;
1197 + #if (SIZEOF_LONG_INT == 8)
1198 + long int num = 0x7fffffffffffffff;
1200 + long long num = 0x7fffffffffffffffll;
1202 + strcpy(expected_out, "9223372036854775807");
1203 + snprintf(buf, mazsize, "%lld", num);
1204 + if(strcmp(buf, expected_out) != 0)
1209 + main() { exit(0); }
1212 + ac_cv_have_broken_snprintf="yes"
1216 + if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
1217 + AC_DEFINE(BROKEN_SNPRINTF)
1222 dnl Checks for structure members
1223 @@ -1800,15 +1671,10 @@
1225 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1226 ac_cv_have_ss_family_in_struct_ss, [
1229 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1230 #include <sys/types.h>
1231 #include <sys/socket.h>
1233 - [ struct sockaddr_storage s; s.ss_family = 1; ],
1234 - [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1235 - [ ac_cv_have_ss_family_in_struct_ss="no" ],
1237 + ]], [[ struct sockaddr_storage s; s.ss_family = 1; ]])],[ ac_cv_have_ss_family_in_struct_ss="yes" ],[ ac_cv_have_ss_family_in_struct_ss="no" ])
1239 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1240 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1241 @@ -1816,15 +1682,11 @@
1243 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1244 ac_cv_have___ss_family_in_struct_ss, [
1247 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1248 #include <sys/types.h>
1249 #include <sys/socket.h>
1251 - [ struct sockaddr_storage s; s.__ss_family = 1; ],
1252 - [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1253 - [ ac_cv_have___ss_family_in_struct_ss="no" ]
1255 + ]], [[ struct sockaddr_storage s; s.__ss_family = 1; ]])],[ ac_cv_have___ss_family_in_struct_ss="yes" ],[ ac_cv_have___ss_family_in_struct_ss="no"
1258 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1259 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1260 @@ -1832,14 +1694,10 @@
1262 AC_CACHE_CHECK([for pw_class field in struct passwd],
1263 ac_cv_have_pw_class_in_struct_passwd, [
1266 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1269 - [ struct passwd p; p.pw_class = 0; ],
1270 - [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1271 - [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1273 + ]], [[ struct passwd p; p.pw_class = 0; ]])],[ ac_cv_have_pw_class_in_struct_passwd="yes" ],[ ac_cv_have_pw_class_in_struct_passwd="no"
1276 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1277 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1278 @@ -1847,14 +1705,10 @@
1280 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1281 ac_cv_have_pw_expire_in_struct_passwd, [
1284 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1287 - [ struct passwd p; p.pw_expire = 0; ],
1288 - [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1289 - [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1291 + ]], [[ struct passwd p; p.pw_expire = 0; ]])],[ ac_cv_have_pw_expire_in_struct_passwd="yes" ],[ ac_cv_have_pw_expire_in_struct_passwd="no"
1294 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1295 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1296 @@ -1862,14 +1716,10 @@
1298 AC_CACHE_CHECK([for pw_change field in struct passwd],
1299 ac_cv_have_pw_change_in_struct_passwd, [
1302 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1305 - [ struct passwd p; p.pw_change = 0; ],
1306 - [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1307 - [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1309 + ]], [[ struct passwd p; p.pw_change = 0; ]])],[ ac_cv_have_pw_change_in_struct_passwd="yes" ],[ ac_cv_have_pw_change_in_struct_passwd="no"
1312 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1313 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1314 @@ -1878,8 +1728,7 @@
1315 dnl make sure we're using the real structure members and not defines
1316 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1317 ac_cv_have_accrights_in_msghdr, [
1320 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
1321 #include <sys/types.h>
1322 #include <sys/socket.h>
1323 #include <sys/uio.h>
1324 @@ -1891,10 +1740,8 @@
1325 m.msg_accrights = 0;
1329 - [ ac_cv_have_accrights_in_msghdr="yes" ],
1330 - [ ac_cv_have_accrights_in_msghdr="no" ]
1332 + ]])],[ ac_cv_have_accrights_in_msghdr="yes" ],[ ac_cv_have_accrights_in_msghdr="no"
1335 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
1336 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
1337 @@ -1902,8 +1749,7 @@
1339 AC_CACHE_CHECK([for msg_control field in struct msghdr],
1340 ac_cv_have_control_in_msghdr, [
1343 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
1344 #include <sys/types.h>
1345 #include <sys/socket.h>
1346 #include <sys/uio.h>
1347 @@ -1915,47 +1761,36 @@
1352 - [ ac_cv_have_control_in_msghdr="yes" ],
1353 - [ ac_cv_have_control_in_msghdr="no" ]
1355 + ]])],[ ac_cv_have_control_in_msghdr="yes" ],[ ac_cv_have_control_in_msghdr="no"
1358 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
1359 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
1362 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
1364 - [ extern char *__progname; printf("%s", __progname); ],
1365 - [ ac_cv_libc_defines___progname="yes" ],
1366 - [ ac_cv_libc_defines___progname="no" ]
1368 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern char *__progname; printf("%s", __progname); ]])],[ ac_cv_libc_defines___progname="yes" ],[ ac_cv_libc_defines___progname="no"
1371 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
1372 AC_DEFINE(HAVE___PROGNAME)
1375 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
1377 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1380 - [ printf("%s", __FUNCTION__); ],
1381 - [ ac_cv_cc_implements___FUNCTION__="yes" ],
1382 - [ ac_cv_cc_implements___FUNCTION__="no" ]
1384 +]], [[ printf("%s", __FUNCTION__); ]])],[ ac_cv_cc_implements___FUNCTION__="yes" ],[ ac_cv_cc_implements___FUNCTION__="no"
1387 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
1388 AC_DEFINE(HAVE___FUNCTION__)
1391 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
1393 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1396 - [ printf("%s", __func__); ],
1397 - [ ac_cv_cc_implements___func__="yes" ],
1398 - [ ac_cv_cc_implements___func__="no" ]
1400 +]], [[ printf("%s", __func__); ]])],[ ac_cv_cc_implements___func__="yes" ],[ ac_cv_cc_implements___func__="no"
1403 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
1404 AC_DEFINE(HAVE___func__)
1405 @@ -1963,25 +1798,18 @@
1407 AC_CACHE_CHECK([whether getopt has optreset support],
1408 ac_cv_have_getopt_optreset, [
1411 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1414 - [ extern int optreset; optreset = 0; ],
1415 - [ ac_cv_have_getopt_optreset="yes" ],
1416 - [ ac_cv_have_getopt_optreset="no" ]
1418 + ]], [[ extern int optreset; optreset = 0; ]])],[ ac_cv_have_getopt_optreset="yes" ],[ ac_cv_have_getopt_optreset="no"
1421 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
1422 AC_DEFINE(HAVE_GETOPT_OPTRESET)
1425 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
1427 - [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
1428 - [ ac_cv_libc_defines_sys_errlist="yes" ],
1429 - [ ac_cv_libc_defines_sys_errlist="no" ]
1431 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);]])],[ ac_cv_libc_defines_sys_errlist="yes" ],[ ac_cv_libc_defines_sys_errlist="no"
1434 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
1435 AC_DEFINE(HAVE_SYS_ERRLIST)
1436 @@ -1989,17 +1817,14 @@
1439 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
1441 - [ extern int sys_nerr; printf("%i", sys_nerr);],
1442 - [ ac_cv_libc_defines_sys_nerr="yes" ],
1443 - [ ac_cv_libc_defines_sys_nerr="no" ]
1445 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ extern int sys_nerr; printf("%i", sys_nerr);]])],[ ac_cv_libc_defines_sys_nerr="yes" ],[ ac_cv_libc_defines_sys_nerr="no"
1448 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1449 AC_DEFINE(HAVE_SYS_NERR)
1454 # Check whether user wants sectok support
1456 [ --with-sectok Enable smartcard support using libsectok],
1457 @@ -2025,15 +1850,14 @@
1459 AC_DEFINE(SMARTCARD)
1460 AC_DEFINE(USE_SECTOK)
1461 - SCARD_MSG="yes, using sectok"
1462 + SCARD_MSG="yes, using sectok"
1467 # Check whether user wants OpenSC support
1469 - AC_HELP_STRING([--with-opensc=PFX],
1470 - [Enable smartcard support using OpenSC]),
1471 + AS_HELP_STRING(--with-opensc=PFX,Enable smartcard support using OpenSC),
1472 opensc_config_prefix="$withval", opensc_config_prefix="")
1473 if test x$opensc_config_prefix != x ; then
1474 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
1475 @@ -2045,36 +1869,36 @@
1476 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
1477 AC_DEFINE(SMARTCARD)
1478 AC_DEFINE(USE_OPENSC)
1479 - SCARD_MSG="yes, using OpenSC"
1480 + SCARD_MSG="yes, using OpenSC"
1484 # Check libraries needed by DNS fingerprint support
1485 -AC_SEARCH_LIBS(getrrsetbyname, resolv,
1486 - [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1488 - # Needed by our getrrsetbyname()
1489 - AC_SEARCH_LIBS(res_query, resolv)
1490 - AC_SEARCH_LIBS(dn_expand, resolv)
1491 - AC_CHECK_FUNCS(_getshort _getlong)
1492 - AC_CHECK_MEMBER(HEADER.ad,
1493 - [AC_DEFINE(HAVE_HEADER_AD)],,
1494 - [#include <arpa/nameser.h>])
1496 + AC_SEARCH_LIBS(getrrsetbyname, resolv,
1497 + [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1499 + # Needed by our getrrsetbyname()
1500 + AC_SEARCH_LIBS(res_query, resolv)
1501 + AC_SEARCH_LIBS(dn_expand, resolv)
1502 + AC_CHECK_FUNCS(_getshort _getlong)
1503 + AC_CHECK_MEMBER(HEADER.ad,
1504 + [AC_DEFINE(HAVE_HEADER_AD)],,
1505 + [#include <arpa/nameser.h>])
1508 # Check whether user wants Kerberos 5 support
1511 AC_ARG_WITH(kerberos5,
1512 - [ --with-kerberos5=PATH Enable Kerberos 5 support],
1513 + [ --with-kerberos5=PATH Enable Kerberos 5 support],
1514 [ if test "x$withval" != "xno" ; then
1515 - if test "x$withval" = "xyes" ; then
1516 - KRB5ROOT="/usr/local"
1518 - KRB5ROOT=${withval}
1520 + if test "x$withval" = "xyes" ; then
1521 + KRB5ROOT="/usr/local"
1523 + KRB5ROOT=${withval}
1531 AC_MSG_CHECKING(for krb5-config)
1532 if test -x $KRB5ROOT/bin/krb5-config ; then
1533 @@ -2094,27 +1918,21 @@
1534 K5LIBS="`$KRB5CONF --libs $k5confopts`"
1535 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
1536 AC_MSG_CHECKING(whether we are using Heimdal)
1537 - AC_TRY_COMPILE([ #include <krb5.h> ],
1538 - [ char *tmp = heimdal_version; ],
1539 - [ AC_MSG_RESULT(yes)
1540 - AC_DEFINE(HEIMDAL) ],
1543 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> ]], [[ char *tmp = heimdal_version; ]])],[ AC_MSG_RESULT(yes)
1544 + AC_DEFINE(HEIMDAL) ],[AC_MSG_RESULT(no)
1548 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
1549 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
1550 - AC_MSG_CHECKING(whether we are using Heimdal)
1551 - AC_TRY_COMPILE([ #include <krb5.h> ],
1552 - [ char *tmp = heimdal_version; ],
1553 - [ AC_MSG_RESULT(yes)
1554 - AC_DEFINE(HEIMDAL)
1555 - K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1557 - [ AC_MSG_RESULT(no)
1558 - K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1561 + AC_MSG_CHECKING(whether we are using Heimdal)
1562 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> ]], [[ char *tmp = heimdal_version; ]])],[ AC_MSG_RESULT(yes)
1563 + AC_DEFINE(HEIMDAL)
1564 + K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
1565 + ],[ AC_MSG_RESULT(no)
1566 + K5LIBS="-lkrb5 -lk5crypto -lcom_err"
1569 AC_SEARCH_LIBS(dn_expand, resolv)
1571 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1572 @@ -2122,7 +1940,7 @@
1573 K5LIBS="-lgssapi $K5LIBS" ],
1574 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1576 - K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1577 + K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1578 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1581 @@ -2130,10 +1948,10 @@
1583 AC_CHECK_HEADER(gssapi.h, ,
1584 [ unset ac_cv_header_gssapi_h
1585 - CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1586 + CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
1587 AC_CHECK_HEADERS(gssapi.h, ,
1588 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
1594 @@ -2142,7 +1960,7 @@
1595 AC_CHECK_HEADER(gssapi_krb5.h, ,
1596 [ CPPFLAGS="$oldCPP" ])
1600 if test ! -z "$need_dash_r" ; then
1601 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
1603 @@ -2157,7 +1975,7 @@
1605 LIBS="$LIBS $K5LIBS"
1606 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
1611 # Looking for programs, paths and files
1612 @@ -2221,7 +2039,7 @@
1614 if test -z "$no_dev_ptmx" ; then
1615 if test "x$disable_ptmx_check" != "xyes" ; then
1616 - AC_CHECK_FILE("/dev/ptmx",
1617 + AC_CHECK_FILE("/dev/ptmx",
1619 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
1621 @@ -2229,13 +2047,14 @@
1625 -AC_CHECK_FILE("/dev/ptc",
1626 +if test "$cross_compiling" != yes; then
1627 +AC_CHECK_FILE("/dev/ptc",
1629 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
1635 # Options from here on. Some of these are preset by platform above
1636 AC_ARG_WITH(mantype,
1637 [ --with-mantype=man|cat|doc Set man page type],
1638 @@ -2270,13 +2089,13 @@
1641 # Check whether to enable MD5 passwords
1644 AC_ARG_WITH(md5-passwords,
1645 [ --with-md5-passwords Enable use of MD5 passwords],
1647 if test "x$withval" != "xno" ; then
1648 AC_DEFINE(HAVE_MD5_PASSWORDS)
1654 @@ -2294,14 +2113,12 @@
1656 if test -z "$disable_shadow" ; then
1657 AC_MSG_CHECKING([if the systems has expire shadow information])
1660 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1661 #include <sys/types.h>
1664 - ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
1665 - [ sp_expire_available=yes ], []
1667 + ]], [[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ]])],[ sp_expire_available=yes ],[
1670 if test "x$sp_expire_available" = "xyes" ; then
1672 @@ -2316,13 +2133,13 @@
1673 DISPLAY_HACK_MSG="yes"
1674 AC_DEFINE(IPADDR_IN_DISPLAY)
1676 - DISPLAY_HACK_MSG="no"
1677 + DISPLAY_HACK_MSG="no"
1678 AC_ARG_WITH(ipaddr-display,
1679 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
1681 if test "x$withval" != "xno" ; then
1682 AC_DEFINE(IPADDR_IN_DISPLAY)
1683 - DISPLAY_HACK_MSG="yes"
1684 + DISPLAY_HACK_MSG="yes"
1688 @@ -2332,7 +2149,9 @@
1689 AC_ARG_ENABLE(etc-default-login,
1690 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
1692 +if test "x$cross_compiling" != "xyes"; then
1693 AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
1696 if test "x$external_path_file" = "x/etc/default/login"; then
1697 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
1698 @@ -2346,7 +2165,7 @@
1701 # Whether to mess with the default path
1702 -SERVER_PATH_MSG="(default)"
1703 +SERVER_PATH_MSG="(default)"
1704 AC_ARG_WITH(default-path,
1705 [ --with-default-path= Specify default \$PATH environment for server],
1707 @@ -2361,7 +2180,7 @@
1708 $external_path_file .])
1710 user_path="$withval"
1711 - SERVER_PATH_MSG="$withval"
1712 + SERVER_PATH_MSG="$withval"
1715 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
1716 @@ -2372,8 +2191,7 @@
1717 If PATH is defined in $external_path_file, ensure the path to scp is included,
1718 otherwise scp will not work.])
1722 + AC_RUN_IFELSE([AC_LANG_SOURCE([[
1723 /* find out what STDPATH is */
1726 @@ -2405,10 +2223,8 @@
1730 - ], [ user_path=`cat conftest.stdpath` ],
1731 - [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
1732 - [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
1734 + ]])],[ user_path=`cat conftest.stdpath` ],[ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],[ user_path="/usr/bin:/bin:/usr/sbin:/sbin"
1736 # make sure $bindir is in USER_PATH so scp will work
1737 t_bindir=`eval echo ${bindir}`
1739 @@ -2445,14 +2261,14 @@
1742 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
1743 -IPV4_IN6_HACK_MSG="no"
1744 +IPV4_IN6_HACK_MSG="no"
1746 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
1748 if test "x$withval" != "xno" ; then
1750 AC_DEFINE(IPV4_IN_IPV6)
1751 - IPV4_IN6_HACK_MSG="yes"
1752 + IPV4_IN6_HACK_MSG="yes"
1756 @@ -2460,7 +2276,7 @@
1757 if test "x$inet6_default_4in6" = "xyes"; then
1758 AC_MSG_RESULT([yes (default)])
1759 AC_DEFINE(IPV4_IN_IPV6)
1760 - IPV4_IN6_HACK_MSG="yes"
1761 + IPV4_IN6_HACK_MSG="yes"
1763 AC_MSG_RESULT([no (default)])
1765 @@ -2485,7 +2301,7 @@
1766 if test ! -d $piddir ; then
1767 piddir=`eval echo ${sysconfdir}`
1769 - NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1770 + NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
1774 @@ -2557,7 +2373,7 @@
1775 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
1777 if test "x$enableval" = "xno" ; then
1778 - AC_DEFINE(DISABLE_PUTUTLINE)
1779 + AC_DEFINE(DISABLE_PUTUTLINE)
1783 @@ -2588,7 +2404,7 @@
1784 dnl lastlog detection
1785 dnl NOTE: the code itself will detect if lastlog is a directory
1786 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
1788 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1789 #include <sys/types.h>
1791 #ifdef HAVE_LASTLOG_H
1792 @@ -2600,13 +2416,10 @@
1797 - [ char *lastlog = LASTLOG_FILE; ],
1798 - [ AC_MSG_RESULT(yes) ],
1800 + ]], [[ char *lastlog = LASTLOG_FILE; ]])],[ AC_MSG_RESULT(yes) ],[
1802 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
1804 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1805 #include <sys/types.h>
1807 #ifdef HAVE_LASTLOG_H
1808 @@ -2615,15 +2428,12 @@
1813 - [ char *lastlog = _PATH_LASTLOG; ],
1814 - [ AC_MSG_RESULT(yes) ],
1816 + ]], [[ char *lastlog = _PATH_LASTLOG; ]])],[ AC_MSG_RESULT(yes) ],[
1818 system_lastlog_path=no
1825 if test -z "$conf_lastlog_location"; then
1826 if test x"$system_lastlog_path" = x"no" ; then
1827 @@ -2645,18 +2455,15 @@
1830 AC_MSG_CHECKING([if your system defines UTMP_FILE])
1832 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1833 #include <sys/types.h>
1839 - [ char *utmp = UTMP_FILE; ],
1840 - [ AC_MSG_RESULT(yes) ],
1841 - [ AC_MSG_RESULT(no)
1842 - system_utmp_path=no ]
1844 + ]], [[ char *utmp = UTMP_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1845 + system_utmp_path=no
1847 if test -z "$conf_utmp_location"; then
1848 if test x"$system_utmp_path" = x"no" ; then
1849 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
1850 @@ -2675,18 +2482,15 @@
1853 AC_MSG_CHECKING([if your system defines WTMP_FILE])
1855 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1856 #include <sys/types.h>
1862 - [ char *wtmp = WTMP_FILE; ],
1863 - [ AC_MSG_RESULT(yes) ],
1864 - [ AC_MSG_RESULT(no)
1865 - system_wtmp_path=no ]
1867 + ]], [[ char *wtmp = WTMP_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1868 + system_wtmp_path=no
1870 if test -z "$conf_wtmp_location"; then
1871 if test x"$system_wtmp_path" = x"no" ; then
1872 for f in /usr/adm/wtmp /var/log/wtmp; do
1873 @@ -2708,7 +2512,7 @@
1874 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1876 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1878 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1879 #include <sys/types.h>
1882 @@ -2717,12 +2521,9 @@
1887 - [ char *utmpx = UTMPX_FILE; ],
1888 - [ AC_MSG_RESULT(yes) ],
1889 - [ AC_MSG_RESULT(no)
1890 - system_utmpx_path=no ]
1892 + ]], [[ char *utmpx = UTMPX_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1893 + system_utmpx_path=no
1895 if test -z "$conf_utmpx_location"; then
1896 if test x"$system_utmpx_path" = x"no" ; then
1897 AC_DEFINE(DISABLE_UTMPX)
1898 @@ -2733,7 +2534,7 @@
1901 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1903 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1904 #include <sys/types.h>
1907 @@ -2742,12 +2543,9 @@
1912 - [ char *wtmpx = WTMPX_FILE; ],
1913 - [ AC_MSG_RESULT(yes) ],
1914 - [ AC_MSG_RESULT(no)
1915 - system_wtmpx_path=no ]
1917 + ]], [[ char *wtmpx = WTMPX_FILE; ]])],[ AC_MSG_RESULT(yes) ],[ AC_MSG_RESULT(no)
1918 + system_wtmpx_path=no
1920 if test -z "$conf_wtmpx_location"; then
1921 if test x"$system_wtmpx_path" = x"no" ; then
1922 AC_DEFINE(DISABLE_WTMPX)
1923 @@ -2839,7 +2637,7 @@
1924 if test "x$PAM_MSG" = "xyes" ; then
1925 echo "PAM is enabled. You may need to install a PAM control file "
1926 echo "for sshd, otherwise password authentication may fail. "
1927 - echo "Example PAM control files can be found in the contrib/ "
1928 + echo "Example PAM control files can be found in the contrib/ "