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