3 # Installation path prefix
11 # Data files access bits
19 # Binaries and data files owner
26 major=`printf "%s" "$release" | cut -d. -f1`
28 CONFFILE="../../Makefile.conf"
34 MAKEOPTS="$MAKEOPTS -j1"
35 CFLAGS="$CFLAGS -ggdb3 -W -Wall"
36 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
43 CFLAGS="$CFLAGS -I/usr/local/include"
44 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
45 LDFLAGS="$LDFLAGS -L/usr/local/lib"
47 if [ "$sys" = "Linux" ]
53 if [ "$sys" = "FreeBSD" ]
65 if [ "$sys" = "Darwin" ]
71 if [ "$OS" = "unknown" ]
73 printf "#############################################################################\n"
74 printf "# Sorry, but we currently support Linux, FreeBSD and Darwin. #\n"
75 printf "#############################################################################\n"
79 printf "#############################################################################\n"
80 printf " Building STG 2.4 libs for $sys $release\n"
81 printf "#############################################################################\n"
94 if [ "$OS" = "linux" ]
100 DEFS="$DEFS -DFREE_BSD"
102 if [ "$OS" = "bsd7" ]
104 DEFS="$DEFS -DFREE_BSD5"
106 if [ "$OS" == "darwin" ]
108 DEFS="$DEFS -DDARWIN"
124 printf "Checking CC... "
125 $CC --version > /dev/null 2> /dev/null
129 printf "$CC not found\n"
133 printf "Checking CXX... "
134 $CXX --version > /dev/null 2> /dev/null
138 printf "$CXX not found\n"
143 printf "Checking endianess... "
144 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
145 $CC $CFLAGS $LDFLAGS build_check.c -o fake
149 printf "Endianess checking failed\n"
156 CXXFLAGS="$CXXFLAGS -DARCH_LE"
157 CFLAGS="$CFLAGS -DARCH_LE"
158 printf "Little Endian\n"
161 CXXFLAGS="$CXXFLAGS -DARCH_BE"
162 CFLAGS="$CFLAGS -DARCH_BE"
163 printf "Big Endian\n"
168 printf "Checking for -lexpat... "
169 printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
170 $CXX $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
181 printf "Checking for iconv 2nd argument... "
182 printf "#include <iconv.h>\nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c
183 $CXX $CXXFLAGS $LDFLAGS -Werror build_check.c -o fake > /dev/null 2> /dev/null
188 DEFS="$DEFS -DCONST_ICONV"
193 printf "Checking for fb_config... "
194 FB_VERSION=`fb_config --version 2> /dev/null`
198 printf "Checking for -lfbclient... "
199 printf "int main() { return 0; }\n" > build_check.c
200 $CXX $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
207 FB_LDFLAGS="-lfbclient"
214 printf "Checking for fb_config --cflags... "
215 FB_CFLAGS=`fb_config --cflags`
221 printf "[$FB_CFLAGS]\n"
222 printf "Checking for fb_config --libs "
223 FB_LDFLAGS=`fb_config --libs`
230 printf "[$FB_LDFLAGS]\n"
237 if [ "$CHECK_EXPAT" != "yes" ]
239 printf -- "-lexpat not found!\n"
243 if [ "$CHECK_FBCLIENT" = "yes" ]
249 printf "OS=$OS\n" > $CONFFILE
250 printf "STG_TIME=yes\n" >> $CONFFILE
251 printf "DEBUG=$DEBUG\n" >> $CONFFILE
252 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
253 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
254 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
255 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
256 printf "ARCH=$ARCH\n" >> $CONFFILE
257 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
258 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
259 if [ "$CHECK_FBCLIENT" = "yes" ]
261 printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE
262 printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE
264 printf "DEFS=$DEFS\n" >> $CONFFILE
265 printf "STG_LIBS=" >> $CONFFILE
268 printf "$lib " >> $CONFFILE
270 printf "\n" >> $CONFFILE
271 printf "CC=$CC\n" >> $CONFFILE
272 printf "CXX=$CXX\n" >> $CONFFILE
273 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
274 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
275 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
276 printf "PREFIX=$PREFIX\n" >> $CONFFILE
277 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
278 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
279 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
280 printf "OWNER=$OWNER\n" >> $CONFFILE
282 if [ "$1" != "debug" ]
286 printf "\n\n\nDebug build. Type $MAKE explicitly\n"