]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
makefile: Support statically linking SDL2 on all platforms
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Sep 2020 05:18:02 +0000 (05:18 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Sep 2020 05:18:02 +0000 (05:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12926 d7cf8633-e32d-0410-b094-e92efae38249

makefile
makefile.inc

index d5bfc55f92275572e4aedb73d89dbfa777f44d95..46aa01075d802036b243d456e2dcab8aeb80311a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -101,6 +101,7 @@ ifeq ($(DP_MAKE_TARGET), linux)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
+       DP_LINK_SDL?=shared
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
@@ -130,6 +131,7 @@ ifeq ($(DP_MAKE_TARGET), macosx)
                CFLAGS_MAKEDEP=
        endif
 
+       DP_LINK_SDL?=shared
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=dlopen
        DP_LINK_ODE?=dlopen
@@ -165,6 +167,7 @@ ifeq ($(DP_MAKE_TARGET), sunos)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
+       DP_LINK_SDL?=shared
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
@@ -191,6 +194,7 @@ ifeq ($(DP_MAKE_TARGET), bsd)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
+       DP_LINK_SDL?=shared
        DP_LINK_ZLIB?=shared
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
@@ -236,6 +240,7 @@ ifeq ($(DP_MAKE_TARGET), mingw)
        EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
 
+       DP_LINK_SDL?=shared
        DP_LINK_ZLIB?=dlopen
        DP_LINK_JPEG?=shared
        DP_LINK_ODE?=dlopen
@@ -246,6 +251,13 @@ endif
 
 # set these to "" if you want to use dynamic loading instead
 # zlib
+ifeq ($(DP_LINK_SDL), shared)
+       SDL_LIBS=$(SDLCONFIG_LIBS)
+endif
+ifeq ($(DP_LINK_SDL), static)
+       SDL_LIBS=$(SDLCONFIG_STATICLIBS)
+endif
+
 ifeq ($(DP_LINK_ZLIB), shared)
        CFLAGS_LIBZ=-DLINK_TO_ZLIB
        LIB_Z=-lz
index 51b64d15eb85857aad1060a2d6a173a7507ce0fd..20c6ec3c2b63130335c5b16d6faeb4d5769c5907 100644 (file)
@@ -241,7 +241,7 @@ LDFLAGS_UNIXSV_PRELOAD=-lz -ljpeg -lpng -lcurl
 LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lxmp
 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
 
-LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS) #-lGLESv2
+LDFLAGS_UNIXSDL=$(SDL_LIBS) #-lGLESv2
 EXE_UNIXSV=darkplaces-dedicated
 EXE_UNIXSDL=darkplaces-sdl
 EXE_UNIXSVNEXUIZ=nexuiz-dedicated
@@ -289,7 +289,7 @@ WINDRES ?= windres
 # Link
 # see LDFLAGS_WINCOMMON in makefile
 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
-LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(SDLCONFIG_LIBS) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
+LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(LDFLAGS_UNIXSDL) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG) $(LIB_SND_XMP)
 EXE_WINSV=darkplaces-dedicated.exe
 EXE_WINSDL=darkplaces-sdl.exe
 EXE_WINSVNEXUIZ=nexuiz-dedicated.exe