Procházet zdrojové kódy

boost: makefile and patches updated to v1.57

Signed-off-by: Carlos M. Ferreira <carlosmf.pt@gmail.com>
claymore před 10 roky
rodič
revize
9e30e779f9
2 změnil soubory, kde provedl 427 přidání a 0 odebrání
  1. 399
    0
      libs/boost/Makefile
  2. 28
    0
      libs/boost/patches/100-do-not-use-librt.patch

+ 399
- 0
libs/boost/Makefile Zobrazit soubor

@@ -0,0 +1,399 @@
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
+
16
+PKG_NAME:=boost
17
+PKG_VERSION:=1_57_0
18
+PKG_RELEASE:=1
19
+
20
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
21
+PKG_SOURCE_URL:=@SF/boost
22
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
23
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION)
24
+PKG_MD5SUM:=25f9a8ac28beeb5ab84aa98510305299
25
+PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
26
+PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com> (Modified from Mirko Vogt <mirko@openwrt.org> Boost 1.51 Original Makefile and patches)
27
+
28
+
29
+PKG_BUILD_DEPENDS:=boost/host
30
+PKG_BUILD_PARALLEL:=0
31
+PKG_USE_MIPS16:=0
32
+
33
+PKG_CONFIG_DEPENDS := \
34
+	CONFIG_PACKAGE_boost-date_time \
35
+	CONFIG_PACKAGE_boost-filesystem \
36
+	CONFIG_PACKAGE_boost-graph \
37
+	CONFIG_PACKAGE_boost-iostreams \
38
+	CONFIG_PACKAGE_boost-math \
39
+	CONFIG_PACKAGE_boost-program_options \
40
+	CONFIG_PACKAGE_boost-python \
41
+	CONFIG_PACKAGE_boost-regex \
42
+	CONFIG_PACKAGE_boost-serialization \
43
+	CONFIG_PACKAGE_boost-signals \
44
+	CONFIG_PACKAGE_boost-system \
45
+	CONFIG_PACKAGE_boost-test \
46
+	CONFIG_PACKAGE_boost-thread \
47
+	CONFIG_PACKAGE_boost-wave \
48
+        CONFIG_PACKAGE_boost-atomic \
49
+
50
+
51
+include $(INCLUDE_DIR)/package.mk
52
+include $(INCLUDE_DIR)/host-build.mk
53
+
54
+define Package/boost/Default
55
+  SECTION:=libs
56
+  CATEGORY:=Libraries
57
+  TITLE:=Boost C++ source libraries
58
+  URL:=http://www.boost.org
59
+  DEPENDS:=+libstdcpp +libpthread +librt
60
+endef
61
+
62
+define Package/boost/Default/description
63
+  Boost provides free peer-reviewed portable C++ source libraries
64
+endef
65
+
66
+define Package/boost-atomic
67
+  $(call Package/boost/Default)
68
+  TITLE+= (atomic)
69
+  DEPENDS+= +boost-system
70
+endef
71
+
72
+define Package/boost-chrono
73
+  $(call Package/boost/Default)
74
+  TITLE+= (chrono)
75
+  DEPENDS+= +boost-system
76
+endef
77
+
78
+define Package/boost-date_time
79
+  $(call Package/boost/Default)
80
+  TITLE+= (date_time)
81
+endef
82
+
83
+define Package/boost-exception
84
+  $(call Package/boost/Default)
85
+  TITLE+= (exception)
86
+endef
87
+
88
+define Package/boost-filesystem
89
+  $(call Package/boost/Default)
90
+  TITLE+= (filesystem)
91
+  DEPENDS+= +boost-system
92
+endef
93
+
94
+define Package/boost-graph
95
+  $(call Package/boost/Default)
96
+  TITLE+= (graph)
97
+  DEPENDS+= +boost-regex
98
+endef
99
+
100
+define Package/boost-graph_parallel
101
+  $(call Package/boost/Default)
102
+  TITLE+= (graph_parallel)
103
+endef
104
+
105
+define Package/boost-iostreams
106
+  $(call Package/boost/Default)
107
+  TITLE+= (iostreams)
108
+  DEPENDS+= +zlib
109
+endef
110
+
111
+define Package/boost-locale
112
+  $(call Package/boost/Default)
113
+  TITLE+= (locale)
114
+endef
115
+
116
+define Package/boost-math
117
+  $(call Package/boost/Default)
118
+  TITLE+= (math)
119
+endef
120
+
121
+define Package/boost-mpi
122
+  $(call Package/boost/Default)
123
+  TITLE+= (mpi)
124
+endef
125
+
126
+define Package/boost-program_options
127
+  $(call Package/boost/Default)
128
+  TITLE+= (program_options)
129
+endef
130
+
131
+define Package/boost-python
132
+  $(call Package/boost/Default)
133
+  TITLE+= (python)
134
+  DEPENDS+= +PACKAGE_boost-python:python
135
+endef
136
+
137
+define Package/boost-random
138
+  $(call Package/boost/Default)
139
+  TITLE+= (random)
140
+  DEPENDS+= +boost-system
141
+endef
142
+
143
+define Package/boost-regex
144
+  $(call Package/boost/Default)
145
+  TITLE+= (regex)
146
+endef
147
+
148
+define Package/boost-serialization
149
+  $(call Package/boost/Default)
150
+  TITLE+= (serialization)
151
+endef
152
+
153
+define Package/boost-signals
154
+  $(call Package/boost/Default)
155
+  TITLE+= (signals)
156
+endef
157
+
158
+define Package/boost-system
159
+  $(call Package/boost/Default)
160
+  TITLE+= (system)
161
+endef
162
+
163
+define Package/boost-test
164
+  $(call Package/boost/Default)
165
+  TITLE+= (test)
166
+endef
167
+
168
+define Package/boost-thread
169
+  $(call Package/boost/Default)
170
+  TITLE+= (thread)
171
+  DEPENDS+= +boost-system +boost-chrono +boost-atomic
172
+endef
173
+
174
+define Package/boost-timer
175
+  $(call Package/boost/Default)
176
+  TITLE+= (timer)
177
+  DEPENDS+= boost-chrono
178
+endef
179
+
180
+define Package/boost-wave
181
+  $(call Package/boost/Default)
182
+  TITLE+= (wave)
183
+  DEPENDS+= +boost-date_time +boost-thread +boost-filesystem
184
+endef
185
+
186
+define Package/boost
187
+  $(call Package/boost/Default)
188
+  TITLE+= (header-only)
189
+  BUILDONLY:=1
190
+endef
191
+
192
+define Build/Configure
193
+endef
194
+
195
+define Host/Compile
196
+	# bjam does not provide a configure-script nor a Makefile
197
+	( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc )
198
+endef
199
+
200
+CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
201
+TARGET_LDFLAGS += -pthread -lrt
202
+
203
+define Build/Compile
204
+	( cd $(PKG_BUILD_DIR) ; \
205
+		echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
206
+		$(if $(CONFIG_PACKAGE_boost-python), \
207
+			echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python :	$(STAGING_DIR)/usr/include/python2.7/ ;" >> \
208
+				tools/build/src/user-config.jam; \
209
+		) \
210
+		bjam \
211
+			'-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
212
+			--toolset=gcc-$(ARCH) --build-type=minimal --layout=system \
213
+			--disable-long-double \
214
+			$(CONFIGURE_ARGS) \
215
+			$(if $(CONFIG_PACKAGE_boost-atomic),,--without-atomic) \
216
+			$(if $(CONFIG_PACKAGE_boost-chrono),,--without-chrono) \
217
+			$(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
218
+			$(if $(CONFIG_PACKAGE_boost-exception),,--without-exception) \
219
+			$(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
220
+			$(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
221
+			$(if $(CONFIG_PACKAGE_boost-graph_parallel),,--without-graph_parallel) \
222
+			$(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
223
+			$(if $(CONFIG_PACKAGE_boost-locale),,--without-locale) \
224
+			$(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
225
+			$(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
226
+			$(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
227
+			$(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
228
+			$(if $(CONFIG_PACKAGE_boost-random),,--without-random) \
229
+			$(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
230
+			$(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
231
+			$(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
232
+			$(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
233
+			$(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
234
+			$(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
235
+			$(if $(CONFIG_PACKAGE_boost-timer),,--without-timer) \
236
+			$(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
237
+			\
238
+			$(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
239
+				-sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
240
+			install \
241
+	)
242
+endef
243
+
244
+define Build/InstallDev
245
+	$(INSTALL_DIR) \
246
+		$(1)/usr/include/boost/
247
+
248
+	$(CP) \
249
+		$(PKG_INSTALL_DIR)/include/boost/* \
250
+		$(1)/usr/include/boost/ \
251
+		# copies _all_ header files - independent of <--with-library>-argument above
252
+
253
+	if [ -d $(PKG_INSTALL_DIR)/lib ]; then \
254
+		$(INSTALL_DIR) \
255
+			$(1)/usr/lib; \
256
+		$(CP) \
257
+			$(PKG_INSTALL_DIR)/lib/*.a \
258
+			$(1)/usr/lib/; \
259
+		$(CP) \
260
+			$(PKG_INSTALL_DIR)/lib/*.so* \
261
+			$(1)/usr/lib/; \
262
+	fi
263
+endef
264
+
265
+define Host/Install
266
+	$(INSTALL_DIR) \
267
+		$(STAGING_DIR_HOST)/bin
268
+
269
+	$(CP) \
270
+		$(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/bjam \
271
+		$(STAGING_DIR_HOST)/bin/
272
+endef
273
+
274
+define Package/boost/Default/install
275
+	$(INSTALL_DIR) \
276
+		$(1)/usr/lib
277
+
278
+	$(CP) \
279
+		$(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
280
+		$(1)/usr/lib/
281
+endef
282
+
283
+define Package/boost-atomic/install
284
+  $(call Package/boost/Default/install,$(1),atomic)
285
+endef
286
+
287
+define Package/boost-chrono/install
288
+  $(call Package/boost/Default/install,$(1),chrono)
289
+endef
290
+
291
+define Package/boost-date_time/install
292
+  $(call Package/boost/Default/install,$(1),date_time)
293
+endef
294
+
295
+define Package/boost-exception/install
296
+  $(call Package/boost/Default/install,$(1),exception)
297
+endef
298
+
299
+define Package/boost-filesystem/install
300
+  $(call Package/boost/Default/install,$(1),filesystem)
301
+endef
302
+
303
+define Package/boost-graph/install
304
+  $(call Package/boost/Default/install,$(1),graph)
305
+endef
306
+
307
+define Package/boost-graph_parallel/install
308
+  $(call Package/boost/Default/install,$(1),graph_parallel)
309
+endef
310
+
311
+define Package/boost-iostreams/install
312
+  $(call Package/boost/Default/install,$(1),iostreams)
313
+endef
314
+
315
+define Package/boost-math/install
316
+  $(call Package/boost/Default/install,$(1),math)
317
+endef
318
+
319
+define Package/boost-mpi/install
320
+  $(call Package/boost/Default/install,$(1),mpi)
321
+endef
322
+
323
+define Package/boost-program_options/install
324
+  $(call Package/boost/Default/install,$(1),program_options)
325
+endef
326
+
327
+define Package/boost-python/install
328
+  $(call Package/boost/Default/install,$(1),python)
329
+endef
330
+
331
+define Package/boost-random/install
332
+  $(call Package/boost/Default/install,$(1),random)
333
+endef
334
+
335
+define Package/boost-regex/install
336
+  $(call Package/boost/Default/install,$(1),regex)
337
+endef
338
+
339
+define Package/boost-serialization/install
340
+  $(call Package/boost/Default/install,$(1),serialization)
341
+endef
342
+
343
+define Package/boost-signals/install
344
+  $(call Package/boost/Default/install,$(1),signals)
345
+endef
346
+
347
+define Package/boost-system/install
348
+  $(call Package/boost/Default/install,$(1),system)
349
+endef
350
+
351
+define Package/boost-test/install
352
+	$(INSTALL_DIR) \
353
+		$(1)/usr/lib
354
+
355
+	$(CP) \
356
+		$(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
357
+		$(1)/usr/lib/
358
+
359
+	$(CP) \
360
+		$(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
361
+		$(1)/usr/lib/
362
+endef
363
+
364
+define Package/boost-thread/install
365
+  $(call Package/boost/Default/install,$(1),thread)
366
+endef
367
+
368
+define Package/boost-timer/install
369
+  $(call Package/boost/Default/install,$(1),timer)
370
+endef
371
+
372
+define Package/boost-wave/install
373
+  $(call Package/boost/Default/install,$(1),wave)
374
+endef
375
+
376
+$(eval $(call HostBuild))
377
+$(eval $(call BuildPackage,boost))
378
+$(eval $(call BuildPackage,boost-atomic))
379
+$(eval $(call BuildPackage,boost-chrono))
380
+$(eval $(call BuildPackage,boost-date_time))
381
+#$(eval $(call BuildPackage,boost-exception))
382
+$(eval $(call BuildPackage,boost-filesystem))
383
+$(eval $(call BuildPackage,boost-graph))
384
+#$(eval $(call BuildPackage,boost-graph_parallel))
385
+$(eval $(call BuildPackage,boost-iostreams))
386
+$(eval $(call BuildPackage,boost-locale))
387
+$(eval $(call BuildPackage,boost-math))
388
+#$(eval $(call BuildPackage,boost-mpi))
389
+$(eval $(call BuildPackage,boost-program_options))
390
+$(eval $(call BuildPackage,boost-random))
391
+$(eval $(call BuildPackage,boost-python))
392
+$(eval $(call BuildPackage,boost-regex))
393
+$(eval $(call BuildPackage,boost-serialization))
394
+$(eval $(call BuildPackage,boost-signals))
395
+$(eval $(call BuildPackage,boost-system))
396
+$(eval $(call BuildPackage,boost-test))
397
+$(eval $(call BuildPackage,boost-thread))
398
+$(eval $(call BuildPackage,boost-timer))
399
+$(eval $(call BuildPackage,boost-wave))

+ 28
- 0
libs/boost/patches/100-do-not-use-librt.patch Zobrazit soubor

@@ -0,0 +1,28 @@
1
+Index: boost_1_57_0/tools/build/src/tools/gcc.jam
2
+===================================================================
3
+--- boost_1_57_0.orig/tools/build/src/tools/gcc.jam
4
++++ boost_1_57_0/tools/build/src/tools/gcc.jam
5
+@@ -1037,7 +1037,7 @@ rule setup-threading ( targets * : sourc
6
+             case *bsd    : option = -pthread ;  # There is no -lrt on BSD.
7
+             case sgi     : # gcc on IRIX does not support multi-threading.
8
+             case darwin  : # No threading options.
9
+-            case *       : option = -pthread ; libs = rt ;
10
++            case *       : # pass appropriate options via OpenWrt
11
+         }
12
+ 
13
+         if $(option)
14
+Index: boost_1_57_0/tools/build/src/tools/gcc.py
15
+===================================================================
16
+--- boost_1_57_0.orig/tools/build/src/tools/gcc.py
17
++++ boost_1_57_0/tools/build/src/tools/gcc.py
18
+@@ -700,8 +700,8 @@ elif bjam.variable('UNIX'):
19
+         # Darwin has no threading options, don't set anything here.
20
+         pass
21
+     else:
22
+-        flags('gcc', 'OPTIONS', ['<threading>multi'], ['-pthread'])
23
+-        flags('gcc', 'FINDLIBS-SA', [], ['rt'])
24
++        # pass appropriate options via OpenWrt
25
++        pass
26
+ 
27
+ def cpu_flags(toolset, variable, architecture, instruction_set, values, default=None):
28
+     #FIXME: for some reason this fails.  Probably out of date feature code