Merge pull request #878 from jow-/lxc-autoconf-fix
[feed/packages.git] / libs / boost / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 #
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.
11 #
12
13
14 include $(TOPDIR)/rules.mk
15 include $(INCLUDE_DIR)/nls.mk
16 include $(INCLUDE_DIR)/target.mk
17
18 PKG_NAME:=boost
19 PKG_VERSION:=1_57_0
20 PKG_RELEASE:=2
21
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:=25f9a8ac28beeb5ab84aa98510305299
27 PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
28 PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com> (Modified from Mirko Vogt <mirko@openwrt.org> Boost 1.51 Original Makefile and patches)
29
30
31 PKG_BUILD_DEPENDS += boost/host
32 PKG_BUILD_PARALLEL:=0
33 PKG_USE_MIPS16:=0
34
35 PKG_CONFIG_DEPENDS := \
36 CONFIG_PACKAGE_boost-date_time \
37 CONFIG_PACKAGE_boost-filesystem \
38 CONFIG_PACKAGE_boost-graph \
39 CONFIG_PACKAGE_boost-iostreams \
40 CONFIG_PACKAGE_boost-math \
41 CONFIG_PACKAGE_boost-program_options \
42 CONFIG_PACKAGE_boost-python \
43 CONFIG_PACKAGE_boost-regex \
44 CONFIG_PACKAGE_boost-serialization \
45 CONFIG_PACKAGE_boost-signals \
46 CONFIG_PACKAGE_boost-system \
47 CONFIG_PACKAGE_boost-test \
48 CONFIG_PACKAGE_boost-thread \
49 CONFIG_PACKAGE_boost-wave \
50 CONFIG_PACKAGE_boost-atomic \
51 CONFIG_PACKAGE_boost-context \
52 CONFIG_PACKAGE_boost-container \
53 CONFIG_PACKAGE_boost-coroutine \
54 CONFIG_PACKAGE_boost-log \
55
56
57
58 include $(INCLUDE_DIR)/package.mk
59 include $(INCLUDE_DIR)/host-build.mk
60
61 define Package/boost/Default
62 SECTION:=libs
63 CATEGORY:=Libraries
64 TITLE:=Boost C++ source libraries
65 URL:=http://www.boost.org
66 DEPENDS:=+libstdcpp +libpthread +librt
67 endef
68
69 define Package/boost/Default/description
70 Boost provides free peer-reviewed portable C++ source libraries
71 endef
72
73 define Package/boost-atomic
74 $(call Package/boost/Default)
75 TITLE+= (atomic)
76 DEPENDS+= +boost-system
77 endef
78
79 define Package/boost-chrono
80 $(call Package/boost/Default)
81 TITLE+= (chrono)
82 DEPENDS+= +boost-system
83 endef
84
85 define Package/boost-date_time
86 $(call Package/boost/Default)
87 TITLE+= (date_time)
88 endef
89
90 define Package/boost-exception
91 $(call Package/boost/Default)
92 TITLE+= (exception)
93 endef
94
95 define Package/boost-filesystem
96 $(call Package/boost/Default)
97 TITLE+= (filesystem)
98 DEPENDS+= +boost-system
99 endef
100
101 define Package/boost-graph
102 $(call Package/boost/Default)
103 TITLE+= (graph)
104 DEPENDS+= +boost-regex
105 endef
106
107 define Package/boost-graph_parallel
108 $(call Package/boost/Default)
109 TITLE+= (graph_parallel)
110 endef
111
112 define Package/boost-iostreams
113 $(call Package/boost/Default)
114 TITLE+= (iostreams)
115 DEPENDS+= +zlib
116 endef
117
118 define Package/boost-locale
119 $(call Package/boost/Default)
120 TITLE+= (locale)
121 DEPENDS+= $(ICONV_DEPENDS)
122 endef
123
124 define Package/boost-math
125 $(call Package/boost/Default)
126 TITLE+= (math)
127 endef
128
129 define Package/boost-mpi
130 $(call Package/boost/Default)
131 TITLE+= (mpi)
132 endef
133
134 define Package/boost-program_options
135 $(call Package/boost/Default)
136 TITLE+= (program_options)
137 endef
138
139 define Package/boost-python
140 $(call Package/boost/Default)
141 TITLE+= (python)
142 DEPENDS+= +PACKAGE_boost-python:python
143 endef
144
145 define Package/boost-random
146 $(call Package/boost/Default)
147 TITLE+= (random)
148 DEPENDS+= +boost-system
149 endef
150
151 define Package/boost-regex
152 $(call Package/boost/Default)
153 TITLE+= (regex)
154 endef
155
156 define Package/boost-serialization
157 $(call Package/boost/Default)
158 TITLE+= (serialization)
159 endef
160
161 define Package/boost-signals
162 $(call Package/boost/Default)
163 TITLE+= (signals)
164 endef
165
166 define Package/boost-system
167 $(call Package/boost/Default)
168 TITLE+= (system)
169 endef
170
171 define Package/boost-test
172 $(call Package/boost/Default)
173 TITLE+= (test)
174 endef
175
176 define Package/boost-thread
177 $(call Package/boost/Default)
178 TITLE+= (thread)
179 DEPENDS+= +boost-system +boost-chrono +boost-atomic
180 endef
181
182 define Package/boost-timer
183 $(call Package/boost/Default)
184 TITLE+= (timer)
185 DEPENDS+= boost-chrono
186 endef
187
188 define Package/boost-wave
189 $(call Package/boost/Default)
190 TITLE+= (wave)
191 DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
192 endef
193
194 define Package/boost-context
195 $(call Package/boost/Default)
196 TITLE+= (context)
197 endef
198
199 define Package/boost-container
200 $(call Package/boost/Default)
201 TITLE+= (container)
202 endef
203
204 define Package/boost-coroutine
205 $(call Package/boost/Default)
206 TITLE+= (coroutine)
207 DEPENDS+= +boost-system +boost-chrono +boost-context +boost-thread
208 endef
209
210 define Package/boost-log
211 $(call Package/boost/Default)
212 TITLE+= (log)
213 DEPENDS+= +boost-system +boost-chrono +boost-date_time +boost-thread +boost-filesystem +boost-regex
214 endef
215
216 define Package/boost
217 $(call Package/boost/Default)
218 TITLE+= (header-only)
219 BUILDONLY:=1
220 endef
221
222 define Build/Configure
223 endef
224
225 define Host/Compile
226 # bjam does not provide a configure-script nor a Makefile
227 ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
228 endef
229
230 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
231 TARGET_LDFLAGS += -pthread -lrt
232
233
234
235
236 ifneq ($(findstring mips,$(ARCH)),)
237 ifeq ($(ARCH),mips64)
238 BOOST_ABI = 64
239 else ifeq ($(ARCH),octeon)
240 BOOST_ABI = 64
241 else
242 BOOST_ABI = o32
243 endif
244 else ifeq ($(ARCH),arm)
245 BOOST_ABI = aapcs
246 else
247 BOOST_ABI = sysv
248 endif
249
250
251
252 define Build/Compile
253 echo "Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE)";
254 ( cd $(PKG_BUILD_DIR) ; \
255 echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
256 $(if $(CONFIG_PACKAGE_boost-python), \
257 echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \
258 tools/build/src/user-config.jam; \
259 ) \
260 bjam \
261 '-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
262 --toolset=gcc-$(ARCH) --build-type=minimal --layout=system abi=$(BOOST_ABI) \
263 --disable-long-double \
264 $(CONFIGURE_ARGS) \
265 $(if $(CONFIG_PACKAGE_boost-atomic),,--without-atomic) \
266 $(if $(CONFIG_PACKAGE_boost-chrono),,--without-chrono) \
267 $(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
268 $(if $(CONFIG_PACKAGE_boost-exception),,--without-exception) \
269 $(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
270 $(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
271 $(if $(CONFIG_PACKAGE_boost-graph_parallel),,--without-graph_parallel) \
272 $(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
273 $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_UCLIBC),on,off), \
274 --without-locale boost.locale.iconv=off) \
275 $(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
276 $(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
277 $(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
278 $(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
279 $(if $(CONFIG_PACKAGE_boost-random),,--without-random) \
280 $(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
281 $(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
282 $(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
283 $(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
284 $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
285 $(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
286 $(if $(CONFIG_PACKAGE_boost-timer),,--without-timer) \
287 $(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
288 $(if $(CONFIG_PACKAGE_boost-context),,--without-context) \
289 $(if $(CONFIG_PACKAGE_boost-container),,--without-container) \
290 $(if $(CONFIG_PACKAGE_boost-coroutine),,--without-coroutine) \
291 $(if $(CONFIG_PACKAGE_boost-log),,--without-log) \
292 \
293 $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
294 -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
295 install \
296 )
297 endef
298
299 define Build/InstallDev
300 $(INSTALL_DIR) \
301 $(1)/usr/include/boost/
302
303 $(CP) \
304 $(PKG_INSTALL_DIR)/include/boost/* \
305 $(1)/usr/include/boost/ \
306 # copies _all_ header files - independent of <--with-library>-argument above
307
308 if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
309 $(INSTALL_DIR) \
310 $(1)/usr/lib; \
311 $(CP) \
312 $(PKG_INSTALL_DIR)/lib/*.a \
313 $(1)/usr/lib/; \
314 $(CP) \
315 $(PKG_INSTALL_DIR)/lib/*.so* \
316 $(1)/usr/lib/; \
317 fi
318 endef
319
320 define Host/Install
321 $(INSTALL_DIR) \
322 $(STAGING_DIR_HOST)/bin
323
324 $(CP) \
325 $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/bjam \
326 $(STAGING_DIR_HOST)/bin/
327 endef
328
329 define Package/boost/Default/install
330 $(INSTALL_DIR) \
331 $(1)/usr/lib
332
333 $(CP) \
334 $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
335 $(1)/usr/lib/
336 endef
337
338 define Package/boost-atomic/install
339 $(call Package/boost/Default/install,$(1),atomic)
340 endef
341
342 define Package/boost-chrono/install
343 $(call Package/boost/Default/install,$(1),chrono)
344 endef
345
346 define Package/boost-date_time/install
347 $(call Package/boost/Default/install,$(1),date_time)
348 endef
349
350 define Package/boost-exception/install
351 $(call Package/boost/Default/install,$(1),exception)
352 endef
353
354 define Package/boost-filesystem/install
355 $(call Package/boost/Default/install,$(1),filesystem)
356 endef
357
358 define Package/boost-graph/install
359 $(call Package/boost/Default/install,$(1),graph)
360 endef
361
362 define Package/boost-graph_parallel/install
363 $(call Package/boost/Default/install,$(1),graph_parallel)
364 endef
365
366 define Package/boost-iostreams/install
367 $(call Package/boost/Default/install,$(1),iostreams)
368 endef
369
370 define Package/boost-math/install
371 $(call Package/boost/Default/install,$(1),math)
372 endef
373
374 define Package/boost-mpi/install
375 $(call Package/boost/Default/install,$(1),mpi)
376 endef
377
378 define Package/boost-program_options/install
379 $(call Package/boost/Default/install,$(1),program_options)
380 endef
381
382 define Package/boost-python/install
383 $(call Package/boost/Default/install,$(1),python)
384 endef
385
386 define Package/boost-random/install
387 $(call Package/boost/Default/install,$(1),random)
388 endef
389
390 define Package/boost-regex/install
391 $(call Package/boost/Default/install,$(1),regex)
392 endef
393
394 define Package/boost-serialization/install
395 $(call Package/boost/Default/install,$(1),serialization)
396 endef
397
398 define Package/boost-signals/install
399 $(call Package/boost/Default/install,$(1),signals)
400 endef
401
402 define Package/boost-system/install
403 $(call Package/boost/Default/install,$(1),system)
404 endef
405
406 define Package/boost-test/install
407 $(INSTALL_DIR) \
408 $(1)/usr/lib
409
410 $(CP) \
411 $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
412 $(1)/usr/lib/
413
414 $(CP) \
415 $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
416 $(1)/usr/lib/
417 endef
418
419 define Package/boost-thread/install
420 $(call Package/boost/Default/install,$(1),thread)
421 endef
422
423 define Package/boost-timer/install
424 $(call Package/boost/Default/install,$(1),timer)
425 endef
426
427 define Package/boost-wave/install
428 $(call Package/boost/Default/install,$(1),wave)
429 endef
430
431 define Package/boost-context/install
432 $(call Package/boost/Default/install,$(1),context)
433 endef
434
435 define Package/boost-container/install
436 $(call Package/boost/Default/install,$(1),container)
437 endef
438
439 define Package/boost-coroutine/install
440 $(call Package/boost/Default/install,$(1),coroutine)
441 endef
442
443 define Package/boost-log/install
444 $(call Package/boost/Default/install,$(1),log)
445 endef
446
447
448
449 $(eval $(call HostBuild))
450 $(eval $(call BuildPackage,boost))
451 $(eval $(call BuildPackage,boost-atomic))
452 $(eval $(call BuildPackage,boost-chrono))
453 $(eval $(call BuildPackage,boost-date_time))
454 #$(eval $(call BuildPackage,boost-exception))
455 $(eval $(call BuildPackage,boost-filesystem))
456 $(eval $(call BuildPackage,boost-graph))
457 #$(eval $(call BuildPackage,boost-graph_parallel))
458 $(eval $(call BuildPackage,boost-iostreams))
459 $(eval $(call BuildPackage,boost-locale))
460 $(eval $(call BuildPackage,boost-math))
461 #$(eval $(call BuildPackage,boost-mpi))
462 $(eval $(call BuildPackage,boost-program_options))
463 $(eval $(call BuildPackage,boost-random))
464 $(eval $(call BuildPackage,boost-python))
465 $(eval $(call BuildPackage,boost-regex))
466 $(eval $(call BuildPackage,boost-serialization))
467 $(eval $(call BuildPackage,boost-signals))
468 $(eval $(call BuildPackage,boost-system))
469 $(eval $(call BuildPackage,boost-test))
470 $(eval $(call BuildPackage,boost-thread))
471 $(eval $(call BuildPackage,boost-timer))
472 $(eval $(call BuildPackage,boost-wave))
473 $(eval $(call BuildPackage,boost-context))
474 $(eval $(call BuildPackage,boost-container))
475 $(eval $(call BuildPackage,boost-coroutine))
476 $(eval $(call BuildPackage,boost-log))