[master] aad8de860 build: Move zlib checks down
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Jan 30 14:14:05 UTC 2023
commit aad8de860d8f5237bc3ec6197af04e93e6cbabfb
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Mon Jan 30 14:57:50 2023 +0100
build: Move zlib checks down
As I suspected, the -Werror setup for libvgz C flags were needed to
properly discard them for suncc. Both warnings are conditionally not
turned into errors, so -Wno-unknown-warning-option should no longer
be needed.
Refs madler/zlib#633
diff --git a/configure.ac b/configure.ac
index 9596b8285..dc0153c50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,27 +249,6 @@ LIBS="${save_LIBS}"
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
-# zlib-specific flags
-VGZ_CFLAGS="-Wno-error=strict-prototypes -Wno-unknown-warning-option"
-
-dnl https://github.com/madler/zlib/issues/633
-AX_CHECK_COMPILE_FLAG([-Wno-error=deprecated-non-prototype],
- [VGZ_CFLAGS="$VGZ_CFLAGS -Wno-error=deprecated-non-prototype"])
-
-AC_SUBST(VGZ_CFLAGS)
-
-# Support for visibility attribute (zlib)
-AC_CACHE_CHECK([whether we have support for visibility attributes],
- [ac_cv_have_viz],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- int __attribute__((visibility ("hidden"))) foo;
- ]],[])],
- [AC_DEFINE([HAVE_HIDDEN], [1],
- [Define to 1 if visibility attribute hidden is available.])
- ])
-])
-
AC_ARG_ENABLE(ubsan,
AS_HELP_STRING([--enable-ubsan],
[enable undefined behavior sanitizer (default is NO)]),
@@ -721,6 +700,28 @@ if test $? -ne 0 ; then
AC_MSG_ERROR([wflags.py failure])
fi
+# zlib-specific flags
+AX_CHECK_COMPILE_FLAG([-Wno-error=strict-prototypes],
+ [VGZ_CFLAGS="$VGZ_CFLAGS -Wno-error=strict-prototypes"])
+
+dnl https://github.com/madler/zlib/issues/633
+AX_CHECK_COMPILE_FLAG([-Wno-error=deprecated-non-prototype],
+ [VGZ_CFLAGS="$VGZ_CFLAGS -Wno-error=deprecated-non-prototype"])
+
+AC_SUBST(VGZ_CFLAGS)
+
+# Support for visibility attribute (zlib)
+AC_CACHE_CHECK([whether we have support for visibility attributes],
+ [ac_cv_have_viz],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ int __attribute__((visibility ("hidden"))) foo;
+ ]],[])],
+ [AC_DEFINE([HAVE_HIDDEN], [1],
+ [Define to 1 if visibility attribute hidden is available.])
+ ])
+])
+
# --enable-stack-protector
AC_ARG_ENABLE(stack-protector,
AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is YES)]),
More information about the varnish-commit
mailing list