2 # Copyright (C) 2009-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # Dude, this "boost" is really one of the most crude stuff I ported yet.
10 include $(TOPDIR)/rules.mk
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
22 PKG_BUILD_DEPENDS:=boost/host
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 \
41 include $(INCLUDE_DIR)/package.mk
42 include $(INCLUDE_DIR)/host-build.mk
44 define Package/boost/Default
47 TITLE:=Boost C++ source libraries
48 URL:=http://www.boost.org
49 DEPENDS:=+libstdcpp +libpthread +librt
50 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
53 define Package/boost/Default/description
54 Boost provides free peer-reviewed portable C++ source libraries
57 define Package/boost-chrono
58 $(call Package/boost/Default)
60 DEPENDS+= +boost-system
63 define Package/boost-date_time
64 $(call Package/boost/Default)
68 define Package/boost-exception
69 $(call Package/boost/Default)
73 define Package/boost-filesystem
74 $(call Package/boost/Default)
76 DEPENDS+= +boost-system
79 define Package/boost-graph
80 $(call Package/boost/Default)
82 DEPENDS+= +boost-regex
85 define Package/boost-graph_parallel
86 $(call Package/boost/Default)
87 TITLE+= (graph_parallel)
90 define Package/boost-iostreams
91 $(call Package/boost/Default)
96 define Package/boost-locale
97 $(call Package/boost/Default)
101 define Package/boost-math
102 $(call Package/boost/Default)
106 define Package/boost-mpi
107 $(call Package/boost/Default)
111 define Package/boost-program_options
112 $(call Package/boost/Default)
113 TITLE+= (program_options)
116 define Package/boost-python
117 $(call Package/boost/Default)
119 DEPENDS+= +PACKAGE_boost-python:python
122 define Package/boost-random
123 $(call Package/boost/Default)
127 define Package/boost-regex
128 $(call Package/boost/Default)
132 define Package/boost-serialization
133 $(call Package/boost/Default)
134 TITLE+= (serialization)
137 define Package/boost-signals
138 $(call Package/boost/Default)
142 define Package/boost-system
143 $(call Package/boost/Default)
147 define Package/boost-test
148 $(call Package/boost/Default)
152 define Package/boost-thread
153 $(call Package/boost/Default)
157 define Package/boost-timer
158 $(call Package/boost/Default)
160 DEPENDS+= boost-chrono
163 define Package/boost-wave
164 $(call Package/boost/Default)
166 DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
170 $(call Package/boost/Default)
171 TITLE+= (header-only)
175 define Build/Configure
179 # bjam does not provide a configure-script nor a Makefile
180 ( cd $(HOST_BUILD_DIR)/tools/build/v2/engine ; ./build.sh gcc )
183 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
184 TARGET_LDFLAGS += -pthread -lrt
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; \
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 \
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) \
221 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
222 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
227 define Build/InstallDev
229 $(1)/usr/include/boost/
232 $(PKG_INSTALL_DIR)/include/boost/* \
233 $(1)/usr/include/boost/ \
234 # copies _all_ header files - independent of <--with-library>-argument above
236 if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
240 $(PKG_INSTALL_DIR)/lib/*.a \
243 $(PKG_INSTALL_DIR)/lib/*.so* \
250 $(STAGING_DIR_HOST)/bin
253 $(HOST_BUILD_DIR)/tools/build/v2/engine/bin.*/bjam \
254 $(STAGING_DIR_HOST)/bin/
257 define Package/boost/Default/install
262 $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
266 define Package/boost-chrono/install
267 $(call Package/boost/Default/install,$(1),chrono)
270 define Package/boost-date_time/install
271 $(call Package/boost/Default/install,$(1),date_time)
274 define Package/boost-exception/install
275 $(call Package/boost/Default/install,$(1),exception)
278 define Package/boost-filesystem/install
279 $(call Package/boost/Default/install,$(1),filesystem)
282 define Package/boost-graph/install
283 $(call Package/boost/Default/install,$(1),graph)
286 define Package/boost-graph_parallel/install
287 $(call Package/boost/Default/install,$(1),graph_parallel)
290 define Package/boost-iostreams/install
291 $(call Package/boost/Default/install,$(1),iostreams)
294 define Package/boost-math/install
295 $(call Package/boost/Default/install,$(1),math)
298 define Package/boost-mpi/install
299 $(call Package/boost/Default/install,$(1),mpi)
302 define Package/boost-program_options/install
303 $(call Package/boost/Default/install,$(1),program_options)
306 define Package/boost-python/install
307 $(call Package/boost/Default/install,$(1),python)
310 define Package/boost-random/install
311 $(call Package/boost/Default/install,$(1),random)
314 define Package/boost-regex/install
315 $(call Package/boost/Default/install,$(1),regex)
318 define Package/boost-serialization/install
319 $(call Package/boost/Default/install,$(1),serialization)
322 define Package/boost-signals/install
323 $(call Package/boost/Default/install,$(1),signals)
326 define Package/boost-system/install
327 $(call Package/boost/Default/install,$(1),system)
330 define Package/boost-test/install
335 $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
339 $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
343 define Package/boost-thread/install
344 $(call Package/boost/Default/install,$(1),thread)
347 define Package/boost-timer/install
348 $(call Package/boost/Default/install,$(1),timer)
351 define Package/boost-wave/install
352 $(call Package/boost/Default/install,$(1),wave)
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))