summaryrefslogtreecommitdiffstats
path: root/bin/get_config_variables
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /bin/get_config_variables
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/get_config_variables')
-rw-r--r--bin/get_config_variables29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/get_config_variables b/bin/get_config_variables
new file mode 100644
index 0000000000..7cc1e9325d
--- /dev/null
+++ b/bin/get_config_variables
@@ -0,0 +1,29 @@
+#!/bin/sh
+#set -x
+
+glv_var="$1"
+glv_config="config_host.mk"
+
+if [ "$glv_var" = "--build" ] ; then
+ glv_config="config_build.mk"
+ shift
+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=$("${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