Skip to content

Commit d1766ab

Browse files
Update ax_check_compile_flag.m4 from upstream
1 parent ea1989a commit d1766ab

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

m4/ax_check_compile_flag.m4

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,24 @@
3434
# and this notice are preserved. This file is offered as-is, without any
3535
# warranty.
3636

37-
#serial 6
37+
#serial 11
3838

3939
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
4040
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
4141
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
42-
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
42+
AC_CACHE_CHECK([whether the _AC_LANG compiler accepts $1], CACHEVAR, [
4343
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
44-
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
44+
if test x"m4_case(_AC_LANG,
45+
[C], [$GCC],
46+
[C++], [$GXX],
47+
[Fortran], [$GFC],
48+
[Fortran 77], [$G77],
49+
[Objective C], [$GOBJC],
50+
[Objective C++], [$GOBJCXX],
51+
[no])" = xyes ; then
52+
add_gnu_werror="-Werror"
53+
fi
54+
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 $add_gnu_werror"
4555
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
4656
[AS_VAR_SET(CACHEVAR,[yes])],
4757
[AS_VAR_SET(CACHEVAR,[no])])

0 commit comments

Comments
 (0)