aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/win32
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/win32')
-rw-r--r--erts/etc/win32/msys_tools/erl12
-rw-r--r--erts/etc/win32/msys_tools/vc/cc.sh3
-rw-r--r--erts/etc/win32/msys_tools/vc/ld.sh4
-rw-r--r--erts/etc/win32/nsis/Makefile27
-rwxr-xr-xerts/etc/win32/nsis/dll_version_helper.sh16
-rw-r--r--erts/etc/win32/nsis/erlang20.nsi15
-rwxr-xr-xerts/etc/win32/nsis/find_redist.sh52
7 files changed, 87 insertions, 42 deletions
diff --git a/erts/etc/win32/msys_tools/erl b/erts/etc/win32/msys_tools/erl
index 576825c4be..cf49c33229 100644
--- a/erts/etc/win32/msys_tools/erl
+++ b/erts/etc/win32/msys_tools/erl
@@ -27,22 +27,16 @@ for x in "$@"; do
-I/*|-o/*)
y=`echo $x | sed 's,^-[Io]\(/.*\),\1,g'`;
z=`echo $x | sed 's,^-\([Io]\)\(/.*\),\1,g'`;
- #echo "Foooo:$z"
- MPATH=`cygpath -m $y`;
+ MPATH=`msys2win_path.sh -m $y`;
CMD="$CMD -$z\"$MPATH\"";;
/*)
- #echo "absolute:"$x;
- MPATH=`cygpath -m $x`;
+ MPATH=`msys2win_path.sh -m $x`;
CMD="$CMD \"$MPATH\"";;
-# +{*);;
*)
-# y=`echo $x | sed 's,",\\\\\\\\\\\",g'`;
y=`echo $x | sed 's,",\\\",g'`;
CMD="$CMD \"$y\"";;
esac
done
-#echo "$@"
-#eval echo erlc.exe $CMD
-ERL_TOP=`cygpath -m $ERL_TOP`
+ERL_TOP=`msys2win_path.sh -m $ERL_TOP`
export ERL_TOP
eval erl.exe $CMD
diff --git a/erts/etc/win32/msys_tools/vc/cc.sh b/erts/etc/win32/msys_tools/vc/cc.sh
index 6c1b20a003..3250ce158f 100644
--- a/erts/etc/win32/msys_tools/vc/cc.sh
+++ b/erts/etc/win32/msys_tools/vc/cc.sh
@@ -152,6 +152,9 @@ while test -n "$1" ; do
-EH*)
y=`echo $x | sed 's,",\\\",g'`;
CMD="$CMD $y";;
+ -TP|-Tp)
+ y=`echo $x | sed 's,",\\\",g'`;
+ CMD="$CMD $y";;
-l*)
y=`echo $x | sed 's,^-l\(.*\),\1,g'`;
LINKCMD="$LINKCMD $x";;
diff --git a/erts/etc/win32/msys_tools/vc/ld.sh b/erts/etc/win32/msys_tools/vc/ld.sh
index aa44a65912..9ed841f8fe 100644
--- a/erts/etc/win32/msys_tools/vc/ld.sh
+++ b/erts/etc/win32/msys_tools/vc/ld.sh
@@ -170,8 +170,8 @@ RES=$?
CMANIFEST=`win2msys_path.sh $MANIFEST`
if [ "$RES" = "0" -a -f "$CMANIFEST" ]; then
# Add stuff to manifest to turn off "virtualization"
- sed -n -i '1h;1!H;${;g;s,<trustInfo.*</trustInfo>.,,g;p;}' $CMANIFEST
- sed -i "s/<\/assembly>/ <ms_asmv2:trustInfo xmlns:ms_asmv2=\"urn:schemas-microsoft-com:asm.v2\">\n <ms_asmv2:security>\n <ms_asmv2:requestedPrivileges>\n <ms_asmv2:requestedExecutionLevel level=\"AsInvoker\" uiAccess=\"false\"\/>\n <\/ms_asmv2:requestedPrivileges>\n <\/ms_asmv2:security>\n <\/ms_asmv2:trustInfo>\n<\/assembly>/" $CMANIFEST
+ sed -n -i '1h;1!H;${;g;s,<trustInfo.*</trustInfo>.,,g;p;}' $CMANIFEST 2>/dev/null
+ sed -i "s/<\/assembly>/ <ms_asmv2:trustInfo xmlns:ms_asmv2=\"urn:schemas-microsoft-com:asm.v2\">\n <ms_asmv2:security>\n <ms_asmv2:requestedPrivileges>\n <ms_asmv2:requestedExecutionLevel level=\"AsInvoker\" uiAccess=\"false\"\/>\n <\/ms_asmv2:requestedPrivileges>\n <\/ms_asmv2:security>\n <\/ms_asmv2:trustInfo>\n<\/assembly>/" $CMANIFEST 2>/dev/null
eval mt.exe -nologo -manifest "$MANIFEST" -outputresource:"$OUTPUTRES" >>/tmp/link.exe.${p}.1 2>>/tmp/link.exe.${p}.2
RES=$?
diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile
index ae2343b420..6a93c5153d 100644
--- a/erts/etc/win32/nsis/Makefile
+++ b/erts/etc/win32/nsis/Makefile
@@ -40,10 +40,29 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
TARGET_DIR = $(RELEASE_PATH)
-WTESTROOT=$(shell (cygpath -d $(RELEASE_PATH) 2>/dev/null || cygpath -w $(RELEASE_PATH)))
-WTARGET_DIR=$(shell (cygpath -d $(TARGET_DIR) 2>/dev/null || cygpath -d $(TARGET_DIR)))
+
+ifeq ($(MSYSTEM),MINGW32)
+
+ MAKENSISFLAGS = //V2
+ WTESTROOT=$(shell (msys2win_path.sh $(RELEASE_PATH)))
+ WTARGET_DIR=$(shell (msys2win_path.sh $(TARGET_DIR)))
+
+else
+
+ MAKENSISFLAGS = /V2
+ WTESTROOT=$(shell (cygpath -d $(RELEASE_PATH) 2>/dev/null || cygpath -w $(RELEASE_PATH)))
+ WTARGET_DIR=$(shell (cygpath -d $(TARGET_DIR) 2>/dev/null || cygpath -d $(TARGET_DIR)))
+
+endif
+
+ifeq ($(CONFIG_SUBTYPE),win64)
+ WINTYPE=win64
+else
+ WINTYPE=win32
+endif
REDIST_FILE=$(shell (sh ./find_redist.sh || echo ""))
+REDIST_TARGET=$(shell (sh ./find_redist.sh -n || echo ""))
REDIST_DLL_VERSION=$(shell (sh ./dll_version_helper.sh || echo ""))
REDIST_DLL_NAME=$(shell (sh ./dll_version_helper.sh -n || echo ""))
@@ -65,16 +84,18 @@ release_spec:
echo '!define ERTS_VERSION "$(VSN)"' >> $(VERSION_HEADER);\
echo '!define TESTROOT "$(WTESTROOT)"' >> $(VERSION_HEADER);\
echo '!define OUTFILEDIR "$(WTARGET_DIR)"' >> $(VERSION_HEADER);\
+ echo '!define WINTYPE "$(WINTYPE)"' >> $(VERSION_HEADER);\
if [ -f $(CUSTOM_MODERN) ];\
then \
echo '!define HAVE_CUSTOM_MODERN 1' >> $(VERSION_HEADER); \
fi;\
if [ '!' -z "$(REDIST_FILE)" -a '!' -z "$(REDIST_DLL_VERSION)" ];\
then \
- cp $(REDIST_FILE) $(RELEASE_PATH)/vcredist_x86.exe;\
+ cp $(REDIST_FILE) $(RELEASE_PATH)/$(REDIST_TARGET);\
echo '!define HAVE_REDIST_FILE 1' >> $(VERSION_HEADER); \
echo '!define REDIST_DLL_VERSION "$(REDIST_DLL_VERSION)"' >> $(VERSION_HEADER);\
echo '!define REDIST_DLL_NAME "$(REDIST_DLL_NAME)"' >> $(VERSION_HEADER);\
+ echo '!define REDIST_EXECUTABLE "$(REDIST_TARGET)"' >> $(VERSION_HEADER);\
fi;\
if [ -f $(RELEASE_PATH)/docs/doc/index.html ];\
then \
diff --git a/erts/etc/win32/nsis/dll_version_helper.sh b/erts/etc/win32/nsis/dll_version_helper.sh
index eecd4a72b5..96e4532b7a 100755
--- a/erts/etc/win32/nsis/dll_version_helper.sh
+++ b/erts/etc/win32/nsis/dll_version_helper.sh
@@ -36,11 +36,11 @@ int main(void)
}
EOF
-cl /MD hello.c > /dev/null 2>&1
+cl -MD hello.c > /dev/null 2>&1
if [ '!' -f hello.exe.manifest ]; then
# Gah - VC 2010 changes the way it handles DLL's and manifests... Again...
# need another way of getting the version
- DLLNAME=`dumpbin.exe /imports hello.exe | egrep MSVCR.*dll`
+ DLLNAME=`dumpbin.exe -imports hello.exe | egrep MSVCR.*dll`
DLLNAME=`echo $DLLNAME`
cat > helper.c <<EOF
#include <windows.h>
@@ -59,11 +59,7 @@ int main(void)
char *vs_verinfo;
unsigned int vs_ver_size;
- struct LANGANDCODEPAGE {
- WORD language;
- WORD codepage;
- } *translate;
-
+ WORD *translate;
unsigned int tr_size;
if (!(versize = GetFileVersionInfoSize(REQ_MODULE,&dummy))) {
@@ -79,10 +75,10 @@ int main(void)
fprintf(stderr,"No translation info in %s!\n",REQ_MODULE);
exit(3);
}
- n = tr_size/sizeof(translate);
+ n = tr_size/(2*sizeof(*translate));
for(i=0; i < n; ++i) {
sprintf(buff,"\\\\StringFileInfo\\\\%04x%04x\\\\FileVersion",
- translate[i].language,translate[i].codepage);
+ translate[i*2],translate[i*2+1]);
if (VerQueryValue(versinfo,buff,&vs_verinfo,&vs_ver_size)) {
printf("%s\n",(char *) vs_verinfo);
return 0;
@@ -92,7 +88,7 @@ int main(void)
return 0;
}
EOF
- cl /MD helper.c version.lib > /dev/null 2>&1
+ cl -MD helper.c version.lib > /dev/null 2>&1
if [ '!' -f helper.exe ]; then
echo "Failed to build helper program." >&2
exit 1
diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi
index 941e8e6f5d..fb0eff3867 100644
--- a/erts/etc/win32/nsis/erlang20.nsi
+++ b/erts/etc/win32/nsis/erlang20.nsi
@@ -31,17 +31,24 @@ Var STARTMENU_FOLDER
!define MY_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
;General
- OutFile "${OUTFILEDIR}\otp_win32_${OTP_VERSION}.exe"
+ OutFile "${OUTFILEDIR}\otp_${WINTYPE}_${OTP_VERSION}.exe"
;Folder selection page
+!if ${WINTYPE} == "win64"
+ InstallDir "$PROGRAMFILES64\erl${ERTS_VERSION}"
+!else
InstallDir "$PROGRAMFILES\erl${ERTS_VERSION}"
-
+!endif
;Remember install folder
InstallDirRegKey HKLM "SOFTWARE\Ericsson\Erlang\${ERTS_VERSION}" ""
; Set the default start menu folder
+!if ${WINTYPE} == "win64"
+ !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_VERSION} (x64)"
+!else
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_VERSION}"
+!endif
;--------------------------------
;Modern UI Configuration
@@ -98,12 +105,12 @@ Var STARTMENU_FOLDER
Section "Microsoft redistributable libraries." SecMSRedist
SetOutPath "$INSTDIR"
- File "${TESTROOT}\vcredist_x86.exe"
+ File "${TESTROOT}\${REDIST_EXECUTABLE}"
; Set back verbosity...
!verbose 1
; Run the setup program
- ExecWait '"$INSTDIR\vcredist_x86.exe"'
+ ExecWait '"$INSTDIR\${REDIST_EXECUTABLE}"'
!verbose 1
SectionEnd ; MSRedist
diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh
index bc4260ecba..7c449c9e4e 100755
--- a/erts/etc/win32/nsis/find_redist.sh
+++ b/erts/etc/win32/nsis/find_redist.sh
@@ -65,7 +65,6 @@ remove_path_element()
else
echo "${ACC}/$1"
fi
-
#echo "ACC=$ACC" >&2
#echo "1=$1" >&2
}
@@ -89,20 +88,39 @@ add_path_element()
echo "$PA"
}
+
CLPATH=`lookup_prog_in_path cl`
if [ -z "$CLPATH" ]; then
- echo "Can not locate cl.exe and vcredist_x86.exe - OK if using mingw" >&2
+ echo "Can not locate cl.exe and vcredist_x86/x64.exe - OK if using mingw" >&2
exit 1
fi
-#echo $CLPATH
+# Look to see if it's 64bit
+XX=`remove_path_element cl "$CLPATH"`
+YY=`remove_path_element amd64 "$XX"`
+if [ "$YY" != "$XX" ]; then
+ AMD64DIR=true
+ VCREDIST=vcredist_x64
+ COMPONENTS="cl amd64 bin vc"
+else
+ AMD64DIR=false
+ VCREDIST=vcredist_x86
+ COMPONENTS="cl bin vc"
+fi
+
+if [ X"$1" = X"-n" ]; then
+ echo $VCREDIST.exe
+ exit 0
+fi
+
+# echo $CLPATH
BPATH=$CLPATH
-for x in cl bin vc; do
- #echo $x
+for x in $COMPONENTS; do
+ # echo $x
NBPATH=`remove_path_element $x "$BPATH"`
if [ "$NBPATH" = "$BPATH" ]; then
- echo "Failed to locate vcredist_x86.exe because cl.exe was in an unexpected location" >&2
+ echo "Failed to locate $VCREDIST.exe because cl.exe was in an unexpected location" >&2
exit 2
fi
BPATH="$NBPATH"
@@ -115,7 +133,12 @@ fail=false
if [ '!' -z "$RCPATH" ]; then
BPATH=$RCPATH
allow_fail=false
- for x in rc bin @ANY v6.0A v7.0A v7.1; do
+ if [ $AMD64DIR = true ]; then
+ COMPONENTS="rc x64 bin @ANY v6.0A v7.0A v7.1"
+ else
+ COMPONENTS="rc bin @ANY v6.0A v7.0A v7.1"
+ fi
+ for x in $COMPONENTS; do
if [ $x = @ANY ]; then
allow_fail=true
else
@@ -131,6 +154,7 @@ if [ '!' -z "$RCPATH" ]; then
BPATH_LIST="$BPATH_LIST $BPATH"
fi
fi
+# echo "BPATH_LIST=$BPATH_LIST"
# Frantic search through two roots with different
# version directories. We want to be very specific about the
@@ -143,7 +167,7 @@ for BP in $BPATH_LIST; do
BPATH=$BP
fail=false
allow_fail=false
- for x in $verdir @ANY bootstrapper packages vcredist_x86 Redist VC @ALL vcredist_x86.exe; do
+ for x in $verdir @ANY bootstrapper packages $VCREDIST Redist VC @ALL $VCREDIST.exe; do
#echo "x=$x"
#echo "BPATH=$BPATH"
#echo "allow_fail=$allow_fail"
@@ -170,18 +194,18 @@ for BP in $BPATH_LIST; do
fi
done
-# shortcut for locating vcredist_x86.exe is to put it into $ERL_TOP
-if [ -f $ERL_TOP/vcredist_x86.exe ]; then
- echo $ERL_TOP/vcredist_x86.exe
+# shortcut for locating $VCREDIST.exe is to put it into $ERL_TOP
+if [ -f $ERL_TOP/$VCREDIST.exe ]; then
+ echo $ERL_TOP/$VCREDIST.exe
exit 0
fi
# or $ERL_TOP/.. to share across multiple builds
-if [ -f $ERL_TOP/../vcredist_x86.exe ]; then
- echo $ERL_TOP/../vcredist_x86.exe
+if [ -f $ERL_TOP/../$VCREDIST.exe ]; then
+ echo $ERL_TOP/../$VCREDIST.exe
exit 0
fi
-echo "Failed to locate vcredist_x86.exe because directory structure was unexpected" >&2
+echo "Failed to locate $VCREDIST.exe because directory structure was unexpected" >&2
exit 3