1 # <rdenis (at) simphalempin (dot) com>.
2 # This file (flags.m4) is free software; unlimited permission to
3 # copy and/or distribute it , with or without modifications, as long
4 # as this notice is preserved.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
8 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 AC_DEFUN([RDC_PROG_CC_FLAGS_IFELSE],
13 CFLAGS_save="${CFLAGS}"
14 as_ac_var=`echo "ac_cv_prog_cc_flags_$1" | $as_tr_sh`
15 AC_CACHE_CHECK([if $CC accepts $1], [$as_ac_var], [
16 CFLAGS="${CFLAGS_save} $1"
17 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
24 ac_res=`eval echo '${'$as_ac_var'}'`
25 AS_IF([test "${ac_res}" != "no"], [
26 CXXFLAGS="${CXXFLAGS} $1"
27 OBJCFLAGS="${OBJCFLAGS} $1"
30 CFLAGS="${CFLAGS_save}"
35 AC_DEFUN([RDC_PROG_CC_WFLAGS],
37 RDC_PROG_CC_FLAGS_IFELSE([-W$a])
41 AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE],
43 CFLAGS_save="${CFLAGS}"
44 as_ac_var=`echo "ac_cv_prog_cc_flags_$1" | $as_tr_sh`
45 AC_CACHE_CHECK([if $CC accepts $1], [$as_ac_var], [
46 CFLAGS="${CFLAGS_save} $1"
47 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
54 ac_res=`eval echo '${'$as_ac_var'}'`
55 AS_IF([test "${ac_res}" != "no"], [
59 LDFLAGS="${CFLAGS_save}"