-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 26 Feb 2010 23:45:22 +0100
Lars-Peter Clausen <l...@metafoo.de> wrote:

> Hi

Hi,

> Thanks for the patch. Unfortunately it won't work the way you've
> implemented it.
> [...]
> It would be nice if you could redo the patch with an separate package
> for each sub-lib.

Done. Patch attached. Now including all boost libs and two patches.
(the boost package itself is only for the boost headers, that do not
need to be compiled) Additional there is a patch to enable the shared
python module that is needed for boost-python.

Alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAkuaq8oACgkQ1SSUxvEq73zm4ACdFeWViWlicBl1zMNpNV+q+2Ej
yT0An2NwQFQLeKpQvadX65lZLQKFk0p+
=a8Sj
-----END PGP SIGNATURE-----
Index: packages/libs/boost/patches/010-one-cpu.patch
===================================================================
--- packages/libs/boost/patches/010-one-cpu.patch	(revision 0)
+++ packages/libs/boost/patches/010-one-cpu.patch	(revision 0)
@@ -0,0 +1,12 @@
+diff -Naur boost_1_35_0.orig/libs/thread/src/pthread/thread.cpp boost_1_35_0/libs/thread/src/pthread/thread.cpp
+--- boost_1_35_0.orig/libs/thread/src/pthread/thread.cpp	2008-05-08 06:18:57.000000000 -0400
++++ boost_1_35_0/libs/thread/src/pthread/thread.cpp	2008-05-08 06:20:15.000000000 -0400
+@@ -419,7 +419,7 @@
+ #if defined(PTW32_VERSION) || defined(__hpux)
+         return pthread_num_processors_np();
+ #elif defined(__linux__)
+-        return get_nprocs();
++        return 1;
+ #elif defined(__APPLE__) || defined(__FreeBSD__)
+         int count;
+         size_t size=sizeof(count);
Index: packages/libs/boost/patches/020-buildin-offsetof.patch
===================================================================
--- packages/libs/boost/patches/020-buildin-offsetof.patch	(revision 0)
+++ packages/libs/boost/patches/020-buildin-offsetof.patch	(revision 0)
@@ -0,0 +1,11 @@
+--- boost_1_38_0/boost/python/detail/config.hpp	2007-11-25 19:07:19.000000000 +0100
++++ boost_1_38_0/boost/python/detail/config.hpp	2010-02-26 02:06:26.000000000 +0100
+@@ -111,7 +111,7 @@
+ # define BOOST_PYTHON_OFFSETOF(s_name, s_member) \
+         ((size_t)__INTADDR__(&(((s_name *)0)->s_member)))
+ #else
+-# define BOOST_PYTHON_OFFSETOF offsetof
++# define BOOST_PYTHON_OFFSETOF __builtin_offsetof
+ #endif
+ 
+ //  enable automatic library variant selection  ------------------------------// 
Index: packages/libs/boost/Makefile
===================================================================
--- packages/libs/boost/Makefile	(revision 20168)
+++ packages/libs/boost/Makefile	(working copy)
@@ -22,62 +22,237 @@
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/boost
+define Package/boost/Default
   SECTION:=libs
   CATEGORY:=Libraries
-  TITLE:=Boost provides free peer-reviewed portable C++ source libraries
-  URL:=http://www.boost.org/
+  TITLE:=Boost C++ source libraries
+  URL:=http://www.boost.org
 endef
 
-define Package/boost-serialization
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Boost-serialization library
-  DEPENDS:=+boost
+define Package/boost/Default/description
+  Boost provides free peer-reviewed portable C++ source libraries
 endef
 
+define Package/boost-date_time
+  $(call Package/boost/Default)
+  TITLE+= (date_time)
+endef
+
+define Package/boost-filesystem
+  $(call Package/boost/Default)
+  TITLE+= (filesystem)
+endef
+
+define Package/boost-function_types
+  $(call Package/boost/Default)
+  TITLE+= (function_types)
+endef
+
+define Package/boost-graph
+  $(call Package/boost/Default)
+  TITLE+= (graph)
+endef
+
+define Package/boost-iostreams
+  $(call Package/boost/Default)
+  TITLE+= (iostreams)
+  DEPENDS+= +zlib
+endef
+
+define Package/boost-math
+  $(call Package/boost/Default)
+  TITLE+= (math)
+endef
+
+define Package/boost-mpi
+  $(call Package/boost/Default)
+  TITLE+= (mpi)
+endef
+
+define Package/boost-program_options
+  $(call Package/boost/Default)
+  TITLE+= (program_options)
+endef
+
+define Package/boost-python
+  $(call Package/boost/Default)
+  TITLE+= (python)
+  DEPENDS+= +python
+endef
+
 define Package/boost-regex
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Boost-regex library
-  DEPENDS:=+boost
+  $(call Package/boost/Default)
+  TITLE+= (regex)
 endef
 
+define Package/boost-serialization
+  $(call Package/boost/Default)
+  TITLE+= (serialization)
+endef
+
+define Package/boost-signals
+  $(call Package/boost/Default)
+  TITLE+= (signals)
+endef
+
+define Package/boost-system
+  $(call Package/boost/Default)
+  TITLE+= (system)
+endef
+
+define Package/boost-test
+  $(call Package/boost/Default)
+  TITLE+= (test)
+endef
+
+define Package/boost-thread
+  $(call Package/boost/Default)
+  TITLE+= (thread)
+endef
+
+define Package/boost-wave
+  $(call Package/boost/Default)
+  TITLE+= (wave)
+endef
+
+define Package/boost
+  $(call Package/boost/Default)
+  TITLE+= (header-only)
+  BUILDONLY:=1
+endef
+
 define Build/Configure
 endef
 
 # bjam does not support anything like DESTDIR
 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
 
+# link against libstdc++
+LDFLAGS+= -lstdc++
+
 define Build/Compile
 	( cd $(PKG_BUILD_DIR) ; \
 		echo "using gcc : : $(GNU_TARGET_NAME)-gcc : <cflags>$(CFLAGS) <cxxflags>$(CXXFLAGS) <linkflags>$(LDFLAGS) ;" > tools/build/v2/site-config.jam ; \
+		$(if $(CONFIG_PACKAGE_boost-python),echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.6/ ;" >> tools/build/v2/site-config.jam ;) \
 		bjam \
 			'-sBUILD=release <optimization>space <inlining>on <debug-symbols>off' \
 			--toolset=gcc --build-type=minimal --layout=system \
-			$(patsubst %,--with-regex,$(filter y m,$(CONFIG_PACKAGE_boost-regex))) \
-			$(patsubst %,--with-serialization,$(filter y m,$(CONFIG_PACKAGE_boost-serialization))) \
+			$(if $(CONFIG_PACKAGE_boost-date_time),,--without-date_time) \
+			$(if $(CONFIG_PACKAGE_boost-filesystem),,--without-filesystem) \
+			$(if $(CONFIG_PACKAGE_boost-function_types),,--without-function_types) \
+			$(if $(CONFIG_PACKAGE_boost-graph),,--without-graph) \
+			$(if $(CONFIG_PACKAGE_boost-iostreams),,--without-iostreams) \
+			$(if $(CONFIG_PACKAGE_boost-math),,--without-math) \
+			$(if $(CONFIG_PACKAGE_boost-mpi),,--without-mpi) \
+			$(if $(CONFIG_PACKAGE_boost-program_options),,--without-program_options) \
+			$(if $(CONFIG_PACKAGE_boost-python),,--without-python) \
+			$(if $(CONFIG_PACKAGE_boost-regex),,--without-regex) \
+			$(if $(CONFIG_PACKAGE_boost-serialization),,--without-serialization) \
+			$(if $(CONFIG_PACKAGE_boost-signals),,--without-signals) \
+			$(if $(CONFIG_PACKAGE_boost-system),,--without-system) \
+			$(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
+			$(if $(CONFIG_PACKAGE_boost-thread),,--without-thread) \
+			$(if $(CONFIG_PACKAGE_boost-wave),,--without-wave) \
+			\
+			$(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \
+				-sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \
 			$(CONFIGURE_ARGS) \
 			install \
 	)
 endef
 
-define Package/boost/description
-    Boost provides free peer-reviewed portable C++ source libraries
-endef
-
 define Build/InstallDev
-    $(INSTALL_DIR) $(1)/usr/include/boost $(1)/usr/lib
+	$(INSTALL_DIR) $(1)/usr/include/boost/
 	$(CP) $(PKG_INSTALL_DIR)/include/boost/* $(1)/usr/include/boost/ # copies _all_ header files - independent of <--with-library>-argument above
+
+	$(INSTALL_DIR) $(1)/usr/lib
 	$(CP) $(PKG_INSTALL_DIR)/lib/*.a $(1)/usr/lib/
 	$(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/usr/lib/
 endef
 
-define Package/boost/install
-    $(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/usr/lib/
+define Package/boost/Default/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* $(1)/usr/lib/
 endef
 
+define Package/boost-date_time/install
+  $(call Package/boost/Default/install,$(1),date_time)
+endef
+
+define Package/boost-filesystem/install
+  $(call Package/boost/Default/install,$(1),filesystem)
+endef
+
+define Package/boost-function_types/install
+  $(call Package/boost/Default/install,$(1),function_types)
+endef
+
+define Package/boost-graph/install
+  $(call Package/boost/Default/install,$(1),graph)
+endef
+
+define Package/boost-iostreams/install
+  $(call Package/boost/Default/install,$(1),iostreams)
+endef
+
+define Package/boost-math/install
+  $(call Package/boost/Default/install,$(1),math)
+endef
+
+define Package/boost-mpi/install
+  $(call Package/boost/Default/install,$(1),mpi)
+endef
+
+define Package/boost-program_options/install
+  $(call Package/boost/Default/install,$(1),program_options)
+endef
+
+define Package/boost-python/install
+  $(call Package/boost/Default/install,$(1),python)
+endef
+
+define Package/boost-regex/install
+  $(call Package/boost/Default/install,$(1),regex)
+endef
+
+define Package/boost-serialization/install
+  $(call Package/boost/Default/install,$(1),serialization)
+endef
+
+define Package/boost-signals/install
+  $(call Package/boost/Default/install,$(1),signals)
+endef
+
+define Package/boost-system/install
+  $(call Package/boost/Default/install,$(1),system)
+endef
+
+define Package/boost-test/install
+  $(call Package/boost/Default/install,$(1),test)
+endef
+
+define Package/boost-thread/install
+  $(call Package/boost/Default/install,$(1),thread)
+endef
+
+define Package/boost-wave/install
+  $(call Package/boost/Default/install,$(1),wave)
+endef
+
+$(eval $(call BuildPackage,boost))
+$(eval $(call BuildPackage,boost-date_time))
+$(eval $(call BuildPackage,boost-filesystem))
+$(eval $(call BuildPackage,boost-function_types))
+$(eval $(call BuildPackage,boost-graph))
+$(eval $(call BuildPackage,boost-iostreams))
+$(eval $(call BuildPackage,boost-math))
+$(eval $(call BuildPackage,boost-mpi))
+$(eval $(call BuildPackage,boost-program_options))
+$(eval $(call BuildPackage,boost-python))
+$(eval $(call BuildPackage,boost-regex))
 $(eval $(call BuildPackage,boost-serialization))
-$(eval $(call BuildPackage,boost-regex))
-$(eval $(call BuildPackage,boost))
+$(eval $(call BuildPackage,boost-signals))
+$(eval $(call BuildPackage,boost-system))
+$(eval $(call BuildPackage,boost-test))
+$(eval $(call BuildPackage,boost-thread))
+$(eval $(call BuildPackage,boost-wave))
Index: packages/lang/python/Makefile
===================================================================
--- packages/lang/python/Makefile	(revision 20168)
+++ packages/lang/python/Makefile	(working copy)
@@ -130,10 +130,11 @@
 	$(MAKE) -C $(PKG_BUILD_DIR) distclean
 	$(call Build/Configure/Default, \
 		--sysconfdir=/etc \
-		--disable-shared \
+		--enable-shared \
 		--without-cxx-main \
 		--with-threads \
 		--with-system-ffi \
+		--enable-unicode=ucs4 \
 		ac_cv_lib_readline_readline=no \
 		ac_cv_have_chflags=no \
 		ac_cv_have_lchflags=no \
@@ -154,7 +155,7 @@
 		$(1)/usr/include/
 	$(CP) \
 		$(PKG_INSTALL_DIR)/host/lib/python$(PYTHON_VERSION) \
-		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
+		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).* \
 		$(1)/usr/lib/
 
 	$(CP) \
@@ -178,6 +179,8 @@
 endef
 
 define PyPackage/python/filespec
++|/usr/lib/libpython$(PYTHON_VERSION).so
++|/usr/lib/libpython$(PYTHON_VERSION).so.1.0
 +|/usr/lib/python$(PYTHON_VERSION)
 -|/usr/lib/python$(PYTHON_VERSION)/bsddb/test
 -|/usr/lib/python$(PYTHON_VERSION)/config
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to