--- Makefile.in.old 2004-10-19 04:01:40.073351200 +0000 +++ Makefile.in 2004-10-19 04:04:09.718601664 +0000 @@ -49,6 +49,8 @@ OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ zutil.o inflate.o infback.o inftrees.o inffast.o +PIC_OBJS = $(OBJS:%.o=%.lo) + OBJA = # to use the asm code: make OBJA=match.o @@ -77,8 +79,11 @@ mv _match.o match.o rm -f _match.s -$(SHAREDLIBV): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) +%.lo: %.c + $(CC) $(CFLAGS) -DPIC -fPIC -c $< -o $@ + +$(SHAREDLIBV): $(PIC_OBJS) + $(LDSHARED) -o $@ $(PIC_OBJS) -lc rm -f $(SHAREDLIB) $(SHAREDLIBM) ln -s $@ $(SHAREDLIB) ln -s $@ $(SHAREDLIBM) @@ -89,13 +94,10 @@ minigzip$(EXE): minigzip.o $(LIBS) $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -install: $(LIBS) +install-libs: $(LIBS) -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi - cp zlib.h zconf.h $(includedir) - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h cp $(LIBS) $(libdir) cd $(libdir); chmod 755 $(LIBS) -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 @@ -110,6 +112,11 @@ # The ranlib in install is needed on NeXTSTEP which checks file times # ldconfig is for Linux +install: install-libs + -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi + cp zlib.h zconf.h $(includedir) + chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h + uninstall: cd $(includedir); \ cd $(libdir); rm -f libz.a; \ --- configure.old 2004-10-19 04:04:23.315534616 +0000 +++ configure 2004-10-19 04:07:56.916062400 +0000 @@ -73,7 +73,11 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then CC="$cc" - SFLAGS=${CFLAGS-"-fPIC -O3"} + #SFLAGS=${CFLAGS-"-fPIC -O3"} + # the above is horribly wrong on a few archs where -fPIC should ALWAYS be + # used in the creation of shared libraries. without the following, the + # shared lib test will sometimes fail even when shared libs -can- be created. + SFLAGS="${CFLAGS-"-O3"} -fPIC" CFLAGS="$cflags" case `(uname -s || echo unknown) 2>/dev/null` in Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; @@ -160,7 +164,7 @@ if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then CFLAGS="$SFLAGS" - LIBS="$SHAREDLIBV" + LIBS="$LIBS $SHAREDLIBV" echo Building shared library $SHAREDLIBV with $CC. elif test -z "$old_cc" -a -z "$old_cflags"; then echo No shared library support.