level up boost to version 0.46
[openwrt/svn-archive/archive.git] / libs / boost / Makefile
1 #
2 # Copyright (C) 2009-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 # Dude, this "boost" is really one of the most crude stuff I ported yet.
9
10 include $(TOPDIR)/rules.mk
11
12 PKG_NAME:=boost
13 PKG_VERSION:=1_46_0
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/boost
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
19 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION)
20 PKG_MD5SUM:=820393d5746553c192db7b81ba0e53fe
21
22 PKG_BUILD_DEPENDS:=boost/host
23 PKG_BUILD_PARALLEL:=1
24
25 PKG_CONFIG_DEPENDS := \
26 CONFIG_PACKAGE_boost-date_time \
27 CONFIG_PACKAGE_boost-filesystem \
28 CONFIG_PACKAGE_boost-graph \
29 CONFIG_PACKAGE_boost-iostreams \
30 CONFIG_PACKAGE_boost-math \
31 CONFIG_PACKAGE_boost-program_options \
32 CONFIG_PACKAGE_boost-python \
33 CONFIG_PACKAGE_boost-regex \
34 CONFIG_PACKAGE_boost-serialization \
35 CONFIG_PACKAGE_boost-signals \
36 CONFIG_PACKAGE_boost-system \
37 CONFIG_PACKAGE_boost-test \
38 CONFIG_PACKAGE_boost-thread \
39 CONFIG_PACKAGE_boost-wave \
40
41 include $(INCLUDE_DIR)/package.mk
42 include $(INCLUDE_DIR)/host-build.mk
43
44 define Package/boost/Default
45 SECTION:=libs
46 CATEGORY:=Libraries
47 TITLE:=Boost C++ source libraries
48 URL:=http://www.boost.org
49 DEPENDS:=+libstdcpp
50 endef
51
52 define Package/boost/Default/description
53 Boost provides free peer-reviewed portable C++ source libraries
54 endef
55
56 define Package/boost-date_time
57 $(call Package/boost/Default)
58 TITLE+= (date_time)
59 endef
60
61 define Package/boost-filesystem
62 $(call Package/boost/Default)
63 TITLE+= (filesystem)
64 endef
65
66 define Package/boost-graph
67 $(call Package/boost/Default)
68 TITLE+= (graph)
69 endef
70
71 define Package/boost-iostreams
72 $(call Package/boost/Default)
73 TITLE+= (iostreams)
74 DEPENDS+= +zlib
75 endef
76
77 define Package/boost-math
78 $(call Package/boost/Default)
79 TITLE+= (math)
80 endef
81
82 #define Package/boost-mpi
83 # $(call Package/boost/Default)
84 # TITLE+= (mpi)
85 #endef
86
87 define Package/boost-program_options
88 $(call Package/boost/Default)
89 TITLE+= (program_options)
90 endef
91
92 define Package/boost-python
93 $(call Package/boost/Default)
94 TITLE+= (python)
95 DEPENDS+= +python
96 endef
97
98 define Package/boost-regex
99 $(call Package/boost/Default)
100 TITLE+= (regex)
101 endef
102
103 define Package/boost-serialization
104 $(call Package/boost/Default)
105 TITLE+= (serialization)
106 endef
107
108 define Package/boost-signals
109 $(call Package/boost/Default)
110 TITLE+= (signals)
111 endef
112
113 define Package/boost-system
114 $(call Package/boost/Default)
115 TITLE+= (system)
116 endef
117
118 define Package/boost-test
119 $(call Package/boost/Default)
120 TITLE+= (test)
121 endef
122
123 define Package/boost-thread
124 $(call Package/boost/Default)
125 TITLE+= (thread)
126 endef
127
128 define Package/boost-wave
129 $(call Package/boost/Default)
130 TITLE+= (wave)
131 endef
132
133 define Package/boost
134 $(call Package/boost/Default)
135 TITLE+= (header-only)
136 BUILDONLY:=1
137 endef
138
139 define Build/Configure
140 endef
141
142 define Host/Compile
143 # bjam does not provide a configure-script nor a Makefile
144 ( cd $(HOST_BUILD_DIR)/tools/build/v2/engine/src ; ./build.sh gcc )
145 endef
146
147 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
148 TARGET_LDFLAGS += -pthreads -lrt
149
150 define Build/Compile
151 ( cd $(PKG_BUILD_DIR) ; \
152 echo "using gcc : : $(GNU_TARGET_NAME)-gcc : <cflags>$(TARGET_CFLAGS) <cxxflags>$(TARGET_CXXFLAGS) <linkflags>$(TARGET_LDFLAGS) ;" > tools/build/v2/site-config.jam ; \
153 $(if $(CONFIG_PACKAGE_boost-python), \
154 echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.6/ ;" >> \
155 tools/build/v2/site-config.jam; \
156 ) \
157 bjam \
158 '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
159 $(filter -j%,$(PKG_JOBS)) \
160 --toolset=gcc --build-type=minimal --layout=system \
161 --disable-long-double \
162 $(CONFIGURE_ARGS) \
163 $(if $(CONFIG_PACKAGE_boost-date_time),--with-date_time) \
164 $(if $(CONFIG_PACKAGE_boost-filesystem),--with-filesystem) \
165 $(if $(CONFIG_PACKAGE_boost-graph),--with-graph) \
166 $(if $(CONFIG_PACKAGE_boost-iostreams),--with-iostreams) \
167 $(if $(CONFIG_PACKAGE_boost-math),--with-math) \
168 $(if $(CONFIG_PACKAGE_boost-mpi),--with-mpi) \
169 $(if $(CONFIG_PACKAGE_boost-program_options),--with-program_options) \
170 $(if $(CONFIG_PACKAGE_boost-python),--with-python) \
171 $(if $(CONFIG_PACKAGE_boost-regex),--with-regex) \
172 $(if $(CONFIG_PACKAGE_boost-serialization),--with-serialization) \
173 $(if $(CONFIG_PACKAGE_boost-signals),--with-signals) \
174 $(if $(CONFIG_PACKAGE_boost-system),--with-system) \
175 $(if $(CONFIG_PACKAGE_boost-test),--with-test) \
176 $(if $(CONFIG_PACKAGE_boost-thread),--with-thread) \
177 $(if $(CONFIG_PACKAGE_boost-wave),--with-wave) \
178 \
179 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
180 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
181 install \
182 )
183 endef
184
185 define Build/InstallDev
186 $(INSTALL_DIR) $(1)/usr/include/boost/
187 $(CP) $(PKG_INSTALL_DIR)/include/boost/* $(1)/usr/include/boost/ # copies _all_ header files - independent of <--with-library>-argument above
188
189 if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
190 $(INSTALL_DIR) $(1)/usr/lib; \
191 $(CP) $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/; \
192 $(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/usr/lib/; \
193 fi
194 endef
195
196 define Host/Install
197 $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
198 $(CP) $(HOST_BUILD_DIR)/tools/build/v2/engine/src/bin.*/bjam $(STAGING_DIR_HOST)/bin/
199 endef
200
201 define Package/boost/Default/install
202 $(INSTALL_DIR) $(1)/usr/lib
203 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
204 endef
205
206 define Package/boost-date_time/install
207 $(call Package/boost/Default/install,$(1),date_time)
208 endef
209
210 define Package/boost-filesystem/install
211 $(call Package/boost/Default/install,$(1),filesystem)
212 endef
213
214 define Package/boost-graph/install
215 $(call Package/boost/Default/install,$(1),graph)
216 endef
217
218 define Package/boost-iostreams/install
219 $(call Package/boost/Default/install,$(1),iostreams)
220 endef
221
222 define Package/boost-math/install
223 $(call Package/boost/Default/install,$(1),math)
224 endef
225
226 #define Package/boost-mpi/install
227 # $(call Package/boost/Default/install,$(1),mpi)
228 #endef
229
230 define Package/boost-program_options/install
231 $(call Package/boost/Default/install,$(1),program_options)
232 endef
233
234 define Package/boost-python/install
235 $(call Package/boost/Default/install,$(1),python)
236 endef
237
238 define Package/boost-regex/install
239 $(call Package/boost/Default/install,$(1),regex)
240 endef
241
242 define Package/boost-serialization/install
243 $(call Package/boost/Default/install,$(1),serialization)
244 endef
245
246 define Package/boost-signals/install
247 $(call Package/boost/Default/install,$(1),signals)
248 endef
249
250 define Package/boost-system/install
251 $(call Package/boost/Default/install,$(1),system)
252 endef
253
254 define Package/boost-test/install
255 $(INSTALL_DIR) $(1)/usr/lib
256 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* $(1)/usr/lib/
257 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* $(1)/usr/lib/
258 endef
259
260 define Package/boost-thread/install
261 $(call Package/boost/Default/install,$(1),thread)
262 endef
263
264 define Package/boost-wave/install
265 $(call Package/boost/Default/install,$(1),wave)
266 endef
267
268 $(eval $(call HostBuild))
269 $(eval $(call BuildPackage,boost))
270 $(eval $(call BuildPackage,boost-date_time))
271 $(eval $(call BuildPackage,boost-filesystem))
272 $(eval $(call BuildPackage,boost-graph))
273 $(eval $(call BuildPackage,boost-iostreams))
274 $(eval $(call BuildPackage,boost-math))
275 #$(eval $(call BuildPackage,boost-mpi))
276 $(eval $(call BuildPackage,boost-program_options))
277 $(eval $(call BuildPackage,boost-python))
278 $(eval $(call BuildPackage,boost-regex))
279 $(eval $(call BuildPackage,boost-serialization))
280 $(eval $(call BuildPackage,boost-signals))
281 $(eval $(call BuildPackage,boost-system))
282 $(eval $(call BuildPackage,boost-test))
283 $(eval $(call BuildPackage,boost-thread))
284 $(eval $(call BuildPackage,boost-wave))