File: acmacros.m4

package info (click to toggle)
freefem++ 3.61.1+dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,108 kB
  • sloc: cpp: 141,214; ansic: 28,664; sh: 4,925; makefile: 3,142; fortran: 1,171; perl: 844; awk: 290; php: 199; pascal: 41; f90: 32
file content (39 lines) | stat: -rw-r--r-- 889 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
29
30
31
32
33
34
35
36
37
38
39
# Checks whether a compiler accepts a given flag
# ----------------------------------------------

# $1 = compiler name
# $2 = flag
# $3 = make macro containing flags for that compiler
# $4 =  exec is true ..
# Note: changes AC_LANG()

AC_DEFUN([CHECK_COMPILE_FLAG],
	[AC_MSG_CHECKING(whether the $1 compiler accepts $2)
	check_save_flags="$$3"
	AC_LANG_PUSH($1)
	$3="$$3 $2"

	# The program needs to contain something for the test source
	# file to be created by autoconf.

	# Some options really need to be linked (not only compiled) to
	# check whether they work.

	AC_LINK_IFELSE([ifelse($1,Fortran 77,
[       program x
       end],
			[AC_LANG_PROGRAM])],
		check_flag_ok=yes,
		check_flag_ok=no)
	AC_MSG_RESULT($check_flag_ok)
	if test "$check_flag_ok" = no;
	then
		$3="$check_save_flags"
	fi
	if test -n "$4" ;
         then 
	        $4="$check_flag_ok"
	fi

	AC_LANG_POP($1)
])