From dd7548db8419456db01cad4902faea511a78db26 Mon Sep 17 00:00:00 2001 From: LionsPhil Date: Sat, 19 Mar 2016 12:26:58 +0000 Subject: [PATCH] Cross-compile Windows resources Add a new clean-slate resource file, leaving the Visual Studio-generated one alone. Define the icon and version metadata. Make autoconf/automake build and link the resource file when doing a Windows build. Closes #4. --- configure.ac | 3 ++- src/Makefile.am | 8 ++++++++ src/windows_resources.rc | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/windows_resources.rc diff --git a/configure.ac b/configure.ac index f1f7fb7..62f3a4f 100644 --- a/configure.ac +++ b/configure.ac @@ -35,12 +35,13 @@ AC_SEARCH_LIBS([Mix_OpenAudio], [SDL_mixer], [], [ AC_MSG_ERROR([unable to find Mix_OpenAudio from libSDL_mixer]) ]) -# Configure flag to indicate a Windows build +# Configure flag to indicate a Windows build (Automake needs to know too) AC_ARG_ENABLE([windows], AS_HELP_STRING([--enable-windows], [Build for Windows (you must also use mingw32!)])) AS_IF([test "x$enable_windows" = "xyes"], [ AC_DEFINE([WINDOWS], [], [Windows build]) ]) +AM_CONDITIONAL([WINDOWS], [test "x$enable_windows" = "xyes"]) # Support --enable-silent-rules or make V=0 for cleaner build logs AM_SILENT_RULES diff --git a/src/Makefile.am b/src/Makefile.am index 2d2c179..b008837 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,3 +43,11 @@ strangelp_SOURCES = \ typedefs.h \ w32_gfx.cpp \ w32_sound.cpp + +# If we're doing a Windows build, get the icon in there too +if WINDOWS +strangelp_LDADD = windows_resources.o + +windows_resources.o: windows_resources.rc ../winicon.ico + i586-mingw32msvc-windres -v -o $@ $< +endif diff --git a/src/windows_resources.rc b/src/windows_resources.rc new file mode 100644 index 0000000..6d3d09e --- /dev/null +++ b/src/windows_resources.rc @@ -0,0 +1,37 @@ +#include + +#define VERSION_NUM 2005,11,11,1 +#define VERSION_STR "20051111.1" + +//VS_VERSION_INFO VERSIONINFO +1 VERSIONINFO +FILEVERSION VERSION_NUM +PRODUCTVERSION VERSION_NUM +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Digital Eel / LionsPhil" + VALUE "FileDescription", "Strange Adventures in Infinite Space (LionsPhil fork)" + VALUE "FileVersion", VERSION_STR + VALUE "InternalName", "strangelp" + VALUE "LegalCopyright", "Copyright Digital Eel et. al.; licensed under the terms of the GNU GPL" + VALUE "OriginalFilename", "strangelp.exe" + VALUE "ProductName", "Strange Adventures in Infinite Space" + VALUE "ProductVersion", VERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +2 ICON "../winicon.ico"