override cflags (not honored by ./configure)
[openwrt/svn-archive/archive.git] / libs / libnet-1.0.x / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libnet
12 PKG_VERSION:=1.0.2a
13 PKG_RELEASE:=7
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/deprecated/
17 PKG_MD5SUM:=ddf53f0f484184390e8c2a1bd0853667
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/Libnet-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libnet0
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libpcap
29 TITLE:=Low-level packet creation library (v1.0.x)
30 URL:=http://www.packetfactory.net/libnet/
31 endef
32
33 ENDIANESS:=lil
34 ifeq ($(CONFIG_BIG_ENDIAN),y)
35 ENDIANESS:=big
36 endif
37
38 define Build/Configure
39 (cd $(PKG_BUILD_DIR); touch \
40 configure.in \
41 include.m4 \
42 aclocal.m4 \
43 Makefile.in \
44 configure \
45 );
46 $(call Build/Configure/Default, \
47 --enable-shared \
48 --enable-static \
49 --with-pf_packet=yes \
50 , \
51 ac_libnet_have_pf_packet=yes \
52 ac_cv_lbl_unaligned_fail=no \
53 ac_cv_libnet_endianess=$(ENDIANESS) \
54 )
55 endef
56
57 define Build/Compile
58 # pass CFLAGS again to override -O2 set by configure
59 $(MAKE) -C $(PKG_BUILD_DIR) \
60 CFLAGS="$(TARGET_CFLAGS)" \
61 DESTDIR="$(PKG_INSTALL_DIR)" \
62 all install
63 endef
64
65 define Build/InstallDev
66 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.0.x/bin/
67 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(STAGING_DIR)/usr/lib/libnet-1.0.x/bin/
68 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.0.x/include
69 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(STAGING_DIR)/usr/lib/libnet-1.0.x/include/
70 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.0.x/lib
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(STAGING_DIR)/usr/lib/libnet-1.0.x/lib/
72 endef
73
74 define Build/UninstallDev
75 rm -rf $(STAGING_DIR)/usr/lib/libnet-1.0.x
76 endef
77
78 define Package/libnet0/install
79 install -m0755 -d $(1)/usr/lib
80 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/
81 endef
82
83 $(eval $(call BuildPackage,libnet0))