Kaydet (Commit) e00a3a68 authored tarafından David Ostrovsky's avatar David Ostrovsky

core: fix build with system boost 1.59

9a6cdce3 was trying to fix the problem
with exposing deprecated vars and functions in system's error_code.hpp
include file by patching bundled boost version.  This approach would
only make sense, when upstream version is going to be fixed ASAP. Apply
another approach, and follow the same pattern as applied in external
libraries, by defining

  -DBOOST_ERROR_CODE_HEADER_ONLY \
  -DBOOST_SYSTEM_NO_DEPRECATED

instead of patching bundled boost version.  This way, the code would
work with unpatched system boost 1.59 final as well.

Change-Id: I8684ca458ea4a5b7d7c3c3acfe7c14a6d19bc665
Reviewed-on: https://gerrit.libreoffice.org/18201Reviewed-by: 's avatarDavid Ostrovsky <david@ostrovsky.org>
Tested-by: 's avatarDavid Ostrovsky <david@ostrovsky.org>
üst 0fad62c2
...@@ -84,8 +84,6 @@ boost_patches += boost_1_59_0.rational.wshadow.patch ...@@ -84,8 +84,6 @@ boost_patches += boost_1_59_0.rational.wshadow.patch
boost_patches += boost_1_59_0.multi_array.wshadow.patch boost_patches += boost_1_59_0.multi_array.wshadow.patch
# https://svn.boost.org/trac/boost/ticket/11501 # https://svn.boost.org/trac/boost/ticket/11501
boost_patches += boost_1_59_0.property_tree.wreturn-type.patch boost_patches += boost_1_59_0.property_tree.wreturn-type.patch
# https://svn.boost.org/trac/boost/ticket/11597
boost_patches += boost_1_59_0.system.no.deprecated.patch
$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
......
Starting from 1.59.0 final release, there are undefined generic_category()
errors in internal and external modules: [1].
Instead of defining the -DBOOST_SYSTEM_NO_DEPRECATED in internal and external
modules, patch the boost to not define the deprecated stuff per default.
[1] http://paste.openstack.org/show/430509
diff -ru boost.orig/boost/system/detail/error_code.ipp boost/boost/system/detail/error_code.ipp
--- foo/misc/boost.orig/boost/system/detail/error_code.ipp 2015-01-06 17:08:27.000000000 +0100
+++ foo/misc/boost/boost/system/detail/error_code.ipp 2015-08-28 21:47:00.941340365 +0200
@@ -437,7 +437,7 @@
} // unnamed namespace
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;
// note that it doesn't matter if this
// isn't initialized before use since
diff -ru boost.orig/boost/system/error_code.hpp boost/boost/system/error_code.hpp
--- foo/misc/boost.orig/boost/system/error_code.hpp 2015-01-06 17:08:27.000000000 +0100
+++ foo/misc/boost/boost/system/error_code.hpp 2015-08-28 21:47:58.318344217 +0200
@@ -139,7 +139,7 @@
} // namespace errc
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
namespace posix = errc;
namespace posix_error = errc;
# endif
@@ -214,7 +214,7 @@
#endif
// deprecated synonyms --------------------------------------------------//
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
inline const error_category & get_system_category() { return system_category(); }
inline const error_category & get_generic_category() { return generic_category(); }
inline const error_category & get_posix_category() { return generic_category(); }
@@ -394,7 +394,7 @@
};
// predefined error_code object used as "throw on error" tag
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
BOOST_SYSTEM_DECL extern error_code throws;
# endif
diff -ru boost.orig/boost/system/linux_error.hpp boost/boost/system/linux_error.hpp
--- foo/misc/boost.orig/boost/system/linux_error.hpp 2015-01-06 17:08:27.000000000 +0100
+++ foo/misc/boost/boost/system/linux_error.hpp 2015-08-28 21:47:17.172341455 +0200
@@ -89,7 +89,7 @@
};
} // namespace linux_error
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
namespace Linux = linux_error;
# endif
diff -ru boost.orig/boost/system/windows_error.hpp boost/boost/system/windows_error.hpp
--- foo/misc/boost.orig/boost/system/windows_error.hpp 2015-01-06 17:08:27.000000000 +0100
+++ foo/misc/boost/boost/system/windows_error.hpp 2015-08-28 21:46:39.802338946 +0200
@@ -105,7 +105,7 @@
} // namespace windows
-# ifndef BOOST_SYSTEM_NO_DEPRECATED
+# ifdef BOOST_SYSTEM_DEPRECATED
namespace windows = windows_error;
# endif
...@@ -38,7 +38,8 @@ $(call gb_ExternalProject_get_state_target,libebook,build) : ...@@ -38,7 +38,8 @@ $(call gb_ExternalProject_get_state_target,libebook,build) :
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
--disable-werror \ --disable-werror \
--disable-weffc \ --disable-weffc \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED" \
XML_CFLAGS="$(LIBXML_CFLAGS)" \ XML_CFLAGS="$(LIBXML_CFLAGS)" \
XML_LIBS="$(LIBXML_LIBS)" \ XML_LIBS="$(LIBXML_LIBS)" \
REVENGE_GENERATORS_CFLAGS=' ' REVENGE_GENERATORS_LIBS=' ' REVENGE_STREAM_CFLAGS=' ' REVENGE_STREAM_LIBS=' ' \ REVENGE_GENERATORS_CFLAGS=' ' REVENGE_GENERATORS_LIBS=' ' REVENGE_STREAM_CFLAGS=' ' REVENGE_STREAM_LIBS=' ' \
......
...@@ -35,7 +35,8 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) : ...@@ -35,7 +35,8 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) :
--disable-werror \ --disable-werror \
--disable-weffc \ --disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED" \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
&& $(MAKE) \ && $(MAKE) \
) )
......
...@@ -63,7 +63,7 @@ liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG ...@@ -63,7 +63,7 @@ liborcus_CPPFLAGS+=-D_GLIBCXX_DEBUG
endif endif
endif endif
liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) liborcus_CXXFLAGS=$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(CXXFLAGS_CXX11) -DBOOST_SYSTEM_NO_DEPRECATED
liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS) liborcus_LDFLAGS=$(LDFLAGS) $(gb_LTOFLAGS)
ifeq ($(COM),MSC) ifeq ($(COM),MSC)
liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS) liborcus_CXXFLAGS+=$(BOOST_CXXFLAGS)
......
...@@ -33,7 +33,8 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) : ...@@ -33,7 +33,8 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) :
--disable-werror \ --disable-werror \
--disable-weffc \ --disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED" \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
&& $(MAKE) \ && $(MAKE) \
) )
......
...@@ -34,7 +34,8 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) : ...@@ -34,7 +34,8 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) :
--disable-generators \ --disable-generators \
--without-docs \ --without-docs \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost))" \ CXXFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED" \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
&& $(MAKE) \ && $(MAKE) \
......
...@@ -47,6 +47,8 @@ gb_CPPU_ENV := gcc3 ...@@ -47,6 +47,8 @@ gb_CPPU_ENV := gcc3
gb_AFLAGS := $(AFLAGS) gb_AFLAGS := $(AFLAGS)
gb_COMPILERDEFS := \ gb_COMPILERDEFS := \
-DBOOST_ERROR_CODE_HEADER_ONLY \
-DBOOST_SYSTEM_NO_DEPRECATED \
-DCPPU_ENV=$(gb_CPPU_ENV) \ -DCPPU_ENV=$(gb_CPPU_ENV) \
gb_CFLAGS_COMMON := \ gb_CFLAGS_COMMON := \
......
...@@ -44,7 +44,9 @@ endif ...@@ -44,7 +44,9 @@ endif
# like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled) # like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled)
gb_COMPILERDEFS := \ gb_COMPILERDEFS := \
-DBOOST_ERROR_CODE_HEADER_ONLY \
-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \ -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \
-DBOOST_SYSTEM_NO_DEPRECATED \
-D_CRT_NON_CONFORMING_SWPRINTFS \ -D_CRT_NON_CONFORMING_SWPRINTFS \
-D_CRT_NONSTDC_NO_DEPRECATE \ -D_CRT_NONSTDC_NO_DEPRECATE \
-D_CRT_SECURE_NO_DEPRECATE \ -D_CRT_SECURE_NO_DEPRECATE \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment