From caf437c22a8616fd2a4f6512dbc9a036ad3b984b Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Tue, 17 Mar 2015 15:04:43 +0000 Subject: Unbreak editors/openoffice-4 and editors/openoffice-devel on systems where clang is the base compiler. The issue was that these ports would only successfully build with gcc and libstdc++, so they specified USE_GCC=yes, but they linked to other C++ ports that were compiled with clang, which brought in libc++. The conflict between libstdc++ and libc++ caused the application to crash whenever an operation that popped up a dialog box was attempted. Thanks to dim@ for helping me track this down. The fix is to patch various bits of the openoffice souce to allow it to be built with clang on systems where the C++ dependencies are also compiled with clang. [1] Add a CUPS option so that CUPS can be disabled [2]. Register print/cups-client as a LIB_DEPENDS when CUPS is enabled. pkg-message claims that user settings are stored in ~/.openoffice,org4, whereas all other platforms seem to use ~/.openoffice.org/4 (or equivalent), and both openoffice-4 and openoffice-devel actually use ~/.openoffice.org-devel/4. The addition of -devel to the location happened with r325370. The / appears to have been introduced in r297259. Change the location match other platforms. Introduce a new variable ${AOOUDIR} so that the actual location and pkg-message stay in sync. Rename ${OOOTAG} to ${AOOTAG} and restore its value so that it can once again be substituted into pkg-message. It has not been set since r296269. Various Makefile cleanups: * Gather and sort USE_* * Simplify use of ${REINPLACE_CMD} * --x-includes and --x-libraries are automatically passed to configure, which ignores them * Get rid of unnecessary include of bsd.port.options.mk PR: 188088 [1] PR: 198458 [2] Differential Revision: https://reviews.freebsd.org/D2055 Reviewed by: pfg Approved by: mat (mentor) --- ...source_cpp__uno_gcc3__freebsd__intel_except.cxx | 11 ++++ ..._source_cpp__uno_gcc3__freebsd__intel_share.hxx | 67 ++++++++++++++++++++++ ...ource_cpp__uno_gcc3__freebsd__intel_uno2cpp.cxx | 14 +++++ ...ource_cpp__uno_gcc3__freebsd__x86-64_except.cxx | 11 ++++ ...source_cpp__uno_gcc3__freebsd__x86-64_share.hxx | 67 ++++++++++++++++++++++ ...urce_cpp__uno_gcc3__freebsd__x86-64_uno2cpp.cxx | 14 +++++ editors/openoffice-devel/files/patch-freebsd.mk | 14 ++++- ...unix_sysshell_recently__used__file__handler.cxx | 10 ++++ editors/openoffice-devel/files/patch-unxfbsd.mk | 33 ++++++++--- editors/openoffice-devel/files/pkg-message.in | 8 +-- 10 files changed, 235 insertions(+), 14 deletions(-) create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_except.cxx create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_share.hxx create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_uno2cpp.cxx create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_except.cxx create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_share.hxx create mode 100644 editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_uno2cpp.cxx create mode 100644 editors/openoffice-devel/files/patch-shell_source_unix_sysshell_recently__used__file__handler.cxx (limited to 'editors/openoffice-devel/files') diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_except.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_except.cxx new file mode 100644 index 000000000000..098e7c168b03 --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_except.cxx @@ -0,0 +1,11 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx.orig 2014-09-19 17:51:13 UTC ++++ bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx +@@ -24,7 +24,7 @@ + // MARKER(update_precomp.py): autogen include statement, do not remove + #include "precompiled_bridges.hxx" + +-#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) ++#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || defined(__clang__) + #include + #endif + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_share.hxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_share.hxx new file mode 100644 index 000000000000..534898c4061d --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_share.hxx @@ -0,0 +1,67 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx.orig 2014-09-19 17:51:12 UTC ++++ bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx +@@ -26,6 +26,11 @@ + #include + #include + #include ++#ifndef __GLIBCXX__ ++#include ++ ++using namespace ::__cxxabiv1; ++#endif /* ! __GLIBCXX__ */ + + namespace CPPU_CURRENT_NAMESPACE + { +@@ -34,6 +39,7 @@ void dummy_can_throw_anything( char cons + + // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h + ++#ifdef __GLIBCXX__ + struct _Unwind_Exception + { + unsigned exception_class __attribute__((__mode__(__DI__))); +@@ -63,11 +69,13 @@ struct __cxa_exception + _Unwind_Exception unwindHeader; + }; + ++#endif /* __GLIBCXX__ */ + extern "C" void *__cxa_allocate_exception( + std::size_t thrown_size ) throw(); + extern "C" void __cxa_throw ( + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); + ++#ifdef __GLIBCXX__ + struct __cxa_eh_globals + { + __cxa_exception *caughtExceptions; +@@ -75,6 +83,7 @@ struct __cxa_eh_globals + }; + extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); + ++#endif /* __GLIBCXX__ */ + // ----- + + //================================================================================================== +@@ -84,3 +93,22 @@ void raiseException( + void fillUnoException( + __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); + } ++#ifndef __GLIBCXX__ ++ ++class __class_type_info : public std::type_info ++{ ++public: ++ explicit __class_type_info( const char* pRttiName) ++ : std::type_info( pRttiName) ++ {} ++}; ++ ++class __si_class_type_info : public __class_type_info ++{ ++ const __class_type_info* mpBaseType; ++public: ++ explicit __si_class_type_info( const char* pRttiName, __class_type_info* pBaseType) ++ : __class_type_info( pRttiName), mpBaseType( pBaseType) ++ {} ++}; ++#endif /* ! __GLIBCXX__ */ diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_uno2cpp.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_uno2cpp.cxx new file mode 100644 index 000000000000..289424d7bbcc --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__intel_uno2cpp.cxx @@ -0,0 +1,14 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx.orig 2014-09-19 17:51:13 UTC ++++ bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx +@@ -305,7 +305,11 @@ static void cpp_call( + catch (...) + { + // fill uno exception ++#ifndef __GLIBCXX__ ++ CPPU_CURRENT_NAMESPACE::fillUnoException( __cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); ++#else /* __GLIBCXX__ */ + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); ++#endif /* __GLIBCXX__ */ + + // temporary params + for ( ; nTempIndizes--; ) diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_except.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_except.cxx new file mode 100644 index 000000000000..b463e756b8a0 --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_except.cxx @@ -0,0 +1,11 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx.orig 2014-09-19 17:51:13 UTC ++++ bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx +@@ -24,7 +24,7 @@ + // MARKER(update_precomp.py): autogen include statement, do not remove + #include "precompiled_bridges.hxx" + +-#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) ++#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || defined(__clang__) + #include + #endif + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_share.hxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_share.hxx new file mode 100644 index 000000000000..a1e9fa3855fb --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_share.hxx @@ -0,0 +1,67 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx.orig 2014-09-19 10:51:12.000000000 -0700 ++++ bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx 2015-03-13 09:58:02.000000000 -0700 +@@ -26,6 +26,11 @@ + #include + #include + #include ++#ifndef __GLIBCXX__ ++#include ++ ++using namespace ::__cxxabiv1; ++#endif /* ! __GLIBCXX__ */ + + namespace CPPU_CURRENT_NAMESPACE + { +@@ -34,6 +39,7 @@ + + // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h + ++#ifdef __GLIBCXX__ + struct _Unwind_Exception + { + unsigned exception_class __attribute__((__mode__(__DI__))); +@@ -63,11 +69,13 @@ + _Unwind_Exception unwindHeader; + }; + ++#endif /* __GLIBCXX__ */ + extern "C" void *__cxa_allocate_exception( + std::size_t thrown_size ) throw(); + extern "C" void __cxa_throw ( + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); + ++#ifdef __GLIBCXX__ + struct __cxa_eh_globals + { + __cxa_exception *caughtExceptions; +@@ -75,6 +83,7 @@ + }; + extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); + ++#endif /* __GLIBCXX__ */ + // ----- + + //================================================================================================== +@@ -84,3 +93,22 @@ + void fillUnoException( + __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); + } ++#ifndef __GLIBCXX__ ++ ++class __class_type_info : public std::type_info ++{ ++public: ++ explicit __class_type_info( const char* pRttiName) ++ : std::type_info( pRttiName) ++ {} ++}; ++ ++class __si_class_type_info : public __class_type_info ++{ ++ const __class_type_info* mpBaseType; ++public: ++ explicit __si_class_type_info( const char* pRttiName, __class_type_info* pBaseType) ++ : __class_type_info( pRttiName), mpBaseType( pBaseType) ++ {} ++}; ++#endif /* ! __GLIBCXX__ */ diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_uno2cpp.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_uno2cpp.cxx new file mode 100644 index 000000000000..736f9dc61f76 --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__x86-64_uno2cpp.cxx @@ -0,0 +1,14 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx.orig 2014-09-19 10:51:13.000000000 -0700 ++++ bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx 2015-03-13 09:48:24.000000000 -0700 +@@ -446,7 +446,11 @@ + catch (...) + { + // fill uno exception ++#ifndef __GLIBCXX__ ++ CPPU_CURRENT_NAMESPACE::fillUnoException( __cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); ++#else /* __GLIBCXX__ */ + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); ++#endif /* __GLIBCXX__ */ + + // temporary params + for ( ; nTempIndizes--; ) diff --git a/editors/openoffice-devel/files/patch-freebsd.mk b/editors/openoffice-devel/files/patch-freebsd.mk index 427de633d0a4..ae9ea3630f0c 100644 --- a/editors/openoffice-devel/files/patch-freebsd.mk +++ b/editors/openoffice-devel/files/patch-freebsd.mk @@ -1,6 +1,14 @@ ---- solenv/gbuild/platform/freebsd.mk 2012-10-31 10:39:44.000000000 +0900 -+++ solenv/gbuild/platform/freebsd.mk 2012-10-31 17:40:48.000000000 +0900 -@@ -121,6 +121,7 @@ +--- solenv/gbuild/platform/freebsd.mk.orig 2014-09-19 18:16:41 UTC ++++ solenv/gbuild/platform/freebsd.mk +@@ -96,6 +96,7 @@ gb_CXXFLAGS := \ + -fvisibility-inlines-hidden \ + -fvisibility=hidden \ + -pipe \ ++ %%HAVE_STL_INCLUDE_PATH%% \ + + ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) + gb_CFLAGS_WERROR := -Werror +@@ -121,6 +122,7 @@ gb_LinkTarget_LDFLAGS += \ -Wl,-z,combreloc \ -Wl,-z,defs \ $(subst -L../lib , ,$(SOLARLIB)) \ diff --git a/editors/openoffice-devel/files/patch-shell_source_unix_sysshell_recently__used__file__handler.cxx b/editors/openoffice-devel/files/patch-shell_source_unix_sysshell_recently__used__file__handler.cxx new file mode 100644 index 000000000000..369459efe9a2 --- /dev/null +++ b/editors/openoffice-devel/files/patch-shell_source_unix_sysshell_recently__used__file__handler.cxx @@ -0,0 +1,10 @@ +--- shell/source/unix/sysshell/recently_used_file_handler.cxx.orig 2014-09-19 18:15:07 UTC ++++ shell/source/unix/sysshell/recently_used_file_handler.cxx +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + namespace /* private */ { + //######################################## diff --git a/editors/openoffice-devel/files/patch-unxfbsd.mk b/editors/openoffice-devel/files/patch-unxfbsd.mk index 55a159337693..ad4194f9b1e0 100644 --- a/editors/openoffice-devel/files/patch-unxfbsd.mk +++ b/editors/openoffice-devel/files/patch-unxfbsd.mk @@ -1,13 +1,32 @@ ---- solenv/inc/unxfbsd.mk~ 2012-10-31 10:39:44.000000000 +0900 -+++ solenv/inc/unxfbsd.mk 2012-10-31 17:42:59.000000000 +0900 -@@ -80,14 +80,14 @@ +--- solenv/inc/unxfbsd.mk.orig 2014-09-19 18:16:56 UTC ++++ solenv/inc/unxfbsd.mk +@@ -27,7 +27,7 @@ ASM= + AFLAGS= + + SOLAR_JAVA*= +-PICSWITCH*:=-fpic ++PICSWITCH*:=-fPIC + JAVAFLAGSDEBUG=-g + + # Include arch specific makefile. +@@ -49,7 +49,7 @@ JAVAFLAGSDEBUG=-g + #LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter" + + # _PTHREADS is needed for the stl +-CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450 ++CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 %%HAVE_STL_INCLUDE_PATH%% + + # enable visibility define in "sal/types.h" + .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" +@@ -86,14 +86,14 @@ CFLAGSENABLESYMBOLS=-g # was temporarily .ENDIF # flags for the C++ Compiler -CFLAGSCC= -pipe $(ARCH_FLAGS) +CFLAGSCC= -pipe $(ARCH_FLAGS) %%RPATH%% # Flags for enabling exception handling - CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs +-CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs ++CFLAGSEXCEPTIONS=-fexceptions # Flags for disabling exception handling CFLAGS_NO_EXCEPTIONS=-fno-exceptions @@ -17,9 +36,9 @@ .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" CFLAGSCXX += -fvisibility-inlines-hidden .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" -@@ -145,7 +145,7 @@ - LINKFLAGSRUNPATH_OXT= - LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\' +@@ -156,7 +156,7 @@ LINKFLAGSRUNPATH_OXT= + LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' + #LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\' LINKFLAGSRUNPATH_NONE= -LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE) +LINKFLAGS=-Wl,-z,combreloc %%RPATH%% $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE) diff --git a/editors/openoffice-devel/files/pkg-message.in b/editors/openoffice-devel/files/pkg-message.in index 5d4f68bb1a37..cb3cab509d72 100644 --- a/editors/openoffice-devel/files/pkg-message.in +++ b/editors/openoffice-devel/files/pkg-message.in @@ -1,9 +1,9 @@ -Apache OpenOffice Build %%OOOTAG%% Personal Install How-To +Apache OpenOffice Build %%AOOTAG%% Personal Install How-To Written by: Martin Blapp and Maho Nakata -Apache OpenOffice %%OOOTAG%% will soon been installed in +Apache OpenOffice %%AOOTAG%% will soon be installed in %%PREFIX%%/%%EXECBASE%% 1. User installation @@ -11,7 +11,7 @@ Apache OpenOffice %%OOOTAG%% will soon been installed in Just type "%%EXECBASE%%" after you have successfully installed the package. If there is no installed OO.org dir -in your homedir, the setup installs ".%%OOODIR%%" folder. +in your homedir, the setup installs "%%AOOUDIR%%" folder. 2. Starting OO.org ------------------ @@ -35,5 +35,5 @@ OO.org does need $LANG to be set to a suitable value. 3. If you run into problems -------------------------------------------------- If you somehow run into problems, please remove the already -installed ".%%OOODIR%%" dir in your homedir. Redo the user +installed "%%AOOUDIR%%" dir in your homedir. Redo the user installation and the problems should go away. -- cgit v1.2.3