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