5 # $Date: 2010/04/14 08:59:11 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
28 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
36 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
37 LDFLAGS="$LDFLAGS -L/usr/local/lib"
39 if [ "$sys" = "Linux" ]
46 if [ "$sys" = "FreeBSD" ]
60 if [ "$OS" = "unknown" ]
62 echo "#############################################################################"
63 echo "# Sorry, but sgconf currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
64 echo "#############################################################################"
68 echo "#############################################################################"
69 echo " Building sgconf for $sys $release"
70 echo "#############################################################################"
72 STG_LIBS="conffiles.lib
77 if [ "$OS" = "linux" ]
84 DEFS="$DEFS -DFREE_BSD"
86 DEFS="$DEFS -DFREE_BSD5"
106 echo -n "Checking CC... "
107 $CC --version > /dev/null 2> /dev/null
115 echo -n "Checking CXX... "
116 $CXX --version > /dev/null 2> /dev/null
120 echo "$CXX not found"
125 echo -n "Checking endianess... "
126 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
127 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
131 echo "Endianess checking failed"
138 CXXFLAGS="$CXXFLAGS -DARCH_LE"
139 CFLAGS="$CFLAGS -DARCH_LE"
143 CXXFLAGS="$CXXFLAGS -DARCH_BE"
144 CFLAGS="$CFLAGS -DARCH_BE"
150 echo -n "Checking for -lexpat... "
151 echo "int main() { return 0; }" > build_check.c
152 $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
164 if [ "$CHECK_EXPAT" != "yes" ]
166 echo "-lexpat not found!"
170 echo "OS=$OS" > $CONFFILE
171 echo "STG_TIME=yes" >> $CONFFILE
172 echo "DEBUG=$DEBUG" >> $CONFFILE
173 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
174 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
175 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
176 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
177 echo "ARCH=$ARCH" >> $CONFFILE
178 echo "CHECK_EXPAT=$CHECK_EXPAT" >> $CONFFILE
179 echo "DEFS=$DEFS" >> $CONFFILE
180 echo -n "STG_LIBS=" >> $CONFFILE
183 echo -n "$lib " >> $CONFFILE
186 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
187 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
188 echo "CFLAGS=$CFLAGS" >> $CONFFILE
189 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
190 echo "PREFIX=$PREFIX" >> $CONFFILE
191 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
192 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
193 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
194 echo "OWNER=$OWNER" >> $CONFFILE