2 # Copyright (C) 2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 # Original Boost 1.51 Makefile by Mirko Vogt <mirko@openwrt.org>
10 # Dude, this "boost" is really one of the most crude stuff I ported yet.
14 include $(TOPDIR
)/rules.mk
15 include $(INCLUDE_DIR
)/nls.mk
16 include $(INCLUDE_DIR
)/target.mk
22 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_VERSION
).
tar.gz
23 PKG_SOURCE_URL
:=@SF
/boost
24 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)_
$(PKG_VERSION
)
25 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)_
$(PKG_VERSION
)
26 PKG_MD5SUM
:=28f58b9a33469388302110562bdf6188
27 PKG_LICENSE
:=Boost Software License
<http
://www.boost.org
/users
/license.html
>
28 PKG_MAINTAINER
:=Carlos M. Ferreira
<carlosmf.pt@gmail.com
>
30 PKG_BUILD_DEPENDS
+= boost
/host
34 include $(INCLUDE_DIR
)/package.mk
35 include $(INCLUDE_DIR
)/host-build.mk
38 define Package
/boost
/Default
41 TITLE
:=Boost C
++ source library
42 URL
:=http
://www.boost.org
43 DEPENDS
:=+libstdcpp
+libpthread
+librt
46 define Package
/boost
/description
/Default
50 define Package
/boost
/description
51 This package provides the Boost v1.59 libraries.
52 Boost is a set of free
, peer-reviewed
, portable C
++ source libraries.
53 This package provides the following libraries
:
59 - - coroutine2
(requires GCC v5 and up
)
84 define Package
/boost-libs
85 $(call Package
/boost
/Default
)
87 DEPENDS
+= $(BOOST_DEPENDS
)
91 define Package
/boost-libs
/description
92 $(call Package
/boost
/description
/Default
)
94 This meta package contains only dependencies to the other libraries from
95 the boost libraries collection.
98 # Create a meta-package of dependent libraries (for ALL)
99 define Package
/boost-libs
/install
103 define Package
/boost
/install
109 $(call Package
/boost
/Default
)
111 DEPENDS
:=+ALL
:boost-libs
+ALL
:boost-test
114 define Package
/boost
/config
115 menu
"Select Boost Options"
116 depends on PACKAGE_boost
117 comment
"Boost compilation options."
120 prompt
"Compile Boost libraries."
121 default boost-static-and-shared-libs
123 Choose which version to compile.
125 - Only Shared libs will be compiled.
127 - Only Static libs will be compiled.
129 - Both Static and Shared libs will be compiled.
131 config boost-shared-libs
134 config boost-static-libs
137 config boost-static-and-shared-libs
142 prompt
"Selects Boost Runtime linkage."
143 default boost-runtime-shared
145 Choose which C and C
++ runtimes to use
:
146 -> Use Shared runtimes.
147 -> Use Static runtimes.
148 - Not available if Shared libs are to be built.
149 -> Use both runtimes.
150 - Not available if Shared libs are to be built.
151 - Two separate versions of Boost are built
, linking each to a different runtime.
152 - This option requires
"Use tagged names" option to be active.
154 config boost-runtime-shared
157 config boost-runtime-static
158 depends on @
(!boost-shared-libs
&&!boost-static-and-shared-libs
)
161 config boost-runtime-static-and-shared
162 depends on @
(boost-use-name-tags
&&!boost-shared-libs
&&!boost-static-and-shared-libs
)
167 prompt
"Select a Variant."
168 default boost-variant-release
170 Chooses which boost variant should be selected
:
171 -> Release
: Optimizes Boost for release.
172 - Optimization
: Speed
; Debug Symbols
: Off
; Inlining
: Full
; Runtime Debugging
: Off.
174 - Optimization
: Off
; Debug Symbols
: On
; Inlining
: Off
; Runtime Debugging
: On.
176 - Profiling
: On
; Debug Symbols
: On.
178 config boost-variant-release
181 config boost-variant-debug
184 config boost-variant-profile
188 config boost-use-name-tags
189 bool
"Use tagged names."
191 Add name
tags the lib files
, to diferentiate each library version
:
192 "-mt" for multi-threading.
194 "-s" for runtime static link
".
195 Might break compatibility with libraries that expect boost libs with default names.
198 config boost-single-thread
199 depends on @boost-use-name-tags
200 bool "Single thread Support.
"
202 Compile Boost libraries in single-thread mode.
205 config boost-build-type-complete
206 depends on @boost-use-name-tags
207 bool "Complete Boost Build.
"
209 Builds both release and debug libs. It will take much longer to compile.
213 menu "Select Boost libraries
"
214 depends on PACKAGE_boost
217 config boost-libs-all
218 bool "Include
all Boost libraries.
"
219 select PACKAGE_boost-libs
221 config boost-test-pkg
222 bool "Boost
test package.
"
223 select PACKAGE_boost-test
225 config boost-coroutine2
226 depends on @GCC_VERSION_5
227 bool "Boost couroutine2 support.
"
228 select PACKAGE_boost-coroutine
231 config boost-graph-parallel
232 bool "Boost parallel graph support.
"
233 select PACKAGE_boost-graph
236 $(foreach lib,$(BOOST_LIBS), \
237 config PACKAGE_boost-$(lib)
238 prompt "Boost
$(lib
) library.
"
244 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
246 define Package/boost-test
247 $(call Package/boost/Default)
250 DEPENDS+=+boost-system +boost-timer
253 define Build/Configure
257 # 2: dependencies on other boost libraries (short name)
258 # 3: dependencies on other packages
259 define DefineBoostLibrary
261 BOOST_DEPENDS+= +boost-$(1)
264 PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1)
266 define Package/boost-$(1)
267 $(call Package/boost/Default)
269 DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3)
273 define Package/boost-$(1)/description
274 $(call Package/boost/description/Default)
276 This package contains the Boost $(1) library.
281 $(eval $(call DefineBoostLibrary,atomic,system,))
282 $(eval $(call DefineBoostLibrary,chrono,system,))
283 $(eval $(call DefineBoostLibrary,container,,))
284 $(eval $(call DefineBoostLibrary,context,chrono system thread,))
285 $(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
286 $(eval $(call DefineBoostLibrary,date_time,,))
287 #$(eval $(call DefineBoostLibrary,exception,,))
288 $(eval $(call DefineBoostLibrary,filesystem,system,))
289 $(eval $(call DefineBoostLibrary,graph,regex,))
290 $(eval $(call DefineBoostLibrary,iostreams,,+PACKAGE_boost-iostreams:zlib))
291 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) @BUILD_NLS))
292 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
293 $(eval $(call DefineBoostLibrary,math,,))
294 #$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
295 $(eval $(call DefineBoostLibrary,program_options,,))
296 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
297 $(eval $(call DefineBoostLibrary,python3,,+PACKAGE_boost-python3:python3))
298 $(eval $(call DefineBoostLibrary,random,system,))
299 $(eval $(call DefineBoostLibrary,regex,,))
300 $(eval $(call DefineBoostLibrary,serialization,,))
301 $(eval $(call DefineBoostLibrary,signals,,))
302 $(eval $(call DefineBoostLibrary,system,,))
303 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
304 $(eval $(call DefineBoostLibrary,timer,chrono))
305 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
309 # b2 does not provide a configure-script nor a Makefile
310 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
313 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
314 TARGET_LDFLAGS += -pthread -lrt
317 $(if $(CONFIG_PACKAGE_boost-python), -I$(STAGING_DIR)/usr/include/python2.7/) \
318 $(if $(CONFIG_PACKAGE_boost-python3), -I$(STAGING_DIR)/usr/include/python3.5/) \
319 $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
321 ifneq ($(findstring mips,$(ARCH)),)
323 ifneq ($(findstring 64,$(ARCH)),)
326 else ifneq ($(findstring arm,$(ARCH)),)
328 else ifeq ($(ARCH),aarch64)
337 $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
338 ( cd $(PKG_BUILD_DIR) ; \
339 echo "using gcc
: $(ARCH
) : $(GNU_TARGET_NAME
)-gcc
: <compileflags
>\"$(TARGET_CFLAGS
)\" <cxxflags>\"$(TARGET_CXXFLAGS
) $(if
$(CONFIG_boost-coroutine2
),-std
=c
++14,)\" <linkflags
>\"$(TARGET_LDFLAGS
)\" ;" > tools/build/src/user-config.jam ; \
340 $(if $(CONFIG_PACKAGE_boost-python3), \
341 echo "using python
: 3.5 : $(STAGING_DIR_ROOT
)/usr
/bin
/python3
: $(STAGING_DIR
)/usr
/include/python3.5
/ ;" >> \
342 tools/build/src/user-config.jam; \
344 $(if $(CONFIG_PACKAGE_boost-python), \
345 echo "using python
: 2.7 : $(STAGING_DIR_ROOT
)/usr
/bin
/python
: $(STAGING_DIR
)/usr
/include/python2.7
/ ;" >> \
346 tools/build/src/user-config.jam; \
350 --ignore-site-config \
351 --toolset=gcc-$(ARCH) abi=$(BOOST_ABI) \
352 --disable-long-double \
353 $(if $(CONFIG_boost-variant-release), variant=release,) \
354 $(if $(CONFIG_boost-variant-debug), variant=debug,) \
355 $(if $(CONFIG_boost-variant-profile), variant=profile,) \
356 $(if $(CONFIG_boost-use-name-tags),--layout=tagged,--layout=system) \
357 $(if $(CONFIG_boost-build-type-complete),--build-type=complete,--build-type=minimal) \
358 $(if $(CONFIG_boost-shared-libs),link=shared,) \
359 $(if $(CONFIG_boost-static-libs),link=static,) \
360 $(if $(CONFIG_boost-static-and-shared-libs),link=static$(comma)shared,) \
361 $(if $(CONFIG_boost-runtime-shared),runtime-link=shared,) \
362 $(if $(CONFIG_boost-runtime-static),runtime-link=static,) \
363 $(if $(CONFIG_boost-runtime-static-and-shared),runtime-link=shared$(comma)static,) \
364 $(if $(CONFIG_boost-single-thread),threading=single,) \
367 $(if $(CONFIG_boost-coroutine2),,--without-coroutine2) \
368 $(if $(CONFIG_boost-graph-parallel),,--without-graph_parallel) \
369 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
370 $(foreach lib,$(BOOST_LIBS), \
371 $(if $(findstring python,$(lib)), \
372 $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
373 $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
375 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
376 boost.locale.iconv=off) \
378 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
379 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
384 define Build/InstallDev
386 $(1)/usr/include/boost/
389 $(PKG_INSTALL_DIR)/include/boost/* \
390 $(1)/usr/include/boost/ \
391 # copies _all_ header files - independent of <--with-library>-argument above
393 $(INSTALL_DIR) $(1)/usr/lib
394 $(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files
395 $(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
400 $(STAGING_DIR)/host/bin
403 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 \
404 $(STAGING_DIR)/host/bin/
407 define Package/boost/Default/install
412 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
415 define Package/boost-test/install
420 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
423 $(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
426 define BuildBoostLibrary
427 define Package/boost-$(1)/install
428 $(call Package/boost/Default/install,$$(1),$(1))
431 $$(eval $$(call BuildPackage,boost-$(1)))
434 $(eval $(call HostBuild))
436 $(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib))))
437 $(eval $(call BuildPackage,boost-test))
438 $(eval $(call BuildPackage,boost-libs))
439 $(eval $(call BuildPackage,boost))