| 1 | # $Id: Makefile 3139 2006-02-05 17:30:49Z florian $
|
|---|
| 2 |
|
|---|
| 3 | include $(TOPDIR)/rules.mk
|
|---|
| 4 |
|
|---|
| 5 | PKG_NAME:=libpcap
|
|---|
| 6 | PKG_VERSION:=0.9.4
|
|---|
| 7 | PKG_RELEASE:=1
|
|---|
| 8 | PKG_MD5SUM:=79025766e8027df154cb1f32de8a7974
|
|---|
| 9 |
|
|---|
| 10 | PKG_SOURCE_URL:=http://www.tcpdump.org/release/
|
|---|
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|---|
| 12 |
|
|---|
| 13 | WRKSRC:=${WRKDIR}/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
|
|---|
| 14 |
|
|---|
| 15 | include $(TOPDIR)/package/rules.mk
|
|---|
| 16 |
|
|---|
| 17 | $(eval $(call PKG_template,LIBPCAP,libpcap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 18 |
|
|---|
| 19 | $(WRKBUILD)/.configured:
|
|---|
| 20 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 21 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 22 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 23 | CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
|
|---|
| 24 | LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
|
|---|
| 25 | ac_cv_linux_vers=$(BR2_DEFAULT_KERNEL_HEADERS) \
|
|---|
| 26 | ./configure \
|
|---|
| 27 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 28 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 29 | --build=$(GNU_HOST_NAME) \
|
|---|
| 30 | --program-prefix="" \
|
|---|
| 31 | --program-suffix="" \
|
|---|
| 32 | --prefix=/usr \
|
|---|
| 33 | --exec-prefix=/usr \
|
|---|
| 34 | --bindir=/usr/bin \
|
|---|
| 35 | --datadir=/usr/share \
|
|---|
| 36 | --includedir=/usr/include \
|
|---|
| 37 | --infodir=/usr/share/info \
|
|---|
| 38 | --libdir=/usr/lib \
|
|---|
| 39 | --libexecdir=/usr/lib \
|
|---|
| 40 | --localstatedir=/var \
|
|---|
| 41 | --mandir=/usr/share/man \
|
|---|
| 42 | --sbindir=/usr/sbin \
|
|---|
| 43 | --sysconfdir=/etc \
|
|---|
| 44 | --disable-nls \
|
|---|
| 45 | --enable-largefile \
|
|---|
| 46 | --enable-shared \
|
|---|
| 47 | --enable-static \
|
|---|
| 48 | --disable-yydebug \
|
|---|
| 49 | --enable-ipv6 \
|
|---|
| 50 | --with-build-cc=$(HOSTCC) \
|
|---|
| 51 | --with-pcap=linux \
|
|---|
| 52 | );
|
|---|
| 53 | touch $@
|
|---|
| 54 |
|
|---|
| 55 | $(WRKBUILD)/.built:
|
|---|
| 56 | rm -rf $(WRKINST)
|
|---|
| 57 | mkdir -p $(WRKINST)
|
|---|
| 58 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 59 | CCOPT="$(TARGET_CFLAGS) -I${WRKDIR}/linux/include" \
|
|---|
| 60 | DESTDIR="$(WRKINST)" \
|
|---|
| 61 | all install
|
|---|
| 62 | touch $@
|
|---|
| 63 |
|
|---|
| 64 | $(IPKG_LIBPCAP):
|
|---|
| 65 | install -m0755 -d $(IDIR_LIBPCAP)/usr/lib
|
|---|
| 66 | $(CP) $(WRKINST)/usr/lib/libpcap.so.* $(IDIR_LIBPCAP)/usr/lib/
|
|---|
| 67 | $(RSTRIP) $(IDIR_LIBPCAP)
|
|---|
| 68 | $(IPKG_BUILD) $(IDIR_LIBPCAP) $(PACKAGE_DIR)
|
|---|
| 69 |
|
|---|
| 70 | $(STAGING_DIR)/usr/lib/libpcap.so: $(WRKBUILD)/.built
|
|---|
| 71 | mkdir -p $(STAGING_DIR)/usr/include
|
|---|
| 72 | $(CP) $(WRKINST)/usr/include/pcap* $(STAGING_DIR)/usr/include/
|
|---|
| 73 | mkdir -p $(STAGING_DIR)/usr/lib
|
|---|
| 74 | $(CP) $(WRKINST)/usr/lib/libpcap.{a,so*} $(STAGING_DIR)/usr/lib/
|
|---|
| 75 | touch $(STAGING_DIR)/usr/lib/libpcap.so
|
|---|
| 76 |
|
|---|
| 77 | install-dev: $(STAGING_DIR)/usr/lib/libpcap.so
|
|---|
| 78 |
|
|---|
| 79 | uninstall-dev:
|
|---|
| 80 | rm -rf $(STAGING_DIR)/usr/include/pcap*
|
|---|
| 81 | rm -rf $(STAGING_DIR)/usr/lib/libpcap.{a,so*}
|
|---|
| 82 |
|
|---|
| 83 | compile-targets: install-dev
|
|---|
| 84 | clean-targets: uninstall-dev
|
|---|