File: acinclude.m4

package info (click to toggle)
faucc 20180503-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,452 kB
  • sloc: ansic: 38,797; yacc: 1,602; xml: 519; lex: 378; sh: 178; makefile: 125
file content (28 lines) | stat: -rw-r--r-- 810 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
27
28
#
# $Id: acinclude.m4,v 1.1 2012/01/20 15:45:23 vrsieh Exp $
#
# Copyright (C) 2004-2012 FAUmachine Team <info@faumachine.org>.
# This program is free software. You can redistribute it and/or modify it
# under the terms of the GNU General Public License, either version 2 of
# the License, or (at your option) any later version. See COPYING.
#

# usage: AC_PROG_CC_OPTION(--compiler-option, if-supported, if-unsupported)
# add this option to $(CC) if it is supported by the compiler
# if no sc
# Martin Waitz <tali@admingilde.org>
AC_DEFUN([AC_PROG_CC_OPTION], [
	AC_MSG_CHECKING([whether $CC supports $1])
	ac_save_CC="$CC"
	CC="$CC $1"
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],[
		AC_MSG_RESULT([yes])
		ifelse($2, , [], [
		CC="$ac_save_CC"
		$2])
	], [
		AC_MSG_RESULT([no])
		CC="$ac_save_CC"
		$3
	])
])