42ee58e3bbe898905c1d74c9f823c5f74bd8188d
[openwrt/svn-archive/packages.git] / libs / boost / Makefile
1 #
2 # Copyright (C) 2009-2012 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_51_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:=6a1f32d902203ac70fbec78af95b3cf8
21
22 PKG_BUILD_DEPENDS:=boost/host
23 PKG_BUILD_PARALLEL:=0
24 PKG_USE_MIPS16:=0
25
26 PKG_CONFIG_DEPENDS := \
27 CONFIG_PACKAGE_boost-date_time \
28 CONFIG_PACKAGE_boost-filesystem \
29 CONFIG_PACKAGE_boost-graph \
30 CONFIG_PACKAGE_boost-iostreams \
31 CONFIG_PACKAGE_boost-math \
32 CONFIG_PACKAGE_boost-program_options \
33 CONFIG_PACKAGE_boost-python \
34 CONFIG_PACKAGE_boost-regex \
35 CONFIG_PACKAGE_boost-serialization \
36 CONFIG_PACKAGE_boost-signals \
37 CONFIG_PACKAGE_boost-system \
38 CONFIG_PACKAGE_boost-test \
39 CONFIG_PACKAGE_boost-thread \
40 CONFIG_PACKAGE_boost-wave \
41
42 include $(INCLUDE_DIR)/package.mk
43 include $(INCLUDE_DIR)/host-build.mk
44
45 define Package/boost/Default
46 SECTION:=libs
47 CATEGORY:=Libraries
48 TITLE:=Boost C++ source libraries
49 URL:=http://www.boost.org
50 DEPENDS:=+libstdcpp +libpthread +librt
51 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
52 endef
53
54 define Package/boost/Default/description
55 Boost provides free peer-reviewed portable C++ source libraries
56 endef
57
58 define Package/boost-chrono
59 $(call Package/boost/Default)
60 TITLE+= (chrono)
61 DEPENDS+= +boost-system
62 endef
63
64 define Package/boost-date_time
65 $(call Package/boost/Default)
66 TITLE+= (date_time)
67 endef
68
69 define Package/boost-exception
70 $(call Package/boost/Default)
71 TITLE+= (exception)
72 endef
73
74 define Package/boost-filesystem
75 $(call Package/boost/Default)
76 TITLE+= (filesystem)
77 DEPENDS+= +boost-system
78 endef
79
80 define Package/boost-graph
81 $(call Package/boost/Default)
82 TITLE+= (graph)
83 DEPENDS+= +boost-regex
84 endef
85
86 define Package/boost-graph_parallel
87 $(call Package/boost/Default)
88 TITLE+= (graph_parallel)
89 endef
90
91 define Package/boost-iostreams
92 $(call Package/boost/Default)
93 TITLE+= (iostreams)
94 DEPENDS+= +zlib
95 endef
96
97 define Package/boost-locale
98 $(call Package/boost/Default)
99 TITLE+= (locale)
100 endef
101
102 define Package/boost-math
103 $(call Package/boost/Default)
104 TITLE+= (math)
105 endef
106
107 define Package/boost-mpi
108 $(call Package/boost/Default)
109 TITLE+= (mpi)
110 endef
111
112 define Package/boost-program_options
113 $(call Package/boost/Default)
114 TITLE+= (program_options)
115 endef
116
117 define Package/boost-python
118 $(call Package/boost/Default)
119 TITLE+= (python)
120 DEPENDS+= +PACKAGE_boost-python:python
121 endef
122
123 define Package/boost-random
124 $(call Package/boost/Default)
125 TITLE+= (random)
126 endef
127
128 define Package/boost-regex
129 $(call Package/boost/Default)
130 TITLE+= (regex)
131 endef
132
133 define Package/boost-serialization
134 $(call Package/boost/Default)
135 TITLE+= (serialization)
136 endef
137
138 define Package/boost-signals
139 $(call Package/boost/Default)
140 TITLE+= (signals)
141 endef
142
143 define Package/boost-system
144 $(call Package/boost/Default)
145 TITLE+= (system)
146 endef
147
148 define Package/boost-test
149 $(call Package/boost/Default)
150 TITLE+= (test)
151 endef
152
153 define Package/boost-thread
154 $(call Package/boost/Default)
155 TITLE+= (thread)
156 DEPENDS+= +boost-system +boost-chrono
157 endef
158
159 define Package/boost-timer
160 $(call Package/boost/Default)
161 TITLE+= (timer)
162 DEPENDS+= boost-chrono
163 endef
164
165 define Package/boost-wave
166 $(call Package/boost/Default)
167 TITLE+= (wave)
168 DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
169 endef
170
171 define Package/boost
172 $(call Package/boost/Default)
173 TITLE+= (header-only)
174 BUILDONLY:=1
175 endef
176
177 define Build/Configure
178 endef
179
180 define Host/Compile
181 # bjam does not provide a configure-script nor a Makefile
182 ( cd $(HOST_BUILD_DIR)/tools/build/v2/engine ; ./build.sh gcc )
183 endef
184
185 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
186 TARGET_LDFLAGS += -pthread -lrt
187
188 define Build/Compile
189 ( cd $(PKG_BUILD_DIR) ; \
190 echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/v2/user-config.jam ; \
191 $(if $(CONFIG_PACKAGE_boost-python), \
192 echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
193 tools/build/v2/user-config.jam; \
194 ) \
195 bjam \
196 '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
197 --toolset=gcc-$(ARCH) --build-type=minimal --layout=system \
198 --disable-long-double \
199 $(CONFIGURE_ARGS) \
200 $(if $(CONFIG_PACKAGE_boost-chrono),,--without-chrono) \
201 $(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
202 $(if $(CONFIG_PACKAGE_boost-exception),,--without-exception) \
203 $(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
204 $(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
205 $(if $(CONFIG_PACKAGE_boost-graph_parallel),,--without-graph_parallel) \
206 $(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
207 $(if $(CONFIG_PACKAGE_boost-locale),,--without-locale) \
208 $(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
209 $(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
210 $(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
211 $(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
212 $(if $(CONFIG_PACKAGE_boost-random),,--without-random) \
213 $(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
214 $(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
215 $(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
216 $(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
217 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
218 $(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
219 $(if $(CONFIG_PACKAGE_boost-timer),,--without-timer) \
220 $(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
221 \
222 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
223 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
224 install \
225 )
226 endef
227
228 define Build/InstallDev
229 $(INSTALL_DIR) \
230 $(1)/usr/include/boost/
231
232 $(CP) \
233 $(PKG_INSTALL_DIR)/include/boost/* \
234 $(1)/usr/include/boost/ \
235 # copies _all_ header files - independent of <--with-library>-argument above
236
237 if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
238 $(INSTALL_DIR) \
239 $(1)/usr/lib; \
240 $(CP) \
241 $(PKG_INSTALL_DIR)/lib/*.a \
242 $(1)/usr/lib/; \
243 $(CP) \
244 $(PKG_INSTALL_DIR)/lib/*.so* \
245 $(1)/usr/lib/; \
246 fi
247 endef
248
249 define Host/Install
250 $(INSTALL_DIR) \
251 $(STAGING_DIR_HOST)/bin
252
253 $(CP) \
254 $(HOST_BUILD_DIR)/tools/build/v2/engine/bin.*/bjam \
255 $(STAGING_DIR_HOST)/bin/
256 endef
257
258 define Package/boost/Default/install
259 $(INSTALL_DIR) \
260 $(1)/usr/lib
261
262 $(CP) \
263 $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
264 $(1)/usr/lib/
265 endef
266
267 define Package/boost-chrono/install
268 $(call Package/boost/Default/install,$(1),chrono)
269 endef
270
271 define Package/boost-date_time/install
272 $(call Package/boost/Default/install,$(1),date_time)
273 endef
274
275 define Package/boost-exception/install
276 $(call Package/boost/Default/install,$(1),exception)
277 endef
278
279 define Package/boost-filesystem/install
280 $(call Package/boost/Default/install,$(1),filesystem)
281 endef
282
283 define Package/boost-graph/install
284 $(call Package/boost/Default/install,$(1),graph)
285 endef
286
287 define Package/boost-graph_parallel/install
288 $(call Package/boost/Default/install,$(1),graph_parallel)
289 endef
290
291 define Package/boost-iostreams/install
292 $(call Package/boost/Default/install,$(1),iostreams)
293 endef
294
295 define Package/boost-math/install
296 $(call Package/boost/Default/install,$(1),math)
297 endef
298
299 define Package/boost-mpi/install
300 $(call Package/boost/Default/install,$(1),mpi)
301 endef
302
303 define Package/boost-program_options/install
304 $(call Package/boost/Default/install,$(1),program_options)
305 endef
306
307 define Package/boost-python/install
308 $(call Package/boost/Default/install,$(1),python)
309 endef
310
311 define Package/boost-random/install
312 $(call Package/boost/Default/install,$(1),random)
313 endef
314
315 define Package/boost-regex/install
316 $(call Package/boost/Default/install,$(1),regex)
317 endef
318
319 define Package/boost-serialization/install
320 $(call Package/boost/Default/install,$(1),serialization)
321 endef
322
323 define Package/boost-signals/install
324 $(call Package/boost/Default/install,$(1),signals)
325 endef
326
327 define Package/boost-system/install
328 $(call Package/boost/Default/install,$(1),system)
329 endef
330
331 define Package/boost-test/install
332 $(INSTALL_DIR) \
333 $(1)/usr/lib
334
335 $(CP) \
336 $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
337 $(1)/usr/lib/
338
339 $(CP) \
340 $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
341 $(1)/usr/lib/
342 endef
343
344 define Package/boost-thread/install
345 $(call Package/boost/Default/install,$(1),thread)
346 endef
347
348 define Package/boost-timer/install
349 $(call Package/boost/Default/install,$(1),timer)
350 endef
351
352 define Package/boost-wave/install
353 $(call Package/boost/Default/install,$(1),wave)
354 endef
355
356 $(eval $(call HostBuild))
357 $(eval $(call BuildPackage,boost))
358 $(eval $(call BuildPackage,boost-chrono))
359 $(eval $(call BuildPackage,boost-date_time))
360 #$(eval $(call BuildPackage,boost-exception))
361 $(eval $(call BuildPackage,boost-filesystem))
362 $(eval $(call BuildPackage,boost-graph))
363 #$(eval $(call BuildPackage,boost-graph_parallel))
364 $(eval $(call BuildPackage,boost-iostreams))
365 $(eval $(call BuildPackage,boost-locale))
366 $(eval $(call BuildPackage,boost-math))
367 #$(eval $(call BuildPackage,boost-mpi))
368 $(eval $(call BuildPackage,boost-program_options))
369 $(eval $(call BuildPackage,boost-random))
370 $(eval $(call BuildPackage,boost-python))
371 $(eval $(call BuildPackage,boost-regex))
372 $(eval $(call BuildPackage,boost-serialization))
373 $(eval $(call BuildPackage,boost-signals))
374 $(eval $(call BuildPackage,boost-system))
375 $(eval $(call BuildPackage,boost-test))
376 $(eval $(call BuildPackage,boost-thread))
377 $(eval $(call BuildPackage,boost-timer))
378 $(eval $(call BuildPackage,boost-wave))