[Libreoffice-commits] core.git: 3 commits - config_host.mk.in configure.ac lpsolve/lp_solve_5.5.patch nss/ExternalProject_nss.mk nss/nss.patch

Tor Lillqvist tml at iki.fi
Wed Jun 26 04:25:16 PDT 2013


 config_host.mk.in          |    1 
 configure.ac               |   56 +++++++++++++++++++++++++++++----------------
 lpsolve/lp_solve_5.5.patch |    3 +-
 nss/ExternalProject_nss.mk |    2 -
 nss/nss.patch              |   19 +++++++++++++++
 5 files changed, 60 insertions(+), 21 deletions(-)

New commits:
commit 1365a4d281f969e8cd3833422b2d771621d40245
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jun 26 13:41:36 2013 +0300

    Need to use the right libtool on OS X
    
    Change-Id: I37b2a892143892740674ce9882ed61ea88eda894

diff --git a/config_host.mk.in b/config_host.mk.in
index 1ce8618..c0f4e6b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -302,6 +302,7 @@ export LIBPNG_CFLAGS=$(gb_SPACE)@LIBPNG_CFLAGS@
 export LIBPNG_LIBS=$(gb_SPACE)@LIBPNG_LIBS@
 export LIBREPOSITORY_JAR=@LIBREPOSITORY_JAR@
 export LIBSERIALIZER_JAR=@LIBSERIALIZER_JAR@
+export LIBTOOL=@LIBTOOL@
 export LIBXML_CFLAGS=$(gb_SPACE)@LIBXML_CFLAGS@
 export LIBXML_JAR=@LIBXML_JAR@
 export LIBXML_LIBS=$(gb_SPACE)@LIBXML_LIBS@
diff --git a/configure.ac b/configure.ac
index cfe2023..1e1108f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2591,6 +2591,7 @@ if test $_os = Darwin; then
     fi
 
     # If no CC and CXX environment vars, try to guess where the compiler is
+    LIBTOOL=libtool
     if test -z "$save_CC"; then
         AC_MSG_CHECKING([what compiler to use])
         case $with_macosx_sdk in
@@ -2604,6 +2605,7 @@ if test $_os = Darwin; then
                 CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
                 CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
             fi
+            LIBTOOL=libtool
             ;;
         10.7|10.8|10.9)
             if test "$enable_libc__" = yes -a "$with_macosx_version_min_required" != 10.6; then
@@ -2619,6 +2621,7 @@ if test $_os = Darwin; then
             CXX="`xcrun -find clang++` $bitness $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
             XCRUN=xcrun
             AR=`xcrun -find ar`
+            LIBTOOL=`xcrun -find libtool`
             RANLIB=`xcrun -find ranlib`
             ;;
         esac
@@ -2715,6 +2718,7 @@ AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
 AC_SUBST(XCRUN)
+AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
 AC_SUBST(ENABLE_MACOSX_SANDBOX)
 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
@@ -2761,6 +2765,7 @@ if test $_os = iOS; then
     CXX="`xcrun -find clang++` -arch $arch -isysroot $sysroot $lto $versionmin"
     XCRUN=xcrun
     AR=`xcrun -find ar`
+    LIBTOOL=`xcrun -find libtool`
     RANLIB=`xcrun -find ranlib`
 fi
 
diff --git a/lpsolve/lp_solve_5.5.patch b/lpsolve/lp_solve_5.5.patch
index 7f976f0..124fed8 100644
--- a/lpsolve/lp_solve_5.5.patch
+++ b/lpsolve/lp_solve_5.5.patch
@@ -87,7 +87,8 @@
  
 -$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
 +$c $extra_cflags -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $extra_cdefs $src
- libtool -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
+-libtool -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
++$LIBTOOL -static -o liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
  
  if [ "$so" != "" ]
  then
commit 673205080eee4c6ce20375c9a28b5dc34d3c5475
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jun 26 13:24:27 2013 +0300

    Make sure the nss build uses the ar and ranlib we want
    
    The interaction of environment variables and make variables is fun.
    
    For some reason, the
    workdir/.../UnpackedTarball/nss/mozilla/nsprpub/configure script is
    run twice: Once directly from nss/ExternalProject_nss.mk, once from
    the sub-make run from nss/ExternalProject_nss.mk. In the first case,
    the AR and RANLIB exported by the gbuild make process propagate just
    fine to the configure script. In the latter case, not. So add AR and
    RANLIB assignments on the sub-make command line (to override values
    set in some of the nss makefiles), *and* make sure the sub-make
    exports AR and RANLIB.
    
    Change-Id: Ibd55bc8a7e001106e12b2207500e74c7bd01c73a

diff --git a/nss/ExternalProject_nss.mk b/nss/ExternalProject_nss.mk
index 8a1d489..f907154 100644
--- a/nss/ExternalProject_nss.mk
+++ b/nss/ExternalProject_nss.mk
@@ -71,7 +71,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject
 		$(if $(filter YES,$(CROSS_COMPILING)),\
 		NSINSTALL="$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/nss/nsinstall.py") \
 		NSDISTMODE=copy \
-		$(MAKE) -j1 nss_build_all \
+		$(MAKE) -j1 AR=$(AR) RANLIB=$(RANLIB) nss_build_all \
 		$(if $(filter MACOSX,$(OS)),&& $(PERL) \
 			$(SOLARENV)/bin/macosx-change-install-names.pl shl OOO \
 			$(gb_Package_SOURCEDIR_nss)/mozilla/dist/out/lib/libfreebl3.dylib \
diff --git a/nss/nss.patch b/nss/nss.patch
index aa714a4..e2d7d76 100644
--- a/nss/nss.patch
+++ b/nss/nss.patch
@@ -138,6 +138,25 @@
  #
  # Define USE_DEBUG_RTL if you want to use the debug runtime library
  # (RTL) in the debug build
+--- misc/nss-3.13.5/mozilla/security/coreconf/rules.mk
++++ misc/build/nss-3.13.5/mozilla/security/coreconf/rules.mk
+@@ -293,7 +293,7 @@
+ ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
+ 	$(AR) $(subst /,\\,$(OBJS))
+ else
+-	$(AR) $(OBJS)
++	$(AR) cr $@ $(OBJS)
+ endif
+ 	$(RANLIB) $@
+ 
+--- misc/nss-3.13.5/mozilla/security/nss/Makefile
++++ misc/build/nss-3.13.5/mozilla/security/nss/Makefile
+@@ 1,0 +1,0 @@
++export AR
++export RANLIB
+ #! gmake
+ #
+ # ***** BEGIN LICENSE BLOCK *****
 --- misc/nss-3.13.5/mozilla/security/nss/cmd/platlibs.mk	2010-02-04 19:59:10.000000000 +0100
 +++ misc/build/nss-3.13.5/mozilla/security/nss/cmd/platlibs.mk	2010-06-11 16:35:55.004869805 +0200
 @@ -41,27 +41,32 @@
commit c8238341068195827abefc0118a562b4956d5d56
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Jun 25 20:28:05 2013 +0300

    Experiment with LTO for OS X and iOS, too
    
    With Clang, LTO means compiling to LLVM intermediate representation
    instead of object code, and optimisation and code generation at link
    time.
    
    As expected, linking the single executable for the iOS experimental
    app takes quite some time (several hours), and in fact it eventually
    fails. Hopefully better luck on OS X.
    
    Need to use xcrun to find the right ar and ranlib, too, from the
    Xcode toolchain being used.
    
    Change-Id: Iee69397c57bf1d622882ad78c188e1734f6cbd63

diff --git a/configure.ac b/configure.ac
index 765a973..cfe2023 100644
--- a/configure.ac
+++ b/configure.ac
@@ -850,9 +850,11 @@ AC_ARG_ENABLE(linkoo,
 AC_ARG_ENABLE(lto,
     AS_HELP_STRING([--enable-lto],
         [Enable link-time optimization. Suitable for product builds.
-         Building takes longer but libraries are optimized for speed.
-         (possible only with gcc-4.5 or later,
-          better to use gcc-4.6 and 'gold' as linker)]))
+         Building takes longer but libraries and executables are optimized for speed.
+         (For GCC, best to use GCC 4.6 or later and 'gold' linker.
+          Also possible for Clang.
+          Experimental work in progress,
+          don't use unless you are working on this.)]))
 
 AC_ARG_ENABLE(crashdump,
     AS_HELP_STRING([--enable-crashdump],
@@ -2384,6 +2386,18 @@ if test "$COMPATH" = "."; then
 fi
 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
 
+# Set the ENABLE_LTO variable
+# ===================================================================
+AC_MSG_CHECKING([whether to use link-time optimization])
+if test -n "$enable_lto" -a "$enable_lto" != "no"; then
+    ENABLE_LTO="TRUE"
+    AC_MSG_RESULT([yes])
+else
+    ENABLE_LTO=""
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_LTO)
+
 dnl ===================================================================
 dnl  Test the Solaris compiler version
 dnl ===================================================================
@@ -2598,9 +2612,14 @@ if test $_os = Darwin; then
                 stdlib="-std=c++11 -stdlib=libc++"
                 CPP_LIBRARY="LIBCPP"
             fi
-            CC="`xcrun -find clang` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
-            CXX="`xcrun -find clang++` $bitness $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
+            if test "$ENABLE_LTO" = TRUE; then
+                lto=-flto
+            fi
+            CC="`xcrun -find clang` $bitness $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
+            CXX="`xcrun -find clang++` $bitness $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
             XCRUN=xcrun
+            AR=`xcrun -find ar`
+            RANLIB=`xcrun -find ranlib`
             ;;
         esac
         AC_MSG_RESULT([$CC and $CXX])
@@ -2735,8 +2754,14 @@ if test $_os = iOS; then
 
     AC_MSG_RESULT($sysroot)
 
-    CXX="$xcode_developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch $arch -isysroot $sysroot $versionmin"
-    CC="$xcode_developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch $arch -isysroot $sysroot $versionmin"
+    if test "$ENABLE_LTO" = TRUE; then
+        lto=-flto
+    fi
+    CC="`xcrun -find clang` -arch $arch -isysroot $sysroot $lto $versionmin"
+    CXX="`xcrun -find clang++` -arch $arch -isysroot $sysroot $lto $versionmin"
+    XCRUN=xcrun
+    AR=`xcrun -find ar`
+    RANLIB=`xcrun -find ranlib`
 fi
 
 AC_MSG_CHECKING([whether to treat the installation as read-only])
@@ -4333,18 +4358,6 @@ else
 fi
 AC_SUBST(DISABLE_LINKOO)
 
-# Set the ENABLE_LTO variable
-# ===================================================================
-AC_MSG_CHECKING([whether to use link-time optimization])
-if test -n "$enable_lto" -a "$enable_lto" != "no"; then
-    ENABLE_LTO="TRUE"
-    AC_MSG_RESULT([yes])
-else
-    ENABLE_LTO=""
-    AC_MSG_RESULT([no])
-fi
-AC_SUBST(ENABLE_LTO)
-
 if test "$enable_headless" = "yes"; then
     # be sure to do not mess with uneeded stuff
     test_randr=no


More information about the Libreoffice-commits mailing list