mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 09:23:24 +00:00

GIMP_DETECT_CFLAGS: pass -Werror to the compiler when checking for flags, so the macro fails if passing a flag only warns but doesn't cause the compiler to fail. Before, the compiler would warn about the flag for each file compiled.
20 lines
523 B
Text
20 lines
523 B
Text
dnl GIMP_DETECT_CFLAGS(RESULT, FLAGSET)
|
|
dnl Detect if the compiler supports a set of flags
|
|
|
|
AC_DEFUN([GIMP_DETECT_CFLAGS],
|
|
[
|
|
$1=
|
|
for flag in $2; do
|
|
if test -z "[$]$1"; then
|
|
$1_save_CFLAGS="$CFLAGS"
|
|
CFLAGS="$CFLAGS -Werror $flag"
|
|
AC_MSG_CHECKING([whether [$]CC understands [$]flag])
|
|
AC_TRY_COMPILE([], [], [$1_works=yes], [$1_works=no])
|
|
AC_MSG_RESULT([$]$1_works)
|
|
CFLAGS="[$]$1_save_CFLAGS"
|
|
if test "x[$]$1_works" = "xyes"; then
|
|
$1="$flag"
|
|
fi
|
|
fi
|
|
done
|
|
])
|