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:=313a11e97eb56eb7efd18325354631be
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
52 define Package/boost/Default/description
53 Boost provides free peer-reviewed portable C++ source libraries
56 define Package/boost-date_time
57 $(call Package/boost/Default)
61 define Package/boost-filesystem
62 $(call Package/boost/Default)
66 define Package/boost-graph
67 $(call Package/boost/Default)
71 define Package/boost-iostreams
72 $(call Package/boost/Default)
77 define Package/boost-math
78 $(call Package/boost/Default)
82 #define Package/boost-mpi
83 # $(call Package/boost/Default)
87 define Package/boost-program_options
88 $(call Package/boost/Default)
89 TITLE+= (program_options)
92 define Package/boost-python
93 $(call Package/boost/Default)
98 define Package/boost-regex
99 $(call Package/boost/Default)
103 define Package/boost-serialization
104 $(call Package/boost/Default)
105 TITLE+= (serialization)
108 define Package/boost-signals
109 $(call Package/boost/Default)
113 define Package/boost-system
114 $(call Package/boost/Default)
118 define Package/boost-test
119 $(call Package/boost/Default)
123 define Package/boost-thread
124 $(call Package/boost/Default)
128 define Package/boost-wave
129 $(call Package/boost/Default)
134 $(call Package/boost/Default)
135 TITLE+= (header-only)
139 define Build/Configure
143 # bjam does not provide a configure-script nor a Makefile
144 ( cd $(HOST_BUILD_DIR)/tools/build/v2/engine ; ./build.sh gcc )
147 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
148 TARGET_LDFLAGS += -pthread -lrt
151 ( cd $(PKG_BUILD_DIR) ; \
152 echo "using gcc : : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(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; \
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 \
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) \
179 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
180 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
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
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/; \
197 $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
198 $(CP) $(HOST_BUILD_DIR)/tools/build/v2/engine/bin.*/bjam $(STAGING_DIR_HOST)/bin/
201 define Package/boost/Default/install
202 $(INSTALL_DIR) $(1)/usr/lib
203 $(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
206 define Package/boost-date_time/install
207 $(call Package/boost/Default/install,$(1),date_time)
210 define Package/boost-filesystem/install
211 $(call Package/boost/Default/install,$(1),filesystem)
214 define Package/boost-graph/install
215 $(call Package/boost/Default/install,$(1),graph)
218 define Package/boost-iostreams/install
219 $(call Package/boost/Default/install,$(1),iostreams)
222 define Package/boost-math/install
223 $(call Package/boost/Default/install,$(1),math)
226 #define Package/boost-mpi/install
227 # $(call Package/boost/Default/install,$(1),mpi)
230 define Package/boost-program_options/install
231 $(call Package/boost/Default/install,$(1),program_options)
234 define Package/boost-python/install
235 $(call Package/boost/Default/install,$(1),python)
238 define Package/boost-regex/install
239 $(call Package/boost/Default/install,$(1),regex)
242 define Package/boost-serialization/install
243 $(call Package/boost/Default/install,$(1),serialization)
246 define Package/boost-signals/install
247 $(call Package/boost/Default/install,$(1),signals)
250 define Package/boost-system/install
251 $(call Package/boost/Default/install,$(1),system)
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/
260 define Package/boost-thread/install
261 $(call Package/boost/Default/install,$(1),thread)
264 define Package/boost-wave/install
265 $(call Package/boost/Default/install,$(1),wave)
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))