5 # $Date: 2010/05/09 12:39:01 $
6 ######################################################
8 # Installation path prefix
12 # Binaries access bits
16 # Data files access bits
24 # Binaries and data files owner
30 release=`uname -r | cut -b1`
32 CONFFILE="../../Makefile.conf"
38 MAKEOPTS="$MAKEOPTS -j1"
39 CFLAGS="$CFLAGS -ggdb3 -W -Wall"
40 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
47 CFLAGS="$CFLAGS -I/usr/local/include"
48 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
49 LDFLAGS="$LDFLAGS -L/usr/local/lib"
51 if [ "$sys" = "Linux" ]
58 if [ "$sys" = "FreeBSD" ]
70 if [ "$sys" = "Darwin" ]
76 if [ "$OS" = "unknown" ]
78 printf "#############################################################################\n"
79 printf "# Sorry, but we currently support Linux, FreeBSD and Darwin. #\n"
80 printf "#############################################################################\n"
84 printf "#############################################################################\n"
85 printf " Building STG 2.4 libs for $sys $release\n"
86 printf "#############################################################################\n"
99 if [ "$OS" = "linux" ]
105 DEFS="$DEFS -DFREE_BSD"
107 if [ "$OS" = "bsd7" ]
109 DEFS="$DEFS -DFREE_BSD5"
111 if [ "$OS" == "darwin" ]
113 DEFS="$DEFS -DDARWIN"
129 printf "Checking CC... "
130 $CC --version > /dev/null 2> /dev/null
134 printf "$CC not found\n"
138 printf "Checking CXX... "
139 $CXX --version > /dev/null 2> /dev/null
143 printf "$CXX not found\n"
148 printf "Checking endianess... "
149 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
150 $CC $CFLAGS $LDFLAGS build_check.c -o fake
154 printf "Endianess checking failed\n"
161 CXXFLAGS="$CXXFLAGS -DARCH_LE"
162 CFLAGS="$CFLAGS -DARCH_LE"
163 printf "Little Endian\n"
166 CXXFLAGS="$CXXFLAGS -DARCH_BE"
167 CFLAGS="$CFLAGS -DARCH_BE"
168 printf "Big Endian\n"
173 printf "Checking for -lexpat... "
174 printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
175 $CXX $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
186 printf "Checking for -lfbclient... "
187 printf "int main() { return 0; }\n" > build_check.c
188 $CXX $CXXFLAGS $LDFLAGS build_check.c -lfbclient -o fake > /dev/null 2> /dev/null
201 if [ "$CHECK_EXPAT" != "yes" ]
203 printf -- "-lexpat not found!\n"
207 if [ "$CHECK_FBCLIENT" = "yes" ]
213 printf "OS=$OS\n" > $CONFFILE
214 printf "STG_TIME=yes\n" >> $CONFFILE
215 printf "DEBUG=$DEBUG\n" >> $CONFFILE
216 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
217 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
218 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
219 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
220 printf "ARCH=$ARCH\n" >> $CONFFILE
221 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
222 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
223 printf "DEFS=$DEFS\n" >> $CONFFILE
224 printf "STG_LIBS=" >> $CONFFILE
227 printf "$lib " >> $CONFFILE
229 printf "\n" >> $CONFFILE
230 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
231 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
232 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
233 printf "PREFIX=$PREFIX\n" >> $CONFFILE
234 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
235 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
236 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
237 printf "OWNER=$OWNER\n" >> $CONFFILE
239 if [ "$1" != "debug" ]
243 printf "\n\n\nDebug build. Type $MAKE explicitly\n"