5 # $Date: 2008/01/05 12:11:02 $
6 ######################################################
11 major=`printf "%s" "$release" | cut -d. -f1`
13 CONFFILE="../../Makefile.conf"
23 MAKEOPTS="$MAKEOPTS -j1"
24 CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra"
25 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
32 CFLAGS="$CFLAGS -I/usr/local/include"
33 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
34 LDFLAGS="$LDFLAGS -L/usr/local/lib"
36 if [ "$sys" = "Linux" ]
42 if [ "$sys" = "FreeBSD" ]
54 if [ "$sys" = "Darwin" ]
60 if [ "$OS" = "unknown" ]
62 printf "#############################################################################\n"
63 printf "# Sorry, but sgconf_xml is currently supported by Linux, FreeBSD and Darwin.#\n"
64 printf "#############################################################################\n"
68 printf "#############################################################################\n"
69 printf " Building sgconf_xml for $sys $release\n"
70 printf "#############################################################################\n"
72 STG_LIBS="conffiles.lib
77 if [ "$OS" = "linux" ]
84 DEFS="$DEFS -DFREE_BSD"
86 DEFS="$DEFS -DFREE_BSD5"
106 printf "Checking CC... "
107 $CC --version > /dev/null 2> /dev/null
111 printf "$CC not found\n"
115 printf "Checking CXX... "
116 $CXX --version > /dev/null 2> /dev/null
120 printf "$CXX not found\n"
125 printf "Checking endianess... "
126 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
127 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
131 printf "Endianess checking failed\n"
138 CXXFLAGS="$CXXFLAGS -DARCH_LE"
139 CFLAGS="$CFLAGS -DARCH_LE"
140 printf "Little Endian\n"
143 CXXFLAGS="$CXXFLAGS -DARCH_BE"
144 CFLAGS="$CFLAGS -DARCH_BE"
145 printf "Big Endian\n"
150 printf "Checking for -lexpat... "
151 printf "int main() { return 0; }\n" > build_check.c
152 $CC $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
164 if [ "$CHECK_EXPAT" != "yes" ]
166 printf "-lexpat not found!\n"
170 printf "OS=$OS\n" > $CONFFILE
171 printf "STG_TIME=yes\n" >> $CONFFILE
172 printf "DEBUG=$DEBUG\n" >> $CONFFILE
173 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
174 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
175 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
176 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
177 printf "ARCH=$ARCH\n" >> $CONFFILE
178 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
179 printf "DEFS=$DEFS\n" >> $CONFFILE
180 printf "STG_LIBS=" >> $CONFFILE
183 printf "$lib " >> $CONFFILE
185 printf "\n" >> $CONFFILE
186 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
187 printf "CC=$CC\n" >> $CONFFILE
188 printf "CXX=$CXX\n" >> $CONFFILE
189 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
190 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
191 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
192 printf "PREFIX=$PREFIX\n" >> $CONFFILE
193 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
194 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
195 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
196 printf "OWNER=$OWNER\n" >> $CONFFILE
198 if [ "$1" != "debug" ]
202 printf "\n\n\nDebug build. Type $MAKE explicitly\n"