]> git.zerfleddert.de Git - micropolis/blob - src/sim/sdl_helper
c0dfdb8a637ef6ed4896ed3aff939c55268d6836
[micropolis] / src / sim / sdl_helper
1 SDLINCLUDE="`pkg-config --cflags sdl 2>/dev/null`"
2 SDLLIBS="`pkg-config --libs sdl 2>/dev/null`"
3
4 found=0
5
6 if echo '#include <SDL_mixer.h>'|(cpp ${SDLINCLUDE}) >/dev/null 2>&1; then
7 found=1
8 else
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
18 fi
19
20 if [ "${found}" = "1" ]; then
21 SDLINCLUDE="${SDLINCLUDE} -DWITH_SDL_MIXER"
22 SDLLIBS="${SDLLIBS} -lSDL_mixer"
23 else
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
40 fi
41
42 if [ "${1}" = "cflags" ]; then
43 echo "${SDLINCLUDE}"
44 elif [ "${1}" = "libs" ]; then
45 echo "${SDLLIBS}"
46 fi
Impressum, Datenschutz