Skip to content
Open
5 changes: 5 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 12 additions & 37 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
], [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 <sys/resource.h> 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}.
Expand Down Expand Up @@ -585,17 +563,17 @@ AC_DEFUN([APACHE_CHECK_OPENSSL],[
fi
fi

AC_MSG_CHECKING([for OpenSSL version >= 0.9.8a])
AC_TRY_COMPILE([#include <openssl/opensslv.h>],[
AC_CACHE_CHECK([for OpenSSL version >= 0.9.8a], [ap_cv_openssl098a], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],[[
#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`"
Expand Down Expand Up @@ -932,11 +910,8 @@ dnl
AC_DEFUN([APACHE_CHECK_VOID_PTR_LEN], [

AC_CACHE_CHECK([for void pointer length], [ap_cv_void_ptr_lt_long],
[AC_TRY_RUN([
int main(void)
{
return sizeof(void *) < sizeof(long);
}], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof(void *) < sizeof(long);])],
[ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
[ap_cv_void_ptr_lt_long="cross compile - not checked"])])

if test "$ap_cv_void_ptr_lt_long" = "yes"; then
Expand Down Expand Up @@ -1078,9 +1053,9 @@ AC_DEFUN([APACHE_CHECK_JANSSON],[

# attempts to include jansson.h fail me. So lets make sure we can at least
# include its other header file
AC_TRY_COMPILE([#include <jansson_config.h>],[],
[AC_MSG_RESULT(OK)
ac_cv_jansson=yes],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jansson_config.h>]], [[]])],
[AC_MSG_RESULT(OK)
ac_cv_jansson=yes],
[AC_MSG_RESULT(FAILED)])

if test "x$ac_cv_jansson" = "xyes"; then
Expand Down
29 changes: 23 additions & 6 deletions buildconf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -61,6 +62,10 @@ do
--with-regen-expr)
regen_expr=yes
;;

--with-errors)
autoconf_args="$autoconf_args -Werror"
;;

-h|--help)
cat <<EOF
Expand All @@ -85,6 +90,8 @@ Configuration:
--with-regen-expr suppress the timestamp adjustment which prevents the
rebuild of the ap_expr expression parser

--with-errors fail on autoconf generation warnings

APR-Config Mode:

When passing an apr-config executable to --with-apr, buildconf will attempt to
Expand Down Expand Up @@ -254,7 +261,7 @@ if [ $apr_major_version -lt 2 ] ; then
apu_src_dir=`cd $apu_src_dir && pwd`
fi

echo copying build files
echo buildconf: copying build files
if [ -n "${apr_config}" ]; then
# If we're using apr-config, we switch things up a little bit:
# - use automake's config.* scripts instead of APR's
Expand Down Expand Up @@ -294,13 +301,23 @@ if [ -z "${apr_config}" ]; then
fi
fi

echo rebuilding $config_h_in
echo buildconf: rebuilding $config_h_in
rm -f $config_h_in
${AUTOHEADER:-autoheader} 2>&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
Expand All @@ -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`
Expand Down
47 changes: 14 additions & 33 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ dnl
dnl Use ./buildconf to produce a configure script
dnl

AC_PREREQ(2.60)
AC_PREREQ(2.70)
AC_INIT(ABOUT_APACHE)

AC_CONFIG_HEADER(include/ap_config_auto.h)
AC_CONFIG_HEADERS(include/ap_config_auto.h)
AC_CONFIG_AUX_DIR(build)

dnl Absolute source/build directory
Expand All @@ -33,7 +33,7 @@ dnl AC_DISABLE_OPTION_CHECKING defined which turns this off by default.
dnl We want to have this turned off here since our configure calls can
dnl contain options for APR / APR-UTIL configure that are unknown to us.
dnl So avoid confusing the user by turning this off. See also PR 45221.
ifdef([AC_DISABLE_OPTION_CHECKING], [AC_DISABLE_OPTION_CHECKING])
AC_DISABLE_OPTION_CHECKING

dnl XXX we can't just use AC_PREFIX_DEFAULT because that isn't subbed in
dnl by configure until it is too late. Is that how it should be or not?
Expand Down Expand Up @@ -76,7 +76,7 @@ dnl ## Run configure for packages Apache uses
dnl shared library support for these packages doesn't currently
dnl work on some platforms

AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

orig_prefix="$prefix"

Expand Down Expand Up @@ -203,9 +203,6 @@ dnl PCRE and for our config tests will be whatever PCRE determines.
AC_PROG_CC
AC_PROG_CPP

dnl Try to get c99 support for variadic macros
ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])

dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
dnl we got already CC_FOR_BUILD from environment.
if test "x${build_alias}" != "x${host_alias}"; then
Expand Down Expand Up @@ -362,7 +359,7 @@ case $host in
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
*-solaris2*)
dnl This is a hack -- we should be using AC_TRY_RUN instead
dnl This is a hack -- we should be using AC_RUN_IFELSE instead
ap_platform_runtime_link_flag="-R"
dnl solaris 8 and above don't have a thundering herd
dnl not sure about rev's before this one.
Expand Down Expand Up @@ -422,14 +419,7 @@ APACHE_SUBST(MKINSTALLDIRS)
APACHE_SUBST(INSTALL)

dnl Various OS checks that apparently set required flags
ifdef([AC_USE_SYSTEM_EXTENSIONS], [
AC_USE_SYSTEM_EXTENSIONS
], [
AC_AIX
AC_MINIX
])

AC_ISC_POSIX

# Ensure that satisfactory versions of apr and apr-util are
# found if external copies are configured.
Expand Down Expand Up @@ -462,11 +452,6 @@ dnl I think these are just used all over the place, so just check for
dnl them at the base of the tree. If some are specific to a single
dnl directory, they should be moved (Comment #Spoon)

dnl Regarding standard header files: AC_HEADER_STDC doesn't set symbols
dnl HAVE_STRING_H, HAVE_STDLIB_H, etc., so those are checked for
dnl explicitly so that the normal HAVE_xxx_H symbol is defined.

AC_HEADER_STDC
AC_CHECK_HEADERS( \
string.h \
limits.h \
Expand Down Expand Up @@ -550,12 +535,11 @@ APACHE_CHECK_VOID_PTR_LEN
if test $ac_cv_func_gettid = no; then
# On Linux before glibc 2.30, gettid() is only usable via syscall()
AC_CACHE_CHECK([for gettid() via syscall], ap_cv_gettid,
[AC_TRY_RUN(#define _GNU_SOURCE
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
int main(int argc, char **argv) {
pid_t t = syscall(SYS_gettid); return t == -1 ? 1 : 0; },
#include <sys/types.h>]],
[[pid_t t = syscall(SYS_gettid); return t == -1 ? 1 : 0;]])],
[ap_cv_gettid=yes], [ap_cv_gettid=no], [ap_cv_gettid=no])])
if test "$ap_cv_gettid" = "yes"; then
AC_DEFINE(HAVE_SYS_GETTID, 1, [Define if you have gettid() via syscall()])
Expand All @@ -569,13 +553,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 <sys/types.h>
#include <time.h>], [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 <sys/types.h>
#include <time.h>])

AC_CHECK_DECL(CMSG_DATA,,, [#include <sys/types.h>
#include <sys/socket.h>])
Expand Down Expand Up @@ -735,7 +716,7 @@ if test "$enable_pie" = "yes"; then
save_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS -fPIE"
LDFLAGS="$LDFLAGS -pie"
AC_TRY_RUN([static int foo[30000]; int main () { return 0; }],
AC_RUN_IFELSE([AC_LANG_SOURCE([static int foo[30000]; int main () { return 0; }])],
[ap_cv_cc_pie=yes], [ap_cv_cc_pie=no], [ap_cv_cc_pie=yes])
CFLAGS=$save_CFLAGS
LDFLAGS=$save_LDFLAGS
Expand All @@ -744,7 +725,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)
Expand Down
9 changes: 4 additions & 5 deletions modules/cache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ if test "x$ap_distcache_configured" = "x"; then
if test "$ap_distcache_found" = "yes"; then
dnl test for a good version
AC_MSG_CHECKING(for distcache version)
AC_TRY_COMPILE([#include <distcache/dc_client.h>],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <distcache/dc_client.h>]],[[
#if DISTCACHE_CLIENT_API != 0x0001
#error "distcache API version is unrecognised"
#endif],
#endif]])],
[],
[ap_distcache_found="no"])
AC_MSG_RESULT($ap_distcache_found)
Expand All @@ -99,9 +99,8 @@ if test "x$ap_distcache_configured" = "x"; then
ap_distcache_libs="-ldistcache -lnal"
APR_ADDTO(LIBS, [$ap_distcache_libs])

AC_TRY_LINK(
[#include <distcache/dc_client.h>],
[DC_CTX *foo = DC_CTX_new((const char *)0,0);],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <distcache/dc_client.h>]],
[[DC_CTX *foo = DC_CTX_new((const char *)0,0);]])],
[],
[ap_distcache_found="no"])
AC_MSG_RESULT($ap_distcache_found)
Expand Down
7 changes: 3 additions & 4 deletions modules/filters/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ APACHE_MODULE(deflate, Deflate transfer encoding support, , , most, [
fi
APR_ADDTO(LIBS, [-lz])
AC_MSG_CHECKING([for zlib library])
AC_TRY_LINK([#include <zlib.h>], [int i = Z_OK;],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[int i = Z_OK;]])],
[AC_MSG_RESULT(found)
APR_ADDTO(MOD_DEFLATE_LDADD, [$ap_zlib_ldflags -lz])],
[AC_MSG_RESULT(not found)
Expand Down Expand Up @@ -152,10 +152,9 @@ APACHE_MODULE(brotli, Brotli compression support, , , most, [
ap_save_cppflags=$CPPFLAGS
APR_ADDTO(CPPFLAGS, [-I${ap_brotli_base}/include])
AC_MSG_CHECKING([for Brotli library >= 0.6.0 via prefix])
AC_TRY_COMPILE(
[#include <brotli/encode.h>],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <brotli/encode.h>]],[[
const uint8_t *o = BrotliEncoderTakeOutput((BrotliEncoderState*)0, (size_t*)0);
if (o) return *o;],
if (o) return *o;]])],
[AC_MSG_RESULT(yes)
ap_brotli_found=yes
ap_brotli_cflags="-I${ap_brotli_base}/include"
Expand Down
4 changes: 2 additions & 2 deletions modules/http2/config2.m4
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ AC_DEFUN([APACHE_CHECK_NGHTTP2],[
fi

AC_MSG_CHECKING([for nghttp2 version >= 1.2.1])
AC_TRY_COMPILE([#include <nghttp2/nghttp2ver.h>],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nghttp2/nghttp2ver.h>]],[[
#if !defined(NGHTTP2_VERSION_NUM)
#error "Missing nghttp2 version"
#endif
#if NGHTTP2_VERSION_NUM < 0x010201
#error "Unsupported nghttp2 version " NGHTTP2_VERSION_TEXT
#endif],
#endif]])],
[AC_MSG_RESULT(OK)
ac_cv_nghttp2=yes],
[AC_MSG_RESULT(FAILED)])
Expand Down
2 changes: 1 addition & 1 deletion modules/lua/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ AC_DEFUN([CHECK_LUA],

AC_ARG_WITH(
lua,
[AC_HELP_STRING([--with-lua=PATH],[Path to the Lua installation prefix])],
[AS_HELP_STRING([--with-lua=PATH],[Path to the Lua installation prefix])],
lua_path="$withval",
:)

Expand Down
4 changes: 2 additions & 2 deletions modules/md/config2.m4
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ AC_DEFUN([APACHE_CHECK_CURL],[
AC_CHECK_HEADERS([curl/curl.h])

AC_MSG_CHECKING([for curl version >= 7.29])
AC_TRY_COMPILE([#include <curl/curlver.h>],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curl/curlver.h>]],[[
#if !defined(LIBCURL_VERSION_MAJOR)
#error "Missing libcurl version"
#endif
Expand All @@ -109,7 +109,7 @@ AC_DEFUN([APACHE_CHECK_CURL],[
#endif
#if LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR < 29
#error "Unsupported libcurl version " LIBCURL_VERSION
#endif],
#endif]])],
[AC_MSG_RESULT(OK)
ac_cv_curl=yes],
[AC_MSG_RESULT(FAILED)])
Expand Down
Loading
Loading