[Libreoffice-commits] .: 4 commits - configure.in scp2/source set_soenv.in solenv/gbuild solenv/inc

Tor Lillqvist tml at kemper.freedesktop.org
Mon Aug 29 10:40:47 PDT 2011


 configure.in                          |  145 ++++++++++++----------------------
 scp2/source/ooo/common_brand.scp      |   10 --
 scp2/source/ooo/file_library_ooo.scp  |   13 ---
 scp2/source/ooo/module_hidden_ooo.scp |    1 
 scp2/source/ooo/scpaction_ooo.scp     |    4 
 scp2/source/ooo/ure.scp               |   11 --
 set_soenv.in                          |    7 +
 solenv/gbuild/platform/winmingw.mk    |   24 -----
 solenv/inc/wntgcci.mk                 |    4 
 9 files changed, 62 insertions(+), 157 deletions(-)

New commits:
commit 26e9dfea9abee8a53eefcc42a648c06fcff19d49
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Aug 29 18:29:22 2011 +0300

    I don't think we need to explicitly link with libstdc++ and libgcc
    
    Surely these are linked to by default anyway? Is this just old cruft,
    or specific to OOo's use of MinGW on Cygwin, and not needed with a
    modern mingw-w64 cross-compiler? Let's see...

diff --git a/solenv/gbuild/platform/winmingw.mk b/solenv/gbuild/platform/winmingw.mk
index 8c05639..3286d5e 100644
--- a/solenv/gbuild/platform/winmingw.mk
+++ b/solenv/gbuild/platform/winmingw.mk
@@ -44,26 +44,6 @@ gb_AWK := awk
 gb_CLASSPATHSEP := :
 gb_YACC := bison
 gb_RC := $(WINDRES)
-ifeq ($(MINGW_SHARED_GXXLIB),YES)
-gb_MINGW_LIBSTDCPP := $(subst -l,,$(MINGW_SHARED_LIBSTDCPP))
-else
-gb_MINGW_LIBSTDCPP := \
-		stdc++ \
-		moldname
-endif
-ifeq ($(MINGW_SHARED_GCCLIB),YES)
-gb_MINGW_LIBGCC := \
-		gcc_s \
-		gcc
-else
-ifeq ($(MINGW_GCCLIB_EH),YES)
-gb_MINGW_LIBGCC := \
-		gcc \
-		gcc_eh
-else
-gb_MINGW_LIBGCC := gcc
-endif
-endif
 
 gb_OSDEFS := \
 	-DWINVER=0x0500 \
@@ -160,9 +140,7 @@ gb_COMPILERNOOPTFLAGS := -O0
 
 gb_STDLIBS := \
 	mingwthrd \
-	$(gb_MINGW_LIBSTDCPP) \
 	mingw32 \
-	$(gb_MINGW_LIBGCC) \
 	uwinapi \
 	mingwex \
 
@@ -476,8 +454,6 @@ gb_Library_PLAINLIBS_NONE += \
 	mingwthrd \
 	mingw32 \
 	mingwex \
-	$(gb_MINGW_LIBSTDCPP) \
-	$(gb_MINGW_LIBGCC) \
 	advapi32 \
 	crypt32 \
 	d3d9 \
diff --git a/solenv/inc/wntgcci.mk b/solenv/inc/wntgcci.mk
index 38fa79c..24b7e4e 100644
--- a/solenv/inc/wntgcci.mk
+++ b/solenv/inc/wntgcci.mk
@@ -118,11 +118,7 @@ LINKFLAGSPROF=
 LINKFLAGSDEBUG=-g
 LINKFLAGSOPT=
 
-.IF "$(MINGW_SHARED_GXXLIB)"=="YES" && "$(DYNAMIC_CRT)"!=""
-STDLIBCPP=$(MINGW_SHARED_LIBSTDCPP)
-.ELSE
 STDLIBCPP=-lstdc++
-.ENDIF
 UWINAPILIB*=$(DYNAMIC) -luwinapi
 
 .IF "$(MINGW_SHARED_GCCLIB)"=="YES" && "$(DYNAMIC_CRT)"!=""
commit 268cfa5cf4b4aa75daf79a0e3019f37e37746509
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Aug 29 18:27:58 2011 +0300

    Fix MINGW_SHARED_LIBSTDCPP

diff --git a/configure.in b/configure.in
index 0f1e878..286bcca 100755
--- a/configure.in
+++ b/configure.in
@@ -3234,7 +3234,9 @@ using namespace std;
         [   
             MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's at .*DLL Name: @@'`
             if test -n "$MINGW_GXXDLL"; then
-                MINGW_SHARED_LIBSTDCPP=-l${MINGW_GXXDLL%.dll}
+                mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
+                mingw_gxxdll_root=${mingw_gxxdll_root#lib}
+                MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
                 MINGW_SHARED_GXXLIB=YES
                 AC_MSG_RESULT([$MINGW_GXXDLL])
             else
commit 4639374b16b3f9f32ece3e10cb5908b104bf2765
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Aug 29 18:05:23 2011 +0300

    mingwm10.dll is obsolete

diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 6809f74..f176559 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -78,7 +78,6 @@ Module gid_Module_Root_Brand
              gid_Brand_File_Lib_Dbghelp,
              gid_Brand_File_Lib_Mingw_GccS,
              gid_Brand_File_Lib_Mingw_Stdcpp,
-             gid_Brand_File_Lib_Mingwm10,
              gid_Brand_File_Lib_Msvcr80,
              gid_Brand_File_Lib_Msvcp80,
              gid_Brand_File_Lib_Msvcm80,
@@ -780,15 +779,6 @@ End
 #endif
 
 
-#if defined WNT && defined(_gcc3)
-File gid_Brand_File_Lib_Mingwm10
-    BIN_FILE_BODY;
-    Styles = (PACKED);
-    Dir = gid_Brand_Dir_Program;
-    Name = "mingwm10.dll";
-End
-#endif
-
 #if defined(WNT) && defined( _gcc3 )
 
 #if defined(MINGW_GCCDLL)
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index b1ef33b..3ea5298 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -908,19 +908,6 @@ STD_LIB_FILE(gid_File_Lib_ooxml,ooxml)
 
 STD_LIB_FILE(gid_File_Lib_Rtftok,rtftok)
 
-#ifdef WNT
-#if defined(_gcc3)
-
-File gid_File_Lib_Mingwm10
-    BIN_FILE_BODY;
-    Styles = (PACKED);
-    Dir = gid_Dir_Program;
-    Name = "mingwm10.dll";
-End
-
-#endif
-#endif
-
 #if defined(WNT) && defined( _gcc3 )
 
 #if defined(MINGW_GCCDLL)
diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp
index b718738..273f802 100644
--- a/scp2/source/ooo/module_hidden_ooo.scp
+++ b/scp2/source/ooo/module_hidden_ooo.scp
@@ -456,7 +456,6 @@ Module gid_Module_Root_Files_5
     GID_FILE_LIB_WPD,
     gid_File_Lib_Mingw_GccS,
     gid_File_Lib_Mingw_Stdcpp,
-    gid_File_Lib_Mingwm10,
 	gid_File_Lib_Msvcp70,
 	gid_File_Lib_Msvcr70,
 	gid_File_Lib_Ole,
diff --git a/scp2/source/ooo/scpaction_ooo.scp b/scp2/source/ooo/scpaction_ooo.scp
index 768460e..13a1316 100644
--- a/scp2/source/ooo/scpaction_ooo.scp
+++ b/scp2/source/ooo/scpaction_ooo.scp
@@ -52,10 +52,6 @@ ScpAction scp_Copy_Readme_Txt
 End
 
 #if defined(WNT) && defined(_gcc3)
-ScpAction SCP_COPY_MINGWM10
-    Copy = "mingwm10.dll";
-    Name = "mingwm10.dll";
-End
 #if defined(MINGW_GCCDLL)
 ScpAction SCP_COPY_MINGW_GCCS
     Copy = MINGW_GCCDLL;
diff --git a/scp2/source/ooo/ure.scp b/scp2/source/ooo/ure.scp
index 6d61daf..33ea472 100644
--- a/scp2/source/ooo/ure.scp
+++ b/scp2/source/ooo/ure.scp
@@ -910,16 +910,6 @@ File gid_File_Dl_Stdcpp
 End
 #endif
 
-#if (defined WNT && defined _gcc3)
-File gid_File_Lib_Mingwm10_Ure
-    TXT_FILE_BODY;
-    Dir = SCP2_URE_DL_DIR;
-    Name = SCP2_URE_DL_NORMAL("mingwm10");
-    Styles = (PACKED, VERSION_INDEPENDENT_COMP_ID);
-    // CompID = "601FEC1D-8665-4476-9911-83BDCCE83025";
-End
-#endif
-
 #if defined(WNT) && defined( _gcc3 )
 
 #if defined(MINGW_GCCDLL)
@@ -1147,7 +1137,6 @@ Module gid_Module_Root_Ure_Hidden
             gid_File_Dl_Stdcpp,
             gid_File_Lib_Mingw_GccS_Ure,
             gid_File_Lib_Mingw_Stdcpp_Ure,
-            gid_File_Lib_Mingwm10_Ure,
             gid_File_Dl_Unicows,
             gid_File_Dl_Uwinapi,
             gid_File_Lib_Msvcr80_Ure,
commit 5007d5c54381c2f86f0e6a30d7a9931b4793da3b
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Aug 29 17:44:48 2011 +0300

    MinGW cross-compilation improvements
    
    Make sure the MINGW_FOO environment variables get set and propagated
    to the build environment also in the MinGW cross-compilation case. The
    OOo code used to do that for MinGW natively on Windows (under
    Cygwin). (Which we don't intend to support.)
    
    Now, whether the *use* of these variables in the various makefiles etc
    is relevant any more remains to be seen. I suspect all that might well
    be unnecessary, as we after all are capable of cross-build the code
    using MinGW just fine currently with none of these MINGW_FOO being
    set.
    
    One place where at least MINGW_GCCDLL and MINGW_GXXDLL is needed,
    though, is in scp2. We presumably do want to include these DLLs (the
    shared libgcc and libstdc++) in the installation set, to the extent
    the scp2 stuff can be used still in a MinGW cross-build context.

diff --git a/configure.in b/configure.in
index 24993bc..0f1e878 100755
--- a/configure.in
+++ b/configure.in
@@ -1542,12 +1542,14 @@ cygwin*|interix*|mingw32*)
     test_freetype=no
     test_fontconfig=no
     _os=WINNT
-    # Confusingly, if the host OS matches "mingw32*", that means
-    # we are using the MinGW compiler, either natively (unlikely)
-    # or cross-compiling. We use WITH_MINGW to indicate
-    # use of MinGW in both cases.
-    case "$host_os" in
 
+    # If the host OS matches "mingw32*", that means we are using the
+    # MinGW cross-compiler, because we don't see the point in building
+    # LibreOffice using MinGW on Windows. If you want to build on
+    # Windows, use MSVC. If you want to use MinGW, surely you want to
+    # cross-compile (from Linux or some other Unix).
+
+    case "$host_os" in
     mingw32*)
         WITH_MINGW=yes
         if test -z "$CC" ; then
@@ -1683,19 +1685,10 @@ if test $_os != iOS -a $_os != Android; then
     BUILD_TYPE="$BUILD_TYPE DESKTOP"
 fi
 
-if test $build_os = "cygwin"; then
-    dnl ===================================================================
-    dnl If $CC is set to a MinGW compiler, set WITH_MINGW
-    dnl ===================================================================
-    if test "$WITH_MINGW" != "yes" -a -n "$CC" -a "`$CC -dumpmachine 2>/dev/null | $SED -e 's/^.*-//'`" = "mingw32"; then
-        WITH_MINGW="yes"
-    fi
-fi
-
 dnl ===================================================================
 dnl Extra check for Windows. Cygwin builds need gcc to build dmake
-dnl and g++ to build guw.exe although MSVC or MinGW is used to
-dnl build LibreOffice.
+dnl although MSVC is used to build other build-time tools and 
+dnl LibreOffice itself.
 dnl ===================================================================
 if test "build_os" = "cygwin" ; then
     AC_MSG_CHECKING([for Cygwin gcc/g++])
@@ -3169,10 +3162,6 @@ if test "$GXX" = "yes"; then
         if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
             with_gxx_include_path="/usr/include"
         fi
-        if test "$build_os" = "cygwin" -a "$WITH_MINGW" = "yes"; then
-            with_gxx_include_path=`cygpath -d "$with_gxx_include_path"`
-            with_gxx_include_path=`cygpath -u "$with_gxx_include_path"`
-        fi
         if echo $with_gxx_include_path | grep -q linux; then
             # workaround for Mandriva - issue 100049
             with_gxx_include_path=`cd $with_gxx_include_path && pwd`
@@ -3196,22 +3185,13 @@ dnl ===================================================================
 dnl Set the MinGW include directories
 dnl ===================================================================
 if test "$WITH_MINGW" = "yes"; then
-    AC_MSG_CHECKING([for MinGW runtime include path])
+    AC_MSG_CHECKING([for MinGW include path])
     cat >conftest.$ac_ext <<_ACEOF
 #include <stddef.h>
 #include <bits/c++config.h>
 _ACEOF
     _mingw_lib_include_path=`$CXX -E -xc++ conftest.$ac_ext | $SED -n -e '/.*1*"\(.*\)\/stddef.h".*/s//\1/p' -e '/.*1*"\(.*\)\/bits\/c++config.h".*/s//\1/p' | sort -u | xargs echo`
     rm conftest.$ac_ext
-    if test "$build_os" = "cygwin" -a -n "$_mingw_lib_include_path"; then
-        _temp=""
-        for a in $_mingw_lib_include_path
-        do
-            a=`cygpath -d "$a"`
-            _temp="$_temp "`cygpath -u "$a"`
-        done
-        _mingw_lib_include_path=$_temp
-    fi
     if test -z "$_mingw_lib_include_path"; then
         _mingw_lib_include_path="NO_LIB_INCLUDE"
         AC_MSG_RESULT([no MinGW include path])
@@ -3220,72 +3200,55 @@ _ACEOF
     fi
     MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
     AC_SUBST(MINGW_LIB_INCLUDE_PATH)
-    dnl mingw gcc 4.4.0 needs backward in include path to use hash_set/hash_map
-    AC_MSG_CHECKING([for MinGW C++ backward include path])
-    cat >conftest.$ac_ext <<_ACEOF
-#include <hash_set>
-_ACEOF
-    _mingw_backward_include_path=`$CXX -E -xc++ -Wno-deprecated conftest.$ac_ext 2>&5| $SED -n -e '/.*1*"\(.*\)\/hash_set".*/s//\1/p' | sort -u | xargs echo`
-    rm conftest.$ac_ext
-    if test "$build_os" = "cygwin" -a -n "$_mingw_backward_include_path"; then
-        _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path`
-        _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path`
-        AC_MSG_RESULT([$_mingw_backward_include_path])
-    else
-        _mingw_backward_include_path="NO_BACKWARD_INCLUDE"
-        AC_MSG_RESULT([no MinGW C++ backward includes])
-    fi
-    MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path"
-    AC_SUBST(MINGW_BACKWARD_INCLUDE_PATH)
+
     mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
     MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
 
-    # How to do this crack when cross-compiling?
-    AC_MSG_CHECKING([whether to use dynamic libgcc])
-    if test "$build_os" = "cygwin" -a -e "$MINGW_CLIB_DIR/libgcc_s.a"; then
-        AC_MSG_CHECKING([dynamic libgcc name])
-        MINGW_GCCDLL_pattern=`nm $MINGW_CLIB_DIR/libgcc_s.a | $SED -ne 's at .* _libgcc\(.*\)_dll_iname at libgcc\1.dll at p' | uniq | $SED -e 's at _@?@g'`
-        MINGW_GCCDLL=`cd $COMPATH/bin && ls $MINGW_GCCDLL_pattern 2>/dev/null`
-        if test -n "$MINGW_GCCDLL"; then
-            MINGW_SHARED_GCCLIB=YES
-            AC_MSG_RESULT([use $MINGW_GCCDLL])
-        else
-            AC_MSG_RESULT([no])
-        fi
-    else
-        AC_MSG_RESULT([no])
-    fi
-    if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then
-        MINGW_GCCLIB_EH=YES
-    fi
+    AC_LANG_PUSH([C++])
+
+    AC_MSG_CHECKING([for dynamic libgcc])
+    AC_TRY_LINK([
+#include <iostream>
+using namespace std;
+],  
+        [ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ],
+        [   
+            MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's at .*DLL Name: @@'`
+            if test -n "$MINGW_GCCDLL"; then
+                MINGW_SHARED_GCCLIB=YES
+                AC_MSG_RESULT([ $MINGW_GCCDLL])
+            else
+                AC_MSG_ERROR([no])
+            fi
+       ],
+       [ AC_MSG_RESULT([no])
+       ]
+    )
+
+    AC_MSG_CHECKING([for dynamic libstdc++])
+    AC_TRY_LINK([
+#include <iostream>
+using namespace std;
+],  
+        [ cout << "Hello there." << endl; ],
+        [   
+            MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's at .*DLL Name: @@'`
+            if test -n "$MINGW_GXXDLL"; then
+                MINGW_SHARED_LIBSTDCPP=-l${MINGW_GXXDLL%.dll}
+                MINGW_SHARED_GXXLIB=YES
+                AC_MSG_RESULT([$MINGW_GXXDLL])
+            else
+                AC_MSG_ERROR([no])
+            fi
+       ],
+       [ AC_MSG_RESULT([no])
+       ]
+    )
+
+    AC_LANG_POP([C++])
 
-    AC_MSG_CHECKING([whether to use dynamic libstdc++])
-    MINGW_SHARED_LIBSTDCPP=
-    if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then
-        MINGW_SHARED_LIBSTDCPP=stdc++_s
-    fi
-    if test -e "$MINGW_CLIB_DIR/libstdc++.dll.a" ; then
-        MINGW_SHARED_LIBSTDCPP=stdc++.dll
-    fi
-    if test "$build_os" = "cygwin" -a -n "$MINGW_SHARED_LIBSTDCPP" ; then
-        AC_MSG_CHECKING([dynamic libstdc++ name])
-        MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/lib$MINGW_SHARED_LIBSTDCPP.a | sed -ne 's at .* _libstdc__\(.*\)_dll_iname at libstdc++\1.dll at p' | uniq | sed -e 's at _@?@g'`
-        MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null`
-        if test -n "$MINGW_GXXDLL"; then
-            MINGW_SHARED_LIBSTDCPP=-l$MINGW_SHARED_LIBSTDCPP
-            MINGW_SHARED_GXXLIB=YES
-            AC_MSG_RESULT([use $MINGW_GXXDLL])
-        else
-            MINGW_SHARED_LIBSTDCPP=
-            AC_MSG_RESULT([no])
-        fi
-    else
-        AC_MSG_RESULT([no])
-    fi
-    test "$build_os" = "cygwin" && MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR`
     AC_SUBST(MINGW_CLIB_DIR)
     AC_SUBST(MINGW_SHARED_GCCLIB)
-    AC_SUBST(MINGW_GCCLIB_EH)
     AC_SUBST(MINGW_SHARED_GXXLIB)
     AC_SUBST(MINGW_SHARED_LIBSTDCPP)
     AC_SUBST(MINGW_GCCDLL)
diff --git a/set_soenv.in b/set_soenv.in
index b79c70d..2cb9829 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1630,6 +1630,13 @@ elsif ( $platform =~ m/mingw32/ )
 {  ToFile( "NSIS_PATH",         $NSIS_PATH,         "e" );
    ToFile( "DISABLE_ACTIVEX",   "@DISABLE_ACTIVEX@","e" );
    ToFile( "DISABLE_ATL",       "@DISABLE_ATL@",    "e" );
+   ToFile( "MINGW_CLIB_DIR",    "@MINGW_CLIB_DIR@", "e" );
+   ToFile( "MINGW_SHARED_GCCLIB", "@MINGW_SHARED_GCCLIB@", "e" );
+   ToFile( "MINGW_SHARED_GXXLIB", "@MINGW_SHARED_GXXLIB@", "e" );
+   ToFile( "MINGW_SHARED_LIBSTDCPP", "@MINGW_SHARED_LIBSTDCPP@", "e" );
+   ToFile( "MINGW_GCCDLL",      "@MINGW_GCCDLL@",   "e" );
+   ToFile( "MINGW_GXXDLL",      "@MINGW_GXXDLL@",   "e" );
+
 }
 
 if ("@WITH_VC_REDIST@" eq "TRUE") {


More information about the Libreoffice-commits mailing list