flac/m4/add_cxxflags.m4
Martijn van Beurden d94a43d5c3 Update configure.ac and m4 files with autoupdate 2.60
Starting with autoconf 2.70, obsolescence warnings are output by
default. To keep the script as compatible as possible, I build
autoconf 2.60 and ran the autoupdate that came with it on
configure.ac and all m4 files.
2022-04-15 09:36:15 +02:00

17 lines
521 B
Plaintext

dnl @synopsis XIPH_ADD_CXXFLAGS
dnl
dnl Add the given option to CXXFLAGS, if it doesn't break the compiler
AC_DEFUN([XIPH_ADD_CXXFLAGS],
[AC_MSG_CHECKING([if $CXX accepts $1])
AC_LANG_ASSERT([C++])
ac_add_cxxflags__old_cxxflags="$CXXFLAGS"
CXXFLAGS="$1"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <cstdio>
]], [[puts("Hello, World!"); return 0;]])],[AC_MSG_RESULT(yes)
CXXFLAGS="$ac_add_cxxflags__old_cxxflags $1"],[AC_MSG_RESULT(no)
CXXFLAGS="$ac_add_cxxflags__old_cxxflags"
])
])# XIPH_ADD_CXXFLAGS