diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 50433612e67..9e032ae1e52 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -36,6 +36,11 @@ jobs: SKIP_TESTING=1 TEST_LOGNO=1 # ------------------------------------------------------------------------- + - name: autoconf warnings test + env: | + BUILDCONFIG=--with-errors + SKIP_TESTING=1 + # ------------------------------------------------------------------------- - name: Default # ------------------------------------------------------------------------- - name: All-static modules diff --git a/acinclude.m4 b/acinclude.m4 index c40cbd2304b..21fb645310a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -4,7 +4,7 @@ dnl Autoconf 2.50 can not handle substr correctly. It does have dnl AC_HELP_STRING, so let's try to call it if we can. dnl Note: this define must be on one line so that it can be properly returned dnl as the help string. -AC_DEFUN([APACHE_HELP_STRING],[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])dnl +AC_DEFUN([APACHE_HELP_STRING],[ifdef([AS_HELP_STRING], AS_HELP_STRING($1, $2),[ifelse(regexp(AC_ACVERSION, 2\.1), -1, AC_HELP_STRING($1,$2),[ ]$1 substr([ ],len($1))$2)])])dnl dnl APACHE_SUBST(VARIABLE) dnl Makes VARIABLE available in generated files @@ -120,28 +120,6 @@ AC_DEFUN([APACHE_GEN_CONFIG_VARS],[ done ]) -dnl -dnl APACHE_TYPE_RLIM_T -dnl -dnl If rlim_t is not defined, define it to int -dnl -AC_DEFUN([APACHE_TYPE_RLIM_T], [ - AC_CACHE_CHECK([for rlim_t], ac_cv_type_rlim_t, [ - AC_TRY_COMPILE([ -#include -#include -#include -], [rlim_t spoon;], [ - ac_cv_type_rlim_t=yes - ],[ac_cv_type_rlim_t=no - ]) - ]) - if test "$ac_cv_type_rlim_t" = "no" ; then - AC_DEFINE(rlim_t, int, - [Define to 'int' if doesn't define it for us]) - fi -]) - dnl the list of build variables which are available for customization on a dnl per module subdir basis (to be inserted into modules.mk with a "MOD_" dnl prefix, i.e. MOD_CFLAGS etc.). Used in APACHE_MODPATH_{INIT,FINISH}. @@ -585,17 +563,17 @@ AC_DEFUN([APACHE_CHECK_OPENSSL],[ fi fi - AC_MSG_CHECKING([for OpenSSL version >= 0.9.8a]) - AC_TRY_COMPILE([#include ],[ + AC_CACHE_CHECK([for OpenSSL version >= 0.9.8a], [ap_cv_openssl098a], [ + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include ],[ #if !defined(OPENSSL_VERSION_NUMBER) #error "Missing OpenSSL version" #endif #if OPENSSL_VERSION_NUMBER < 0x0090801f #error "Unsupported OpenSSL version " OPENSSL_VERSION_TEXT -#endif], - [AC_MSG_RESULT(yes) - ac_cv_openssl=yes], - [AC_MSG_RESULT(no)]) +#endif]), [ap_cv_openssl098a=yes], [ap_cv_openssl098a=no])]) + if test "x$ap_cv_openssl098a" = xyes; then + ac_cv_openssl=yes + fi if test "x$ac_cv_openssl" = "xyes"; then ap_openssl_libs="${ap_openssl_libs:--lssl -lcrypto} `$apr_config --libs`" diff --git a/buildconf b/buildconf index e7199a70d87..74ad23c7a40 100755 --- a/buildconf +++ b/buildconf @@ -36,6 +36,7 @@ esac apr_src_dir="srclib/apr ../apr" apu_src_dir="" +autoconf_args="-Wall" # By default, touch the checked-in sources to suppress regeneration of # the ap_expr parser. @@ -61,6 +62,10 @@ do --with-regen-expr) regen_expr=yes ;; + + --with-errors) + autoconf_args="$autoconf_args -Werror" + ;; -h|--help) cat <&1 | grep -v "$cross_compile_warning" +if ${AUTOHEADER:-autoheader} ${autoconf_args}; then + : +else + echo buildconf: ERROR: autoheader failed, bailing out. + exit 1 +fi -echo rebuilding configure +echo buildconf: rebuilding configure rm -f config.cache -${AUTOCONF:-autoconf} 2>&1 | grep -v "$cross_compile_warning" +if ${AUTOCONF:-autoconf} ${autoconf_args}; then + : +else + echo buildconf: ERROR: autoconf failed, bailing out. + exit 2 +fi # Remove autoconf 2.5x cache directories rm -rf autom4te*.cache @@ -309,7 +326,7 @@ rm -rf autom4te*.cache rm -rf bsd_converted if [ -f `which cut` ]; then - echo rebuilding rpm spec file + echo buildconf: rebuilding rpm spec file ( VMMN=`build/get-version.sh mmn include/ap_mmn.h MODULE_MAGIC_NUMBER` EPOCH=`build/get-version.sh epoch include/ap_release.h AP_SERVER` REVISION=`build/get-version.sh all include/ap_release.h AP_SERVER` diff --git a/configure.in b/configure.in index c56c8972afd..a835570a43c 100644 --- a/configure.in +++ b/configure.in @@ -429,8 +429,6 @@ AC_AIX AC_MINIX ]) -AC_ISC_POSIX - # Ensure that satisfactory versions of apr and apr-util are # found if external copies are configured. if test "${apr_found}" = "yes"; then @@ -569,13 +567,10 @@ case ${host}X${ac_cv_func_gettid}X${ap_cv_gettid} in esac dnl ## Check for the tm_gmtoff field in struct tm to get the timezone diffs -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include -#include ], [struct tm tm; tm.tm_gmtoff;], - ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) -if test "$ac_cv_struct_tm_gmtoff" = "yes"; then - AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field]) -fi +AC_CHECK_MEMBER([struct tm.tm_gmtoff], + [AC_DEFINE(HAVE_GMTOFF, 1, [Define if struct tm has a tm_gmtoff field])], [], + [#include +#include ]) AC_CHECK_DECL(CMSG_DATA,,, [#include #include ]) @@ -744,7 +739,7 @@ if test "$enable_pie" = "yes"; then PICFLAGS="-fPIE" PILDFLAGS="-pie" else - AC_ERROR([--enable-pie requested but $CC failed using PIE flags]) + AC_MSG_ERROR([--enable-pie requested but $CC failed using PIE flags]) fi fi APACHE_SUBST(PICFLAGS) diff --git a/os/unix/config.m4 b/os/unix/config.m4 index dacbf6b5398..a2b443334ed 100644 --- a/os/unix/config.m4 +++ b/os/unix/config.m4 @@ -1,5 +1,10 @@ if test "$OS" = "unix" ; then - APACHE_TYPE_RLIM_T + AC_CHECK_TYPE(rlim_t, [], + AC_DEFINE_UNQUOTED(rlim_t, int, + [Define to 'int' if doesn't define it for us]), + [#include +#include +#include ]) AC_CHECK_HEADERS(sys/time.h sys/resource.h sys/sem.h sys/ipc.h)