5 # $Date: 2008/01/05 12:11:02 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
22 MAKEOPTS="$MAKEOPTS -j1"
23 CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra"
24 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra"
31 CFLAGS="$CFLAGS -I/usr/local/include"
32 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
35 if [ "$sys" = "Linux" ]
42 if [ "$sys" = "FreeBSD" ]
54 if [ "$OS" = "unknown" ]
56 printf "#############################################################################\n"
57 printf "# Sorry, but sgconf_xml is currently supported by Linux, FreeBSD and Darwin.#\n"
58 printf "#############################################################################\n"
62 printf "#############################################################################\n"
63 printf " Building sgconf_xml for $sys $release\n"
64 printf "#############################################################################\n"
66 STG_LIBS="conffiles.lib
71 if [ "$OS" = "linux" ]
78 DEFS="$DEFS -DFREE_BSD"
80 DEFS="$DEFS -DFREE_BSD5"
100 printf "Checking CC... "
101 $CC --version > /dev/null 2> /dev/null
105 printf "$CC not found\n"
109 printf "Checking CXX... "
110 $CXX --version > /dev/null 2> /dev/null
114 printf "$CXX not found\n"
119 printf "Checking endianess... "
120 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
121 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
125 printf "Endianess checking failed\n"
132 CXXFLAGS="$CXXFLAGS -DARCH_LE"
133 CFLAGS="$CFLAGS -DARCH_LE"
134 printf "Little Endian\n"
137 CXXFLAGS="$CXXFLAGS -DARCH_BE"
138 CFLAGS="$CFLAGS -DARCH_BE"
139 printf "Big Endian\n"
144 printf "Checking for -lexpat... "
145 printf "int main() { return 0; }\n" > build_check.c
146 $CC $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
158 if [ "$CHECK_EXPAT" != "yes" ]
160 printf "-lexpat not found!\n"
164 printf "OS=$OS\n" > $CONFFILE
165 printf "STG_TIME=yes\n" >> $CONFFILE
166 printf "DEBUG=$DEBUG\n" >> $CONFFILE
167 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
168 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
169 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
170 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
171 printf "ARCH=$ARCH\n" >> $CONFFILE
172 printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE
173 printf "DEFS=$DEFS\n" >> $CONFFILE
174 printf "STG_LIBS=" >> $CONFFILE
177 printf "$lib " >> $CONFFILE
179 printf "\n" >> $CONFFILE
180 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
181 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
182 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
183 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
184 printf "PREFIX=$PREFIX\n" >> $CONFFILE
185 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
186 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
187 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
188 printf "OWNER=$OWNER\n" >> $CONFFILE
190 if [ "$1" != "debug" ]
194 printf "\n\n\nDebug build. Type $MAKE explicitly\n"