From: Pieter Lexis Date: Thu, 7 Jan 2021 11:53:41 +0000 (+0100) Subject: Fix warnings on autoconf 2.70 X-Git-Tag: rec-4.5.0-alpha1~12^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=691c80fbd804bf7d18e9a95f820ca18434dc3eff;p=thirdparty%2Fpdns.git Fix warnings on autoconf 2.70 This bumps the minimal autoconf requirement to 2.69 as well. This version is on Ubuntu 16.04 (EOL due in 3 months) and CentOS 7. Closes #9918 --- diff --git a/configure.ac b/configure.ac index 0f15838e87..cf4f2ffb22 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,10 @@ -AC_PREREQ([2.61]) +AC_PREREQ([2.69]) AC_INIT([pdns], m4_esyscmd([builder-support/gen-version])) AC_CONFIG_SRCDIR([pdns/receiver.cc]) AC_CONFIG_MACRO_DIR([m4]) +AC_USE_SYSTEM_EXTENSIONS AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([build-aux]) @@ -25,7 +26,6 @@ AC_PROG_CC AM_PROG_CC_C_O PDNS_CHECK_BISON PDNS_CHECK_FLEX -AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CXX @@ -35,10 +35,6 @@ AS_IF([test "x$CXX" = "xno" || test "x$CXX:x$GXX" = "xg++:x"], AC_LANG([C++]) -AC_DEFINE([_GNU_SOURCE], [1], - [Define _GNU_SOURCE so that we get all necessary prototypes] -) - # Warn when pkg.m4 is missing m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config]) diff --git a/m4/pdns_check_flex.m4 b/m4/pdns_check_flex.m4 index e6f46d4e0f..41f6ee6e14 100644 --- a/m4/pdns_check_flex.m4 +++ b/m4/pdns_check_flex.m4 @@ -1,5 +1,5 @@ AC_DEFUN([PDNS_CHECK_FLEX], [ - AC_REQUIRE([AC_PROG_LEX]) + AC_PROG_LEX(noyywrap) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([if the lexer is flex],[pdns_cv_prog_flex],[ diff --git a/m4/pdns_check_lmdb.m4 b/m4/pdns_check_lmdb.m4 index f1921bde91..5a54f07391 100644 --- a/m4/pdns_check_lmdb.m4 +++ b/m4/pdns_check_lmdb.m4 @@ -2,7 +2,7 @@ dnl invoking this makes lmdb a requirement AC_DEFUN([PDNS_CHECK_LMDB], [ AC_MSG_CHECKING([where to find the lmdb library and headers]) AC_ARG_WITH([lmdb], - AC_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[ + AS_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[ with_lmdb=$withval ],[ with_lmdb=auto diff --git a/m4/pdns_enable_remotebackend_zeromq.m4 b/m4/pdns_enable_remotebackend_zeromq.m4 index b20d1b2680..b40c495f11 100644 --- a/m4/pdns_enable_remotebackend_zeromq.m4 +++ b/m4/pdns_enable_remotebackend_zeromq.m4 @@ -38,7 +38,7 @@ AC_DEFUN([PDNS_ENABLE_REMOTEBACKEND_ZEROMQ],[ CXXFLAGS="$old_CXXFLAGS" LDFLAGS="$old_LDFLAGS" ], - [AC_MSG_ERROR([remotebackend \"zeromq\" selected but the \"remote\" backend itself is not selected. Please add \"remote\" to your modules or dynmodules list and re-run configure!])] + [AC_MSG_ERROR([remotebackend "zeromq" selected but the "remote" backend itself is not selected. Please add "remote" to your modules or dynmodules list and re-run configure!])] ) ] ) diff --git a/m4/tm-gmtoff.m4 b/m4/tm-gmtoff.m4 index e2655852c6..9c1c65d01b 100644 --- a/m4/tm-gmtoff.m4 +++ b/m4/tm-gmtoff.m4 @@ -3,12 +3,20 @@ dnl (Borrowed from the Gaim project) dnl The Gaim Project (now know as Pidgin) is licensed under the GPLv2 AC_DEFUN([MC_TM_GMTOFF], -[AC_REQUIRE([AC_STRUCT_TM])dnl -AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, -[AC_TRY_COMPILE([#include -#include <$ac_cv_struct_tm>], [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_TM_GMTOFF, 1, [tm_gmtoff is available.]) -fi + [AC_REQUIRE([AC_STRUCT_TM])dnl + AC_CACHE_CHECK([for tm_gmtoff in struct tm], + ac_cv_struct_tm_gmtoff, + [ + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#include <$ac_cv_struct_tm> +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_TM_GMTOFF, 1, [tm_gmtoff is available.]) + fi ]) diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 250cf67295..cba6cc6853 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -1,4 +1,4 @@ -AC_PREREQ([2.61]) +AC_PREREQ([2.69]) AC_INIT([dnsdist], m4_esyscmd(build-aux/gen-version)) AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip parallel-tests 1.11 subdir-objects]) @@ -8,7 +8,6 @@ AC_CONFIG_HEADERS([config.h]) AC_PROG_CC AC_PROG_CXX AC_LANG([C++]) -AC_GNU_SOURCE AC_DEFINE([DNSDIST], [1], [This is dnsdist] diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index 5b93a347dd..4b05096fd2 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -1,4 +1,4 @@ -AC_PREREQ([2.61]) +AC_PREREQ([2.69]) AC_INIT([pdns-recursor], m4_esyscmd(build-aux/gen-version)) AC_CONFIG_AUX_DIR([build-aux]) @@ -7,6 +7,7 @@ AM_SILENT_RULES([yes]) AC_CONFIG_SRCDIR([pdns_recursor.cc]) AC_CONFIG_MACRO_DIR([m4]) +AC_USE_SYSTEM_EXTENSIONS AC_CONFIG_HEADERS([config.h]) AC_CANONICAL_HOST @@ -24,8 +25,6 @@ AC_PROG_CC AC_PROG_CXX AC_LANG([C++]) -AC_GNU_SOURCE - AC_DEFINE([RECURSOR], [1], [This is the PowerDNS Recursor] ) @@ -34,7 +33,7 @@ AC_DEFINE([RECURSOR], [1], m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config]) AX_CXX_COMPILE_STDCXX_17([noext], [mandatory]) -AC_PROG_LIBTOOL +LT_INIT() PDNS_CHECK_OS PDNS_CHECK_NETWORK_LIBS