diff options
Diffstat (limited to 'conf/m4/plptools/PLP_CHECK_COMPILER_FLAG.m4')
-rw-r--r-- | conf/m4/plptools/PLP_CHECK_COMPILER_FLAG.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/conf/m4/plptools/PLP_CHECK_COMPILER_FLAG.m4 b/conf/m4/plptools/PLP_CHECK_COMPILER_FLAG.m4 new file mode 100644 index 0000000..120499e --- /dev/null +++ b/conf/m4/plptools/PLP_CHECK_COMPILER_FLAG.m4 @@ -0,0 +1,27 @@ +AC_DEFUN(PLP_CHECK_COMPILER_FLAG, +[ +dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50 +AC_MSG_CHECKING(whether $CXX supports -$1) +plp_cache=`echo $1 | sed 'y%.=/+-%___p_%'` +AC_CACHE_VAL(plp_cv_prog_cxx_$plp_cache, +[ +echo 'int main() { return 0; }' >conftest.cc +eval "plp_cv_prog_cxx_$plp_cache=no" +if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then + if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then + eval "plp_cv_prog_cxx_$plp_cache=yes" + fi +fi +rm -f conftest* +]) +if eval "test \"`echo '$plp_cv_prog_cxx_'$plp_cache`\" = yes"; then + AC_MSG_RESULT(yes) + : + $2 +else + AC_MSG_RESULT(no) + : + $3 +fi +]) + |