source: freewrt/package/libpcap/patches/100-shared-lib.patch@ 428f140

freewrt_1_0 freewrt_2_0
Last change on this file since 428f140 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 3.2 KB
  • libpcap-0.9.4

    diff -urN libpcap-0.9.4.orig/Makefile.in libpcap-0.9.4/Makefile.in
    old new  
    3737srcdir = @srcdir@
    3838VPATH = @srcdir@
    3939
     40# some defines for shared library compilation
     41MAJ=0.9
     42MIN=4
     43VERSION=$(MAJ).$(MIN)
     44LIBNAME=pcap
     45LIBRARY=lib$(LIBNAME).a
     46SOLIBRARY=lib$(LIBNAME).so
     47SHAREDLIB=$(SOLIBRARY).$(VERSION)
     48
    4049#
    4150# You shouldn't need to edit anything below.
    4251#
     
    5059
    5160# Standard CFLAGS
    5261CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
     62CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ)
    5363
    5464INSTALL = @INSTALL@
    5565INSTALL_PROGRAM = @INSTALL_PROGRAM@
     
    7080.c.o:
    7181        @rm -f $@
    7282        $(CC) $(CFLAGS) -c $(srcdir)/$*.c
     83        $(CC) $(CFLAGS) -c -o $@ $(srcdir)/$*.c
    7384
     85%_pic.o: %.c
     86        @rm -f $@
     87        $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c
     88       
    7489PSRC =  pcap-@V_PCAP@.c
    7590FSRC =  fad-@V_FINDALLDEVS@.c
    7691SSRC =  @SSRC@
     
    8499# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
    85100# hack the extra indirection
    86101OBJ =   $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
     102OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=_pic.o) $(CSRC:.c=_pic.o) $(SSRC:.c=_pic.o) $(GENSRC:.c=_pic.o)
    87103HDR =   pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
    88104        ethertype.h gencode.h gnuc.h
    89105GENHDR = \
     
    95111TAGFILES = \
    96112        $(SRC) $(HDR) $(TAGHDR)
    97113
    98 CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
     114CLEANFILES = $(OBJ) $(OBJ_PIC) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so*
    99115
    100 all: libpcap.a
     116all: libpcap.a $(SHAREDLIB)
    101117
    102118libpcap.a: $(OBJ)
    103119        @rm -f $@
    104120        ar rc $@ $(OBJ) $(LIBS)
    105121        $(RANLIB) $@
    106122
     123$(SHAREDLIB): $(OBJ_PIC)
     124        -@rm -f $@
     125        -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ)
     126        $(CC) $(CFLAGS_SHARED) -o $(SHAREDLIB) $(OBJ_PIC) -lc
     127        ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ)
     128        ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY)
     129
     130       
    107131shared: libpcap.$(DYEXT)
    108132
    109133#
     
    129153scanner.o: scanner.c tokdefs.h
    130154        $(CC) $(CFLAGS) -c scanner.c
    131155
     156scanner_pic.o: scanner.c tokdefs.h
     157        $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c
     158
     159
    132160pcap.o: version.h
    133161
    134162tokdefs.h: grammar.c
     
    142170        @rm -f $@
    143171        $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
    144172
     173grammar_pic.o: grammar.c
     174        @rm -f $@
     175        $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c
     176
    145177version.o: version.c
    146178        $(CC) $(CFLAGS) -c version.c
    147179
     180version_pic.o: version.c
     181        $(CC) -fPIC $(CFLAGS) -c version.c -o $@
     182
    148183snprintf.o: $(srcdir)/missing/snprintf.c
    149184        $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
    150185
     
    170205bpf_filter.o: bpf_filter.c
    171206        $(CC) $(CFLAGS) -c bpf_filter.c
    172207
     208bpf_filter_pic.o: bpf_filter.c
     209        $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@
     210
     211
    173212install: libpcap.a
    174213        [ -d $(DESTDIR)$(libdir) ] || \
    175214            (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
    176215        $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
     216        $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/
     217        ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ)
     218        ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY)
    177219        $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
    178220        [ -d $(DESTDIR)$(includedir) ] || \
    179221            (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
Note: See TracBrowser for help on using the repository browser.