diff options
author | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
commit | b2f192faabe412adce79534e22efe9fb69ee40e2 (patch) | |
tree | 7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/packages/libpcap | |
parent | 2cf0eadf9f730027833af802d7e6c90b44248f80 (diff) | |
download | poky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz |
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/libpcap')
-rw-r--r-- | meta/packages/libpcap/libpcap-0.9.3/shared.patch | 119 | ||||
-rw-r--r-- | meta/packages/libpcap/libpcap_0.9.3.bb | 32 |
2 files changed, 151 insertions, 0 deletions
diff --git a/meta/packages/libpcap/libpcap-0.9.3/shared.patch b/meta/packages/libpcap/libpcap-0.9.3/shared.patch new file mode 100644 index 0000000000..cc66a5e5ef --- /dev/null +++ b/meta/packages/libpcap/libpcap-0.9.3/shared.patch | |||
@@ -0,0 +1,119 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- libpcap-0.9.3/Makefile.in~shared | ||
7 | +++ libpcap-0.9.3/Makefile.in | ||
8 | @@ -37,6 +37,15 @@ | ||
9 | srcdir = @srcdir@ | ||
10 | VPATH = @srcdir@ | ||
11 | |||
12 | +# some defines for shared library compilation - FIXME, if not matching | ||
13 | +MAJ=0.9 | ||
14 | +MIN=3 | ||
15 | +VERSION=$(MAJ).$(MIN) | ||
16 | +LIBNAME=pcap | ||
17 | +LIBRARY=lib$(LIBNAME).a | ||
18 | +SOLIBRARY=lib$(LIBNAME).so | ||
19 | +SHAREDLIB=$(SOLIBRARY).$(VERSION) | ||
20 | + | ||
21 | # | ||
22 | # You shouldn't need to edit anything below. | ||
23 | # | ||
24 | @@ -50,6 +59,7 @@ | ||
25 | |||
26 | # Standard CFLAGS | ||
27 | CFLAGS = $(CCOPT) $(INCLS) $(DEFS) | ||
28 | +CFLAGS_SHARED = -shared -Wl,-soname,$(SOLIBRARY).$(MAJ) | ||
29 | |||
30 | INSTALL = @INSTALL@ | ||
31 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
32 | @@ -70,6 +80,9 @@ | ||
33 | .c.o: | ||
34 | @rm -f $@ | ||
35 | $(CC) $(CFLAGS) -c $(srcdir)/$*.c | ||
36 | +%_pic.o: %.c | ||
37 | + @rm -f $@ | ||
38 | + $(CC) -fPIC $(CFLAGS) -c -o $@ $(srcdir)/$*.c | ||
39 | |||
40 | PSRC = pcap-@V_PCAP@.c | ||
41 | FSRC = fad-@V_FINDALLDEVS@.c | ||
42 | @@ -84,6 +97,7 @@ | ||
43 | # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot | ||
44 | # hack the extra indirection | ||
45 | OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS) | ||
46 | +OBJ_PIC = $(PSRC:.c=_pic.o) $(FSRC:.c=.o) $(CSRC:.c=_pic.o) $(GENSRC:.c=_pic.o) | ||
47 | HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \ | ||
48 | ethertype.h gencode.h gnuc.h | ||
49 | GENHDR = \ | ||
50 | @@ -95,15 +109,22 @@ | ||
51 | TAGFILES = \ | ||
52 | $(SRC) $(HDR) $(TAGHDR) | ||
53 | |||
54 | -CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c | ||
55 | +CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c libpcap.so* | ||
56 | |||
57 | -all: libpcap.a | ||
58 | +all: libpcap.a $(SHAREDLIB) | ||
59 | |||
60 | libpcap.a: $(OBJ) | ||
61 | @rm -f $@ | ||
62 | ar rc $@ $(OBJ) $(LIBS) | ||
63 | $(RANLIB) $@ | ||
64 | |||
65 | +$(SHAREDLIB): $(OBJ_PIC) | ||
66 | + -@rm -f $@ | ||
67 | + -@rm -f $(SOLIBRARY) $(SOLIBRARY).$(MAJ) | ||
68 | + $(CC) $(CFLAGS_SHARED) -o $(SHAREDLIB) $(OBJ_PIC) -lc | ||
69 | + ln -s $(SHAREDLIB) $(SOLIBRARY).$(MAJ) | ||
70 | + ln -s $(SOLIBRARY).$(MAJ) $(SOLIBRARY) | ||
71 | + | ||
72 | shared: libpcap.$(DYEXT) | ||
73 | |||
74 | # | ||
75 | @@ -129,6 +150,9 @@ | ||
76 | scanner.o: scanner.c tokdefs.h | ||
77 | $(CC) $(CFLAGS) -c scanner.c | ||
78 | |||
79 | +scanner_pic.o: scanner.c tokdefs.h | ||
80 | + $(CC) -fPIC $(CFLAGS) -o $@ -c scanner.c | ||
81 | + | ||
82 | pcap.o: version.h | ||
83 | |||
84 | tokdefs.h: grammar.c | ||
85 | @@ -142,9 +166,16 @@ | ||
86 | @rm -f $@ | ||
87 | $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c | ||
88 | |||
89 | +grammer_pic.o: grammar.c | ||
90 | + @rm -f $@ | ||
91 | + $(CC) -fPIC $(CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c | ||
92 | + | ||
93 | version.o: version.c | ||
94 | $(CC) $(CFLAGS) -c version.c | ||
95 | |||
96 | +version_pic.o: version.c | ||
97 | + $(CC) -fPIC $(CFLAGS) -c version.c -o $@ | ||
98 | + | ||
99 | snprintf.o: $(srcdir)/missing/snprintf.c | ||
100 | $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c | ||
101 | |||
102 | @@ -170,11 +201,17 @@ | ||
103 | bpf_filter.o: bpf_filter.c | ||
104 | $(CC) $(CFLAGS) -c bpf_filter.c | ||
105 | |||
106 | +bpf_filter_pic.o: bpf_filter.c | ||
107 | + $(CC) -fPIC $(CFLAGS) -c bpf_filter.c -o $@ | ||
108 | + | ||
109 | install: libpcap.a | ||
110 | [ -d $(DESTDIR)$(libdir) ] || \ | ||
111 | (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) | ||
112 | $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a | ||
113 | $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a | ||
114 | + $(INSTALL_DATA) $(SHAREDLIB) $(DESTDIR)$(libdir)/ | ||
115 | + ln -sf $(SHAREDLIB) $(DESTDIR)$(libdir)/$(SOLIBRARY).$(MAJ) | ||
116 | + ln -sf $(SOLIBRARY).$(MAJ) $(DESTDIR)$(libdir)/$(SOLIBRARY) | ||
117 | [ -d $(DESTDIR)$(includedir) ] || \ | ||
118 | (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir)) | ||
119 | $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h | ||
diff --git a/meta/packages/libpcap/libpcap_0.9.3.bb b/meta/packages/libpcap/libpcap_0.9.3.bb new file mode 100644 index 0000000000..5d66687482 --- /dev/null +++ b/meta/packages/libpcap/libpcap_0.9.3.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | DESCRIPTION = "Network Packet Capture Library" | ||
2 | HOMEPAGE = "http://www.tcpdump.org/" | ||
3 | LICENSE = "BSD" | ||
4 | SECTION = "libs/network" | ||
5 | PR = "r1" | ||
6 | |||
7 | SRC_URI = "http://www.tcpdump.org/release/libpcap-${PV}.tar.gz \ | ||
8 | file://shared.patch;patch=1" | ||
9 | |||
10 | inherit autotools | ||
11 | |||
12 | EXTRA_OECONF = "--with-pcap=linux" | ||
13 | |||
14 | CPPFLAGS_prepend = "-I${S} " | ||
15 | CFLAGS_prepend = "-I${S} " | ||
16 | CXXFLAGS_prepend = "-I${S} " | ||
17 | |||
18 | do_configure_prepend () { | ||
19 | if [ ! -e acinclude.m4 ]; then | ||
20 | cat aclocal.m4 > acinclude.m4 | ||
21 | fi | ||
22 | } | ||
23 | |||
24 | do_stage () { | ||
25 | install -m 0644 pcap.h ${STAGING_INCDIR}/pcap.h | ||
26 | install -m 0644 pcap-namedb.h ${STAGING_INCDIR}/pcap-namedb.h | ||
27 | install -m 0644 pcap-bpf.h ${STAGING_INCDIR}/pcap-bpf.h | ||
28 | oe_libinstall -a -so libpcap ${STAGING_LIBDIR} | ||
29 | install -d ${STAGING_INCDIR}/net | ||
30 | ln -sf ${STAGING_INCDIR}/pcap-bpf.h ${STAGING_INCDIR}/net/bpf.h | ||
31 | install -m 0644 acinclude.m4 ${STAGING_DATADIR}/aclocal/libpcap.m4 | ||
32 | } | ||