]> andersk Git - gssapi-openssh.git/blobdiff - openssh/configure.ac
we're not using $GSI_LIBS anymore, so check $GSI_LDFLAGS instead
[gssapi-openssh.git] / openssh / configure.ac
index 1997002ded62a2cbbe0f7da10350d6faa23380b4..20dafc5b91b231006e749b2da766a87f99d8ad7b 100644 (file)
@@ -94,9 +94,12 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
        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.*) ;;
+               1.*) no_attrib_nonnull=1 ;;
+               2.8* | 2.9*)
+                    CFLAGS="$CFLAGS -Wsign-compare"
+                    no_attrib_nonnull=1
+                    ;;
+               2.*) no_attrib_nonnull=1 ;;
                3.*) CFLAGS="$CFLAGS -Wsign-compare" ;;
                4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign" ;;
                *) ;;
@@ -115,6 +118,10 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        fi
 fi
 
+if test "x$no_attrib_nonnull" != "x1" ; then
+       AC_DEFINE(HAVE_ATTRIBUTE__NONNULL__, 1, [Have attribute nonnull])
+fi
+
 AC_ARG_WITH(rpath,
        [  --without-rpath         Disable auto-added -R linker paths],
        [
@@ -198,6 +205,7 @@ AC_CHECK_HEADERS( \
        netgroup.h \
        pam/pam_appl.h \
        paths.h \
+       poll.h \
        pty.h \
        readpassphrase.h \
        rpc/types.h \
@@ -229,6 +237,7 @@ AC_CHECK_HEADERS( \
        time.h \
        tmpdir.h \
        ttyent.h \
+       ucred.h \
        unistd.h \
        usersec.h \
        util.h \
@@ -360,7 +369,7 @@ int main(void) { exit(0); }
        ;;
 *-*-cygwin*)
        check_for_libcrypt_later=1
-       LIBS="$LIBS /usr/lib/textmode.o"
+       LIBS="$LIBS /usr/lib/textreadmode.o"
        AC_DEFINE(HAVE_CYGWIN, 1, [Define if you are on Cygwin])
        AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
        AC_DEFINE(DISABLE_SHADOW, 1,
@@ -383,7 +392,8 @@ int main(void) { exit(0); }
        AC_DEFINE(BROKEN_SETREGID)
        ;;
 *-*-darwin*)
-       AC_DEFINE(BROKEN_GETADDRINFO, 1, [getaddrinfo is broken (if present)])],
+       AC_DEFINE(BROKEN_GETADDRINFO, 1, [Define if getaddrinfo is broken)])
+       AC_DEFINE(BROKEN_GETADDRINFO)
        AC_DEFINE(SETEUID_BREAKS_SETUID)
        AC_DEFINE(BROKEN_SETREUID)
        AC_DEFINE(BROKEN_SETREGID)
@@ -792,6 +802,11 @@ mips-sony-bsd|mips-sony-newsos4)
        AC_DEFINE(DISABLE_LASTLOG)
        AC_DEFINE(SSHD_ACQUIRES_CTTY)
        enable_etc_default_login=no     # has incompatible /etc/default/login
+       case "$host" in
+       *-*-nto-qnx6*)
+               AC_DEFINE(DISABLE_FD_PASSING)
+               ;;
+       esac
        ;;
 
 *-*-ultrix*)
@@ -1143,33 +1158,29 @@ if test "x$gsi_path" != "xno" ; then
                 AC_MSG_ERROR(--with-globus-flavor=TYPE must specify a flavor type)
        fi
 
-       GLOBUS_INCLUDE="${gsi_path}/include/${globus_flavor_type}"
-       if test ! -d "$GLOBUS_INCLUDE" ; then
-               AC_MSG_ERROR(Cannot find Globus flavor-specific include directory: ${GLOBUS_INCLUDE})
-       fi
-       GSI_CPPFLAGS="-I${GLOBUS_INCLUDE}"
-       
        if test -x ${gsi_path}/bin/globus-makefile-header ; then
-               GSI_LIBS=`${gsi_path}/bin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
+               ${gsi_path}/bin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | sed 's/ = \(.*\)/="\1"/' > ./gpt_build_tmp.sh
        elif test -x ${gsi_path}/sbin/globus-makefile-header ; then
-               GSI_LIBS=`${gsi_path}/sbin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | perl -n -e 'if (/GLOBUS_PKG_LIBS = (.*)/){print $1;}'`
+               ${gsi_path}/sbin/globus-makefile-header --flavor=${globus_flavor_type} ${gsi_static} globus_gss_assist | sed 's/ = \(.*\)/="\1"/' > ./gpt_build_tmp.sh
        else
                AC_MSG_ERROR(Cannot find globus-makefile-header: Globus installation is incomplete)
        fi
+    . ./gpt_build_tmp.sh
        if test -n "${need_dash_r}"; then
-               GSI_LDFLAGS="-L${gsi_path}/lib -R{gsi_path}/lib"
+               GSI_LDFLAGS="-L${gsi_path}/lib -R${gsi_path}/lib"
        else
                GSI_LDFLAGS="-L${gsi_path}/lib"
        fi
-       if test -z "$GSI_LIBS" ; then
+       if test -z "$GLOBUS_PKG_LIBS" ; then
                AC_MSG_ERROR(globus-makefile-header failed)
        fi
 
        AC_DEFINE(HAVE_GSSAPI_H)
 
-       LIBS="$LIBS $GSI_LIBS"
-       LDFLAGS="$LDFLAGS $GSI_LDFLAGS"
-       CPPFLAGS="$CPPFLAGS $GSI_CPPFLAGS"
+       LIBS="$LIBS $GLOBUS_LIBS $GLOBUS_PKG_LIBS"
+       LDFLAGS="$LDFLAGS $GLOBUS_LDFLAGS"
+       CPPFLAGS="$CPPFLAGS $GLOBUS_CPPFLAGS $GLOBUS_INCLUDES"
+    CFLAGS="$CFLAGS $GLOBUS_CFLAGS"
 
        # test that we got the libraries OK
        AC_TRY_LINK(
@@ -1271,8 +1282,7 @@ AC_ARG_WITH(tcp-wrappers,
                                        CPPFLAGS="-I${withval} ${CPPFLAGS}"
                                fi
                        fi
-                       LIBWRAP="-lwrap"
-                       LIBS="$LIBWRAP $LIBS"
+                       LIBS="-lwrap $LIBS"
                        AC_MSG_CHECKING(for libwrap)
                        AC_TRY_LINK(
                                [
@@ -1288,7 +1298,7 @@ AC_ARG_WITH(tcp-wrappers,
                                        AC_DEFINE(LIBWRAP, 1,
                                                [Define if you want
                                                TCP Wrappers support])
-                                       AC_SUBST(LIBWRAP)
+                                       SSHDLIBS="$SSHDLIBS -lwrap"
                                        TCPW_MSG="yes"
                                ],
                                [
@@ -1403,6 +1413,7 @@ AC_CHECK_FUNCS( \
        getnameinfo \
        getopt \
        getpeereid \
+       getpeerucred \
        _getpty \
        getrlimit \
        getttyent \
@@ -1421,6 +1432,7 @@ AC_CHECK_FUNCS( \
        ogetaddrinfo \
        openlog_r \
        openpty \
+       poll \
        prctl \
        pstat \
        readpassphrase \
@@ -1454,6 +1466,7 @@ AC_CHECK_FUNCS( \
        strtonum \
        strtoll \
        strtoul \
+       swap32 \
        sysconf \
        tcgetpgrp \
        truncate \
@@ -1526,6 +1539,14 @@ AC_CHECK_DECLS(writev, , , [
 #include <unistd.h>
        ])
 
+AC_CHECK_DECLS(MAXSYMLINKS, , , [
+#include <sys/param.h>
+       ])
+
+AC_CHECK_DECLS(offsetof, , , [
+#include <stddef.h>
+       ])
+
 AC_CHECK_FUNCS(setresuid, [
        dnl Some platorms have setresuid that isn't implemented, test for this
        AC_MSG_CHECKING(if setresuid seems to work)
@@ -1651,7 +1672,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
 
 # Check for missing getpeereid (or equiv) support
 NO_PEERCHECK=""
-if test "x$ac_cv_func_getpeereid" != "xyes" ; then
+if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "xyes"; then
        AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
        AC_TRY_COMPILE(
                [#include <sys/types.h>
@@ -1928,7 +1949,7 @@ AC_ARG_WITH(ssl-dir,
                fi
        ]
 )
-if test -z "$GSI_LIBS" ; then
+if test -z "$GSI_LDFLAGS" ; then
 LIBS="-lcrypto $LIBS"
 fi
 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
@@ -2021,6 +2042,14 @@ int main(void) {
        ]
 )
 
+AC_ARG_WITH(openssl-header-check,
+       [  --without-openssl-header-check Disable OpenSSL version consistency check],
+       [  if test "x$withval" = "xno" ; then
+               openssl_check_nonfatal=1
+          fi
+       ]
+)
+
 # Sanity check OpenSSL headers
 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
 AC_RUN_IFELSE(
@@ -2034,9 +2063,18 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
        ],
        [
                AC_MSG_RESULT(no)
-               AC_MSG_ERROR([Your OpenSSL headers do not match your library.
-Check config.log for details.
+               if test "x$openssl_check_nonfatal" = "x"; then
+                       AC_MSG_ERROR([Your OpenSSL headers do not match your
+library. Check config.log for details.
+If you are sure your installation is consistent, you can disable the check
+by running "./configure --without-openssl-header-check".
+Also see contrib/findssl.sh for help identifying header/library mismatches.
+])
+               else
+                       AC_MSG_WARN([Your OpenSSL headers do not match your
+library. Check config.log for details.
 Also see contrib/findssl.sh for help identifying header/library mismatches.])
+               fi
        ],
        [
                AC_MSG_WARN([cross compiling: not checking])
@@ -2124,7 +2162,12 @@ fi
 # Search for SHA256 support in libc and/or OpenSSL
 AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
 
-AC_CHECK_LIB(iaf, ia_openinfo)
+saved_LIBS="$LIBS"
+AC_CHECK_LIB(iaf, ia_openinfo, [
+       LIBS="$LIBS -liaf"
+       AC_CHECK_FUNCS(set_id, [SSHDLIBS="$SSHDLIBS -liaf"])
+])
+LIBS="$saved_LIBS"
 
 ### Configure cryptographic random number support
 
@@ -2174,7 +2217,7 @@ AC_ARG_WITH(pam,
 
                        PAM_MSG="yes"
 
-                       LIBPAM="-lpam"
+                       SSHDLIBS="$SSHDLIBS -lpam"
                        AC_DEFINE(USE_PAM, 1,
                                [Define if you want to enable PAM support])
 
@@ -2184,11 +2227,10 @@ AC_ARG_WITH(pam,
                                        # libdl already in LIBS
                                        ;;
                                *)
-                                       LIBPAM="$LIBPAM -ldl"
+                                       SSHDLIBS="$SSHDLIBS -ldl"
                                        ;;
                                esac
                        fi
-                       AC_SUBST(LIBPAM)
                fi
        ]
 )
@@ -3297,25 +3339,43 @@ int main()
                        [#include <arpa/nameser.h>])
        ])
 
+AC_MSG_CHECKING(if struct __res_state _res is an extern)
+AC_LINK_IFELSE([
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+extern struct __res_state _res;
+int main() { return 0; }
+               ],
+               [AC_MSG_RESULT(yes)
+                AC_DEFINE(HAVE__RES_EXTERN, 1,
+                   [Define if you have struct __res_state _res as an extern])
+               ],
+               [ AC_MSG_RESULT(no) ]
+)
+
 # Check whether user wants SELinux support
 SELINUX_MSG="no"
 LIBSELINUX=""
 AC_ARG_WITH(selinux,
        [  --with-selinux   Enable SELinux support],
        [ if test "x$withval" != "xno" ; then
+               save_LIBS="$LIBS"
                AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
                SELINUX_MSG="yes"
                AC_CHECK_HEADER([selinux/selinux.h], ,
                    AC_MSG_ERROR(SELinux support requires selinux.h header))
                AC_CHECK_LIB(selinux, setexeccon, [ LIBSELINUX="-lselinux" ],
                    AC_MSG_ERROR(SELinux support requires libselinux library))
-               save_LIBS="$LIBS"
-               LIBS="$LIBS $LIBSELINUX"
+               SSHDLIBS="$SSHDLIBS $LIBSELINUX"
                AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level)
                LIBS="$save_LIBS"
        fi ]
 )
-AC_SUBST(LIBSELINUX)
 
 # Check whether user wants Kerberos 5 support
 KRB5_MSG="no"
@@ -4227,7 +4287,10 @@ echo "          Compiler: ${CC}"
 echo "    Compiler flags: ${CFLAGS}"
 echo "Preprocessor flags: ${CPPFLAGS}"
 echo "      Linker flags: ${LDFLAGS}"
-echo "         Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
+echo "         Libraries: ${LIBS}"
+if test ! -z "${SSHDLIBS}"; then
+echo "         +for sshd: ${SSHDLIBS}"
+fi
 
 echo ""
 
@@ -4253,12 +4316,12 @@ if test ! -z "$RAND_HELPER_CMDHASH" ; then
 fi
 
 if test ! -z "$NO_PEERCHECK" ; then
-       echo "WARNING: the operating system that you are using does not "
-       echo "appear to support either the getpeereid() API nor the "
-       echo "SO_PEERCRED getsockopt() option. These facilities are used to "
-       echo "enforce security checks to prevent unauthorised connections to "
-       echo "ssh-agent. Their absence increases the risk that a malicious "
-       echo "user can connect to your agent. "
+       echo "WARNING: the operating system that you are using does not"
+       echo "appear to support getpeereid(), getpeerucred() or the"
+       echo "SO_PEERCRED getsockopt() option. These facilities are used to"
+       echo "enforce security checks to prevent unauthorised connections to"
+       echo "ssh-agent. Their absence increases the risk that a malicious"
+       echo "user can connect to your agent."
        echo ""
 fi
 
This page took 0.759889 seconds and 4 git commands to generate.