[Libreoffice-commits] core.git: 2 commits - config_host.mk.in configure.ac odk/config odk/CustomTarget_build-examples.mk odk/Module_odk.mk odk/settings

Stephan Bergmann sbergman at redhat.com
Wed Feb 1 14:16:56 UTC 2017


 config_host.mk.in                  |    1 +
 configure.ac                       |   10 +++++++---
 odk/CustomTarget_build-examples.mk |    2 +-
 odk/Module_odk.mk                  |    2 +-
 odk/config/configure.pl            |   27 +++++++++++----------------
 odk/config/setsdkenv_unix.sh.in    |    4 +---
 odk/settings/settings.mk           |    3 ---
 odk/settings/std.mk                |    8 ++++----
 8 files changed, 26 insertions(+), 31 deletions(-)

New commits:
commit c14b9630a9f2be95d8c55c253e516f3acd7ccf78
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Feb 1 15:15:57 2017 +0100

    Adapt CustomTarget_odk/build-examples to macOS
    
    Change-Id: Ib64d5b5fa1bf13a484adb296b969d1b96387f0c6

diff --git a/config_host.mk.in b/config_host.mk.in
index 1ddf49d..c577e4c 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -280,6 +280,7 @@ export INSTALL_NAME_TOOL=@INSTALL_NAME_TOOL@
 export INSTDIR=@INSTDIR@
 export INSTDIR_FOR_BUILD=@INSTDIR_FOR_BUILD@
 export INSTROOT=@INSTROOT@
+export INSTROOTBASE=@INSTROOTBASE@
 export INSTROOT_FOR_BUILD=@INSTROOT_FOR_BUILD@
 export IWYU_PATH=@IWYU_PATH@
 export JAVACOMPILER=@JAVACOMPILER@
diff --git a/configure.ac b/configure.ac
index 93896d7..8a825d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -622,7 +622,8 @@ DLLPOST=".so"
 
 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
 
-INSTROOTSUFFIX=
+INSTROOTBASESUFFIX=
+INSTROOTCONTENTSUFFIX=
 SDKDIRNAME=sdk
 
 case "$host_os" in
@@ -742,7 +743,8 @@ darwin*) # Mac OS X or iOS
             mac_sanitize_path
             AC_MSG_NOTICE([sanitized the PATH to $PATH])
         fi
-        INSTROOTSUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app/Contents
+        INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
+        INSTROOTCONTENTSUFFIX=/Contents
         SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
     fi
     enable_systray=no
@@ -4492,7 +4494,8 @@ AC_SUBST(ENABLE_HEADLESS)
 
 WORKDIR="${BUILDDIR}/workdir"
 INSTDIR="${BUILDDIR}/instdir"
-INSTROOT="${INSTDIR}${INSTROOTSUFFIX}"
+INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
+INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
 SOLARINC="-I. -I$SRC_ROOT/include $SOLARINC"
 AC_SUBST(COM)
 AC_SUBST(CPUNAME)
@@ -4502,6 +4505,7 @@ AC_SUBST(EPM_FLAGS)
 AC_SUBST(USING_X11)
 AC_SUBST([INSTDIR])
 AC_SUBST([INSTROOT])
+AC_SUBST([INSTROOTBASE])
 AC_SUBST(OS)
 AC_SUBST(P_SEP)
 AC_SUBST(WORKDIR)
diff --git a/odk/CustomTarget_build-examples.mk b/odk/CustomTarget_build-examples.mk
index 7a1b490..27f0158 100644
--- a/odk/CustomTarget_build-examples.mk
+++ b/odk/CustomTarget_build-examples.mk
@@ -107,7 +107,7 @@ $(call gb_CustomTarget_get_workdir,odk/build-examples)/setsdkenv: \
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
 	sed -e 's!@OO_SDK_NAME@!sdk!' \
         -e 's!@OO_SDK_HOME@!$(INSTDIR)/$(SDKDIRNAME)!' \
-        -e 's!@OFFICE_HOME@!$(INSTDIR)!' -e 's!@OO_SDK_MAKE_HOME@!!' \
+        -e 's!@OFFICE_HOME@!$(INSTROOTBASE)!' -e 's!@OO_SDK_MAKE_HOME@!!' \
         -e 's!@OO_SDK_ZIP_HOME@!!' -e 's!@OO_SDK_CAT_HOME@!!' \
         -e 's!@OO_SDK_SED_HOME@!!' -e 's!@OO_SDK_CPP_HOME@!!' \
         -e 's!@OO_SDK_JAVA_HOME@!$(JAVA_HOME)!' \
diff --git a/odk/Module_odk.mk b/odk/Module_odk.mk
index 1d7187e..a72102c 100644
--- a/odk/Module_odk.mk
+++ b/odk/Module_odk.mk
@@ -56,7 +56,7 @@ $(eval $(call gb_Module_add_check_targets,odk,\
 	CustomTarget_check \
 ))
 
-ifeq ($(OS),LINUX)
+ifneq ($(filter $(OS),LINUX MACOSX),)
 $(eval $(call gb_Module_add_subsequentcheck_targets,odk, \
     CustomTarget_build-examples \
 ))
commit c306c444bfd3d0984741fd99ed4f29016ef14ee2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Feb 1 14:53:19 2017 +0100

    Also on macOS use JDK's .../Home/bin/javac etc.
    
    Only on macOS, the SDK used to expect javac etc. in a Commands sub-dir (which
    Apple's JDK 1.6.0 has but Oracle's JDK 1.8.x don't).  However, at least both
    Apple's latest JDK 1.6.0 (as available via <https://support.apple.com/kb/DL1572>
    "Download Java for OS X 2015-001") and any recent Oracle JDK 1.8.x (like
    jdk1.8.0_121.jdk) have a Home sub-dir that contains a "standard" sub-tree with
    bin sub-dir etc., like on other platforms.  So consistently make the SDK use
    that instead.
    
    This removes the JAVABIN Make variable from settings.mk.  It is assumed to not
    be used by client code.
    
    Change-Id: Ie0ad647f489528444dfd399c2f00500b772d3288

diff --git a/odk/config/configure.pl b/odk/config/configure.pl
index c9505dc..bc56d87 100755
--- a/odk/config/configure.pl
+++ b/odk/config/configure.pl
@@ -74,11 +74,6 @@ $main::cppVersion = "4.0.1";
 $main::OO_SDK_CPP_HOME_SUGGESTION = searchprog($main::cppName);
 
 $main::OO_SDK_JAVA_HOME = "";
-$main::OO_SDK_JAVA_BIN_DIR = "bin";
-if ( $main::operatingSystem =~ m/darwin/ )
-{
-    $main::OO_SDK_JAVA_BIN_DIR="Commands";
-}
 $main::OO_SDK_JAVA_HOME_SUGGESTION = searchprog("javac");
 $main::javaVersion = "1.5.0_01";
 
@@ -387,8 +382,8 @@ while ( (!$main::correctVersion) &&
 # prepare Java path
 $main::correctVersion = 0;
 
-# prepare Java suggestion (cut bin or Commands directory to be in the root of the Java SDK)
-$main::offset = rindex($main::OO_SDK_JAVA_HOME_SUGGESTION, "/$main::OO_SDK_JAVA_BIN_DIR");
+# prepare Java suggestion (cut bin directory to be in the root of the Java SDK)
+$main::offset = rindex($main::OO_SDK_JAVA_HOME_SUGGESTION, "/bin");
 if ( $main::offset != -1 )
 {
     $main::OO_SDK_JAVA_HOME_SUGGESTION = substr($main::OO_SDK_JAVA_HOME_SUGGESTION, 0, $main::offset);
@@ -396,7 +391,7 @@ if ( $main::offset != -1 )
 
 while ( (!$main::correctVersion) &&
         ((! -d "$main::OO_SDK_JAVA_HOME" ) ||
-         ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac"))) )
+         ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/bin/javac"))) )
 {
     print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory  (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: ";
     $main::OO_SDK_JAVA_HOME = readStdIn();
@@ -408,9 +403,9 @@ while ( (!$main::correctVersion) &&
     if ( ! $main::OO_SDK_JAVA_HOME eq "" )
     {
         if ( (! -d "$main::OO_SDK_JAVA_HOME") ||
-             ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) )
+             ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/bin/javac")) )
         {
-            print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n";
+            print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/bin/javac'.\n";
             if ( skipChoice("JAVA SDK") == 1 )
             {
                 $main::correctVersion = 1;
@@ -419,10 +414,10 @@ while ( (!$main::correctVersion) &&
         } else
         {
             #check version
-            my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
+            my $testVersion = `$main::OO_SDK_JAVA_HOME/bin/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
             $testVersion =~ s#([^\n]+)\n#$1#go;
 
-            $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1);
+            $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/bin/java", 1);
             if ( !$main::correctVersion )
             {
                 if ( skipChoice("JAVA SDK") == 1 )
@@ -559,17 +554,17 @@ sub searchprog
         if ( $main::operatingSystem =~ m/darwin/ ) {
             $progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK");
 
-            if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
+            if ( -e "$progDir/Home/bin/javac" )
             {
-                return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
+                return "$progDir/Home/bin";
             }
         }
 
         if ( $main::operatingSystem =~ m/solaris/ ) {
             $progDir = resolveLink("/usr/jdk", "latest");
-            if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" )
+            if ( -e "$progDir/bin/javac" )
             {
-                return "$progDir/$main::OO_SDK_JAVA_BIN_DIR";
+                return "$progDir/bin";
             }
         }
     }
diff --git a/odk/config/setsdkenv_unix.sh.in b/odk/config/setsdkenv_unix.sh.in
index 1ca7249..03644b5 100644
--- a/odk/config/setsdkenv_unix.sh.in
+++ b/odk/config/setsdkenv_unix.sh.in
@@ -81,12 +81,10 @@ sdk_platform=`/bin/sh ${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4`
 
 # Set the directory name.
 programdir=program
-javadir=bin
 sdk_lo_java_dir=program/classes
 case ${sdk_platform} in
   darwin*)
     programdir="Contents/MacOS"
-    javadir=Commands
     sdk_lo_java_dir=Contents/Resources/java
     ;;
 esac
@@ -244,7 +242,7 @@ fi
 # Add directory of the Java tools to the path, if necessary.
 if [ -n "${OO_SDK_JAVA_HOME}" ]
 then
-    PATH=${OO_SDK_JAVA_HOME}/${javadir}:${PATH}
+    PATH=${OO_SDK_JAVA_HOME}/bin:${PATH}
 #    JAVA_HOME=${OO_SDK_JAVA_HOME}
 #    export JAVA_HOME
     export OO_SDK_JAVA_HOME
diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk
index 74bd791..b455a6b 100644
--- a/odk/settings/settings.mk
+++ b/odk/settings/settings.mk
@@ -38,8 +38,6 @@ ifeq "$(DEBUG)" "yes"
 JAVAC_FLAGS+=-g
 endif
 
-JAVABIN=bin
-
 ###########################################################################
 #
 # Windows specific settings
@@ -368,7 +366,6 @@ endif
 ifeq "$(PLATFORM)" "macosx"
 
 UNOPKG_PLATFORM=MacOSX_x86_64
-JAVABIN=Commands
 
 OS=MACOSX
 PS=/
diff --git a/odk/settings/std.mk b/odk/settings/std.mk
index e69fc3e..dfa01e66 100644
--- a/odk/settings/std.mk
+++ b/odk/settings/std.mk
@@ -61,7 +61,7 @@ OFFICE_TYPE_LIBRARY="$(OFFICE_TYPES)"
 
 JAVA_OPTIONS=
 ifneq "$(OO_SDK_JAVA_HOME)" ""
-JAVA_BITS := $(shell $(OO_SDK_JAVA_HOME)/$(JAVABIN)/java -version 2>&1 | tail -1 | cut -d " " -f3)
+JAVA_BITS := $(shell $(OO_SDK_JAVA_HOME)/bin/java -version 2>&1 | tail -1 | cut -d " " -f3)
 ifeq "$(JAVA_BITS)" "64-Bit"
 ifneq "$(PROCTYPE)" "x86_64"
 JAVA_OPTIONS=-d32
@@ -70,9 +70,9 @@ endif
 endif
 
 DEPLOYTOOL="$(OFFICE_PROGRAM_PATH)$(PS)unopkg" add -f
-SDK_JAVA="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/java" $(JAVA_OPTIONS)
-SDK_JAVAC="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/javac"
-SDK_JAR="$(OO_SDK_JAVA_HOME)/$(JAVABIN)/jar"
+SDK_JAVA="$(OO_SDK_JAVA_HOME)/bin/java" $(JAVA_OPTIONS)
+SDK_JAVAC="$(OO_SDK_JAVA_HOME)/bin/javac"
+SDK_JAR="$(OO_SDK_JAVA_HOME)/bin/jar"
 ifneq "$(OO_SDK_ZIP_HOME)" ""
 SDK_ZIP="$(OO_SDK_ZIP_HOME)/zip"
 else


More information about the Libreoffice-commits mailing list