[Libreoffice-commits] core.git: bin/get_config_variables configure.ac

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 11 16:24:54 UTC 2020


 bin/get_config_variables |    8 +++++++-
 configure.ac             |   10 +++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 0bbc213229f6fdd6d1382e426f9ef2b9475ba60c
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Jul 30 03:06:57 2020 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Sep 11 18:24:13 2020 +0200

    cross-compile: fix PATH handling for host
    
    Reading and exporting the PATH variable will result in a bunch of
    error, so we have to work with full patch when using the grep and
    sed commands. Since we just want the PATH for the rest of the host
    config run, we can simply restore it.
    
    Change-Id: I970f3bddece01c1f20ab9db7d55569e5df190675
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102476
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/bin/get_config_variables b/bin/get_config_variables
index 60a2bdc04788..aa8198a44f4f 100644
--- a/bin/get_config_variables
+++ b/bin/get_config_variables
@@ -11,13 +11,19 @@ elif [ "$glv_var" = "--host" ] ; then
     shift
 fi
 
+# full path, in case we export a "wrong" PATH
+test -n "$GREP" && glv_grep="$GREP" || glv_grep=$(command -v grep)
+test -n "$SED" && glv_sed="$SED" || glv_sed=$(command -v sed)
+
 while [ -n "$1" ] ; do
     glv_var="$1"
     shift
-    glv_value=$(grep "^ *export ${glv_var}=" ${glv_config} | sed -e "s/[^=]*=//")
+    glv_value=$("${glv_grep}" "^ *export ${glv_var}=" ${glv_config} | "${glv_sed}" -e 's/[^=]*=//')
     export ${glv_var}="${glv_value}"
 done
 
 unset glv_var
 unset glv_value
 unset glv_config
+unset glv_sed
+unset glv_grep
diff --git a/configure.ac b/configure.ac
index eec433754275..42329199cf80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4942,7 +4942,14 @@ if test "$cross_compiling" = "yes"; then
     mv config.log ../config.Build.log
     mkdir -p ../config_build
     mv config_host/*.h ../config_build
+
+    OLD_PATH=$PATH
     . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT WORKDIR
+    BUILD_PATH=$PATH
+    PATH=$OLD_PATH
+
+    line=`echo "LO_PATH_FOR_BUILD='${BUILD_PATH}'" | sed -e 's,/CONF-FOR-BUILD,,g'`
+    echo "$line" >>build-config
 
     for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT; do
         VV='$'$V
@@ -4963,9 +4970,6 @@ if test "$cross_compiling" = "yes"; then
         fi
     done
 
-    line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
-    echo "$line" >>build-config
-
     )
     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
     test -f config_build.mk || AC_MSG_ERROR([A file called config_build.mk was supposed to have been copied here, but it isn't found])


More information about the Libreoffice-commits mailing list