summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-03-08 12:00:03 +0100
committerAndras Timar <andras.timar@collabora.com>2017-03-10 16:22:45 +0100
commitcf1b4679b0143e97d2e05cae9c5a01f0f4234ed8 (patch)
tree87fe09cc828f8a1d2f586af6f87c2e6078d64294 /configure.ac
parent245792c8514d396e982dc80317208d59a8035077 (diff)
Fix build with latest Cygwin updates
Stop bash complaining about \0 bytes in input (cherry picked from commit 8800292351dcf1f538c47ac6acf834ac2633ce6b) Strip newlines from UCRT detecion using tr (cherry picked from commit 37baabe6436037de604bfbc2702bfb0bc156c41b) Remove stray CR from input (cherry picked from commit 77779166569da389de44075b3d03413b353046a4) Just get rid of CR when parsing .bat output (cherry picked from commit 019ea173701eae4b8c5ffd45bb0063fc0a688ce0) Change-Id: Ieef2f8eb98181f5a4ea6a5527bc36de9b88716b5 Reviewed-on: https://gerrit.libreoffice.org/35010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 86bb733f6a9af9af253afe896e315b463e592dc7)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 18 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index 4192506c2b81..23d9adcd475d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3151,28 +3151,32 @@ dnl ===================================================================
dnl Windows specific tests and stuff
dnl ===================================================================
-# Get a value from the 32-bit side of the Registry
-reg_get_value_32()
+reg_get_value()
{
# Return value: $regvalue
unset regvalue
- _regvalue=`cat "/proc/registry32/$1" 2> /dev/null`
- if test $? -eq 0; then
- regvalue=$_regvalue
+ local _regentry="/proc/registry${1}/${2}"
+ if test -f "$_regentry"; then
+ # Stop bash complaining about \0 bytes in input, as it can't handle them.
+ # Registry keys read via /proc/registry* are always \0 terminated!
+ local _regvalue=$(tr -d '\0' < "$_regentry")
+ if test $? -eq 0; then
+ regvalue=$_regvalue
+ fi
fi
}
+# Get a value from the 32-bit side of the Registry
+reg_get_value_32()
+{
+ reg_get_value "32" "$1"
+}
+
# Get a value from the 64-bit side of the Registry
reg_get_value_64()
{
- # Return value: $regvalue
- unset regvalue
- _regvalue=`cat "/proc/registry64/$1" 2> /dev/null`
-
- if test $? -eq 0; then
- regvalue=$_regvalue
- fi
+ reg_get_value "64" "$1"
}
if test "$_os" = "WINNT"; then
@@ -3304,7 +3308,7 @@ win_get_env_from_vsvars32bat()
echo -e "@echo %$1%\r\n" >> $WRAPPERBATCHFILEPATH
echo -e "@endlocal\r\n" >> $WRAPPERBATCHFILEPATH
chmod +x $WRAPPERBATCHFILEPATH
- _win_get_env_from_vsvars32bat="`$WRAPPERBATCHFILEPATH | $SED -e s/^M^J//`"
+ _win_get_env_from_vsvars32bat=$($WRAPPERBATCHFILEPATH | tr -d "\r")
rm -f $WRAPPERBATCHFILEPATH
echo $_win_get_env_from_vsvars32bat
}
@@ -6796,7 +6800,7 @@ if test "$ENABLE_JAVA" != ""; then
if test -z "$with_jdk_home"; then
for ver in 1.8 1.7 1.6; do
- reg_get_value_$bitness "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
+ reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
if test -n "$regvalue"; then
_jdk_home=$regvalue
break