-
Notifications
You must be signed in to change notification settings - Fork 3
/
ttk-config-here
41 lines (36 loc) · 1.65 KB
/
ttk-config-here
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
#!/bin/sh
prefix=`dirname $0`
libdir=
libfile=
linkflags=
ccflags=
target=
usage () {
echo
echo "Usage: ttk-config-here [--prefix[=DIR]] [--version] [--cflags] [--libs] {--ipod | --x11} {--hotdog | --sdl | --mwin}" 1>&2
echo
exit 1
}
if test $# -eq 0; then
usage
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*) prefix=$optarg ;;
--prefix) echo $prefix ;;
--version) echo 1.3 ;;
--ipod) libdir=$prefix/build/ipod; target=ipod; ccflags="${ccflags} -DIPOD" ;;
--x11) libdir=$prefix/build/x11; target=x ;;
--hotdog) libdir=$libdir-hdog; if test x$target = x; then usage; fi; libfile=ttk; if test x$target = xipod; then linkflags="${linkflags} -lm"; else linkflags="${linkflags} `sdl-config --libs`"; fi; ccflags="${ccflags} -DHDOG" ;;
--sdl) libdir=$libdir-sdl; if test x$target = x; then usage; fi; libfile=ttk; if test x$target = xipod; then linkflags="${linkflags} -lm"; else linkflags="${linkflags} `sdl-config --libs` -lSDL_image"; fi; ccflags="${ccflags} -DSDL -DNO_TF" ;;
--mwin) libdir=$libdir-mwin; if test x$target = x; then usage; fi; libfile=ttk; linkflags="${linkflags} -lm"; if test x$target = xx; then linkflags="${linkflags} -L/usr/X11R6/lib -lX11"; fi; ccflags="${ccflags} -DMWIN" ;;
--cflags) echo ${ccflags} -I${prefix}/src -I${prefix}/mwincludes -I${prefix}/sdlincludes -I/usr/local/include/SDL -I/sw/include/SDL -I${prefix}/../hotdog ;;
--libs) if test x$libfile = x; then usage; fi; echo -L${libdir} -l${libfile} ${linkflags}; if test x$target = xx; then echo -L/sw/lib -L/usr/local/lib; fi ;;
*) usage ;;
esac
shift
done