Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoconf warnings #380

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
36 changes: 7 additions & 29 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
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
15 changes: 5 additions & 10 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <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 @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion os/unix/config.m4
Original file line number Diff line number Diff line change
@@ -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 <sys/resource.h> doesn't define it for us]),
[#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>])

AC_CHECK_HEADERS(sys/time.h sys/resource.h sys/sem.h sys/ipc.h)

Expand Down
Loading