package/aubio: add libsndfile optional dependency
[buildroot-gz.git] / package / boost / boost.mk
blobbb8d799c48c2433c6f3aa871a3f50e51a7d35a1d
1 ################################################################################
3 # boost
5 ################################################################################
7 BOOST_VERSION = 1.61.0
8 BOOST_SOURCE = boost_$(subst .,_,$(BOOST_VERSION)).tar.bz2
9 BOOST_SITE = http://downloads.sourceforge.net/project/boost/boost/$(BOOST_VERSION)
10 BOOST_INSTALL_STAGING = YES
11 BOOST_LICENSE = Boost Software License 1.0
12 BOOST_LICENSE_FILES = LICENSE_1_0.txt
14 # keep host variant as minimal as possible
15 HOST_BOOST_FLAGS = --without-icu \
16 --without-libraries=$(subst $(space),$(comma),atomic chrono context \
17 coroutine coroutine2 date_time exception filesystem graph \
18 graph_parallel iostreams locale log math mpi program_options python \
19 random regex serialization signals system test thread timer type_erasure \
20 wave)
22 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_ATOMIC),,atomic)
23 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
24 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTAINER),,container)
25 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
26 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE),,coroutine)
27 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_COROUTINE2),,coroutine2)
28 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_DATE_TIME),,date_time)
29 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_EXCEPTION),,exception)
30 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_FILESYSTEM),,filesystem)
31 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_GRAPH),,graph)
32 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_GRAPH_PARALLEL),,graph_parallel)
33 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_IOSTREAMS),,iostreams)
34 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOCALE),,locale)
35 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOG),,log)
36 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MATH),,math)
37 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_METAPARSE),,metaparse)
38 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MPI),,mpi)
39 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PROGRAM_OPTIONS),,program_options)
40 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PYTHON),,python)
41 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_RANDOM),,random)
42 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_REGEX),,regex)
43 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SERIALIZATION),,serialization)
44 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SIGNALS),,signals)
45 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SYSTEM),,system)
46 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TEST),,test)
47 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_THREAD),,thread)
48 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TIMER),,timer)
49 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TYPE_ERASURE),,type_erasure)
50 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_WAVE),,wave)
52 BOOST_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
54 ifeq ($(BR2_PACKAGE_ICU),y)
55 BOOST_FLAGS += --with-icu=$(STAGING_DIR)/usr
56 BOOST_DEPENDENCIES += icu
57 else
58 BOOST_FLAGS += --without-icu
59 endif
61 ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
62 BOOST_DEPENDENCIES += bzip2 zlib
63 endif
65 ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
66 BOOST_FLAGS += --with-python-root=$(HOST_DIR)
67 ifeq ($(BR2_PACKAGE_PYTHON3),y)
68 BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)
69 BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m
70 BOOST_DEPENDENCIES += python3
71 else
72 BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON_VERSION_MAJOR)
73 BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)
74 BOOST_DEPENDENCIES += python
75 endif
76 endif
78 HOST_BOOST_OPTS += toolset=gcc threading=multi variant=release link=shared \
79 runtime-link=shared
81 ifeq ($(BR2_MIPS_OABI32),y)
82 BOOST_ABI = o32
83 else ifeq ($(BR2_arm),y)
84 BOOST_ABI = aapcs
85 else
86 BOOST_ABI = sysv
87 endif
89 BOOST_OPTS += toolset=gcc \
90 threading=multi \
91 abi=$(BOOST_ABI) \
92 variant=$(if $(BR2_ENABLE_DEBUG),debug,release)
94 ifeq ($(BR2_sparc64),y)
95 BOOST_OPTS += architecture=sparc instruction-set=ultrasparc
96 endif
98 ifeq ($(BR2_sparc),y)
99 BOOST_OPTS += architecture=sparc instruction-set=v8
100 endif
102 # By default, Boost build and installs both the shared and static
103 # variants. Override that if we want static only or shared only.
104 ifeq ($(BR2_STATIC_LIBS),y)
105 BOOST_OPTS += link=static runtime-link=static
106 else ifeq ($(BR2_SHARED_LIBS),y)
107 BOOST_OPTS += link=shared runtime-link=shared
108 endif
110 ifeq ($(BR2_PACKAGE_BOOST_LOCALE),y)
111 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
112 # posix backend needs monetary.h which isn't available on uClibc
113 BOOST_OPTS += boost.locale.posix=off
114 endif
116 BOOST_DEPENDENCIES += $(if $(BR2_ENABLE_LOCALE),,libiconv)
117 endif
119 BOOST_WITHOUT_FLAGS_COMMASEPARATED += $(subst $(space),$(comma),$(strip $(BOOST_WITHOUT_FLAGS)))
120 BOOST_FLAGS += $(if $(BOOST_WITHOUT_FLAGS_COMMASEPARATED), --without-libraries=$(BOOST_WITHOUT_FLAGS_COMMASEPARATED))
121 BOOST_LAYOUT = $(call qstrip, $(BR2_PACKAGE_BOOST_LAYOUT))
123 # how verbose should the build be?
124 BOOST_OPTS += $(if $(QUIET),-d,-d+1)
125 HOST_BOOST_OPTS += $(if $(QUIET),-d,-d+1)
127 define BOOST_CONFIGURE_CMDS
128 (cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
129 echo "using gcc : `$(TARGET_CC) -dumpversion` : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
130 echo "" >> $(@D)/user-config.jam
131 endef
133 define BOOST_BUILD_CMDS
134 (cd $(@D) && $(TARGET_MAKE_ENV) ./bjam -j$(PARALLEL_JOBS) -q \
135 --user-config=$(@D)/user-config.jam \
136 $(BOOST_OPTS) \
137 --ignore-site-config \
138 --layout=$(BOOST_LAYOUT))
139 endef
141 define BOOST_INSTALL_TARGET_CMDS
142 (cd $(@D) && $(TARGET_MAKE_ENV) ./b2 -j$(PARALLEL_JOBS) -q \
143 --user-config=$(@D)/user-config.jam \
144 $(BOOST_OPTS) \
145 --prefix=$(TARGET_DIR)/usr \
146 --ignore-site-config \
147 --layout=$(BOOST_LAYOUT) install )
148 endef
150 define BOOST_INSTALL_STAGING_CMDS
151 (cd $(@D) && $(TARGET_MAKE_ENV) ./bjam -j$(PARALLEL_JOBS) -q \
152 --user-config=$(@D)/user-config.jam \
153 $(BOOST_OPTS) \
154 --prefix=$(STAGING_DIR)/usr \
155 --ignore-site-config \
156 --layout=$(BOOST_LAYOUT) install)
157 endef
159 define HOST_BOOST_CONFIGURE_CMDS
160 (cd $(@D) && ./bootstrap.sh $(HOST_BOOST_FLAGS))
161 echo "using gcc : `$(HOST_CC) -dumpversion` : $(HOSTCXX) : <cxxflags>\"$(HOST_CXXFLAGS)\" <linkflags>\"$(HOST_LDFLAGS)\" ;" > $(@D)/user-config.jam
162 echo "" >> $(@D)/user-config.jam
163 endef
165 define HOST_BOOST_BUILD_CMDS
166 (cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q \
167 --user-config=$(@D)/user-config.jam \
168 $(HOST_BOOST_OPTS) \
169 --ignore-site-config \
170 --prefix=$(HOST_DIR)/usr )
171 endef
173 define HOST_BOOST_INSTALL_CMDS
174 (cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q \
175 --user-config=$(@D)/user-config.jam \
176 $(HOST_BOOST_OPTS) \
177 --prefix=$(HOST_DIR)/usr \
178 --ignore-site-config \
179 --layout=$(BOOST_LAYOUT) install )
180 endef
182 $(eval $(generic-package))
183 $(eval $(host-generic-package))