source: clfs-embedded/patches/zlib-1.2.3-DESTDIR-1.patch@ 82b88f2

Last change on this file since 82b88f2 was d841e12, checked in by Jim Gifford <clfs@…>, 18 years ago

Removed zlib fpic patch

  • Property mode set to 100644
File size: 6.5 KB
  • Makefile.in

    Submitted By: Jim Gifford <jim@linuxfromscratch.org>
    Date: 2006-11-15
    Initial Package Version: 1.2.3
    Origin: OpenWRT and Jim Gifford
    Upstream Status: Not submitted
    Description: Adds DESTDIR Support
    
    diff -Naur zlib-1.2.3.orig/Makefile.in zlib-1.2.3/Makefile.in
    old new  
    2525#           -Wstrict-prototypes -Wmissing-prototypes
    2626
    2727LDFLAGS=libz.a
    28 LDSHARED=$(CC)
     28LDSHARED=$(CC) -shared -Wl,-soname,$(SHAREDLIBM)
    2929CPP=$(CC) -E
    3030
    31 LIBS=libz.a
     31LIBS=
     32STATICLIB=libz.a
    3233SHAREDLIB=libz.so
    3334SHAREDLIBV=libz.so.1.2.3
    3435SHAREDLIBM=libz.so.1
    3536
    36 AR=ar rc
     37AR=ar
    3738RANLIB=ranlib
    3839TAR=tar
    3940SHELL=/bin/sh
    4041EXE=
    4142
     43DESTDIR =
     44
    4245prefix = /usr/local
    4346exec_prefix = ${prefix}
    4447libdir = ${exec_prefix}/lib
     
    6770          echo '                *** zlib test FAILED ***'; \
    6871        fi
    6972
    70 libz.a: $(OBJS) $(OBJA)
    71         $(AR) $@ $(OBJS) $(OBJA)
     73$(STATICLIB): $(OBJS) $(OBJA)
     74        $(AR) rc $@ $(OBJS) $(OBJA)
    7275        -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
    7376
    7477match.o: match.S
     
    7780        mv _match.o match.o
    7881        rm -f _match.s
    7982
     83$(SHAREDLIB): $(SHAREDLIBV)
     84
    8085$(SHAREDLIBV): $(OBJS)
    81         $(LDSHARED) -o $@ $(OBJS)
     86        $(LDSHARED) -lc -o $@ $(OBJS)
    8287        rm -f $(SHAREDLIB) $(SHAREDLIBM)
    8388        ln -s $@ $(SHAREDLIB)
    8489        ln -s $@ $(SHAREDLIBM)
     
    9095        $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
    9196
    9297install: $(LIBS)
    93         -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
    94         -@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
    95         -@if [ ! -d $(libdir)      ]; then mkdir -p $(libdir); fi
    96         -@if [ ! -d $(man3dir)     ]; then mkdir -p $(man3dir); fi
    97         cp zlib.h zconf.h $(includedir)
    98         chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
    99         cp $(LIBS) $(libdir)
    100         cd $(libdir); chmod 755 $(LIBS)
    101         -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
    102         cd $(libdir); if test -f $(SHAREDLIBV); then \
     98        -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
     99        -@if [ ! -d $(DESTDIR)$(includedir)  ]; then mkdir -p $(DESTDIR)$(includedir); fi
     100        -@if [ ! -d $(DESTDIR)$(libdir)      ]; then mkdir -p $(DESTDIR)$(libdir); fi
     101        -@if [ ! -d $(DESTDIR)$(man3dir)     ]; then mkdir -p $(DESTDIR)$(man3dir); fi
     102        cp zlib.h zconf.h $(DESTDIR)$(includedir)
     103        chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
     104        if [ -e $(STATICLIB) ]; then install -m755 $(STATICLIB) $(DESTDIR)$(libdir); fi
     105        if [ -e $(SHAREDLIBV) ]; then install -m755 $(SHAREDLIBV) $(DESTDIR)$(libdir); fi
     106        -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
     107        cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
    103108          rm -f $(SHAREDLIB) $(SHAREDLIBM); \
    104109          ln -s $(SHAREDLIBV) $(SHAREDLIB); \
    105110          ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
    106111          (ldconfig || true)  >/dev/null 2>&1; \
    107112        fi
    108         cp zlib.3 $(man3dir)
    109         chmod 644 $(man3dir)/zlib.3
     113        cp zlib.3 $(DESTDIR)$(man3dir)
     114        chmod 644 $(DESTDIR)$(man3dir)/zlib.3
    110115# The ranlib in install is needed on NeXTSTEP which checks file times
    111116# ldconfig is for Linux
    112117
  • configure

    diff -Naur zlib-1.2.3.orig/configure zlib-1.2.3/configure
    old new  
    2323VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
    2424VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
    2525VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
    26 AR=${AR-"ar rc"}
     26AR=${AR-"ar"}
    2727RANLIB=${RANLIB-"ranlib"}
    2828prefix=${prefix-/usr/local}
    2929exec_prefix=${exec_prefix-'${prefix}'}
     
    7373
    7474if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
    7575  CC="$cc"
    76   SFLAGS=${CFLAGS-"-fPIC -O3"}
     76  SFLAGS=${CFLAGS-"-D_REENTRANT -fPIC -O3"}
    7777  CFLAGS="$cflags"
    7878  case `(uname -s || echo unknown) 2>/dev/null` in
    7979  Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
     
    424424  echo Checking for mmap support... No.
    425425fi
    426426
     427cat > $test.c <<EOF
     428#include <stdio.h>
     429int main() { char buf[10]; snprintf(buf, sizeof(buf), "%s", "F"); return 0; }
     430EOF
     431if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
     432  echo "Checking for snprintf...         Yes."
     433  CFLAGS="$CFLAGS -DHAS_snprintf"
     434else
     435  echo "Checking for snprintf..  No."
     436fi
     437
     438cat > $test.c <<EOF
     439#include <stdio.h>
     440#include <stdarg.h>
     441int main(void) { va_list a; vsnprintf(0, 0, "", a); return 0; }
     442EOF
     443if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
     444  echo "Checking for vsnprintf...        Yes."
     445  CFLAGS="$CFLAGS -DHAS_vsnprintf"
     446else
     447  echo "Checking for vsnprintf..         No."
     448fi
     449
    427450CPP=${CPP-"$CC -E"}
    428451case $CFLAGS in
    429452  *ASMV*)
     
    440463# udpate Makefile
    441464sed < Makefile.in "
    442465/^CC *=/s#=.*#=$CC#
    443 /^CFLAGS *=/s#=.*#=$CFLAGS#
    444 /^CPP *=/s#=.*#=$CPP#
    445 /^LDSHARED *=/s#=.*#=$LDSHARED#
    446 /^LIBS *=/s#=.*#=$LIBS#
    447 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
    448 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
    449 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
    450 /^AR *=/s#=.*#=$AR#
    451 /^RANLIB *=/s#=.*#=$RANLIB#
    452 /^EXE *=/s#=.*#=$EXE#
    453 /^prefix *=/s#=.*#=$prefix#
    454 /^exec_prefix *=/s#=.*#=$exec_prefix#
    455 /^libdir *=/s#=.*#=$libdir#
    456 /^includedir *=/s#=.*#=$includedir#
    457 /^mandir *=/s#=.*#=$mandir#
    458 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
     466/^CC *=/s%=.*%= $CC%
     467/^CFLAGS *=/s%=.*%= $CFLAGS%
     468/^CPP *=/s%=.*%= $CPP%
     469/^LDSHARED *=/s%=.*%= $LDSHARED%
     470/^LIBS *=/s%=.*%= $LIBS%
     471/^SHAREDLIB *=/s%=.*%= $SHAREDLIB%
     472/^SHAREDLIBV *=/s%=.*%= $SHAREDLIBV%
     473/^SHAREDLIBM *=/s%=.*%= $SHAREDLIBM%
     474/^AR *=/s%=.*%= $AR%
     475/^RANLIB *=/s%=.*%= $RANLIB%
     476/^EXE *=/s%=.*%= $EXE%
     477/^prefix *=/s%=.*%= $prefix%
     478/^exec_prefix *=/s%=.*%= $exec_prefix%
     479/^libdir *=/s%=.*%= $libdir%
     480/^includedir *=/s%=.*%= $includedir%
     481/^mandir *=/s%=.*%= $mandir%
     482/^LDFLAGS *=/s%=.*%= $LDFLAGS%
    459483" > Makefile
  • contrib/minizip/Makefile

    diff -Naur zlib-1.2.3.orig/contrib/minizip/Makefile zlib-1.2.3/contrib/minizip/Makefile
    old new  
    11CC=cc
    2 CFLAGS=-O -I../..
     2CFLAGS=-O2 -g -I../.. -Dunix
    33
    4 UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
    5 ZIP_OBJS = minizip.o zip.o   ioapi.o ../../libz.a
     4UNZ_OBJS = miniunz.o unzip.o ioapi.o
     5ZIP_OBJS = minizip.o zip.o   ioapi.o
    66
    77.c.o:
    88        $(CC) -c $(CFLAGS) $*.c
     
    1010all: miniunz minizip
    1111
    1212miniunz:  $(UNZ_OBJS)
    13         $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
     13        $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) -L ../.. -lz
    1414
    1515minizip:  $(ZIP_OBJS)
    16         $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
     16        $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) -L ../.. -lz
    1717
    1818test:   miniunz minizip
    1919        ./minizip test readme.txt
Note: See TracBrowser for help on using the repository browser.