summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/libpcap/libpcap-shared.patch
blob: a20083682a1062e85dbc0da9b291ffed9c2d30cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff -u -r libpcap-0.6.2/Makefile.in libpcap-shared/Makefile.in
--- libpcap-0.6.2/Makefile.in	Thu Jan 18 05:06:24 2001
+++ libpcap-shared/Makefile.in	Fri Jul 20 16:26:05 2001
@@ -22,6 +22,10 @@
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
 #
+MAJOR = @MAJOR@
+MINOR = @MINOR@
+SUBMINOR = @SUBMINOR@
+VERSION = @VERSION@
 
 # Top level hierarchy
 prefix = @prefix@
@@ -47,7 +51,7 @@
 DEFS = @DEFS@
 
 # Standard CFLAGS
-CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
+CFLAGS = $(CCOPT) $(INCLS) $(DEFS) -fPIC -DPIC
 
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -91,9 +95,14 @@
 TAGFILES = \
 	$(SRC) $(HDR) $(TAGHDR)
 
-CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
 
-all: libpcap.a
+
+CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so.$(VERSION)
+
+all: libpcap.a libpcap.so.$(VERSION)
+
+libpcap.so.$(VERSION):
+	gcc -shared -Wl,-soname -Wl,libpcap.so.$(VERSION) -o libpcap.so.$(VERSION) $(OBJ) -lc
 
 libpcap.a: $(OBJ)
 	@rm -f $@
@@ -139,6 +148,10 @@
 	[ -d $(DESTDIR)$(libdir) ] || \
 	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
 	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
+	$(INSTALL_DATA) libpcap.so.$(VERSION)  $(DESTDIR)$(libdir)/libpcap.so.$(VERSION)
+	ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so
+	ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(MAJOR)
+	ln -s libpcap.so.$(VERSION) $(DESTDIR)$(libdir)/libpcap.so.$(MAJOR).$(MINOR)
 	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
 	[ -d $(DESTDIR)$(includedir) ] || \
 	    (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))