diff --git a/build/stamp-exe.sh b/build/stamp-exe.sh new file mode 100755 index 0000000..25e673d --- /dev/null +++ b/build/stamp-exe.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# this script is needed to inscribe metadata in the .exe files +# targeting windows. it creates a .rs to be used when linking + +cat << EOF > cjit.rc +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Dyne.org Foundation" + VALUE "FileDescription", "CJIT, Just in Time C" + VALUE "FileVersion", "`date +'%Y%m%d'`" + VALUE "InternalName", "cjit" + VALUE "LegalCopyright", "Copyright by the Dyne.org Foundation" + VALUE "OriginalFilename", "cjit.exe" + VALUE "ProductName", "CJIT" + VALUE "ProductVersion", "3" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END +EOF + +if [ "$(which windres)" = "" ]; then + x86_64-w64-mingw32-windres cjit.rc -O coff -o cjit.res +else + windres cjit.rc -O coff -o cjit.res +fi diff --git a/build/win-wsl.mk b/build/win-wsl.mk index 9b63195..db93e09 100644 --- a/build/win-wsl.mk +++ b/build/win-wsl.mk @@ -18,7 +18,8 @@ ldflags += -static-libgcc all: deps cjit.exe cjit.exe: ${SOURCES} - $(cc) $(cflags) -o $@ $(SOURCES) ${ldflags} ${ldadd} + ./build/stamp-exe.sh + $(cc) $(cflags) -o $@ $(SOURCES) cjit.res ${ldflags} ${ldadd} # upx-ucl -q $@ # somehow upx compression helps the binary to function: it