]> git.zerfleddert.de Git - micropolis/blame - src/sim/sdl_helper
change SDL linking to work with newer SDL versions again
[micropolis] / src / sim / sdl_helper
CommitLineData
8813bb55 1SDLINCLUDE="`pkg-config --cflags sdl 2>/dev/null`"
6522944f 2SDLLIBS="`pkg-config --libs-only-L sdl 2>/dev/null` `pkg-config --libs-only-l sdl 2>/dev/null`"
8813bb55
MG
3
4found=0
5
6if echo '#include <SDL_mixer.h>'|(cpp ${SDLINCLUDE}) >/dev/null 2>&1; then
7 found=1
8else
9 for flag in ${SDLINCLUDE}; do
10 if echo "${flag}" | grep '^-I' >/dev/null 2>&1; then
11 sdlpath="$(echo "${flag}"| sed -e 's/^-I//')"
12 if [ -f "${sdlpath}/SDL_mixer.h" ]; then
13 found=1
14 break
15 fi
16 fi
17 done
18fi
19
20if [ "${found}" = "1" ]; then
21 SDLINCLUDE="${SDLINCLUDE} -DWITH_SDL_MIXER"
22 SDLLIBS="${SDLLIBS} -lSDL_mixer"
23else
24 found=0
25
26 for sdlpath in /usr /usr/local /opt/local /opt/csw /sw; do
27 if [ -f "${sdlpath}/include/SDL/SDL_mixer.h" ]; then
28 SDLINCLUDE="${SDLINCLUDE} -I${sdlpath}/include/SDL -DWITH_SDL_MIXER"
29 SDLLIBS="${SDLLIBS} -L${sdlpath}/lib -lSDL -lSDL_mixer"
30
31 found=1
32 break
33 fi
34 done
35
36 if [ "${found}" = "0" ]; then
37 SDLINCLUDE=""
38 SDLLIBS=""
39 fi
40fi
41
42if [ "${1}" = "cflags" ]; then
43 echo "${SDLINCLUDE}"
44elif [ "${1}" = "libs" ]; then
45 echo "${SDLLIBS}"
46fi
Impressum, Datenschutz