]> andersk Git - openssh.git/blobdiff - configure.ac
- (djm) [Makefile.in configure.ac includes.h misc.c]
[openssh.git] / configure.ac
index 7fa7ed5d50429dffc49bdb35541ed26afa05dff8..ff71931aaf72640a392e6f1e6e886a00b9df2be3 100644 (file)
@@ -85,12 +85,14 @@ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
 
 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
-       GCC_VER=`$CC --version`
+       GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
        case $GCC_VER in
                1.*) ;;
                2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;;
                2.*) ;;
-               *) CFLAGS="$CFLAGS -Wsign-compare" ;;
+               3.*) CFLAGS="$CFLAGS -Wsign-compare" ;;
+               4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;;
+               *) ;;
        esac
 
        if test -z "$have_llong_max"; then
@@ -106,70 +108,6 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        fi
 fi
 
-if test -z "$have_llong_max"; then
-       AC_MSG_CHECKING([for max value of long long])
-       AC_RUN_IFELSE(
-               [AC_LANG_SOURCE([[
-#include <stdio.h>
-/* Why is this so damn hard? */
-#ifdef __GNUC__
-# undef __GNUC__
-#endif
-#define __USE_ISOC99
-#include <limits.h>
-#define DATA "conftest.llminmax"
-int main(void) {
-       FILE *f;
-       long long i, llmin, llmax = 0;
-
-       if((f = fopen(DATA,"w")) == NULL)
-               exit(1);
-
-#if defined(LLONG_MIN) && defined(LLONG_MAX)
-       fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
-       llmin = LLONG_MIN;
-       llmax = LLONG_MAX;
-#else
-       fprintf(stderr, "Calculating  LLONG_MIN and LLONG_MAX\n");
-       /* This will work on one's complement and two's complement */
-       for (i = 1; i > llmax; i <<= 1, i++)
-               llmax = i;
-       llmin = llmax + 1LL;    /* wrap */
-#endif
-
-       /* Sanity check */
-       if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
-           || llmax - 1 > llmax) {
-               fprintf(f, "unknown unknown\n");
-               exit(2);
-       }
-
-       if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
-               exit(3);
-
-       exit(0);
-}
-               ]])],
-               [
-                       llong_min=`$AWK '{print $1}' conftest.llminmax`
-                       llong_max=`$AWK '{print $2}' conftest.llminmax`
-                       AC_MSG_RESULT($llong_max)
-                       AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
-                           [max value of long long calculated by configure])
-                       AC_MSG_CHECKING([for min value of long long])
-                       AC_MSG_RESULT($llong_min)
-                       AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
-                           [min value of long long calculated by configure])
-               ],
-               [
-                       AC_MSG_RESULT(not found)
-               ],
-               [
-                       AC_MSG_WARN([cross compiling: not checking])
-               ]
-       )
-fi
-
 AC_ARG_WITH(rpath,
        [  --without-rpath         Disable auto-added -R linker paths],
        [
@@ -243,6 +181,8 @@ case "$host" in
        AC_DEFINE(SPT_TYPE,SPT_REUSEARGV,
                [Define to a Set Process Title type if your system is
                supported by bsd-setproctitle.c])
+       AC_DEFINE(SSHPAM_CHAUTHTOK_NEEDS_RUID, 1,
+           [AIX 5.2 and 5.3 (and presumably newer) require this])
        ;;
 *-*-cygwin*)
        check_for_libcrypt_later=1
@@ -386,6 +326,16 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
                        [Define if cmsg_type is not passed correctly])
                ;;
        esac
+       # tun(4) forwarding compat code
+       AC_CHECK_HEADERS(linux/if_tun.h)
+       if test "x$ac_cv_header_linux_tun_h" = "xyes" ; then
+               AC_DEFINE(SSH_TUN_LINUX, 1,
+                   [Open tunnel devices the Linux tun/tap way])
+               AC_DEFINE(SSH_TUN_COMPAT_AF, 1,
+                   [Use tunnel device compatibility to OpenBSD])
+               AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
+                   [Prepend the address family to IP tunnel traffic])
+       fi
        ;;
 mips-sony-bsd|mips-sony-newsos4)
        AC_DEFINE(NEED_SETPRGP, 1, [Need setpgrp to acquire controlling tty])
@@ -396,10 +346,18 @@ mips-sony-bsd|mips-sony-newsos4)
        if test "x$withval" != "xno" ; then
                need_dash_r=1
        fi
+       AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
+       AC_CHECK_HEADER([net/if_tap.h], ,
+           AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
+       AC_DEFINE(SSH_TUN_PREPEND_AF, 1,
+           [Prepend the address family to IP tunnel traffic])
        ;;
 *-*-freebsd*)
        check_for_libcrypt_later=1
        AC_DEFINE(LOCKED_PASSWD_PREFIX, "*LOCKED*", [Account locked with pw(1)])
+       AC_DEFINE(SSH_TUN_FREEBSD, 1, [Open tunnel devices the FreeBSD way])
+       AC_CHECK_HEADER([net/if_tap.h], ,
+           AC_DEFINE(SSH_TUN_NO_L2, 1, [No layer 2 tunnel support]))
        ;;
 *-*-bsdi*)
        AC_DEFINE(SETEUID_BREAKS_SETUID)
@@ -418,6 +376,8 @@ mips-sony-bsd|mips-sony-newsos4)
        ;;
 *-*-openbsd*)
        AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel])
+       AC_DEFINE(HAVE_ATTRIBUTE__BOUNDED__, 1, [OpenBSD's gcc has bounded])
+       AC_DEFINE(SSH_TUN_OPENBSD, 1, [Open tunnel devices the OpenBSD way])
        ;;
 *-*-solaris*)
        if test "x$withval" != "xno" ; then
@@ -471,8 +431,8 @@ mips-sony-bsd|mips-sony-newsos4)
 *-sni-sysv*)
        # /usr/ucblib MUST NOT be searched on ReliantUNIX
        AC_CHECK_LIB(dl, dlsym, ,)
-       # -lresolv needs to be at then end of LIBS or DNS lookups break
-       AC_CHECK_LIB(res_query, resolv, [ LIBS="$LIBS -lresolv" ])
+       # -lresolv needs to be at the end of LIBS or DNS lookups break
+       AC_CHECK_LIB(resolv, res_query, [ LIBS="$LIBS -lresolv" ])
        IPADDR_IN_DISPLAY=yes
        AC_DEFINE(USE_PIPES)
        AC_DEFINE(IP_TOS_IS_BROKEN)
@@ -487,11 +447,13 @@ mips-sony-bsd|mips-sony-newsos4)
        ;;
 # UnixWare 1.x, UnixWare 2.x, and others based on code from Univel.
 *-*-sysv4.2*)
+       CFLAGS="$CFLAGS -Dva_list=_VA_LIST"
        AC_DEFINE(USE_PIPES)
        AC_DEFINE(SETEUID_BREAKS_SETUID)
        AC_DEFINE(BROKEN_SETREUID)
        AC_DEFINE(BROKEN_SETREGID)
        AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd])
+       AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
        ;;
 # UnixWare 7.x, OpenUNIX 8
 *-*-sysv5*)
@@ -508,6 +470,8 @@ mips-sony-bsd|mips-sony-newsos4)
                AC_DEFINE(BROKEN_LIBIAF, 1,
                        [ia_uinfo routines not supported by OS yet])
                ;;
+       *)      AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
+               ;;
        esac
        ;;
 *-*-sysv*)
@@ -709,6 +673,7 @@ AC_CHECK_HEADERS( \
        login_cap.h \
        maillock.h \
        ndir.h \
+       net/if.h \
        netdb.h \
        netgroup.h \
        netinet/in_systm.h \
@@ -771,8 +736,8 @@ AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
                        ac_cv_have_broken_dirname, [
                        save_LIBS="$LIBS"
                        LIBS="$LIBS -lgen"
-                       AC_TRY_RUN(
-                               [
+                       AC_RUN_IFELSE(
+                               [AC_LANG_SOURCE([[
 #include <libgen.h>
 #include <string.h>
 
@@ -787,9 +752,10 @@ int main(int argc, char **argv) {
        exit(0);
     }
 }
-                               ],
+                               ]])],
+                               [ ac_cv_have_broken_dirname="no" ],
+                               [ ac_cv_have_broken_dirname="yes" ],
                                [ ac_cv_have_broken_dirname="no" ],
-                               [ ac_cv_have_broken_dirname="yes" ]
                        )
                        LIBS="$save_LIBS"
                ])
@@ -908,7 +874,7 @@ dnl UnixWare 2.x
 AC_CHECK_FUNC(strcasecmp,
        [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
 )
-AC_CHECK_FUNC(utimes,
+AC_CHECK_FUNCS(utimes,
        [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
                                        LIBS="$LIBS -lc89"]) ]
 )
@@ -970,7 +936,7 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
        [
                AC_MSG_RESULT(no)
                AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME, 1,
-                       [Define in your struct dirent expects you to
+                       [Define if your struct dirent expects you to
                        allocate extra space for d_name])
        ],
        [
@@ -1004,12 +970,12 @@ AC_ARG_WITH(skey,
                        SKEY_MSG="yes"
 
                        AC_MSG_CHECKING([for s/key support])
-                       AC_TRY_RUN(
-                               [
+                       AC_LINK_IFELSE(
+                               [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <skey.h>
 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
-                               ],
+                               ]])],
                                [AC_MSG_RESULT(yes)],
                                [
                                        AC_MSG_RESULT(no)
@@ -1166,6 +1132,7 @@ AC_ARG_WITH(audit,
 dnl    Checks for library functions. Please keep in alphabetical order
 AC_CHECK_FUNCS( \
        arc4random \
+       asprintf \
        b64_ntop \
        __b64_ntop \
        b64_pton \
@@ -1241,7 +1208,7 @@ AC_CHECK_FUNCS( \
        truncate \
        unsetenv \
        updwtmpx \
-       utimes \
+       vasprintf \
        vhangup \
        vsnprintf \
        waitpid \
@@ -1360,6 +1327,54 @@ int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
        )
 fi
 
+# If we don't have a working asprintf, then we strongly depend on vsnprintf
+# returning the right thing on overflow: the number of characters it tried to
+# create (as per SUSv3)
+if test "x$ac_cv_func_asprintf" != "xyes" && \
+   test "x$ac_cv_func_vsnprintf" = "xyes" ; then
+       AC_MSG_CHECKING([whether vsnprintf returns correct values on overflow])
+       AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+int x_snprintf(char *str,size_t count,const char *fmt,...)
+{
+       size_t ret; va_list ap;
+       va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);
+       return ret;
+}
+int main(void)
+{
+       char x[1];
+       exit(x_snprintf(x, 1, "%s %d", "hello", 12345) == 11 ? 0 : 1);
+} ]])],
+               [AC_MSG_RESULT(yes)],
+               [
+                       AC_MSG_RESULT(no)
+                       AC_DEFINE(BROKEN_SNPRINTF, 1,
+                               [Define if your snprintf is busted])
+                       AC_MSG_WARN([****** Your vsnprintf() function is broken, complain to your vendor])
+               ],
+               [ AC_MSG_WARN([cross compiling: Assuming working vsnprintf()]) ]
+       )
+fi
+
+# On systems where [v]snprintf is broken, but is declared in stdio,
+# check that the fmt argument is const char * or just char *.
+# This is only useful for when BROKEN_SNPRINTF
+AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+          int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
+          int main(void) { snprintf(0, 0, 0); } 
+    ]])],
+   [AC_MSG_RESULT(yes)
+    AC_DEFINE(SNPRINTF_CONST, [const],
+              [Define as const if snprintf() can declare const char *fmt])],
+   [AC_MSG_RESULT(no)
+    AC_DEFINE(SNPRINTF_CONST, [/* not const */])])
+
 # Check for missing getpeereid (or equiv) support
 NO_PEERCHECK=""
 if test "x$ac_cv_func_getpeereid" != "xyes" ; then
@@ -1379,15 +1394,15 @@ fi
 dnl see whether mkstemp() requires XXXXXX
 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
 AC_MSG_CHECKING([for (overly) strict mkstemp])
-AC_TRY_RUN(
-       [
+AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
 #include <stdlib.h>
 main() { char template[]="conftest.mkstemp-test";
 if (mkstemp(template) == -1)
        exit(1);
 unlink(template); exit(0);
 }
-       ],
+       ]])],
        [
                AC_MSG_RESULT(no)
        ],
@@ -1405,8 +1420,8 @@ fi
 dnl make sure that openpty does not reacquire controlling terminal
 if test ! -z "$check_for_openpty_ctty_bug"; then
        AC_MSG_CHECKING(if openpty correctly handles controlling tty)
-       AC_TRY_RUN(
-               [
+       AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <sys/fcntl.h>
 #include <sys/types.h>
@@ -1438,13 +1453,16 @@ main()
                        exit(0);        /* Did not acquire ctty: OK */
        }
 }
-               ],
+               ]])],
                [
                        AC_MSG_RESULT(yes)
                ],
                [
                        AC_MSG_RESULT(no)
                        AC_DEFINE(SSHD_ACQUIRES_CTTY)
+               ],
+               [
+                       AC_MSG_RESULT(cross-compiling, assuming yes)
                ]
        )
 fi
@@ -1452,8 +1470,8 @@ fi
 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
     test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
        AC_MSG_CHECKING(if getaddrinfo seems to work)
-       AC_TRY_RUN(
-               [
+       AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -1507,13 +1525,16 @@ main(void)
        }
        exit(0);
 }
-               ],
+               ]])],
                [
                        AC_MSG_RESULT(yes)
                ],
                [
                        AC_MSG_RESULT(no)
                        AC_DEFINE(BROKEN_GETADDRINFO)
+               ],
+               [
+                       AC_MSG_RESULT(cross-compiling, assuming yes)
                ]
        )
 fi
@@ -1521,8 +1542,8 @@ fi
 if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
     test "x$check_for_aix_broken_getaddrinfo" = "x1"; then
        AC_MSG_CHECKING(if getaddrinfo seems to work)
-       AC_TRY_RUN(
-               [
+       AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -1564,7 +1585,7 @@ main(void)
        }
        exit(0);
 }
-               ],
+               ]])],
                [
                        AC_MSG_RESULT(yes)
                        AC_DEFINE(AIX_GETNAMEINFO_HACK, 1,
@@ -1574,6 +1595,8 @@ main(void)
                [
                        AC_MSG_RESULT(no)
                        AC_DEFINE(BROKEN_GETADDRINFO)
+               ],
+                       AC_MSG_RESULT(cross-compiling, assuming no)
                ]
        )
 fi
@@ -1798,6 +1821,24 @@ Also see contrib/findssl.sh for help identifying header/library mismatches.])
        ]
 )
 
+# Check for OpenSSL without EVP_aes_{192,256}_cbc
+AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
+AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <string.h>
+#include <openssl/evp.h>
+int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL)}
+       ]])],
+       [
+               AC_MSG_RESULT(no)
+       ],
+       [
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1,
+                   [libcrypto is missing AES 192 and 256 bit functions])
+       ]
+)
+
 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
 # because the system crypt() is more featureful.
 if test "x$check_for_libcrypt_before" = "x1"; then
@@ -2031,7 +2072,10 @@ if test ! -z "$SONY" ; then
   LIBS="$LIBS -liberty";
 fi
 
-# Checks for data types
+# Check for  long long datatypes
+AC_CHECK_TYPES([long long, unsigned long long, long double])
+
+# Check datatype sizes
 AC_CHECK_SIZEOF(char, 1)
 AC_CHECK_SIZEOF(short int, 2)
 AC_CHECK_SIZEOF(int, 4)
@@ -2043,6 +2087,84 @@ if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
        ac_cv_sizeof_long_long_int=0
 fi
 
+# compute LLONG_MIN and LLONG_MAX if we don't know them.
+if test -z "$have_llong_max"; then
+       AC_MSG_CHECKING([for max value of long long])
+       AC_RUN_IFELSE(
+               [AC_LANG_SOURCE([[
+#include <stdio.h>
+/* Why is this so damn hard? */
+#ifdef __GNUC__
+# undef __GNUC__
+#endif
+#define __USE_ISOC99
+#include <limits.h>
+#define DATA "conftest.llminmax"
+int main(void) {
+       FILE *f;
+       long long i, llmin, llmax = 0;
+
+       if((f = fopen(DATA,"w")) == NULL)
+               exit(1);
+
+#if defined(LLONG_MIN) && defined(LLONG_MAX)
+       fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
+       llmin = LLONG_MIN;
+       llmax = LLONG_MAX;
+#else
+       fprintf(stderr, "Calculating  LLONG_MIN and LLONG_MAX\n");
+       /* This will work on one's complement and two's complement */
+       for (i = 1; i > llmax; i <<= 1, i++)
+               llmax = i;
+       llmin = llmax + 1LL;    /* wrap */
+#endif
+
+       /* Sanity check */
+       if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax
+           || llmax - 1 > llmax) {
+               fprintf(f, "unknown unknown\n");
+               exit(2);
+       }
+
+       if (fprintf(f ,"%lld %lld", llmin, llmax) < 0)
+               exit(3);
+
+       exit(0);
+}
+               ]])],
+               [
+                       llong_min=`$AWK '{print $1}' conftest.llminmax`
+                       llong_max=`$AWK '{print $2}' conftest.llminmax`
+
+                       # snprintf on some Tru64s doesn't understand "%lld"
+                       case "$host" in
+                       alpha-dec-osf*)
+                               if test "x$ac_cv_sizeof_long_long_int" = "x8" &&
+                                 test "x$llong_max" = "xld"; then
+                                       llong_min="-9223372036854775808"
+                                       llong_max="9223372036854775807"
+                               fi
+                               ;;
+                       esac
+
+                       AC_MSG_RESULT($llong_max)
+                       AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL],
+                           [max value of long long calculated by configure])
+                       AC_MSG_CHECKING([for min value of long long])
+                       AC_MSG_RESULT($llong_min)
+                       AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL],
+                           [min value of long long calculated by configure])
+               ],
+               [
+                       AC_MSG_RESULT(not found)
+               ],
+               [
+                       AC_MSG_WARN([cross compiling: not checking])
+               ]
+       )
+fi
+
+
 # More checks for data types
 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
        AC_TRY_COMPILE(
@@ -2469,6 +2591,17 @@ OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
 
 AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE(__res_state, state,
+       [Define if we don't have struct __res_state in resolv.h])],
+[
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+])
 
 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
                ac_cv_have_ss_family_in_struct_ss, [
@@ -2644,6 +2777,32 @@ if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
        AC_DEFINE(HAVE___func__, 1, [Define if compiler implements __func__])
 fi
 
+AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
+       AC_TRY_LINK(
+               [#include <stdarg.h>
+                va_list x,y;],
+               [va_copy(x,y);],
+               [ ac_cv_have_va_copy="yes" ],
+               [ ac_cv_have_va_copy="no" ]
+       )
+])
+if test "x$ac_cv_have_va_copy" = "xyes" ; then
+       AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists])
+fi
+
+AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
+       AC_TRY_LINK(
+               [#include <stdarg.h>
+                va_list x,y;],
+               [__va_copy(x,y);],
+               [ ac_cv_have___va_copy="yes" ],
+               [ ac_cv_have___va_copy="no" ]
+       )
+])
+if test "x$ac_cv_have___va_copy" = "xyes" ; then
+       AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists])
+fi
+
 AC_CACHE_CHECK([whether getopt has optreset support],
                ac_cv_have_getopt_optreset, [
        AC_TRY_LINK(
@@ -3083,16 +3242,19 @@ AC_ARG_ENABLE(etc-default-login,
          else
                etc_default_login=yes
          fi ],
-       [ etc_default_login=yes ]
+       [ if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
+         then
+               AC_MSG_WARN([cross compiling: not checking /etc/default/login])
+               etc_default_login=no
+         else
+               etc_default_login=yes
+         fi ]
 )
 
 if test "x$etc_default_login" != "xno"; then
        AC_CHECK_FILE("/etc/default/login",
            [ external_path_file=/etc/default/login ])
-       if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
-       then
-               AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
-       elif test "x$external_path_file" = "x/etc/default/login"; then
+       if test "x$external_path_file" = "x/etc/default/login"; then
                AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN, 1,
                        [Define if your system has /etc/default/login])
        fi
@@ -3131,8 +3293,8 @@ $external_path_file .])
 If PATH is defined in $external_path_file, ensure the path to scp is included,
 otherwise scp will not work.])
                fi
-               AC_TRY_RUN(
-                       [
+               AC_RUN_IFELSE(
+                       [AC_LANG_SOURCE([[
 /* find out what STDPATH is */
 #include <stdio.h>
 #ifdef HAVE_PATHS_H
@@ -3164,7 +3326,8 @@ main()
 
        exit(0);
 }
-               ], [ user_path=`cat conftest.stdpath` ],
+               ]])],
+               [ user_path=`cat conftest.stdpath` ],
                [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
                [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
        )
This page took 0.747356 seconds and 4 git commands to generate.