summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2019-07-29 11:52:55 -0400
committerDavid Thompson <dthompson2@worcester.edu>2019-07-29 11:52:55 -0400
commit1855be7dc9182336eca8ea90d4c54db3ef16ae32 (patch)
treee9aa78c4fd266aa5426c121d621744f9156a88be
parent12bd1fc8a946fae319374a8d868a7a9320501336 (diff)
Add Windows compatibility.
-rw-r--r--sdl2/config.scm.in19
1 files changed, 8 insertions, 11 deletions
diff --git a/sdl2/config.scm.in b/sdl2/config.scm.in
index fb6194a..fed0963 100644
--- a/sdl2/config.scm.in
+++ b/sdl2/config.scm.in
@@ -4,14 +4,11 @@
%libsdl2-ttf
%libsdl2-mixer))
-(define %libsdl2
- "@LIBSDL2@")
-
-(define %libsdl2-image
- "@LIBSDL2_IMAGE@")
-
-(define %libsdl2-ttf
- "@LIBSDL2_TTF@")
-
-(define %libsdl2-mixer
- "@LIBSDL2_MIXER@")
+;; Special case Windows since the DLL names are different. Performing
+;; this check at runtime allows a Linux machine to cross-compile
+;; guile-sdl2 for a Windows target.
+(define %windows? (string-prefix? "Windows" (utsname:sysname (uname))))
+(define %libsdl2 (if %windows? "SDL2" "@LIBSDL2@"))
+(define %libsdl2-image (if %windows? "SDL2_image" "@LIBSDL2_IMAGE@"))
+(define %libsdl2-ttf (if %windows? "SDL2_ttf" "@LIBSDL2_TTF@"))
+(define %libsdl2-mixer (if %windows? "SDL_mixer" "@LIBSDL2_MIXER@"))