summaryrefslogtreecommitdiff
path: root/acinclude.m4
blob: 72ca1030dd37fe1e2000fd44236e0713af9a914e (plain)
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
29
30
31
32
33
34
35
36
37
38
39
dnl usage: AC_PROG_CXX_OPTION(--compiler-option, if-supported, if-unsupported)
dnl add this option to $(CXX) if it is supported by the compiler
dnl if no sc
dnl Martin Waitz <tali@admingilde.org>, modified by Stefan Potyra
AC_DEFUN([AC_PROG_CXX_OPTION], [
	AC_MSG_CHECKING([whether $CXX supports $1])
	ac_save_CXX="$CXX"
	CXX="$CXX $1"
	AC_COMPILE_IFELSE(AC_LANG_PROGRAM(),[
		AC_MSG_RESULT([yes])
		ifelse($2, , [], [
		CXX="$ac_save_CXX"
		$2])
	], [
		AC_MSG_RESULT([no])
		CXX="$ac_save_CXX"
		$3
	])
])

dnl usage: AC_PROG_CC_OPTION(--compiler-option, if-supported, if-unsupported)
dnl add this option to $(CC) if it is supported by the compiler
dnl if no sc
dnl 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
	])
])