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:=6a1f32d902203ac70fbec78af95b3cf8
22 PKG_BUILD_DEPENDS:=boost/host
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 \
42 include $(INCLUDE_DIR)/package.mk
43 include $(INCLUDE_DIR)/host-build.mk
45 define Package/boost/Default
48 TITLE:=Boost C++ source libraries
49 URL:=http://www.boost.org
50 DEPENDS:=+libstdcpp +libpthread +librt
51 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
54 define Package/boost/Default/description
55 Boost provides free peer-reviewed portable C++ source libraries
58 define Package/boost-chrono
59 $(call Package/boost/Default)
61 DEPENDS+= +boost-system
64 define Package/boost-date_time
65 $(call Package/boost/Default)
69 define Package/boost-exception
70 $(call Package/boost/Default)
74 define Package/boost-filesystem
75 $(call Package/boost/Default)
77 DEPENDS+= +boost-system
80 define Package/boost-graph
81 $(call Package/boost/Default)
83 DEPENDS+= +boost-regex
86 define Package/boost-graph_parallel
87 $(call Package/boost/Default)
88 TITLE+= (graph_parallel)
91 define Package/boost-iostreams
92 $(call Package/boost/Default)
97 define Package/boost-locale
98 $(call Package/boost/Default)
102 define Package/boost-math
103 $(call Package/boost/Default)
107 define Package/boost-mpi
108 $(call Package/boost/Default)
112 define Package/boost-program_options
113 $(call Package/boost/Default)
114 TITLE+= (program_options)
117 define Package/boost-python
118 $(call Package/boost/Default)
120 DEPENDS+= +PACKAGE_boost-python:python
123 define Package/boost-random
124 $(call Package/boost/Default)
128 define Package/boost-regex
129 $(call Package/boost/Default)
133 define Package/boost-serialization
134 $(call Package/boost/Default)
135 TITLE+= (serialization)
138 define Package/boost-signals
139 $(call Package/boost/Default)
143 define Package/boost-system
144 $(call Package/boost/Default)
148 define Package/boost-test
149 $(call Package/boost/Default)
153 define Package/boost-thread
154 $(call Package/boost/Default)
156 DEPENDS+= +boost-system +boost-chrono
159 define Package/boost-timer
160 $(call Package/boost/Default)
162 DEPENDS+= boost-chrono
165 define Package/boost-wave
166 $(call Package/boost/Default)
168 DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
172 $(call Package/boost/Default)
173 TITLE+= (header-only)
177 define Build/Configure
181 # bjam does not provide a configure-script nor a Makefile
182 ( cd $(HOST_BUILD_DIR)/tools/build/v2/engine ; ./build.sh gcc )
185 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
186 TARGET_LDFLAGS += -pthread -lrt
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; \
196 '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
197 --toolset=gcc-$(ARCH) --build-type=minimal --layout=system \
198 --disable-long-double \
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) \
222 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
223 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
228 define Build/InstallDev
230 $(1)/usr/include/boost/
233 $(PKG_INSTALL_DIR)/include/boost/* \
234 $(1)/usr/include/boost/ \
235 # copies _all_ header files - independent of <--with-library>-argument above
237 if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
241 $(PKG_INSTALL_DIR)/lib/*.a \
244 $(PKG_INSTALL_DIR)/lib/*.so* \
251 $(STAGING_DIR_HOST)/bin
254 $(HOST_BUILD_DIR)/tools/build/v2/engine/bin.*/bjam \
255 $(STAGING_DIR_HOST)/bin/
258 define Package/boost/Default/install
263 $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
267 define Package/boost-chrono/install
268 $(call Package/boost/Default/install,$(1),chrono)
271 define Package/boost-date_time/install
272 $(call Package/boost/Default/install,$(1),date_time)
275 define Package/boost-exception/install
276 $(call Package/boost/Default/install,$(1),exception)
279 define Package/boost-filesystem/install
280 $(call Package/boost/Default/install,$(1),filesystem)
283 define Package/boost-graph/install
284 $(call Package/boost/Default/install,$(1),graph)
287 define Package/boost-graph_parallel/install
288 $(call Package/boost/Default/install,$(1),graph_parallel)
291 define Package/boost-iostreams/install
292 $(call Package/boost/Default/install,$(1),iostreams)
295 define Package/boost-math/install
296 $(call Package/boost/Default/install,$(1),math)
299 define Package/boost-mpi/install
300 $(call Package/boost/Default/install,$(1),mpi)
303 define Package/boost-program_options/install
304 $(call Package/boost/Default/install,$(1),program_options)
307 define Package/boost-python/install
308 $(call Package/boost/Default/install,$(1),python)
311 define Package/boost-random/install
312 $(call Package/boost/Default/install,$(1),random)
315 define Package/boost-regex/install
316 $(call Package/boost/Default/install,$(1),regex)
319 define Package/boost-serialization/install
320 $(call Package/boost/Default/install,$(1),serialization)
323 define Package/boost-signals/install
324 $(call Package/boost/Default/install,$(1),signals)
327 define Package/boost-system/install
328 $(call Package/boost/Default/install,$(1),system)
331 define Package/boost-test/install
336 $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
340 $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
344 define Package/boost-thread/install
345 $(call Package/boost/Default/install,$(1),thread)
348 define Package/boost-timer/install
349 $(call Package/boost/Default/install,$(1),timer)
352 define Package/boost-wave/install
353 $(call Package/boost/Default/install,$(1),wave)
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))