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"
126 printf "Checking CC... "
127 $CC --version > /dev/null 2> /dev/null
131 printf "$CC not found\n"
135 printf "Checking CXX... "
136 $CXX --version > /dev/null 2> /dev/null
140 printf "$CXX not found\n"
145 printf "Checking endianess... "
146 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
147 $CC $CFLAGS $LDFLAGS build_check.c -o fake
151 printf "Endianess checking failed\n"
158 CXXFLAGS="$CXXFLAGS -DARCH_LE"
159 CFLAGS="$CFLAGS -DARCH_LE"
160 printf "Little Endian\n"
163 CXXFLAGS="$CXXFLAGS -DARCH_BE"
164 CFLAGS="$CFLAGS -DARCH_BE"
165 printf "Big Endian\n"
170 printf "Checking for -lexpat... "
171 printf "#include <expat.h>\nint main() { return 0; }\n" > build_check.c
172 $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
183 printf "Checking for iconv 2nd argument... "
184 printf "#include <iconv.h>\nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c
185 $CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null
190 DEFS="$DEFS -DCONST_ICONV"
195 printf "Checking for fb_config... "
196 FB_VERSION=`fb_config --version 2> /dev/null`
200 printf "Checking for -lfbclient... "
201 printf "int main() { return 0; }\n" > build_check.c
202 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
209 FB_LDFLAGS="-lfbclient"
216 printf "Checking for fb_config --cflags... "
217 FB_CFLAGS=`fb_config --cflags`
223 printf "[$FB_CFLAGS]\n"
224 printf "Checking for fb_config --libs "
225 FB_LDFLAGS=`fb_config --libs`
232 printf "[$FB_LDFLAGS]\n"
239 if [ "$CHECK_EXPAT" != "yes" ]
241 printf -- "-lexpat not found!\n"
245 if [ "$CHECK_FBCLIENT" = "yes" ]
251 printf "OS=$OS\n" > $CONFFILE
252 printf "STG_TIME=yes\n" >> $CONFFILE
253 printf "DEBUG=$DEBUG\n" >> $CONFFILE
254 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
255 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
256 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
257 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
258 printf "ARCH=$ARCH\n" >> $CONFFILE
259 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
260 printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE
261 if [ "$CHECK_FBCLIENT" = "yes" ]
263 printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE
264 printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE
266 printf "DEFS=$DEFS\n" >> $CONFFILE
267 printf "STG_LIBS=" >> $CONFFILE
270 printf "$lib " >> $CONFFILE
272 printf "\n" >> $CONFFILE
273 printf "CC=$CC\n" >> $CONFFILE
274 printf "CXX=$CXX\n" >> $CONFFILE
275 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
276 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
277 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
278 printf "LIBICONV=$LIBICONV\n" >> $CONFFILE
279 printf "PREFIX=$PREFIX\n" >> $CONFFILE
280 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
281 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
282 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
283 printf "OWNER=$OWNER\n" >> $CONFFILE
285 if [ "$1" != "debug" ]
289 printf "\n\n\nDebug build. Type $MAKE explicitly\n"