1 dnl AX_CFLAGS_OPTIONS(var-name, option) 2 dnl add option to var-name if $CC support it. 3 AC_DEFUN([AX_CFLAGS_OPTION], [ 4 AC_MSG_CHECKING([whether ${CC} $2 is understood]) 5 AC_LANG_SAVE 6 AC_LANG_C 7 SAVE_CFLAGS=$CFLAGS 8 CFLAGS=$2 9 AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no])) 10 CFLAGS=$SAVE_CFLAGS 11 AC_LANG_RESTORE 12 ]) 13 14 15 dnl AX_CXXFLAGS_OPTIONS(var-name, option) 16 dnl add option to var-name if $CXX support it. 17 AC_DEFUN([AX_CXXFLAGS_OPTION], [ 18 AC_MSG_CHECKING([whether ${CXX} $2 is understood]) 19 AC_LANG_SAVE 20 AC_LANG_CPLUSPLUS 21 SAVE_CXXFLAGS=$CXXFLAGS 22 CXXFLAGS=$2 23 AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no])) 24 CXXFLAGS=$SAVE_CXXFLAGS 25 AC_LANG_RESTORE 26 ]) 27