2014-02-21 22:09:43 +00:00
|
|
|
dnl @synopsis MN_ADD_CXXFLAGS
|
2009-05-21 21:09:30 +00:00
|
|
|
dnl
|
|
|
|
dnl Add the given option to CXXFLAGS, if it doesn't break the compiler
|
|
|
|
|
2014-02-21 22:09:43 +00:00
|
|
|
AC_DEFUN([MN_ADD_CXXFLAGS],
|
2009-05-21 21:09:30 +00:00
|
|
|
[AC_MSG_CHECKING([if $CXX accepts $1])
|
2014-02-21 22:09:43 +00:00
|
|
|
AC_LANG_ASSERT([C++])
|
2009-05-21 21:09:30 +00:00
|
|
|
ac_add_cxxflags__old_cxxflags="$CXXFLAGS"
|
2014-02-21 22:09:43 +00:00
|
|
|
CXXFLAGS="$1"
|
2009-05-21 21:09:30 +00:00
|
|
|
AC_TRY_LINK([
|
|
|
|
#include <cstdio>
|
|
|
|
],
|
|
|
|
[puts("Hello, World!"); return 0;],
|
2014-02-21 22:09:43 +00:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
CXXFLAGS="$ac_add_cxxflags__old_cxxflags $1",
|
2009-05-21 21:09:30 +00:00
|
|
|
AC_MSG_RESULT([no])
|
2014-02-21 22:09:43 +00:00
|
|
|
CXXFLAGS="$ac_add_cxxflags__old_cxxflags"
|
2009-05-21 21:09:30 +00:00
|
|
|
)
|
2014-02-21 22:09:43 +00:00
|
|
|
])# MN_ADD_CXXFLAGS
|