m4: bump m4 dependencies

This commit is contained in:
Danny Robson 2015-02-03 00:15:28 +11:00
parent 60787655b3
commit bb89f0e94f
3 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,25 @@
# 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,5 +1,9 @@
AC_DEFUN([NC_CXX],[
AX_APPEND_COMPILE_FLAGS([-std=c++1y])
AX_CHECK_COMPILE_FLAG(
[-std=c++1y],
[AX_APPEND_FLAG([-std=c++1y], [CXXFLAGS])],
[AC_ERROR([Unable to enable c++1y])]
)
AX_APPEND_COMPILE_FLAGS([-fno-deduce-init-list], [], [-Werror])
AX_APPEND_COMPILE_FLAGS([-fno-deduce-init-list], [], [-Werror])

View File

@ -3,6 +3,7 @@ AC_DEFUN([NC_DEBUGGING],[
AX_REQUIRE_DEFINED([AS_HELP_STRING])
AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
AX_REQUIRE_DEFINED([NC_APPEND_ONE_COMPILE_FLAG])
##-------------------------------------------------------------------------
AC_ARG_ENABLE([sanitizer], [
@ -31,7 +32,7 @@ AC_DEFUN([NC_DEBUGGING],[
AC_DEFINE([ENABLE_DEBUGGING], [], [Debugging support enabled])
AC_DEFINE([_GLIBCXX_DEBUG], [], [Use glibcxx debugging mode])
AX_APPEND_COMPILE_FLAGS([-O0])
NC_APPEND_ONE_COMPILE_FLAG([-O0])
], [
AX_APPEND_COMPILE_FLAGS([-O2])
])