1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!/bin/sh
type=debug
sdlver=`sdl-config --version`
sdlver1=`echo $sdlver | cut -d. -f1`
sdlver2=`echo $sdlver | cut -d. -f2`
sdlver3=`echo $sdlver | cut -d. -f3`
if [ -z $CC ]; then
echo -n "Checking for gcc..."
if [ -x /usr/bin/gcc ]; then
echo "Found"
CC=gcc
elif [ -x /usr/bin/cc ]; then
echo "Found"
CC=cc
else
echo "No gcc found, if this is in error, specific the CC variable at the top of the Configure script."
fi
fi
echo -n "Checking for SDL..."
if [ "$sdlver1" -ge "1" ]; then
if [ "$sdlver2" -ge "2" ]; then
if [ "$sdlver3" -ge "0" ]; then
echo "Found"
else
echo "Not found"
echo
echo "You need to install SDL 1.2.0 or higher."
exit 0
fi
else
echo "Not found"
echo
echo "You need to install SDL 1.2.0 or higher."
exit 0
fi
else
echo "Not found"
echo
echo "You need to install SDL 1.2.0 or higher."
exit 0
fi
echo -n "Detecting OS..."
OS=`uname`
if echo $OS |grep BSD; then
OS=BSD
else
echo $OS
fi
if [ "${OS}" == "BSD" ]; then
LDFLAGS="`sdl-config --libs` -lm -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86misc -lXxf86vm"
elif [ "${OS}" == "Linux" ]; then
LDFLAGS="`sdl-config --libs`"
elif [ "${OS}" == "BeOS" ]; then
LDFLAGS="`sdl-config --libs`"
elif [ "${OS}" == "UNIX" ]; then
LDFLAGS="`sdl-config --libs`"
fi
echo -n "Checking Release Type..."
if [ "${type}" == "debug" ]; then
echo "Debug"
CFLAGS="-Wall -g `sdl-config --cflags`"
else
echo "Release"
CFLAGS="-Wall -O3 -funroll-loops -fexpensive-optimizations `sdl-config --cflags`"
fi
if [ -f Makefile ]; then
mv Makefile Makefile.old
fi
echo "CC=$CC">Makefile
echo "CFLAGS=$CFLAGS">>Makefile
echo "LDFLAGS=$LDFLAGS">>Makefile
cat Makefile.temp >>Makefile
|