[8.09] merge r17680
[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:=libnet0
12 PKG_VERSION:=1.0.2a
13 PKG_RELEASE:=7
14
15 PKG_SOURCE:=libnet-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/deprecated/
17 PKG_MD5SUM:=ddf53f0f484184390e8c2a1bd0853667
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/Libnet-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/libnet0
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+libpcap
27 TITLE:=Low-level packet creation library (v1.0.x)
28 URL:=http://www.packetfactory.net/libnet/
29 endef
30
31 ENDIANESS:=lil
32 ifeq ($(CONFIG_BIG_ENDIAN),y)
33 ENDIANESS:=big
34 endif
35
36 TARGET_CFLAGS += $(FPIC)
37
38 CONFIGURE_ARGS += \
39 --enable-shared \
40 --enable-static \
41 --with-pf_packet=yes
42
43 CONFIGURE_VARS += \
44 ac_cv_libnet_endianess=$(ENDIANESS) \
45 ac_libnet_have_pf_packet=yes \
46 LL_INT_TYPE=sockpacket
47
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR); touch \
50 configure.in \
51 include.m4 \
52 aclocal.m4 \
53 Makefile.in \
54 configure \
55 );
56 $(call Build/Configure/Default)
57 endef
58
59 define Build/Compile
60 # pass CFLAGS again to override -O2 set by configure
61 $(MAKE) -C $(PKG_BUILD_DIR) \
62 CFLAGS="$(TARGET_CFLAGS)" \
63 DESTDIR="$(PKG_INSTALL_DIR)" \
64 all install
65 endef
66
67 define Build/InstallDev
68 mkdir -p $(1)/usr/lib/libnet-1.0.x/bin/
69 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(1)/usr/lib/libnet-1.0.x/bin/
70 mkdir -p $(1)/usr/lib/libnet-1.0.x/include
71 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(1)/usr/lib/libnet-1.0.x/include/
72 mkdir -p $(1)/usr/lib/libnet-1.0.x/lib
73 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(1)/usr/lib/libnet-1.0.x/lib/
74 endef
75
76 define Package/libnet0/install
77 $(INSTALL_DIR) $(1)/usr/lib
78 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/
79 endef
80
81 $(eval $(call BuildPackage,libnet0))