From 386280f69a9b5050751a88addb42568e09efb44b Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Wed, 31 Oct 2012 17:28:09 -0400 Subject: [PATCH] Update m4 --- bootstrap.sh | 6 +- m4/ax_assert.m4 | 5 +- m4/ax_debug.m4 | 5 +- m4/ax_harden_compiler_flags.m4 | 298 ++++++++++++++++++--------------- m4/ax_hex_version.m4 | 5 +- m4/ax_prog_sphinx_build.m4 | 39 ++--- m4/ax_pthread_timedjoin_np.m4 | 47 +++--- m4/ax_uuid.m4 | 79 +++++---- m4/ax_vcs_checkout.m4 | 8 +- 9 files changed, 269 insertions(+), 223 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index ad4751a6..d822e592 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -672,7 +672,7 @@ function make_target () run_configure fi - if test -n "$TESTS_ENVIRONMENT" -a $VERBOSE; then + if [ -n "$TESTS_ENVIRONMENT" -a $VERBOSE ]; then echo "TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT" fi @@ -869,6 +869,10 @@ autoreconf_setup () GNU_BUILD_FLAGS="$GNU_BUILD_FLAGS --verbose" fi + if [ -z "$ACLOCAL_PATH" ]; then + ACLOCAL_PATH="/usr/local/share/aclocal $ACLOCAL_PATH" + fi + if [[ -z "$WARNINGS" ]]; then if [[ -n "$VCS_CHECKOUT" ]]; then WARNINGS="all,error" diff --git a/m4/ax_assert.m4 b/m4/ax_assert.m4 index 25cd625f..d13787cd 100644 --- a/m4/ax_assert.m4 +++ b/m4/ax_assert.m4 @@ -43,9 +43,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#serial 2 +#serial 4 -AC_DEFUN([AX_ASSERT],[ +AC_DEFUN([AX_ASSERT], + [AC_PREREQ([2.63])dnl AC_REQUIRE([AX_DEBUG]) AC_ARG_ENABLE([assert], [AS_HELP_STRING([--enable-assert], diff --git a/m4/ax_debug.m4 b/m4/ax_debug.m4 index d2e9a480..d83a87e9 100644 --- a/m4/ax_debug.m4 +++ b/m4/ax_debug.m4 @@ -43,9 +43,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#serial 1 +#serial 3 -AC_DEFUN([AX_DEBUG],[ +AC_DEFUN([AX_DEBUG], + [AC_PREREQ([2.63])dnl AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],[ diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4 index af3ee7ff..247665ca 100644 --- a/m4/ax_harden_compiler_flags.m4 +++ b/m4/ax_harden_compiler_flags.m4 @@ -56,108 +56,124 @@ # AX_APPEND_COMPILE_FLAGS([-fstack-protector-all]) -- Issues on 32bit compile # AX_APPEND_COMPILE_FLAGS([-Wlong-long]) -- Don't turn on for compatibility issues memcached_stat_st -#serial 4 - - AC_DEFUN([AX_HARDEN_LINKER_FLAGS], [ - AC_REQUIRE([AX_CHECK_LINK_FLAG]) - AC_REQUIRE([AX_VCS_CHECKOUT]) - AC_REQUIRE([AX_DEBUG]) - AC_REQUIRE([AX_CXX_COMPILER_VERSION]) - - dnl If we are inside of VCS we append -Werror, otherwise we just use it to test other flags - AX_HARDEN_LIB= - ax_append_compile_link_flags_extra= - AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"],[ - AX_CHECK_LINK_FLAG([-Werror],[ - AX_HARDEN_LIB="-Werror $AX_HARDEN_LIB" - ]) - ],[ - AX_CHECK_LINK_FLAG([-Werror],[ - ax_append_compile_link_flags_extra='-Werror' - ]) +#serial 5 + +AC_DEFUN([AX_HARDEN_LINKER_FLAGS], + [AC_PREREQ([2.63])dnl + AC_REQUIRE([AX_CHECK_LINK_FLAG]) + AC_REQUIRE([AX_VCS_CHECKOUT]) + AC_REQUIRE([AX_DEBUG]) + AC_REQUIRE([AX_CXX_COMPILER_VERSION]) + + dnl If we are inside of VCS we append -Werror, otherwise we just use it to test other flags + AX_HARDEN_LIB= + ax_append_compile_link_flags_extra= + AS_IF([test "x$ac_cv_vcs_checkout" = "xyes"], + [AX_CHECK_LINK_FLAG([-Werror], + [AX_HARDEN_LIB="-Werror $AX_HARDEN_LIB"]) + ], + [AX_CHECK_LINK_FLAG([-Werror],[ + ax_append_compile_link_flags_extra='-Werror' ]) + ]) - AX_CHECK_LINK_FLAG([-z relro -z now],[ - AX_HARDEN_LIB="-z relro -z now $AX_HARDEN_LIB" - ],,[$ax_append_compile_link_flags_extra]) + AX_CHECK_LINK_FLAG([-z relro -z now], + [AX_HARDEN_LIB="-z relro -z now $AX_HARDEN_LIB"],, + [$ax_append_compile_link_flags_extra]) - AX_CHECK_LINK_FLAG([-pie],[ - AX_HARDEN_LIB="-pie $AX_HARDEN_LIB" - ],,[$ax_append_compile_link_flags_extra]) + AX_CHECK_LINK_FLAG([-pie], + [AX_HARDEN_LIB="-pie $AX_HARDEN_LIB"],, + [$ax_append_compile_link_flags_extra]) - LIB="$LIB $AX_HARDEN_LIB" - ]) + LIB="$LIB $AX_HARDEN_LIB" + ]) - AC_DEFUN([AX_HARDEN_CC_COMPILER_FLAGS], [ - AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) - AC_REQUIRE([AX_HARDEN_LINKER_FLAGS]) + AC_DEFUN([AX_HARDEN_CC_COMPILER_FLAGS], + [AC_PREREQ([2.63])dnl + AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) + AC_REQUIRE([AX_HARDEN_LINKER_FLAGS]) - AC_LANG_PUSH([C]) + AC_LANG_PUSH([C]) - ac_cv_warnings_as_errors=no - ax_append_compile_cflags_extra= - AS_IF([test "$ac_cv_vcs_checkout" = "yes"],[ - AX_APPEND_COMPILE_FLAGS([-Werror]) - ac_cv_warnings_as_errors=yes - ],[ - AX_APPEND_COMPILE_FLAGS([-Werror],[ax_append_compile_cflags_extra]) - ]) + ac_cv_warnings_as_errors=no + ax_append_compile_cflags_extra= + AS_IF([test "$ac_cv_vcs_checkout" = "yes"],[ + AX_APPEND_COMPILE_FLAGS([-Werror]) + ac_cv_warnings_as_errors=yes + ],[ + AX_APPEND_COMPILE_FLAGS([-Werror],[ax_append_compile_cflags_extra]) + ]) - AX_APPEND_COMPILE_FLAGS([-g]) - AS_IF([test "$ax_enable_debug" = "yes"], [ - AX_APPEND_COMPILE_FLAGS([-ggdb],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-O0],,[$ax_append_compile_cflags_extra]) - ],[ - AX_APPEND_COMPILE_FLAGS([-O2],,[$ax_append_compile_cflags_extra]) - ]) + AX_APPEND_COMPILE_FLAGS([-g]) + AS_IF([test "$ax_enable_debug" = "yes"], [ + AX_APPEND_COMPILE_FLAGS([-ggdb],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-O0],,[$ax_append_compile_cflags_extra]) + ],[ + AX_APPEND_COMPILE_FLAGS([-O2],,[$ax_append_compile_cflags_extra]) + ]) + + AX_APPEND_COMPILE_FLAGS([-fstack-check],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wno-pragmas],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-fstack-check],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wno-pragmas],,[$ax_append_compile_cflags_extra]) - - AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-std=c99],,[$ax_append_compile_cflags_extra]) - dnl Anything below this comment please keep sorted. - AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Waddress],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Warray-bounds],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast],,[$ax_append_compile_cflags_extra]) - dnl Not in use -Wc++-compat - AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wcomment],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wfloat-equal],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wformat-security],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wformat=2],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wlogical-op],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-std=c99],,[$ax_append_compile_cflags_extra]) + dnl Anything below this comment please keep sorted. +AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1],,[$ax_append_compile_cflags_extra]) + dnl -Wmissing-format-attribute + AX_APPEND_COMPILE_FLAGS([-Wno-attributes],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Waddress],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Warray-bounds],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast],,[$ax_append_compile_cflags_extra]) + dnl Not in use -Wc++-compat + AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wcomment],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wfloat-equal],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wformat-security],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wformat=2],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wlogical-op],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers],,[$ax_append_compile_cflags_extra]) + AS_IF([test "$MINGW" = "yes"],[ + AX_APPEND_COMPILE_FLAGS([-Wno-missing-noreturn],,[$ax_append_compile_cflags_extra]) + ],[ AX_APPEND_COMPILE_FLAGS([-Wmissing-noreturn],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wnested-externs],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wnormalized=id],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wold-style-definition],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Woverride-init],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wpointer-sign],,[$ax_append_compile_cflags_extra]) + ]) + AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wnested-externs],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wnormalized=id],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wold-style-definition],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Woverride-init],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wpointer-sign],,[$ax_append_compile_cflags_extra]) + AS_IF([test "$MINGW" = "yes"],[ + AX_APPEND_COMPILE_FLAGS([-Wno-suggest-attribute=const],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-suggest-attribute=noreturn],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-suggest-attribute=pure],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-redundant-decls],,[$ax_append_compile_cflags_extra]) + ],[ AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wswitch-enum],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wundef],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunused-result],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunused-variable],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wwrite-strings],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cflags_extra]) - AX_APPEND_COMPILE_FLAGS([-fwrapv],,[$ax_append_compile_cflags_extra]) - AC_LANG_POP ]) + AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wswitch-enum],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wundef],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused-result],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused-variable],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wwrite-strings],,[$ax_append_compile_cflags_extra]) + AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cflags_extra]) +AX_APPEND_COMPILE_FLAGS([-fwrapv],,[$ax_append_compile_cflags_extra]) + AC_LANG_POP + ]) - AC_DEFUN([AX_HARDEN_CXX_COMPILER_FLAGS], [ + AC_DEFUN([AX_HARDEN_CXX_COMPILER_FLAGS], + [AC_PREREQ([2.63])dnl AC_REQUIRE([AX_HARDEN_CC_COMPILER_FLAGS]) AC_LANG_PUSH([C++]) @@ -169,7 +185,7 @@ ]) AX_APPEND_COMPILE_FLAGS([-g],,[$ax_append_compile_cxxflags_extra]) - AS_IF([test "$ax_enable_debug" = "yes" ], [ + AS_IF([test "$ax_enable_debug" = "yes"], [ AX_APPEND_COMPILE_FLAGS([-O0],,[$ax_append_compile_cxxflags_extra]) AX_APPEND_COMPILE_FLAGS([-ggdb],,[$ax_append_compile_cxxflags_extra]) ],[ @@ -177,59 +193,75 @@ AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2],,[$ax_append_compile_cxxflags_extra]) ]) - AS_IF([test "$ac_cv_vcs_checkout" = "yes" ], [ - AX_APPEND_COMPILE_FLAGS([-Werror],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-fstack-check],,[$ax_append_compile_cxxflags_extra]) - ],[ - AX_APPEND_COMPILE_FLAGS([-Wno-pragmas],,[$ax_append_compile_cxxflags_extra]) - ]) + AS_IF([test "$ac_cv_vcs_checkout" = "yes"], [ + AX_APPEND_COMPILE_FLAGS([-Werror],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-fstack-check],,[$ax_append_compile_cxxflags_extra]) + ],[ + AX_APPEND_COMPILE_FLAGS([-Wno-pragmas],,[$ax_append_compile_cxxflags_extra]) + ]) - AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cxxflags_extra]) - dnl Anything below this comment please keep sorted. - AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Waddress],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Warray-bounds],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wcomment],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wctor-dtor-privacy],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wfloat-equal],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wformat=2],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wall],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wextra],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunknown-pragmas],,[$ax_append_compile_cxxflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wthis-test-should-fail],,[$ax_append_compile_cxxflags_extra]) + dnl Anything below this comment please keep sorted. +AX_APPEND_COMPILE_FLAGS([--param=ssp-buffer-size=1],,[$ax_append_compile_cxxflags_extra]) + dnl -Wmissing-format-attribute + AX_APPEND_COMPILE_FLAGS([-Wno-attributes],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Waddress],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Warray-bounds],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wcomment],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wctor-dtor-privacy],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wfloat-equal],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wformat=2],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized],,[$ax_append_compile_cxxflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers],,[$ax_append_compile_cxxflags_extra]) + AS_IF([test "$MINGW" = "yes"],[ + AX_APPEND_COMPILE_FLAGS([-Wno-missing-noreturn],,[$ax_append_compile_cxxflags_extra]) + ],[ AX_APPEND_COMPILE_FLAGS([-Wmissing-noreturn],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wlogical-op],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wnon-virtual-dtor],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wnormalized=id],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Woverloaded-virtual],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cxxflags_extra]) + ]) + AX_APPEND_COMPILE_FLAGS([-Wlogical-op],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wnon-virtual-dtor],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wnormalized=id],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Woverloaded-virtual],,[$ax_append_compile_cxxflags_extra]) +AX_APPEND_COMPILE_FLAGS([-Wpointer-arith],,[$ax_append_compile_cxxflags_extra]) + AS_IF([test "$MINGW" = "yes"],[ + AX_APPEND_COMPILE_FLAGS([-Wno-suggest-attribute=const],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-suggest-attribute=noreturn],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-error=suggest-attribute=noreturn],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wno-redundant-decls],,[$ax_append_compile_cxxflags_extra]) + ],[ AX_APPEND_COMPILE_FLAGS([-Wredundant-decls],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wswitch-enum],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wundef],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wc++11-compat],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunused-result],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wunused-variable],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wwrite-strings],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-Wformat-security],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cxxflags_extra]) - AX_APPEND_COMPILE_FLAGS([-fwrapv],,[$ax_append_compile_cxxflags_extra]) - AC_LANG_POP + ]) + AX_APPEND_COMPILE_FLAGS([-Wshadow],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wsign-compare],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wswitch-enum],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wundef],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wc++11-compat],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused-result],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wunused-variable],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wwrite-strings],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-Wformat-security],,[$ax_append_compile_cxxflags_extra]) + AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all],,[$ax_append_compile_cxxflags_extra]) +AX_APPEND_COMPILE_FLAGS([-fwrapv],,[$ax_append_compile_cxxflags_extra]) + AC_LANG_POP ]) - AC_DEFUN([AX_HARDEN_COMPILER_FLAGS], [ + AC_DEFUN([AX_HARDEN_COMPILER_FLAGS], + [AC_PREREQ([2.63])dnl AC_REQUIRE([AX_HARDEN_CXX_COMPILER_FLAGS]) AC_REQUIRE([AX_CC_OTHER_FLAGS]) gl_VISIBILITY - AS_IF([ test -n "$CFLAG_VISIBILITY" ], [ CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY" ]) + AS_IF([test -n "$CFLAG_VISIBILITY"], [ CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY" ]) ]) - AC_DEFUN([AX_CC_OTHER_FLAGS], [ + AC_DEFUN([AX_CC_OTHER_FLAGS], + [AC_PREREQ([2.63])dnl AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) AC_REQUIRE([AX_HARDEN_CC_COMPILER_FLAGS]) diff --git a/m4/ax_hex_version.m4 b/m4/ax_hex_version.m4 index bf1bcc1c..48d3a737 100644 --- a/m4/ax_hex_version.m4 +++ b/m4/ax_hex_version.m4 @@ -19,9 +19,10 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 2 +#serial 3 -AC_DEFUN([AX_HEX_VERSION],[ +AC_DEFUN([AX_HEX_VERSION], + [AC_PREREQ([2.63])dnl string_version_$1=`echo $2 | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'` hex_version_$1=`echo $2 | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'` diff --git a/m4/ax_prog_sphinx_build.m4 b/m4/ax_prog_sphinx_build.m4 index 713281bf..8b69df83 100644 --- a/m4/ax_prog_sphinx_build.m4 +++ b/m4/ax_prog_sphinx_build.m4 @@ -4,7 +4,7 @@ # # SYNOPSIS # -# AX_PROG_SPHINX_BUILD +# AX_PROG_SPHINX_BUILD() # # DESCRIPTION # @@ -19,26 +19,27 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 1 +#serial 2 - AC_DEFUN([AX_PROG_SPHINX_BUILD], [ - AC_CHECK_PROGS([PERL], [perl]) - AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:]) - AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found]) - AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found]) +AC_DEFUN([AX_PROG_SPHINX_BUILD], + [AC_PREREQ([2.63])dnl + AC_CHECK_PROGS([PERL], [perl]) + AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:]) + AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found]) + AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found]) - AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:]) - AS_IF([test "x${SPHINXBUILD}" != "x:"],[ - AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[ + AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:]) + AS_IF([test "x${SPHINXBUILD}" != "x:"],[ + AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[ - ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1 - AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes], - [ac_cv_recent_sphinx=no]) - rm -rf conftest.d - ]) + ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1 + AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes], + [ac_cv_recent_sphinx=no]) + rm -rf conftest.d ]) - - AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"]) - AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"]) - AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"]) ]) + + AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"]) + AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"]) + AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"]) +]) diff --git a/m4/ax_pthread_timedjoin_np.m4 b/m4/ax_pthread_timedjoin_np.m4 index daec6c56..39de8fa8 100644 --- a/m4/ax_pthread_timedjoin_np.m4 +++ b/m4/ax_pthread_timedjoin_np.m4 @@ -19,33 +19,32 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 5 +#serial 6 - AC_DEFUN([AX_PTHREAD_TIMEDJOIN_NP], [ - AC_REQUIRE([AX_PTHREAD]) - AC_CACHE_CHECK([check for pthread_timedjoin_np], [ax_cv_pthread_timedjoin_np], [ - AX_SAVE_FLAGS - CFLAGS="$PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([ +AC_DEFUN([AX_PTHREAD_TIMEDJOIN_NP], + [AC_PREREQ([2.63])dnl + AC_REQUIRE([AX_PTHREAD]) + AC_CACHE_CHECK([check for pthread_timedjoin_np], [ax_cv_pthread_timedjoin_np], + [AX_SAVE_FLAGS + CFLAGS="$PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS" + AC_LANG_PUSH([C]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [ #include #include - ], [ - pthread_t thread; - pthread_timedjoin_np(thread, NULL, NULL); - ])], - [ax_cv_pthread_timedjoin_np=yes], - []) + ],[ + pthread_t thread; + pthread_timedjoin_np(thread, NULL, NULL); + ])], + [ax_cv_pthread_timedjoin_np=yes],[]) - AC_LANG_POP - AX_RESTORE_FLAGS - ]) - - AS_IF([test "$ax_cv_pthread_timedjoin_np" = yes],[ - AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[1],[Define if pthread_timedjoin_np is present in pthread.h.])],[ - AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[0],[Define if pthread_timedjoin_np is present in pthread.h.]) - ]) + AC_LANG_POP + AX_RESTORE_FLAGS ]) + AS_IF([test "$ax_cv_pthread_timedjoin_np" = yes], + [AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[1],[Define if pthread_timedjoin_np is present in pthread.h.])], + [AC_DEFINE(HAVE_PTHREAD_TIMEDJOIN_NP,[0],[Define if pthread_timedjoin_np is present in pthread.h.])]) + ]) diff --git a/m4/ax_uuid.m4 b/m4/ax_uuid.m4 index 5f272e18..a6b5b496 100644 --- a/m4/ax_uuid.m4 +++ b/m4/ax_uuid.m4 @@ -1,11 +1,12 @@ +# vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # =========================================================================== # https://github.com/BrianAker/ddm4 # =========================================================================== # # SYNOPSIS # -# AX_UUID -# AX_UUID_GENERATE_TIME_SAFE +# AX_UUID() +# AX_UUID_GENERATE_TIME_SAFE() # # DESCRIPTION # @@ -20,30 +21,32 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 4 +#serial 5 -AC_DEFUN([AX_UUID], [ - AC_CHECK_HEADER([uuid/uuid.h], [ - AC_CACHE_CHECK([check to see if -luuid is not needed], [ax_cv_libuuid_is_required], [ - AC_LANG_PUSH([C]) - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ +AC_DEFUN([AX_UUID], + [AC_PREREQ([2.63])dnl + AC_CHECK_HEADER([uuid/uuid.h],[ + + AC_CACHE_CHECK([check to see if -luuid is needed], [ax_cv_libuuid_is_required], + [AC_LANG_PUSH([C]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include ], [ uuid_t out; uuid_generate(out); ])], [ax_cv_libuuid_is_required=no], - [ax_cv_libuuid_is_required=maybe], + [ax_cv_libuuid_is_required=yes], [AC_MSG_WARN([test program execution failed])]) AC_LANG_POP ]) - AS_IF([test "$ax_cv_libuuid_is_required" = maybe], [ - AC_CACHE_CHECK([check to see if -luuid is needed], [ax_cv_libuuid_works], [ - save_LIBS="$LIBS" + AS_IF([test "$ax_cv_libuuid_is_required" = yes], + [AC_CACHE_CHECK([check to see if -luuid is needed], [ax_cv_libuuid_works], + [AX_SAVE_FLAGS LIBS="-luuid $LIBS" AC_LANG_PUSH([C]) - AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include ], [ uuid_t out; uuid_generate(out); ])], @@ -51,31 +54,34 @@ AC_DEFUN([AX_UUID], [ [ax_cv_libuuid_works=no], [AC_MSG_WARN([test program execution failed])]) AC_LANG_POP - LIBS="$save_LIBS" - ]) - AS_IF([test "$ax_cv_libuuid_works" = yes], [ - AC_SUBST([LIBUUID_LDFLAGS],[-luuid])]) + AX_RESTORE_FLAGS]) ]) - AS_IF([test "$ax_cv_libuuid_is_required" = no], [UUID_UUID_H=yes]) - AS_IF([test "$ax_cv_libuuid_works" = yes], [UUID_UUID_H=yes]) - ]) + AS_IF([test "$ax_cv_libuuid_is_required" = yes], + [AS_IF([test "$ax_cv_libuuid_works" = yes],[ax_libuuid=yes])], + [ax_libuuid=yes]) + ],[ax_libuuid=no]) - AS_IF([test "$UUID_UUID_H" = yes], [ - AC_DEFINE([HAVE_UUID_UUID_H], [1], [Have uuid/uuid.h]) - ],[ - AC_DEFINE([HAVE_UUID_UUID_H], [0], [Have uuid/uuid.h]) - ]) + AS_IF([test "$ax_libuuid" = yes], + [AC_DEFINE([HAVE_UUID_UUID_H],[1],[Have uuid/uuid.h]) + AS_IF([test "$ax_cv_libuuid_is_required" = yes],[ LIBUUID_LDFLAGS='-luuid' ])], + [AC_DEFINE([HAVE_UUID_UUID_H],[0],[Have uuid/uuid.h]) + ]) + + AC_SUBST([LIBUUID_LDFLAGS]) + AM_CONDITIONAL([HAVE_LIBUUID],[test "$ax_libuuid" = yes]) ]) - AC_DEFUN([AX_UUID_GENERATE_TIME_SAFE], [ - AC_REQUIRE([AX_UUID]) - AC_CACHE_CHECK([for uuid_generate_time_safe], [ax_cv_uuid_generate_time_safe], [ - save_LIBS="$LIBS" + AC_DEFUN([AX_UUID_GENERATE_TIME_SAFE], + [AC_PREREQ([2.68])dnl + AC_REQUIRE([AX_UUID])dnl + AC_CACHE_CHECK([for uuid_generate_time_safe], + [ax_cv_uuid_generate_time_safe], + [AX_SAVE_FLAGS LIBS="$LIBUUID_LDFLAGS $LIBS" AC_LANG_PUSH([C]) AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include ], [ + AC_LANG_PROGRAM([#include ],[ uuid_t out; uuid_generate_time_safe(out); ])], @@ -83,11 +89,10 @@ AC_DEFUN([AX_UUID], [ [ax_cv_uuid_generate_time_safe=no], [AC_MSG_WARN([test program execution failed])]) AC_LANG_POP - LIBS="$save_LIBS" + AX_RESTORE_FLAGS ]) - AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes],[ - AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE],[1],[Define if uuid_generate_time_safe is present in uuid/uuid.h.])],[ - AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE],[0],[Define if uuid_generate_time_safe is present in uuid/uuid.h.]) - ]) + AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes], + [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE],[1],[Define if uuid_generate_time_safe is present in uuid/uuid.h.])], + [AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE],[0],[Define if uuid_generate_time_safe is present in uuid/uuid.h.])]) ]) diff --git a/m4/ax_vcs_checkout.m4 b/m4/ax_vcs_checkout.m4 index 9475cab7..9f902c0a 100644 --- a/m4/ax_vcs_checkout.m4 +++ b/m4/ax_vcs_checkout.m4 @@ -45,10 +45,11 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#serial 5 +#serial 6 AC_DEFUN([AX_VCS_SYSTEM], - [AC_CACHE_CHECK([for vcs system], [ac_cv_vcs_system], + [AC_PREREQ([2.63])dnl + AC_CACHE_CHECK([for vcs system], [ac_cv_vcs_system], [ac_cv_vcs_system="none" AS_IF([test -d ".bzr"],[ac_cv_vcs_system="bazaar"]) AS_IF([test -d ".svn"],[ac_cv_vcs_system="svn"]) @@ -58,7 +59,8 @@ AC_DEFUN([AX_VCS_SYSTEM], ]) AC_DEFUN([AX_VCS_CHECKOUT], - [AC_REQUIRE([AX_VCS_SYSTEM]) + [AC_PREREQ([2.63])dnl + AC_REQUIRE([AX_VCS_SYSTEM]) AC_CACHE_CHECK([for vcs checkout],[ac_cv_vcs_checkout], [AS_IF([test "x$ac_cv_vcs_system" != "xnone"], [ac_cv_vcs_checkout=yes], -- 2.30.2