diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:30:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:30:19 +0000 |
commit | 5c1676dfe6d2f3c837a5e074117b45613fd29a72 (patch) | |
tree | cbffb45144febf451e54061db2b21395faf94bfe /m4macros/detectcflags.m4 | |
parent | Initial commit. (diff) | |
download | gimp-5c1676dfe6d2f3c837a5e074117b45613fd29a72.tar.xz gimp-5c1676dfe6d2f3c837a5e074117b45613fd29a72.zip |
Adding upstream version 2.10.34.upstream/2.10.34upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4macros/detectcflags.m4')
-rw-r--r-- | m4macros/detectcflags.m4 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/m4macros/detectcflags.m4 b/m4macros/detectcflags.m4 new file mode 100644 index 0000000..ee33456 --- /dev/null +++ b/m4macros/detectcflags.m4 @@ -0,0 +1,20 @@ +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 +]) |