3 name="nlsop_server nlsop_client nlsop_gui"
16 echo "usage $0 <options>"
18 echo "--prefix=PREFIX specify install prefix"
19 echo "--with-dfblib=DIR specify directfb lib dir"
20 echo "--with-dfbinc=DIR specify directfb include dir"
21 echo "--with-api=DIR specify api dir"
26 case "`echo $1 | awk -F= '{ print $1 }'`" in
27 --prefix) prefix=`echo $1 | awk -F= '{ print $2 }'`; shift;;
28 --help) usage; shift 1;;
29 --with-dfblib) dfblib=`echo $1 | awk -F= '{ print $2 }'`; shift;;
30 --with-dfbinc) dfbinc=`echo $1 | awk -F= '{ print $2 }'`; shift;;
31 --without-dfb) nodfb=1; shift ;;
32 --with-api) apidir=`echo $1 | awk -F= '{ print $2 }'`; shift;;
36 echo "checking for api stuff ..."
38 if [ -z "$apidir" ]; then
39 for i in ../api ../../api; do
40 if [ -f $i/CHANGELOG ]; then
45 if [ -f $apidir/CHANGELOG ]; then
49 if [ "$api_dir" = "0" ]; then
50 echo "api files not found ..."
51 echo "WARNING: your build will fail."
52 echo "please get the api files first (see README file)."
56 echo "checking for dfb stuff ..."
58 if [ -z "$dfbinc" ]; then
59 for i in /usr/include /usr/local/include; do
60 if [ -d $i/directfb ]; then
61 dfb_inc_dir=$i/directfb
65 if [ -d $dfbinc/directfb ]; then
66 dfb_inc_dir=$dfbinc/directfb
69 if [ "$dfb_inc_dir" = "0" ]; then
70 echo "dfb includes not found ..."
74 if [ -z "$dfblib" ]; then
75 for i in /usr/lib /usr/local/lib; do
76 if [ -f $i/libdirectfb.so ]; then
81 if [ -f $dfblib/libdirectfb.so ]; then
85 if [ "$dfb_lib_dir" = "0" ]; then
86 echo "dfb libs not found ..."
90 [ "$nodfb" = "0" ] && echo "directfb installation looks good :)"
92 GENLIBS="-lm -lncurses"
93 GENAPI="network.o event.o list.o display.o input.o"
95 echo "creating Makefile"
98 # $main Makefile, created `date`
100 INCLUDEDIR = /usr/include
103 if [ "$nodfb" = "0" ]; then
105 cat >> Makefile << EOF
106 CFLAGS = -DDEBUG -DUSE_DFB_API -DFONT=\"$prefix/share/$main/decker.ttf\" -O3 -Wall -I$dfb_inc_dir
107 LIBS = -L$dfb_lib_dir -ldirectfb $GENLIBS
109 OBJS = random.o dfbapi.o $GENAPI
114 cat >> Makefile << EOF
115 CFLAGS = -DDEBUG -DNODFB -O3 -Wall
118 OBJS = random.o $GENAPI
123 cat >> Makefile << EOF
130 foo="`echo $i | sed 's/\.o//g'`"
131 cat >> Makefile << EOF
132 ln -sf $api_dir/$foo/${foo}.{c,h} .
137 cat >> Makefile << EOF
140 \$(CC) \$(CFLAGS) -o \$@ \$(OBJS) \$(LIBS) ${i}.c
145 cat >> Makefile << EOF
147 \$(CC) \$(CFLAGS) -o \$@ \$(OBJS) \$(LIBS) nlsop.c
151 cat >> Makefile << EOF
155 rm -f \$(OBJS) \$(OBJS2)
162 mkdir -p $prefix/share/$main
163 cp decker.ttf $prefix/share/$main
164 chmod 644 $prefix/share/$main/decker.ttf