codecleanup: de-static-inline a bunch of input_item functions.
[vlc/pdherbemont.git] / m4 / flags.m4
blob0bf8c3b163504591a9a40e69c4c40a436ac957ae
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
9 # PARTICULAR PURPOSE.
11 AC_DEFUN([RDC_PROG_CC_FLAGS_IFELSE],
12 [AC_LANG_ASSERT(C)
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} $1"
17     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
18       eval "$as_ac_var=yes"
19     ],[
20       eval "$as_ac_var=no"
21     ])
22   ])
24   ac_res=`eval echo '${'$as_ac_var'}'`
25   AS_IF([test "${ac_res}" != "no"], [
26     CFLAGS="${CFLAGS_save} $1"
27     $2
28   ], [
29     CFLAGS="${CFLAGS_save}"
30     $3
31   ])
34 AC_DEFUN([RDC_PROG_CC_WFLAGS],
35 [ for a in $1; do
36     RDC_PROG_CC_FLAGS_IFELSE([-W$a])
37   done
40 AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE],
41 [AC_LANG_ASSERT(C)
42   LDFLAGS_save="${LDFLAGS}"
43   as_ac_var=`echo "ac_cv_prog_link_flags_$1" | $as_tr_sh`
44   AC_CACHE_CHECK([if $LINK accepts $1], [$as_ac_var], [
45     LDFLAGS="${LDFLAGS} $1"
46     AC_LINK_IFELSE([AC_LANG_PROGRAM()], [
47       eval "$as_ac_var=yes"
48     ],[
49       eval "$as_ac_var=no"
50     ])
51   ])
53   ac_res=`eval echo '${'$as_ac_var'}'`
54   AS_IF([test "${ac_res}" != "no"], [
55     LDFLAGS="${LDFLAGS} $1"
56     $2
57   ], [
58     LDFLAGS="${LDFLAGS_save}"
59     $3
60   ])