mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-15 08:31:03 +00:00
Update makefiles to use local SDL/SDL2 copies. Add sdl[2]-config. Patch from szo.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1180 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
d97dd45952
commit
530c6db666
5 changed files with 125 additions and 5 deletions
|
@ -114,7 +114,9 @@ SDL_FRAMEWORK_NAME = SDL2
|
|||
else
|
||||
SDL_FRAMEWORK_NAME = SDL
|
||||
endif
|
||||
ifdef SDL_FRAMEWORK_PATH
|
||||
# default to our local SDL[2].framework for build
|
||||
SDL_FRAMEWORK_PATH ?=../MacOSX
|
||||
ifneq ($(SDL_FRAMEWORK_PATH),)
|
||||
SDL_LIBS +=-Wl,-F,$(SDL_FRAMEWORK_PATH)
|
||||
SDL_CFLAGS+=-F$(SDL_FRAMEWORK_PATH)
|
||||
endif
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# "make DEBUG=1" to build a debug client.
|
||||
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
|
||||
# "make WINSOCK2=1" to use WinSock2 api instead of old WinSock 1.1.
|
||||
# "make CROSS_COMPILE=0" to build natively on windows with mingw and msys
|
||||
|
||||
### Enable/disable SDL2
|
||||
USE_SDL2=0
|
||||
|
@ -81,10 +82,11 @@ ifeq ($(USE_SDL2),1)
|
|||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
# default to our local SDL[2] for build
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_CONFIG ?= sdl2-config
|
||||
SDL_CONFIG ?=../Windows/SDL2/bin/sdl2-config --prefix=../Windows/SDL2
|
||||
else
|
||||
SDL_CONFIG ?= sdl-config
|
||||
SDL_CONFIG ?=../Windows/SDL/bin/sdl-config --prefix=../Windows/SDL
|
||||
endif
|
||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# "make DEBUG=1" to build a debug client.
|
||||
# "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations.
|
||||
# "make WINSOCK2=0" to use the old WinSock 1.1 api (NOT recommended).
|
||||
# "make CROSS_COMPILE=0" to build natively on windows with mingw and msys
|
||||
|
||||
### Enable/disable SDL2
|
||||
USE_SDL2=0
|
||||
|
@ -79,10 +80,11 @@ ifeq ($(USE_SDL2),1)
|
|||
CFLAGS += -DUSE_SDL2
|
||||
endif
|
||||
|
||||
# default to our local SDL[2] for build
|
||||
ifeq ($(USE_SDL2),1)
|
||||
SDL_CONFIG ?= sdl2-config
|
||||
SDL_CONFIG ?=../Windows/SDL2/bin/sdl2-config --prefix=../Windows/SDL2 --lib-suffix=64
|
||||
else
|
||||
SDL_CONFIG ?= sdl-config
|
||||
SDL_CONFIG ?=../Windows/SDL/bin/sdl-config --prefix=../Windows/SDL --lib-suffix=64
|
||||
endif
|
||||
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
|
||||
|
|
57
quakespasm/Windows/SDL/bin/sdl-config
Executable file
57
quakespasm/Windows/SDL/bin/sdl-config
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/sh
|
||||
|
||||
prefix=/opt/cross_sdl12
|
||||
exec_prefix=${prefix}
|
||||
exec_prefix_set=no
|
||||
lib_suffix=
|
||||
|
||||
usage="\
|
||||
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--lib-suffix=SUFFIX] [--version] [--cflags] [--libs]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--lib-suffix=*)
|
||||
lib_suffix=$optarg
|
||||
;;
|
||||
--version)
|
||||
echo 1.2.15
|
||||
;;
|
||||
--cflags)
|
||||
echo -I${prefix}/include -D_GNU_SOURCE=1 -Dmain=SDL_main
|
||||
;;
|
||||
--libs)
|
||||
echo -L${exec_prefix}/lib${lib_suffix} -lmingw32 -lSDLmain -lSDL -mwindows
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
57
quakespasm/Windows/SDL2/bin/sdl2-config
Executable file
57
quakespasm/Windows/SDL2/bin/sdl2-config
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/sh
|
||||
|
||||
prefix=/opt/cross_sdl2
|
||||
exec_prefix=${prefix}
|
||||
exec_prefix_set=no
|
||||
lib_suffix=
|
||||
|
||||
usage="\
|
||||
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--lib-suffix=SUFFIX] [--libs]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--lib-suffix=*)
|
||||
lib_suffix=$optarg
|
||||
;;
|
||||
--version)
|
||||
echo 2.0.4
|
||||
;;
|
||||
--cflags)
|
||||
echo -I${prefix}/include -Dmain=SDL_main
|
||||
;;
|
||||
--libs)
|
||||
echo -L${exec_prefix}/lib${lib_suffix} -lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
Loading…
Reference in a new issue