more pci fixes
[openwrt.git] / package / libnet / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=libnet
6 PKG_VERSION:=1.0.2a
7 PKG_RELEASE:=7
8 PKG_MD5SUM:=ddf53f0f484184390e8c2a1bd0853667
9
10 PKG_SOURCE_URL:=\
11 http://www.packetfactory.net/libnet/dist/deprecated/ \
12 http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_CAT:=zcat
15
16 PKG_BUILD_DIR:=$(BUILD_DIR)/Libnet-$(PKG_VERSION)
17
18 IPKG_LIBNET:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 IDIR_LIBNET:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME)
20 INFO_LIBNET:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
21
22 $(DL_DIR)/$(PKG_SOURCE):
23 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
24
25 $(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
26 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
27 $(PATCH) $(PKG_BUILD_DIR) ./patches
28 touch $(PKG_BUILD_DIR)/.prepared
29
30 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
31 (cd $(PKG_BUILD_DIR); rm -rf config.cache config.status; \
32 touch configure.in; \
33 touch include.m4; \
34 touch aclocal.m4; \
35 touch Makefile.in; \
36 touch configure; \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(TARGET_CFLAGS)" \
39 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
40 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
41 ac_libnet_have_pf_packet=yes \
42 ac_cv_lbl_unaligned_fail=no \
43 ac_cv_libnet_endianess=lil \
44 ./configure \
45 --target=$(GNU_TARGET_NAME) \
46 --host=$(GNU_TARGET_NAME) \
47 --build=$(GNU_HOST_NAME) \
48 --program-prefix="" \
49 --program-suffix="" \
50 --prefix=/usr \
51 --exec-prefix=/usr \
52 --bindir=/usr/bin \
53 --datadir=/usr/share \
54 --includedir=/usr/include \
55 --infodir=/usr/share/info \
56 --libdir=/usr/lib \
57 --libexecdir=/usr/lib \
58 --localstatedir=/var \
59 --mandir=/usr/share/man \
60 --sbindir=/usr/sbin \
61 --sysconfdir=/etc \
62 $(DISABLE_NLS) \
63 $(DISABLE_LARGEFILE) \
64 --enable-shared \
65 --enable-static \
66 --with-pf_packet=yes \
67 );
68 touch $(PKG_BUILD_DIR)/.configured
69
70 $(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.configured
71 $(MAKE) -C $(PKG_BUILD_DIR) \
72 $(TARGET_CONFIGURE_OPTS) \
73 CFLAGS="$(TARGET_CFLAGS)"
74 touch $(PKG_BUILD_DIR)/.built
75
76 $(STAGING_DIR)/usr/lib/libnet.so: $(PKG_BUILD_DIR)/.built
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(STAGING_DIR)" \
79 install
80 rm -rf $(STAGING_DIR)/usr/lib/libnet.la
81
82 $(IPKG_LIBNET): $(STAGING_DIR)/usr/lib/libnet.so
83 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBNET) ./ipkg/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
84 mkdir -p $(IDIR_LIBNET)/usr/lib
85 cp -fpR $(STAGING_DIR)/usr/lib/libnet.so.* $(IDIR_LIBNET)/usr/lib/
86 $(STRIP) $(IDIR_LIBNET)/usr/lib/lib*.so*
87 mkdir -p $(PACKAGE_DIR)
88 $(IPKG_BUILD) $(IDIR_LIBNET) $(PACKAGE_DIR)
89
90 $(INFO_LIBNET): $(IPKG_LIBNET)
91 $(IPKG) install $(IPKG_LIBNET)
92
93 source: $(DL_DIR)/$(PKG_SOURCE)
94 prepare: $(PKG_BUILD_DIR)/.prepared
95 compile: $(IPKG_LIBNET)
96 install: $(INFO_LIBNET)
97
98 clean:
99 -$(MAKE) -C $(PKG_BUILD_DIR) \
100 DESTDIR="$(STAGING_DIR)" \
101 uninstall
102 rm -rf $(PKG_BUILD_DIR) $(IPKG_LIBNET)
This page took 0.052667 seconds and 5 git commands to generate.