summaryrefslogtreecommitdiff
path: root/erts/etc/win32/wsl_tools/reg_query.sh
diff options
context:
space:
mode:
authorDan Gudmundsson <dgud@erlang.org>2019-11-11 15:41:43 +0100
committerDan Gudmundsson <dgud@erlang.org>2019-11-12 07:51:31 +0100
commit3a162745c62b1f46580bdc0851f17ac46937197c (patch)
tree718b21804ac5d5a08d5609b1641515cdb64ac857 /erts/etc/win32/wsl_tools/reg_query.sh
parent78354470a93df501d7803d3a3e51f199ec8c9475 (diff)
downloaderlang-3a162745c62b1f46580bdc0851f17ac46937197c.tar.gz
Add wsl config as an environment to otp build tools
Allows "cross" building with native windows from WSL linux. Currently we only support building on the windows disk, old WSL installations can not access WSL disk at all and on the newer ones it is still problematic. Thus, create the erlang src/git on /mnt/c/<dir>/otp/ and don't create links from wsl to windows, that will cause problems for the scripts and will not work. Use: cd /mnt/c/<dir>/otp eval `./otp_build env_win32 ARCH` ./otp_build To build with emu_cc (32 and 64) it needs mingw-gcc On wsl ubuntu use: 'sudo apt-get install gcc-mingw-w64' to install everything for both build targets. Additional commit comments: - Let configure (crypto/wx) search in '/mnt/c/DocumentedPaths' - Use -Z7 for debug info Add debug info into .o files instead of vc120.pdb which makes parallel compilation more stable. - Use mingw-gcc as emu_cc Packages available in ubuntu. - Use $ERL_TOP/tmp for temporary directories Linux /tmp is not accessable in older wsl (arrived in Win 10 19.03). - Quoting is problematic It seems to be impossible to handle 'spaces' in paths correct, the autotools are just not prepared to handle that and we depend on them. Currently NOT supported but have been prepared for: -Using wsl as disk -- Ensure directory exists If linux file server is overloaded it may take a while until the directory is visible for windows programs. -- Use absolute paths Windows tools needs absolute (the network path) to access files on the wsl drive. Also we can not use mixed mode (forward slashes) for network paths, windows programs don't recognize //wsl$/<install>/
Diffstat (limited to 'erts/etc/win32/wsl_tools/reg_query.sh')
-rwxr-xr-xerts/etc/win32/wsl_tools/reg_query.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/erts/etc/win32/wsl_tools/reg_query.sh b/erts/etc/win32/wsl_tools/reg_query.sh
new file mode 100755
index 0000000000..c05f00dfa1
--- /dev/null
+++ b/erts/etc/win32/wsl_tools/reg_query.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+mkdir -p $ERL_TOP/tmp
+BAT_FILE=$ERL_TOP/tmp/w$$.bat
+if [ -z "$1" -o -z "$2" ]; then
+ echo "Usage:" "$0" '<key> <valuename>'
+ exit 1
+fi
+BACKED=`echo "$1" | sed 's,/,\\\\,g'`
+
+if [ $CONFIG_SUBTYPE = "win64" ]; then
+ REG_OPT=" /reg:64"
+else
+ REG_OPT=" /reg:32"
+fi
+
+WIN_BAT_FILE=`w32_path.sh -w $BAT_FILE`
+RESULT=`reg.exe query "$BACKED" /v "$2" $REG_OPT | sed 's@\\\@/@g' | tr -d '\r\n'`
+echo "$RESULT" | sed "s,.*REG_[^ ]* *,,g"