| 進階會員 | 整個 patch 的內容,更動 Makefile.in。 語法: 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=0
+MINOR=6
+SUBMINOR=2
+VERSION = $(MAJOR).$(MINOR).$(SUBMINOR)
# 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):
+ ld -shared -soname 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))
|
| 回覆 |
| 進階會員 | 其實重點應該就只有兩行 CFLAGS = $(CCOPT) $(INCLS) $(DEFS) -fPIC -DPIC ld -shared -soname libpcap.so.$(VERSION) -o libpcap.so.$(VERSION) $(OBJ) -lc 這兩行修改之後,make 一次,就可以建出 libpcap 的 share lib 可以自行 cp libpcap.so.x 去平常放 lib 的地方 |
| 回覆 |
| 會員 ![]() | 嗯....謝謝大家的幫助.. |
| 回覆 |
| XML | RSS 2.0 | RSS |
本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。