forked from erlehmann/Super-Mario-War
-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure
executable file
·81 lines (70 loc) · 2.92 KB
/
configure
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
#!/bin/sh
# add a debug option, default off (--debug)
DEBUG_OPTS=""
# add a png-save option, default on (--no-png-save)
PNG_SAVE_OPTS="-DPNG_SAVE_FORMAT"
while [ $# != 0 ]
do
case "$1" in
--help) echo
echo "Options:"
echo
echo "--help Display this help text"
echo "--debug Enable debugging support"
echo "--no-png-save Disable saving screenshots in PNG format"
echo
exit ;;
--debug) DEBUG_OPTS="-ggdb3 -gstabs+ -D_DEBUG" ;;
--no-png-save) PNG_SAVE_OPTS="" ;;
esac
shift
done
# Reset existing configuration file
rm -f configuration
touch configuration
# TODO: Add --debug= option
CFLAGS=$CFLAGS" -Wall -I. "$DEBUG_OPTS" "$PNG_SAVE_OPTS
# TODO: Make this better - we don't need it right now
# CFLAGS=$CFLAGS' -DDATAFOLDER=\"data/\" -DMAPFOLDER=\"data/maps/\"'
# Mac OS X configuration
if [ "`uname`" = Darwin ]
then
#SDL_CFLAGS=`sdl-config --cflags`
#SDL_LIBS=`sdl-config --libs`
SDK="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
SDL_CFLAGS="$SDK -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL_net.framework/Headers -I/Library/Frameworks/SDL_mixer.framework/Headers -I/Library/Frameworks/SDL_image.framework/Headers"
SDL_LIBS="-F/Library/Frameworks -framework CoreFoundation -framework Cocoa -framework SDL"
echo 'CFLAGS:=$(CFLAGS) -D__MACOSX__ -DLINUXFUNC -DPREFIXPATH=\"\" '$SDL_CFLAGS $CFLAGS >> configuration
echo 'LDFLAGS:=$(LDFLAGS) '$SDL_LIBS $LDFLAGS -framework SDL_image -framework SDL_mixer -framework png >> configuration
echo 'COMMON_OBJS:=$(COMMON_OBJS) build/linfunc.o build/SDLMain.o' >> configuration
fi
# Linux configuration
if [ "`uname`" = Linux ]
then
echo 'CFLAGS:=$(CFLAGS) -DLINUXFUNC -DPREFIXPATH=\"/usr/share/games/smw\" '`sdl-config --cflags` $CFLAGS >> configuration
echo 'LDFLAGS:=$(LDFLAGS) '`sdl-config --libs` $LDFLAGS -lSDL_image -lSDL_mixer -lpng >> configuration
echo 'COMMON_OBJS:=$(COMMON_OBJS) build/linfunc.o' >> configuration
fi
# SkyOS configuration
if [ "`uname`" = skyos ]
then
echo 'CFLAGS:=$(CFLAGS) -DPREFIXPATH=\"/usr/share/games/smw\" '`sdl-config --cflags` $CFLAGS >> configuration
echo 'LDFLAGS:=$(LDFLAGS) '`sdl-config --libs` $LDFLAGS -lSDL_image -lSDL_mixer -lpng >> configuration
echo 'COMMON_OBJS:=$(COMMON_OBJS) build/linfunc.o' >> configuration
fi
# Windows configuration
if uname | grep MINGW32
then
if [ -d `pwd`/mingw-support ]
then
echo 'CFLAGS:=$(CFLAGS) '-I`pwd`/mingw-support/include -I`pwd`/mingw-support/include/SDL -Dmain=SDL_main $CFLAGS >> configuration
echo 'LDFLAGS:=$(LDFLAGS) '-L`pwd`/mingw-support/lib -lmingw32 -lSDLmain -lSDL -mwindows $LDFLAGS -lSDL_image -lSDL_mixer >> configuration
else
echo 'Please check out mingw-support to build this project.'
echo '# cvs co mingw-support'
rm -f configuration
exit 1
fi
fi
mkdir -p build
make clean