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" ]
101 DEFS="$DEFS -DFREE_BSD"
103 if [ "$OS" = "bsd7" ]
105 DEFS="$DEFS -DFREE_BSD5"
107 if [ "$OS" == "darwin" ]
109 DEFS="$DEFS -DDARWIN"
125 printf "Checking CC... "
126 $CC --version > /dev/null 2> /dev/null
130 printf "$CC not found\n"
134 printf "Checking CXX... "
135 $CXX --version > /dev/null 2> /dev/null
139 printf "$CXX not found\n"
144 printf "Checking endianess... "
145 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
146 $CC $CFLAGS $LDFLAGS build_check.c -o fake
150 printf "Endianess checking failed\n"
157 CXXFLAGS="$CXXFLAGS -DARCH_LE"
158 CFLAGS="$CFLAGS -DARCH_LE"
159 printf "Little Endian\n"
162 CXXFLAGS="$CXXFLAGS -DARCH_BE"
163 CFLAGS="$CFLAGS -DARCH_BE"
164 printf "Big Endian\n"
169 printf "Checking for -lexpat... "
170 printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
171 $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
182 printf "Checking for iconv 2nd argument... "
183 printf "#include <iconv.h>\nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c
184 $CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null
189 DEFS="$DEFS -DCONST_ICONV"
194 printf "Checking for fb_config... "
195 FB_VERSION=`fb_config --version 2> /dev/null`
199 printf "Checking for -lfbclient... "
200 printf "int main() { return 0; }\n" > build_check.c
201 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
208 FB_LDFLAGS="-lfbclient"
215 printf "Checking for fb_config --cflags... "
216 FB_CFLAGS=`fb_config --cflags`
222 printf "[$FB_CFLAGS]\n"
223 printf "Checking for fb_config --libs "
224 FB_LDFLAGS=`fb_config --libs`
231 printf "[$FB_LDFLAGS]\n"
238 if [ "$CHECK_EXPAT" != "yes" ]
240 printf -- "-lexpat not found!\n"
244 if [ "$CHECK_FBCLIENT" = "yes" ]
250 printf "OS=$OS\n" > $CONFFILE
251 printf "STG_TIME=yes\n" >> $CONFFILE
252 printf "DEBUG=$DEBUG\n" >> $CONFFILE
253 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
254 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
255 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
256 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
257 printf "ARCH=$ARCH\n" >> $CONFFILE
258 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
259 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
260 if [ "$CHECK_FBCLIENT" = "yes" ]
262 printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE
263 printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE
265 printf "DEFS=$DEFS\n" >> $CONFFILE
266 printf "STG_LIBS=" >> $CONFFILE
269 printf "$lib " >> $CONFFILE
271 printf "\n" >> $CONFFILE
272 printf "CC=$CC\n" >> $CONFFILE
273 printf "CXX=$CXX\n" >> $CONFFILE
274 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
275 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
276 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
277 printf "LIBICONV=$LIBICONV\n" >> $CONFFILE
278 printf "PREFIX=$PREFIX\n" >> $CONFFILE
279 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
280 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
281 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
282 printf "OWNER=$OWNER\n" >> $CONFFILE
284 if [ "$1" != "debug" ]
288 printf "\n\n\nDebug build. Type $MAKE explicitly\n"