File: gwy-cc-options.m4

package info (click to toggle)
gwyddion 2.47-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 38,180 kB
  • ctags: 37,276
  • sloc: ansic: 317,531; sh: 5,122; xml: 3,583; python: 3,067; makefile: 2,694; cpp: 2,550; pascal: 418; perl: 154; ruby: 130; sed: 17
file content (26 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Check for options compiler supports.  This file is in public domain.
##
AC_DEFUN([GWY_PROG_CC_OPTION],
[AC_REQUIRE([AC_PROG_CC])dnl
dnl

dnl Check whether C compiler accepts option $2, set PROG_CC_$1 to either
dnl the option or empty.  On success, $3 is executed, on failure $4.
AC_CACHE_CHECK([whether $CC knows $2],
  [ac_cv_prog_cc_option_$1],
  [ye_PROG_CC_OPTION_cflags="$CFLAGS"
   CFLAGS="$CFLAGS $2"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
     [ac_cv_prog_cc_option_$1=yes],
     [ac_cv_prog_cc_option_$1=no])
   CFLAGS="$ye_PROG_CC_OPTION_cflags"])
if test "$ac_cv_prog_cc_option_$1" = "yes"; then
  PROG_CC_$1="$2"
  $3
else
  PROG_CC_$1=
  $4
fi
])