Procházet zdrojové kódy

boost: Update 4

  Major Updates
  - Added support for Python 3.5.
  - Removed the restriction for the target MPC85xx when using uclibc [1].
    - No longer required since uclibc was removed from trunk.
  - Added option to force static compilation.
  - Added option to force linking statically to the C++ standard library and compiler runtime support libraries.
  - Added option to disable multithreading support. It can be helpfull for those who wish to fully optimise their code.
    - Some boost libraries will require multithreading to be active. For those, this option is active as a requirement.

  Minor Updates
  - Added -fPIC to CFLags [2].
    - python requires independent position code when statically compiling.

  References:
  [1] - https://github.com/openwrt/packages/issues/1621
  [2] - https://github.com/openwrt/packages/issues/1938

Signed-off-by: Carlos M. Ferreira <carlosmf.pt@gmail.com>
Carlos Miguel Ferreira před 9 roky
rodič
revize
8f7e09026d
1 změnil soubory, kde provedl 73 přidání a 48 odebrání
  1. 73
    48
      libs/boost/Makefile

+ 73
- 48
libs/boost/Makefile Zobrazit soubor

@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/target.mk
17 17
 
18 18
 PKG_NAME:=boost
19 19
 PKG_VERSION:=1_59_0
20
-PKG_RELEASE:=3
20
+PKG_RELEASE:=4
21 21
 
22 22
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
23 23
 PKG_SOURCE_URL:=@SF/boost
@@ -34,17 +34,22 @@ PKG_USE_MIPS16:=0
34 34
 include $(INCLUDE_DIR)/package.mk
35 35
 include $(INCLUDE_DIR)/host-build.mk
36 36
 
37
-# For now, the combination TARGET_mpc85xx&&USE_UCLIBC disables boost due to incompatibility
37
+
38 38
 define Package/boost/Default
39 39
   SECTION:=libs
40 40
   CATEGORY:=Libraries
41 41
   TITLE:=Boost C++ source library
42 42
   URL:=http://www.boost.org
43
-  DEPENDS:=@(!(TARGET_mpc85xx&&USE_UCLIBC)) +libstdcpp +libpthread +librt
43
+  DEPENDS:=+libstdcpp +libpthread +librt
44 44
 endef
45 45
 
46 46
 define Package/boost/description/Default
47
-  Boost provides free peer-reviewed portable C++ source libraries
47
+  true
48
+endef
49
+
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.
48 53
 endef
49 54
 
50 55
 BOOST_LIBS =
@@ -72,34 +77,53 @@ define Package/boost/install
72 77
   true
73 78
 endef
74 79
 
75
-# For now, the combination TARGET_mpc85xx&&USE_UCLIBC disables boost due to incompatibility
80
+
76 81
 define Package/boost
77 82
   $(call Package/boost/Default)
78 83
   TITLE+= packages
79
-  DEPENDS:=@(!(TARGET_mpc85xx&&USE_UCLIBC)) +ALL:boost-libs +ALL:boost-test
84
+  DEPENDS:=+ALL:boost-libs +ALL:boost-test
80 85
 endef
81 86
 
82 87
 define Package/boost/config
83
-    menu "Select Boost libraries"
88
+    menu "Select Boost Options"
84 89
       depends on PACKAGE_boost
90
+      	comment "Boost compilation options."
91
+	    config boost-static-libs
92
+	    	bool "Static Libraries Only"	    	
93
+	    	help 
94
+	    		Static compile of all selected boost libraries.
95
+	    	default n
96
+	    
97
+	    config boost-runtime-static
98
+	    	bool "Use static version of C and C++ runtimes."	    	
99
+	    	help 
100
+	    		Determines if shared or static version of C and C++ runtimes should be used.
101
+	    	default n
102
+	    	select boost-static-libs
103
+
104
+	    config boost-multi-threading
105
+	    	bool "Multithread Support"	    	
106
+	    	help 
107
+	    		Compile Boost libraries with multithread support.
108
+	    	default y
109
+    endmenu
85 110
 
86
-    config boost-libs-all
87
-      bool "Include all Boost libraries"
88
-      select PACKAGE_boost-libs
89
-
90
-   config boost-test-pkg
91
-     bool "Boost test package"
92
-     select PACKAGE_boost-test
93
-
94
-    comment "Libraries"
95
-
96
-    $(foreach lib,$(BOOST_LIBS), \
97
-        config PACKAGE_boost-$(lib)
98
-           prompt "Boost $(lib) library"
99
-
100
-   )
101
-
102
-  endmenu
111
+    menu "Select Boost libraries"
112
+      depends on PACKAGE_boost
113
+		comment "Libraries"
114
+	    config boost-libs-all
115
+	    	bool "Include all Boost libraries"
116
+	    	select PACKAGE_boost-libs	    	
117
+
118
+		config boost-test-pkg
119
+	    	bool "Boost test package"
120
+	    	select PACKAGE_boost-test
121
+	    
122
+    	$(foreach lib,$(BOOST_LIBS), \
123
+        	config PACKAGE_boost-$(lib)
124
+        	prompt "Boost $(lib) library"
125
+   		)
126
+  	endmenu
103 127
 
104 128
 endef
105 129
 
@@ -153,18 +177,15 @@ $(eval $(call DefineBoostLibrary,iostreams,,+zlib))
153 177
 $(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) +@BUILD_NLS))
154 178
 $(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
155 179
 $(eval $(call DefineBoostLibrary,math,,))
156
-#$(eval $(call DefineBoostLibrary,mpi,,))
180
+#$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
157 181
 $(eval $(call DefineBoostLibrary,program_options,,))
158 182
 $(eval $(call DefineBoostLibrary,random,system,))
159
-
160
-# We need a beter way to provide this package, information regarding the Python packages
161
-#  such as Python version and directories locations. 
162
-# Python 2.7 version is for now hard-coded. Python 3 is (until this date) broken in the trunk tree.
163 183
 $(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python))
184
+$(eval $(call DefineBoostLibrary,python3,,+PACKAGE_boost-python3:python3))
164 185
 $(eval $(call DefineBoostLibrary,regex,,))
165 186
 $(eval $(call DefineBoostLibrary,serialization,,))
166 187
 $(eval $(call DefineBoostLibrary,signals,,))
167
-$(eval $(call DefineBoostLibrary,system,,))
188
+$(eval $(call DefineBoostLibrary,system,,+@boost-multi-threading))
168 189
 $(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
169 190
 $(eval $(call DefineBoostLibrary,timer,chrono))
170 191
 $(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
@@ -177,7 +198,7 @@ endef
177 198
 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
178 199
 TARGET_LDFLAGS += -pthread -lrt
179 200
 
180
-TARGET_CFLAGS += $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H)
201
+TARGET_CFLAGS += $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC
181 202
 
182 203
 ifneq ($(findstring mips,$(ARCH)),)
183 204
     BOOST_ABI = o32
@@ -197,8 +218,12 @@ define Build/Compile
197 218
 	$(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE))
198 219
 	( cd $(PKG_BUILD_DIR) ; \
199 220
 		echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : <compileflags>\"$(TARGET_CFLAGS)\" <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \
221
+		$(if $(CONFIG_PACKAGE_boost-python3), \
222
+			echo "using python : 3.5 : $(STAGING_DIR_ROOT)/usr/bin/python3 : $(STAGING_DIR)/usr/include/python3.5/ ;" >> \
223
+				tools/build/src/user-config.jam; \
224
+		) \
200 225
 		$(if $(CONFIG_PACKAGE_boost-python), \
201
-			echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python :	$(STAGING_DIR)/usr/include/python2.7/ ;" >> \
226
+			echo "using python : 2.7 : $(STAGING_DIR_ROOT)/usr/bin/python2 :	$(STAGING_DIR)/usr/include/python2.7/ ;" >> \
202 227
 				tools/build/src/user-config.jam; \
203 228
 		) \
204 229
 		bjam \
@@ -206,13 +231,16 @@ define Build/Compile
206 231
 			--ignore-site-config \
207 232
 			--toolset=gcc-$(ARCH) --build-type=minimal --layout=system abi=$(BOOST_ABI) \
208 233
 			--disable-long-double \
234
+			$(if $(CONFIG_boost-static-libs),link=static,link=shared) \
235
+			$(if $(CONFIG_boost-runtime-static),runtime-link=static,runtime-link=shared) \
236
+			$(if $(CONFIG_boost-multi-threading),threading=multi,threading=single) \
209 237
 			$(CONFIGURE_ARGS) \
210 238
 			--without-mpi \
211 239
 			$(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
212 240
 			$(foreach lib,$(BOOST_LIBS), \
213 241
 				$(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib)) \
214 242
 			) \
215
-			$(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_UCLIBC),on,off), \
243
+			$(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
216 244
 				boost.locale.iconv=off) \
217 245
 			\
218 246
 			$(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
@@ -231,8 +259,8 @@ define Build/InstallDev
231 259
 		# copies _all_ header files - independent of <--with-library>-argument above
232 260
 
233 261
 	$(INSTALL_DIR) $(1)/usr/lib
234
-	-$(CP) $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/
235
-	-$(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/usr/lib/
262
+	$(CP) -v $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/ # copies all compiled archive files 	
263
+	$(FIND) $(PKG_INSTALL_DIR)/lib/ -name '*.so*' -exec $(CP) {} $(1)/usr/lib/ \; # copies all the shared objects files
236 264
 endef
237 265
 
238 266
 define Host/Install
@@ -248,22 +276,19 @@ define Package/boost/Default/install
248 276
 	$(INSTALL_DIR) \
249 277
 		$(1)/usr/lib
250 278
 
251
-	$(CP) \
252
-		$(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \
253
-		$(1)/usr/lib/
279
+	$(FIND) \
280
+		$(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
254 281
 endef
255 282
 
256
-define Package/boost-test/install
257
-	$(INSTALL_DIR) \
258
-		$(1)/usr/lib
283
+define Package/boost-test/install	
284
+		$(INSTALL_DIR) \
285
+			$(1)/usr/lib
259 286
 
260
-	$(CP) \
261
-		$(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \
262
-		$(1)/usr/lib/
263
-
264
-	$(CP) \
265
-		$(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \
266
-		$(1)/usr/lib/
287
+		$(FIND) \
288
+			$(PKG_INSTALL_DIR)/lib/ -name 'libboost_unit_test_framework*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
289
+		
290
+		$(FIND) \
291
+			$(PKG_INSTALL_DIR)/lib/ -name 'libboost_prg_exec_monitor*.so*' -exec $(CP) {} $(1)/usr/lib/ \;	
267 292
 endef
268 293
 
269 294
 define BuildBoostLibrary