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
31 major=`printf "%s" "$release" | cut -d. -f1`
33 CONFFILE="../../Makefile.conf"
39 MAKEOPTS="$MAKEOPTS -j1"
40 CFLAGS="$CFLAGS -ggdb3 -W -Wall"
41 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
48 CFLAGS="$CFLAGS -I/usr/local/include"
49 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
50 LDFLAGS="$LDFLAGS -L/usr/local/lib"
52 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 fb_config... "
187 FB_VERSION=`fb_config --version 2> /dev/null`
191 printf "Checking for -lfbclient... "
192 printf "int main() { return 0; }\n" > build_check.c
193 $CXX $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
200 FB_LDFLAGS="-lfbclient"
207 printf "Checking for fb_config --cflags... "
208 FB_CFLAGS=`fb_config --cflags`
214 printf "[$FB_CFLAGS]\n"
215 printf "Checking for fb_config --libs "
216 FB_LDFLAGS=`fb_config --libs`
223 printf "[$FB_LDFLAGS]\n"
230 if [ "$CHECK_EXPAT" != "yes" ]
232 printf -- "-lexpat not found!\n"
236 if [ "$CHECK_FBCLIENT" = "yes" ]
242 printf "OS=$OS\n" > $CONFFILE
243 printf "STG_TIME=yes\n" >> $CONFFILE
244 printf "DEBUG=$DEBUG\n" >> $CONFFILE
245 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
246 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
247 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
248 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
249 printf "ARCH=$ARCH\n" >> $CONFFILE
250 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
251 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
252 if [ "$CHECK_FBCLIENT" = "yes" ]
254 printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE
255 printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE
257 printf "DEFS=$DEFS\n" >> $CONFFILE
258 printf "STG_LIBS=" >> $CONFFILE
261 printf "$lib " >> $CONFFILE
263 printf "\n" >> $CONFFILE
264 printf "CC=$CC\n" >> $CONFFILE
265 printf "CXX=$CXX\n" >> $CONFFILE
266 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
267 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
268 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
269 printf "PREFIX=$PREFIX\n" >> $CONFFILE
270 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
271 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
272 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
273 printf "OWNER=$OWNER\n" >> $CONFFILE
275 if [ "$1" != "debug" ]
279 printf "\n\n\nDebug build. Type $MAKE explicitly\n"