mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-15 16:41:22 +00:00
Makefile[.*]: SDL2 build support. 'make USE_SDL2=1' to enable.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1019 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
9524b80f79
commit
573c01174b
4 changed files with 62 additions and 1 deletions
|
@ -7,6 +7,9 @@
|
|||
# Enable/Disable user directories support
|
||||
DO_USERDIRS=0
|
||||
|
||||
### Enable/Disable SDL2
|
||||
USE_SDL2=0
|
||||
|
||||
### Enable/Disable codecs for streaming music support
|
||||
USE_CODEC_WAVE=1
|
||||
USE_CODEC_FLAC=0
|
||||
|
@ -93,12 +96,24 @@ LDFLAGS+= -L$(X11BASE)/lib
|
|||
CFLAGS += -I$(X11BASE)/include
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_CONFIG ?= sdl2-config
|
||||
else
|
||||
SDL_CONFIG ?= sdl-config
|
||||
endif
|
||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||
|
||||
ifeq ($(SDLNET),1)
|
||||
ifeq ($(USE_SDL2),1)
|
||||
NET_LIBS :=-lSDL2_net
|
||||
else
|
||||
NET_LIBS :=-lSDL_net
|
||||
endif
|
||||
CFLAGS +=-D_USE_SDLNET
|
||||
else
|
||||
ifeq ($(HOST_OS),sunos)
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
# Enable/Disable user directories support
|
||||
DO_USERDIRS=0
|
||||
|
||||
### Enable/Disable SDL2
|
||||
USE_SDL2=0
|
||||
|
||||
### Enable/Disable codecs for streaming music support
|
||||
USE_CODEC_WAVE=1
|
||||
USE_CODEC_FLAC=1
|
||||
|
@ -84,14 +87,27 @@ ifeq ($(DO_USERDIRS),1)
|
|||
CFLAGS += -DDO_USERDIRS=1
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
# not relying on sdl-config command and assuming
|
||||
# /Library/Frameworks/SDL.framework is available
|
||||
SDL_CFLAGS =-D_GNU_SOURCE=1 -D_THREAD_SAFE
|
||||
SDL_CFLAGS+=-DSDL_FRAMEWORK -DNO_SDL_CONFIG
|
||||
SDL_LIBS =-Wl,-framework,SDL -Wl,-framework,Cocoa
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_LIBS =-Wl,-framework,SDL2
|
||||
else
|
||||
SDL_LIBS =-Wl,-framework,SDL
|
||||
endif
|
||||
SDL_LIBS +=-Wl,-framework,Cocoa
|
||||
|
||||
ifeq ($(SDLNET),1)
|
||||
ifeq ($(USE_SDL2),1)
|
||||
NET_LIBS :=-Wl,-framework,SDL2_net
|
||||
else
|
||||
NET_LIBS :=-Wl,-framework,SDL_net
|
||||
endif
|
||||
CFLAGS +=-D_USE_SDLNET
|
||||
else
|
||||
NET_LIBS :=
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
|
||||
# "make WINSOCK2=1" to use WinSock2 api instead of old WinSock 1.1.
|
||||
|
||||
### Enable/disable SDL2
|
||||
USE_SDL2=0
|
||||
|
||||
### Enable/disable codecs for streaming music support
|
||||
USE_CODEC_WAVE=1
|
||||
USE_CODEC_FLAC=1
|
||||
|
@ -75,7 +78,15 @@ define do_strip
|
|||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_CONFIG ?= sdl2-config
|
||||
else
|
||||
SDL_CONFIG ?= sdl-config
|
||||
endif
|
||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||
|
||||
|
@ -88,7 +99,11 @@ LIBWINSOCK := -lwsock32
|
|||
endif
|
||||
|
||||
ifeq ($(SDLNET),1)
|
||||
ifeq ($(USE_SDL2),1)
|
||||
NET_LIBS := -lSDL2_net
|
||||
else
|
||||
NET_LIBS := -lSDL_net
|
||||
endif
|
||||
CFLAGS +=-D_USE_SDLNET
|
||||
else
|
||||
CFLAGS += $(DEFWINSOCK)
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
|
||||
# "make WINSOCK2=0" to use the old WinSock 1.1 api (NOT recommended).
|
||||
|
||||
### Enable/disable SDL2
|
||||
USE_SDL2=0
|
||||
|
||||
### Enable/disable codecs for streaming music support
|
||||
USE_CODEC_WAVE=1
|
||||
USE_CODEC_FLAC=1
|
||||
|
@ -73,7 +76,15 @@ define do_strip
|
|||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_CONFIG ?= sdl2-config
|
||||
else
|
||||
SDL_CONFIG ?= sdl-config
|
||||
endif
|
||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||
|
||||
|
@ -86,7 +97,11 @@ LIBWINSOCK := -lwsock32
|
|||
endif
|
||||
|
||||
ifeq ($(SDLNET),1)
|
||||
ifeq ($(USE_SDL2),1)
|
||||
NET_LIBS := -lSDL2_net
|
||||
else
|
||||
NET_LIBS := -lSDL_net
|
||||
endif
|
||||
CFLAGS +=-D_USE_SDLNET
|
||||
else
|
||||
CFLAGS += $(DEFWINSOCK)
|
||||
|
|
Loading…
Reference in a new issue