-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·80 lines (66 loc) · 1.97 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
echo -n "Searching C++ compiler ... "
[ -z `which g++` ] && { echo no; exit; }
echo yes
echo -n "Searching sdl-config ... "
[ -z `which sdl-config` ] && { echo no; exit; }
echo yes
# create dummy object-file for testing of libraries
echo "int main(int,char **) { return 0; }" | g++ -c -x c++ -o tst.o -
okay=yes
LPATH=`sdl-config --libs | sed 's/ -l.*//;s/-L//'`
echo "Searching libraries in $LPATH"
for LIB in SDL SDL_gfx SDL_ttf
do
echo -n "library $LIB ... "
g++ -L$LPATH -l$LIB tst.o 2>/dev/null
if [ $? = 0 ]
then echo yes
else echo no; okay=no
fi
done
rm -f a.out
[ $okay = no ] && { echo "Some libraries are missing"; exit; }
echo -n "Searching font files ... "
case "$(uname -s)" in
Darwin)
echo 'searching in a Mac OS X '
FONTPATH="/Library/Fonts/Arial.ttf"
FONTPATH_MONO="/Library/Fonts/Courier New.ttf"
# we could try to load lucida grande or Apple Symbols.ttf
;;
CYGWIN*|MINGW*|MSYS*)
echo 'searching in a MS Windows '
FONTPATH="C:\\\\Windows\\\\Fonts\\\\Arial.ttf"
FONTPATH_MONO="C:\\\\Windows\\\\Fonts\\\\COUR.ttf"
# we could try to load trebuchet or segoe...
;;
*)
echo 'searching in a Linux or other OS '
FONTDIR=/usr/share/fonts
if test $# -gt 1; then
if test $1 = "--fontdir"; then
shift
FONTDIR="$1"
else
echo "unexpected option $1"
exit
fi
fi
FONTPATH=`find $FONTDIR -name FreeSans.ttf`
FONTPATH_MONO=`find $FONTDIR -name FreeMonoBold.ttf`
;;
esac
if [ -z "$FONTPATH" ] || [ -z "$FONTPATH_MONO" ]
then okay=no
else echo okay
fi
[ $okay = no ] && { echo "TrueType font-spec not found"; exit; }
if [ -e "config.h" ]; then
echo "File config.h is already present."
else
echo "const char* FONTPATH=\"$FONTPATH\";" > config.h
echo "const char* FONTPATH_MONO=\"$FONTPATH_MONO\";" >> config.h
echo "//#define arcColor pieColor //uncomment this if your version of SDL_gfx is too old" >> config.h
echo "Created: config.h. Edit it to specify a custom font file."
fi
echo "Now you can run 'make'"