Split python into a host and target build. Also add a HostPython macro to convenientl...
[openwrt/svn-archive/archive.git] / libs / libdnet / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libdnet
11 PKG_VERSION:=1.11
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
16 PKG_MD5SUM:=04c394ed8e1e7fc455456e79e908916d
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 PKG_CONFIG_DEPENDS:=\
22 CONFIG_PACKAGE_libdnet \
23 CONFIG_PACKAGE_pydnet
24
25 PKG_BUILD_DEPENDS:=PACKAGE_pydnet:python
26
27 include $(INCLUDE_DIR)/package.mk
28 $(call include_mk, python-package.mk)
29
30 define Package/libdnet/Default
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE:=Low-level network library
34 URL:=http://sourceforge.net/projects/libdnet/
35 endef
36
37 define Package/libdnet/Default/description
38 libdnet is a library of simplified, portable interface to several
39 low-level networking routines.
40 endef
41
42 define Package/libdnet
43 $(call Package/libdnet/Default)
44 endef
45
46 define Package/libdnet/description
47 $(call Package/libdnet/Default/description)
48 endef
49
50 define Package/pydnet
51 $(call Package/libdnet/Default)
52 DEPENDS:=libdnet +python-mini
53 endef
54
55 define Package/pydnet/description
56 $(call Package/libdnet/Default/description)
57 This package contains the python dnet library.
58 endef
59
60 TARGET_CFLAGS += $(FPIC)
61
62 CONFIGURE_ARGS += \
63 --enable-shared \
64 --enable-static \
65 --without-check \
66 --without-python
67
68 CONFIGURE_VARS += \
69 ac_cv_dnet_bsd_bpf=no
70
71 define Build/Compile
72 $(call Build/Compile/Default)
73 $(if $(CONFIG_PACKAGE_pydnet), \
74 $(call Build/Compile/PyMod, \
75 python/, \
76 build \
77 ) \
78 )
79 endef
80
81 define Build/Install
82 $(call Build/Install/Default)
83 $(if $(CONFIG_PACKAGE_pydnet), \
84 $(call Build/Compile/PyMod, \
85 python/, \
86 install --no-compile --prefix $(PKG_INSTALL_DIR)/usr \
87 ) \
88 )
89 endef
90
91 define Build/InstallDev
92 $(INSTALL_DIR) $(2)/bin
93 $(INSTALL_BIN) \
94 $(PKG_INSTALL_DIR)/usr/bin/dnet-config \
95 $(2)/bin/
96 $(SED) \
97 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
98 $(2)/bin/dnet-config
99
100 $(INSTALL_DIR) $(1)/usr/include
101 $(INSTALL_DATA)\
102 $(PKG_INSTALL_DIR)/usr/include/dnet.h \
103 $(1)/usr/include/
104 $(CP) \
105 $(PKG_INSTALL_DIR)/usr/include/dnet \
106 $(1)/usr/include/
107
108 $(INSTALL_DIR) $(1)/usr/lib
109 $(CP) \
110 $(PKG_INSTALL_DIR)/usr/lib/libdnet.{la,a,so*} \
111 $(1)/usr/lib/
112 endef
113
114 define Package/libdnet/install
115 $(INSTALL_DIR) $(1)/usr/lib
116 $(CP) \
117 $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* \
118 $(1)/usr/lib/
119
120 $(INSTALL_DIR) $(1)/usr/sbin
121 $(INSTALL_BIN) \
122 $(PKG_INSTALL_DIR)/usr/sbin/dnet \
123 $(1)/usr/sbin/
124 endef
125
126 define Package/pydnet/install
127 $(INSTALL_DIR) $(1)/usr/lib
128 $(CP) $(PKG_INSTALL_DIR)/usr/lib/python* $(1)/usr/lib/
129 endef
130
131
132 $(eval $(call BuildPackage,libdnet))
133 $(eval $(call BuildPackage,pydnet))