Commit 48e824a0 authored by Karl Wette's avatar Karl Wette

lalsuite_build.m4: add convenience macros for checking multiple flags

- Should work for gcc, clang, icc
Original: d18047cddd2a03952632d63577811e0d36166301
parent ddb106a7
# -*- mode: autoconf; -*-
# lalsuite_build.m4 - top level build macros
#
# serial 107
# serial 108
# not present in older versions of pkg.m4
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
......@@ -78,6 +78,44 @@ AC_DEFUN([LALSUITE_POP_UVARS],[
# end $0
])
AC_DEFUN([_LALSUITE_CHECK_ERROR_FLAGS],[
# $0: check for flags required to trigger an error for unknown flags
# gcc, clang: -Werror
# icc: -we10006
error_flags=
for flag in -Werror -we10006; do
AX_CHECK_COMPILE_FLAG([${flag}],[error_flags="${error_flags} ${flag}"])
done
AS_IF([test x"${error_flags}" = x],[
AC_MSG_ERROR([could not determine error flags])
])
# end $0
])
AC_DEFUN([LALSUITE_CHECK_COMPILE_FLAGS],[
# $0: check multiple compile flags
LALSUITE_PUSH_UVARS
LALSUITE_CLEAR_UVARS
_LALSUITE_CHECK_ERROR_FLAGS
for flag in m4_normalize($1); do
AX_CHECK_COMPILE_FLAG([${flag}],[$2],[$3],[${error_flags}])
done
LALSUITE_POP_UVARS
# end $0
])
AC_DEFUN([LALSUITE_CHECK_LINK_FLAGS],[
# $0: check multiple link flags
LALSUITE_PUSH_UVARS
LALSUITE_CLEAR_UVARS
_LALSUITE_CHECK_ERROR_FLAGS
for flag in m4_normalize($1); do
AX_CHECK_LINK_FLAG([${flag}],[$2],[$3],[${error_flags}])
done
LALSUITE_POP_UVARS
# end $0
])
AC_DEFUN([LALSUITE_ADD_FLAGS],[
# $0: prepend flags to AM_CPPFLAGS/AM_$1FLAGS/AM_LDFLAGS/LIBS,
# and update values of CPPFLAGS/$1FLAGS/LDFLAGS for Autoconf tests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment