@@ -26,7 +26,7 @@ if test $SRCDIR = "."; then
2626 SRCDIR=" "
2727else
2828 ZINC=' -I. -include zconf.h'
29- ZINCOUT=' -I. -I$(SRCDIR)'
29+ ZINCOUT=' -I. -I$(SRCDIR) -include zconf.h '
3030 SRCDIR=" $SRCDIR /"
3131fi
3232
@@ -321,7 +321,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
321321 esac ;;
322322 AIX* )
323323 LDSHARED=${LDSHARED-" $cc -shared" }
324- LDFLAGS=" ${LDFLAGS} -Wl,-brtl" ;;
324+ LDFLAGS=" ${LDFLAGS} -Wl,-brtl"
325+ SHAREDEXP=libz.exp
326+ SHAREDEXPFLAG=-Wl,-bE:libz.exp ;;
325327 Darwin* | darwin* | * -darwin* )
326328 shared_ext=' .dylib'
327329 SHAREDLIB=libz$shared_ext
403405 fi
404406 if test -n " $ZINC " ; then
405407 ZINC=' -I- -I. -I$(SRCDIR)'
408+ ZINCOUT=' -I- -I. -I$(SRCDIR)'
406409 fi
407410 ;;
408411 SunOS\ 4* ) SFLAGS=${CFLAGS-" -O2 -PIC" }
@@ -507,6 +510,29 @@ else
507510 leave 1
508511fi
509512
513+ # turn off useless GCC 5 warning about PowerPC vector type alignments.
514+ if test " $gcc " -eq 1; then
515+ cat > $test .c << EOF
516+ typedef int zvec __attribute__((vector_size(8)));
517+ struct zstruct { char c; zvec v; };
518+ int zfunc(struct zstruct *s) { return s->c; }
519+ EOF
520+ echo " Checking for gcc vector ABI notes..." >> configure.log
521+ show $CC -c $CFLAGS $test .c
522+ got=` ( $CC -c $CFLAGS $test .c ) 2>&1 `
523+ if test " $got " ! = " " ; then
524+ printf " %s\n" " $got " >> configure.log
525+ fi
526+ case " $got " in
527+ * " changed in GCC 5" * )
528+ if tryboth $CC -c $CFLAGS -Wno-psabi $test .c; then
529+ echo " ... turning the notes off with -Wno-psabi" >> configure.log
530+ CFLAGS=" ${CFLAGS} -Wno-psabi"
531+ SFLAGS=" ${SFLAGS} -Wno-psabi"
532+ fi ;;
533+ esac
534+ fi
535+
510536echo >> configure.log
511537
512538# see if shared library build supported
517543if test $shared -eq 1; then
518544 echo Checking for shared library support... | tee -a configure.log
519545 # we must test in two steps (cc then ld), required at least on SunOS 4.x
546+ # the second link test is for linkers like lld that by default reject a
547+ # version script naming symbols that the test object doesn't define -- if
548+ # that's needed, keep the option, since some builds (e.g. --solo) don't
549+ # define all of the symbols in zlib.map
520550 if try $CC -c $SFLAGS $test .c &&
521- try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test .o; then
551+ { try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test .o ||
552+ { try $LDSHARED $SFLAGS $LDFLAGS -Wl,--undefined-version \
553+ -o $test$shared_ext $test .o &&
554+ LDSHARED=" $LDSHARED -Wl,--undefined-version" ; }; }; then
522555 echo Building shared library $SHAREDLIBV with $CC . | tee -a configure.log
523556 elif test -z " $old_cc " -a -z " $old_cflags " ; then
524557 echo No shared library support. | tee -a configure.log
@@ -1024,6 +1057,7 @@ sed < ${SRCDIR}Makefile.in "
10241057/^LDFLAGS *=/s#=.*#=$LDFLAGS #
10251058/^LDSHARED *=/s#=.*#=$LDSHARED #
10261059/^CPP *=/s#=.*#=$CPP #
1060+ /^VGFMAFLAG *=/s#=.*#=$VGFMAFLAG #
10271061/^STATICLIB *=/s#=.*#=$STATICLIB #
10281062/^SHAREDLIB *=/s#=.*#=$SHAREDLIB #
10291063/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV #
@@ -1033,6 +1067,8 @@ sed < ${SRCDIR}Makefile.in "
10331067/^RANLIB *=/s#=.*#=$RANLIB #
10341068/^LDCONFIG *=/s#=.*#=$LDCONFIG #
10351069/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC #
1070+ /^SHAREDEXP *=/s#=.*#=$SHAREDEXP #
1071+ /^SHAREDEXPFLAG *=/s#=.*#=$SHAREDEXPFLAG #
10361072/^EXE *=/s#=.*#=$EXE #
10371073/^SRCDIR *=/s#=.*#=$SRCDIR #
10381074/^ZINC *=/s#=.*#=$ZINC #
@@ -1054,6 +1090,7 @@ sed < ${SRCDIR}zlib.pc.in "
10541090/^CC *=/s#=.*#=$CC #
10551091/^CFLAGS *=/s#=.*#=$CFLAGS #
10561092/^CPP *=/s#=.*#=$CPP #
1093+ /^VGFMAFLAG *=/s#=.*#=$VGFMAFLAG #
10571094/^LDSHARED *=/s#=.*#=$LDSHARED #
10581095/^STATICLIB *=/s#=.*#=$STATICLIB #
10591096/^SHAREDLIB *=/s#=.*#=$SHAREDLIB #
0 commit comments