From be89bdcf7c8cbf9204c6ef83524cf050fd0ac521 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 15 Jul 2020 10:12:55 -0600 Subject: [PATCH] Fix some warnings displayed by autoconf 2.69b This fixes the missing HAVE_GSSAPI_GSSAPI_H define in config.h.in. TODO: replace shadow_funcs variable in function checks with literals --- config.h.in | 6 ++++ configure | 81 +++++++++++++++++++++++++++++++++------------------- configure.ac | 31 +++++++++++++------- 3 files changed, 78 insertions(+), 40 deletions(-) diff --git a/config.h.in b/config.h.in index 2501ffd5e..52b1915da 100644 --- a/config.h.in +++ b/config.h.in @@ -374,9 +374,15 @@ /* Define to 1 if you have the `grantpt' function. */ #undef HAVE_GRANTPT +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSAPI_GSSAPI_H + /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_KRB5_H +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSAPI_H + /* Define to 1 if you have the `gss_krb5_ccache_name' function. */ #undef HAVE_GSS_KRB5_CCACHE_NAME diff --git a/configure b/configure index 7bd267f8e..66f0ef270 100755 --- a/configure +++ b/configure @@ -26252,9 +26252,12 @@ fi O_CPPFLAGS="$CPPFLAGS" for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}" + # Use AC_PREPROC_IFELSE to check existence to avoid caching + # since we test with multiple values of CPPFLAGS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + + #include int main () { @@ -26262,44 +26265,63 @@ main () ; return 0; } -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - found="gssapi/gssapi.h"; break -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ - ; - return 0; -} _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : - found="gssapi.h"; break -fi -rm -f conftest.err conftest.i conftest.$ac_ext -fi -rm -f conftest.err conftest.i conftest.$ac_ext - done - if test X"$found" != X"no"; then - for ac_header in $found + + for ac_header in gssapi/gssapi.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi.h" "ac_cv_header_gssapi_gssapi_h" "$ac_includes_default" +if test "x$ac_cv_header_gssapi_gssapi_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_GSSAPI_GSSAPI_H 1 _ACEOF fi done - if test X"$found" = X"gssapi/gssapi.h"; then - for ac_header in gssapi/gssapi_krb5.h + break + +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include +int +main () +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + + for ac_header in gssapi.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "gssapi.h" "ac_cv_header_gssapi_h" "$ac_includes_default" +if test "x$ac_cv_header_gssapi_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GSSAPI_H 1 +_ACEOF + +fi + +done + + break + +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +fi +rm -f conftest.err conftest.i conftest.$ac_ext + done + if test X"$ac_cv_header_gssapi_gssapi_h" != X"no"; then + for ac_header in gssapi/gssapi_krb5.h do : ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi_krb5.h" "ac_cv_header_gssapi_gssapi_krb5_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_krb5_h" = xyes; then : @@ -26311,8 +26333,7 @@ fi done - fi - else + elif test X"$ac_cv_header_gssapi_h" = X"no"; then CPPFLAGS="$O_CPPFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS" >&5 $as_echo "$as_me: WARNING: Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS" >&2;} diff --git a/configure.ac b/configure.ac index 217bc401d..c28816363 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl AC_PREREQ([2.59]) AC_INIT([sudo], [1.9.1], [https://bugzilla.sudo.ws/], [sudo]) -AC_CONFIG_HEADER([config.h pathnames.h]) +AC_CONFIG_HEADERS([config.h pathnames.h]) AC_CONFIG_SRCDIR([src/sudo.c]) dnl dnl Note: this must come after AC_INIT @@ -3373,7 +3373,7 @@ case "$enable_zlib" in CPPFLAGS='-I$(top_builddir)/lib/zlib -I$(top_srcdir)/lib/zlib '"${CPPFLAGS}" ZLIB="${ZLIB}"' $(top_builddir)/lib/zlib/libsudo_z.la' ZLIB_SRC=lib/zlib - AC_CONFIG_HEADER([lib/zlib/zconf.h]) + AC_CONFIG_HEADERS([lib/zlib/zconf.h]) AC_CONFIG_FILES([lib/zlib/Makefile]) if test X"$enable_shared" = X"no" -o "$enable_zlib" = "static"; then if test "$enable_zlib" = "shared"; then @@ -3972,7 +3972,7 @@ if test ${with_passwd-'no'} != "no"; then _LIBS="$LIBS" LIBS="$LIBS $shadow_libs" found=no - AC_CHECK_FUNCS($shadow_funcs, [found=yes]) + AC_CHECK_FUNCS([$shadow_funcs], [found=yes]) if test "$found" = "yes"; then case "$shadow_funcs" in *getprpwnam*) SECUREWARE=1;; @@ -4124,14 +4124,25 @@ if test ${with_ldap-'no'} != "no"; then O_CPPFLAGS="$CPPFLAGS" for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}" - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include ]])], [found="gssapi/gssapi.h"; break], [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include ]])], [found="gssapi.h"; break])]) + # Use AC_PREPROC_IFELSE to check existence to avoid caching + # since we test with multiple values of CPPFLAGS + AC_PREPROC_IFELSE([ + AC_LANG_PROGRAM([[#include ]]) + ], [ + AC_CHECK_HEADERS([gssapi/gssapi.h]) + break + ], [ + AC_PREPROC_IFELSE([ + AC_LANG_PROGRAM([[#include ]]) + ], [ + AC_CHECK_HEADERS([gssapi.h]) + break + ]) + ]) done - if test X"$found" != X"no"; then - AC_CHECK_HEADERS([$found]) - if test X"$found" = X"gssapi/gssapi.h"; then - AC_CHECK_HEADERS([gssapi/gssapi_krb5.h]) - fi - else + if test X"$ac_cv_header_gssapi_gssapi_h" != X"no"; then + AC_CHECK_HEADERS([gssapi/gssapi_krb5.h]) + elif test X"$ac_cv_header_gssapi_h" = X"no"; then CPPFLAGS="$O_CPPFLAGS" AC_MSG_WARN([Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS]) fi