Skip to content

Commit

Permalink
Cross-compile Windows resources
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LionsPhil committed Mar 19, 2016
1 parent d2a3285 commit dd7548d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 37 additions & 0 deletions src/windows_resources.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <windows.h>

#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"

0 comments on commit dd7548d

Please sign in to comment.