From: Mika Lindqvist Date: Sat, 21 Jan 2023 23:16:11 +0000 (+0200) Subject: Allow disabling visibility attribute with configure X-Git-Tag: 2.1.0-beta1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a02ba01ddcad7696b82e6c3b587726f423bbfe42;p=thirdparty%2Fzlib-ng.git Allow disabling visibility attribute with configure * Disable visibility check for Cygwin, MinGW and MSYS as the compiler will only issue warning instead of error for unsupported attributes. --- diff --git a/configure b/configure index b05a73142..59c4a7e6a 100755 --- a/configure +++ b/configure @@ -128,6 +128,7 @@ reducedmem=0 gcc=0 warn=0 debug=0 +visibility=1 old_cc="$CC" old_cflags="$CFLAGS" OBJC='$(OBJZ)' @@ -416,6 +417,7 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then LDSHAREDFLAGS="-shared -Wl,-soname,${LIBNAME}.so.${VER1},--version-script,${SRCDIR}/${MAPNAME}" LDCONFIG="ldconfig -m" ;; CYGWIN* | Cygwin* | cygwin*) + visibility=0 ARFLAGS="rcs" SFLAGS="${CFLAGS}" shared_ext='.dll' @@ -441,6 +443,7 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then STRIP="${CROSS_PREFIX}strip" EXE='.exe' ;; MSYS* | msys*) + visibility=0 ARFLAGS="rcs" SFLAGS="${CFLAGS}" shared_ext='.dll' @@ -466,6 +469,7 @@ if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then STRIP="${CROSS_PREFIX}strip" EXE='.exe' ;; MINGW* | mingw*) + visibility=0 ARFLAGS="rcs" CFLAGS="${CFLAGS} -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -Wno-pedantic-ms-format" SFLAGS="${CFLAGS}" @@ -948,7 +952,7 @@ EOF fi # see if we can hide zlib internal symbols that are linked between separate source files using hidden -if test "$gcc" -eq 1; then +if test "$gcc" -eq 1 && test "$visibility" -eq 1; then echo >> configure.log cat > $test.c <> configure.log cat > $test.c <