m4: move nerdcruft m4 into submodule

This commit is contained in:
Danny Robson 2016-06-20 13:30:32 +10:00
parent 4b01f999c4
commit f02ea00f0a
15 changed files with 5 additions and 552 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "m4/nc"]
path = m4/nc
url = git://git.nerdcruft.net/autocruft

View File

@ -10,6 +10,7 @@ AC_INIT([util-cruft], [0.1.0], [danny@nerdcruft.net])
AC_CONFIG_AUX_DIR([build-aux])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4/nc])
AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST

1
m4/nc Submodule

@ -0,0 +1 @@
Subproject commit a3e0bef7f1e93c5a9b835a0439c00a9164de47fc

View File

@ -1,25 +0,0 @@
# SYNOPSIS
#
# NC_APPEND_ONE_COMPILE_FLAG([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# Append the first valid compilation flag in the provided list to FLAGS-VARIABLE
AC_DEFUN([NC_APPEND_ONE_COMPILE_FLAG], [
AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for __dummy in "1"; do
for flag in $1; do
AX_CHECK_COMPILE_FLAG([$flag],
[AX_APPEND_FLAG([$flag], [$2])
break 2],
[],
[$3])
done
AC_MSG_ERROR([unable to find a valid compilation flag in '$1'])
done
])

View File

@ -1,42 +0,0 @@
dnl Attempt to locate boost libraries.
dnl
dnl We explicitly do not use ax_boost_* macros aside from the version checks
dnl because they are catastrophically broken for any remotely complex setup,
dnl and I will just end up punching someone if I have to look at any more
dnl broken M4.
dnl
dnl $1 version required
dnl $2 space delimited list of components required
dnl
dnl sets BOOST_LDFLAGS and BOOST_CPPFLAGS
AC_DEFUN([NC_BOOST], [
AC_REQUIRE([NC_BOOST_BASE])
for _nc_boost_lib in $2; do
AS_CASE([$_nc_boost_lib],
["system"], [NC_BOOST_SYSTEM],
["thread"], [NC_BOOST_THREAD],
["filesystem"], [NC_BOOST_FILESYSTEM],
[AC_MSG_ERROR([unknown boost library $_nc_boost_lib])]
)
dnl find what the variable name is for this package's CPPFLAGS/LIBS
_NAME="$(echo $_nc_boost_lib | tr "[a-z]" "[A-Z]")"
_CPPFLAGS_NAME="BOOST_${_NAME}_CPPFLAGS"
_LDFLAGS_NAME="BOOST_${_NAME}_LDFLAGS"
dnl extract the aforementioned variable's values
_CPPFLAGS="$(eval "echo \$$_CPPFLAGS_NAME")"
_LDFLAGS="$(eval "echo \$$_LDFLAGS_NAME")"
dnl append flags and libs if they don't already exist
for flag in $_CPPFLAGS; do
AS_IF([test " $BOOST_CPPFLAGS " != " *$flag* "], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS $flag"])
done
for lib in $_LDFLAGS; do
AS_IF([test " $BOOST_LDFLAGS " != " *$lib* "], [BOOST_LDFLAGS="$BOOST_LDFLAGS $lib"])
done
done
])

View File

@ -1,7 +0,0 @@
AC_DEFUN([NC_BOOST_BASE], [
: ${BOOST_LDFLAGS=""}
: ${BOOST_CPPFLAGS=""}
BOOST_BASE_LDFLAGS="${BOOST_LDFLAGS}"
BOOST_BASE_CPPFLAGS="${BOOST_CPPFLAGS}"
])

View File

@ -1,37 +0,0 @@
AC_DEFUN([NC_BOOST_FILESYSTEM], [
AC_REQUIRE([NC_BOOST_BASE])
AC_REQUIRE([NC_BOOST_SYSTEM])
AC_LANG_PUSH([C++])
for lib in boost_filesystem; do
AC_MSG_CHECKING([if boost filesystem library is $lib])
nc_save_cxxflags=$CXXFLAGS
nc_save_libs=$LIBS
CXXFLAGS="$CXXFLAGS $BOOST_BASE_CPPFLAGS $BOOST_SYSTEM_CPPFLAGS"
LIBS="$LIBS $BOOST_BASE_LDFLAGS $BOOST_SYSTEM_LDFLAGS -l$lib"
dnl filesystem::path::filename appears to be extern. try calling it.
AC_TRY_LINK(
[@%:@include <boost/filesystem/path.hpp>],
[boost::filesystem::path (".").filename ();],
[nc_cv_boost_filesystem=yes],
[nc_cv_boost_filesystem=no]
)
BOOST_FILESYSTEM_CPPFLAGS=$CXXFLAGS
BOOST_FILESYSTEM_LDFLAGS=-l$lib
CXXFLAGS=$nc_save_cxxflags
LIBS=$nc_save_libs
AC_MSG_RESULT([$nc_cv_boost_filesystem])
AS_IF([test "x$nc_cv_boost_filesystem" = "xyes"], [break;])
done
AC_LANG_POP([C++])
AS_IF([test "x$nc_cv_boost_filesystem" != "xyes"], [
AC_MSG_ERROR([unable to locate a suitable boost_filesystem])
])
])

View File

@ -1,36 +0,0 @@
AC_DEFUN([NC_BOOST_SYSTEM], [
AC_REQUIRE([NC_BOOST_BASE])
AC_LANG_PUSH([C++])
for lib in boost_system; do
AC_MSG_CHECKING([if boost system library is $lib])
nc_save_cxxflags=$CXXFLAGS
nc_save_libs=$LIBS
CXXFLAGS="$CXXFLAGS $BOOST_BASE_CPPFLAGS"
LIBS="$LIBS $BOOST_BASE_LDFLAGS -l$lib"
dnl Try to call boost::system::throws as it appears to be extern
AC_TRY_LINK(
[@%:@include <boost/system/error_code.hpp>],
[boost::system::throws ();],
[nc_cv_boost_system=yes],
[nc_cv_boost_system=no]
)
BOOST_SYSTEM_CPPFLAGS=$CXXFLAGS
BOOST_SYSTEM_LDFLAGS=-l$lib
CXXFLAGS=$nc_save_cxxflags
LIBS=$nc_save_libs
AC_MSG_RESULT([$nc_cv_boost_system])
AS_IF([test "x$nc_cv_boost_system" = "xyes"], [break;])
done
AC_LANG_POP([C++])
AS_IF([test "x$nc_cv_boost_system" != "xyes"], [
AC_MSG_ERROR([unable to locate boost_system])
])
])

View File

@ -1,51 +0,0 @@
AC_DEFUN([NC_BOOST_THREAD], [
AC_REQUIRE([NC_BOOST_BASE])
AC_REQUIRE([NC_BOOST_SYSTEM])
AC_REQUIRE([AC_CANONICAL_HOST])
AS_CASE(["x$host_os"],
["*xmingw*"], [
extra_cflags="-mthreads"
], [
AC_REQUIRE([AX_PTHREAD])
extra_cflags="$PTHREAD_CFLAGS"
extra_libs="$PTHREAD_LIBS"
]
)
AC_LANG_PUSH([C++])
for lib in boost_thread boost_thread_win32; do
AC_MSG_CHECKING([if boost threading library is $lib])
nc_save_cxxflags=$CXXFLAGS
nc_save_libs=$LIBS
CXXFLAGS="$CXXFLAGS $BOOST_BASE_CPPFLAGS $BOOST_SYSTEM_CPPFLAGS $extra_cflags"
LIBS="$LIBS $BOOST_BASE_LDFLAGS $BOOST_SYSTEM_LDFLAGS $extra_libs -l$lib"
dnl Try to call this_thread::yield as it appears to be extern
AC_TRY_LINK(
[
@%:@include <unistd.h>
@%:@include <boost/thread.hpp>
],
[boost::this_thread::yield ();],
[nc_cv_boost_thread=yes],
[nc_cv_boost_thread=no]
)
BOOST_THREAD_CPPFLAGS=$CXXFLAGS
BOOST_THREAD_LDFLAGS=-l$lib
CXXFLAGS=$nc_save_cxxflags
LIBS=$nc_save_libs
AC_MSG_RESULT([$nc_cv_boost_thread])
AS_IF([test "x$nc_cv_boost_thread" = "xyes"], [break;])
done
AC_LANG_POP([C++])
AS_IF([test "x$nc_cv_boost_thread" != "xyes"], [
AC_MSG_ERROR([unable to locate a suitable boost_thread])
])
])

View File

@ -1,24 +0,0 @@
AC_DEFUN([NC_CXX],[
AX_CHECK_COMPILE_FLAG(
[-std=c++1z],
[AX_APPEND_FLAG([-std=c++1z], [CXXFLAGS])],
[AC_MSG_ERROR([Unable to enable c++1z])]
)
AX_APPEND_COMPILE_FLAGS([-pipe], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-deduce-init-list], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-deduce-init-list], [], [-Werror])
AC_C_CONST
AC_C_RESTRICT
AC_C_INLINE
AC_ARG_ENABLE([libcxx], [AS_HELP_STRING([--enable-libcxx], [use clang's cxx library])])
AS_IF([test "x${enable_libcxx}" == "xyes"], [
AX_APPEND_COMPILE_FLAGS([-stdlib=libc++])
])
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden], [], [-Werror])
])

View File

@ -1,43 +0,0 @@
AC_DEFUN([NC_DEBUGGING],[
##-------------------------------------------------------------------------
AX_REQUIRE_DEFINED([AS_HELP_STRING])
AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
##-------------------------------------------------------------------------
AC_ARG_ENABLE([sanitizer], [AS_HELP_STRING([--enable-sanitizer], [enable memory sanitizer])])
AS_IF([test "x$enable_sanitizer" = "xyes"], [
AX_APPEND_COMPILE_FLAGS([-fsanitize=address])
AX_APPEND_COMPILE_FLAGS([-fsanitize=undefined])
AX_APPEND_COMPILE_FLAGS([-ftrapv])
])
AM_CONDITIONAL([WITH_SANITIZER], [test "x${enable_sanitizer}" == "xyes"])
##-------------------------------------------------------------------------
AC_ARG_ENABLE([debugging], [AS_HELP_STRING([--enable-debugging], [enables developer debugging support])])
AS_IF([test "x${enable_debugging}" = "xyes"], [
AC_DEFINE([ENABLE_DEBUGGING], [], [Debugging support enabled])
AC_DEFINE([_GLIBCXX_DEBUG], [], [Use glibcxx debugging mode])
AX_APPEND_COMPILE_FLAGS([-O0])
AX_APPEND_COMPILE_FLAGS([-fstack-protector])
], [
AX_APPEND_COMPILE_FLAGS([-O2])
AX_APPEND_COMPILE_FLAGS([-fno-rtti])
AC_DEFINE([NO_RTTI], [], [RTTI disabled])
])
##-------------------------------------------------------------------------
AS_CASE([${host_os}],
[mingw*], [AX_APPEND_COMPILE_FLAGS([-gstabs])],
[
AX_APPEND_COMPILE_FLAGS([-g])
AX_APPEND_COMPILE_FLAGS([-ggdb])
]
)
])

View File

@ -1,113 +0,0 @@
AC_DEFUN([NC_OPTIMISATION],[
##-------------------------------------------------------------------------
AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
AX_REQUIRE_DEFINED([AX_COMPILER_VENDOR])
AX_COMPILER_VENDOR
##-------------------------------------------------------------------------
## Enable LTO
AC_ARG_ENABLE([lto], [AS_HELP_STRING([--enable-lto], [enable link-time optimisation])])
AS_IF([test "x$enable_lto" == "xyes"], [
AS_IF([test "x$ax_cv_cxx_compiler_vendor" == "xgnu"], [
AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib])
AC_CHECK_TOOLS([AR], [gcc-ar ar])
AC_CHECK_TOOLS([NM], [gcc-nm nm])
])
AX_APPEND_COMPILE_FLAGS([-flto], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-fat-lto-objects], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-flto-odr-type-merging], [], [-Werror])
AX_APPEND_LINK_FLAGS([-fuse-linker-plugin], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fdevirtualize-at-ltrans], [], [-Werror])
])
##-------------------------------------------------------------------------
## Enable frame pointer
AC_ARG_ENABLE([frame-pointer], [AS_HELP_STRING([--enable-frame-pointer], [retain the frame pointer even if optimising])])
AS_IF([test "x$enable_frame_pointer" = "xyes"], [
AX_APPEND_COMPILE_FLAGS([-fno-omit-frame-pointer], [], [-Werror])
])
##-------------------------------------------------------------------------
## Choose the most performant processor architecture and features
AC_CANONICAL_HOST
AS_CASE([$host_cpu],
[x86_64], [
AX_APPEND_COMPILE_FLAGS([-mtune=generic], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-msse], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-msse2], [], [-Werror])
],
[i686], [
AX_APPEND_COMPILE_FLAGS([-march=prescott], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-mtune=generic], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-mcmov], [], [-Werror])
],
[AC_MSG_WARN([unknown host_cpu])]
)
AX_APPEND_COMPILE_FLAGS([-pipe])
# base instruction set requirements for x86
AX_APPEND_COMPILE_FLAGS([-mfpmath=sse], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-msahf], [], [-Werror])
##-------------------------------------------------------------------------
## Enable aggressive code generation optimisations
AS_IF([test "x$enable_debugging" != "xyes"], [
# gcc vectorisation
AX_APPEND_COMPILE_FLAGS([-ftree-vectorize], [], [-Werror])
# clang vectorisation
AX_APPEND_COMPILE_FLAGS([-fvectorize], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fslp-vectorize], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fslp-vectorize-aggressive], [], [-Werror])
# loop hosting/distribution
AX_APPEND_COMPILE_FLAGS([-floop-nest-optimize], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-ftree-loop-distribution], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-ftree-loop-distribute-patterns], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-ftree-loop-im], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-ftree-loop-if-convert-stores], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fivopts], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-funsafe-loop-optimizations], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-floop-interchange], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fpredictive-commoning], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-funswitch-loops], [], [-Werror])
# options that require substantial time/memory
AX_APPEND_COMPILE_FLAGS([-fipa-pta])
dnl # safety removal for performance
AX_APPEND_COMPILE_FLAGS([-fno-stack-protector], [], [-Werror])
])
##-------------------------------------------------------------------------
## Enable code size optimisations (that don't impact performance)
## Note: we assume CXX, and that CXXLINK is g++ not ld, hence the -Wl opt
AS_IF([test "x$enable_debugging" != "xyes"], [
AX_APPEND_COMPILE_FLAGS([-fdevirtualize], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fdevirtualize-speculatively], [], [-Werror])
AX_CHECK_LINK_FLAG([-Wl,--gc-sections], [
AX_APPEND_COMPILE_FLAGS([-fdata-sections], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-ffunction-sections], [], [-Werror])
AX_APPEND_LINK_FLAGS([-Wl,--gc-sections], [], [-Werror])
])
])
])

View File

@ -1,43 +0,0 @@
AC_DEFUN([NC_PLATFORM],[
AC_CANONICAL_HOST
AS_CASE([x${host_os}],
[xmingw*], [nc_cv_platform_win32=yes],
[xlinux*], [nc_cv_platform_linux=yes],
[xfreebsd*], [nc_cv_platform_freebsd=yes],
[AC_MSG_ERROR([unhandled platform ${host_os}])]
)
AM_CONDITIONAL([PLATFORM_WIN32], [test "x$nc_cv_platform_win32" = "xyes"])
AM_CONDITIONAL([PLATFORM_LINUX], [test "x$nc_cv_platform_linux" = "xyes"])
AM_CONDITIONAL([PLATFORM_FREEBSD], [test "x$nc_cv_platform_freebsd" = "xyes"])
AS_CASE([$host_os],
[mingw32], [
AC_DEFINE([WIN32_LEAN_AND_MEAN], [], [reduce win32 header complexity])
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
AC_SUBST([NET_LIBS], [-lws2_32])
AX_APPEND_COMPILE_FLAGS([-DBOOST_THREAD_USE_LIB], [], [-Werror])
## Force as many static libraries as possible to avoid bullshit libc
## cross-library memory management issues.
AX_APPEND_LINK_FLAGS([-static-libstdc++], [], [-Werror])
AX_APPEND_LINK_FLAGS([-static-libgcc], [], [-Werror])
],
[freebsd*], [
AX_APPEND_COMPILE_FLAGS([-I/usr/local/include])
AX_APPEND_LINK_FLAGS([-L/usr/local/lib])
],
[linux*], [:],
[AC_MSG_ERROR([Unknown platform])]
)
AX_APPEND_COMPILE_FLAGS([-fno-common], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-nonansi-builtins], [], [-Werror])
])

View File

@ -1,32 +0,0 @@
AC_DEFUN([NC_SUBPACKAGE_PC], [
base=`basename $1 .pc`
AC_CONFIG_FILES([$1:$base$nc_cv_config_pc_postfix.pc.in])
])
AC_DEFUN([NC_SUBPACKAGE_ENABLE],[
AC_ARG_ENABLE([inline], [AS_HELP_STRING([--enable-inline], [enable building for use as an inline dependency])])
AS_IF([test "x$enable_inline" == "xyes"], [
AC_PROG_LN_S
AC_CACHE_VAL([nc_cv_config_pc_postfix], [nc_cv_config_pc_postfix='-inline'])
AC_CONFIG_COMMANDS([fake/cruft], [
dnl make a fake include directory which looks like the typical
dnl installation prefix. we should probably use AC_CONFIG_LINKS
dnl but i'm not proficient enough at m4 to process the globs
dnl correctly.
AS_MKDIR_P(["fake/cruft"])
$LN_S -nf "$ac_abs_top_srcdir" "fake/cruft/$cruft_base"
AS_IF([test ! -L "fake/cruft/$cruft_base"], [
AC_MSG_ERROR([could not create inline include directory])
])
], [
cruft_base=`echo "${PACKAGE_NAME}" | sed 's/-.*//'`
])
])
])

View File

@ -1,99 +0,0 @@
AC_DEFUN([NC_WARNINGS],[
AC_REQUIRE([AX_APPEND_COMPILE_FLAGS])
AC_REQUIRE([AX_COMPILER_VENDOR])
AX_COMPILER_VENDOR
# -------------------------------------------------------------------------
# Compound warnings
AX_APPEND_COMPILE_FLAGS([-Wall], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wextra], [], [-Werror])
# -------------------------------------------------------------------------
# General warnings
AX_APPEND_COMPILE_FLAGS([-Wbool-compare], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wcast-align], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wcast-qual], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wdisabled-optimization], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wfloat-conversion], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wfloat-equal], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-aggressive-loop-optimizations], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wnoexcept], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wnon-virtual-dtor], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-parentheses], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wpointer-arith], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wredundant-decls], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wshadow], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wsign-compare], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wsign-promo], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wstrict-aliasing], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wtype-limits], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wunsafe-loop-optimizations], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wunused-but-set-variable], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wunused-parameter], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wpessimizing-move], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wswitch-enum], [], [-Werror])
dnl gcc-6.1.0 warnings
AX_APPEND_COMPILE_FLAGS([-Wshift-negative-value], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wnull-dereference], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wduplicated-cond], [], [-Werror])
dnl useless-cast isn't usable on gcc-6.1 due to spurious warnings
dnl see gcc#70844
AX_APPEND_COMPILE_FLAGS([-Wuseless-cast], [], [-Werror])
dnl clang 3.7.1 warnings
AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wdeprecated], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wcovered-switch-default], [], [-Werror])
# -------------------------------------------------------------------------
# Required extensions
#AX_APPEND_COMPILE_FLAGS([-Wgnu-flexible-array-union-member], [], [-Werror])
#AX_APPEND_COMPILE_FLAGS([-Wno-c99-extensions], [], [-Werror])
#AX_APPEND_COMPILE_FLAGS([-Wno-vla-extension], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-vla], [], [-Werror])
dnl GCC will happily compile with any "-Wno" argument, so enable GCC-isms
dnl only if we aren't GCC
AS_IF([test "x$ax_cv_cxx_compiler_vendor" != "xgnu"], [
AX_APPEND_COMPILE_FLAGS([-Wno-c99-extensions], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-flexible-array-extensions], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-gnu-anonymous-struct])
AX_APPEND_COMPILE_FLAGS([-Wno-gnu-conditional-omitted-operand], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-gnu-empty-struct], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-gnu-flexible-array-union-member], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-gnu-zero-variadic-macro-arguments], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-vla-extension], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-zero-length-array], [], [-Werror])
])
# -------------------------------------------------------------------------
# Excessive warnings
AX_APPEND_COMPILE_FLAGS([-Wno-missing-braces], [], [-Werror])
AS_IF([test "x$ax_cv_cxx_compiler_vendor" != "xgnu"], [
AX_APPEND_COMPILE_FLAGS([-Wno-nested-anon-types], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wno-unused-const-variable], [], [-Werror])
])
# -------------------------------------------------------------------------
# Strict warnings
# -------------------------------------------------------------------------
# Advisory warnings
AC_ARG_ENABLE([advisory], [
AS_HELP_STRING([--enable-advisory], [enable advisory warnings])
])
AS_IF([test "x$enable_advisory" = "xyes"], [
AX_APPEND_COMPILE_FLAGS([-Winline], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wsuggest-final-types], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wsuggest-final-methods], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wsuggest-override], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wweak-vtables], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-Wpadded], [], [-Werror])
], [])
])