5 # $Date: 2010/04/14 08:59:11 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
26 CXXFLAGS="$CXXFLAGS -g3 -W -Wall"
32 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
33 LDFLAGS="$LDFLAGS -L/usr/local/lib"
35 if [ "$sys" = "Linux" ]
42 if [ "$sys" = "FreeBSD" ]
55 if [ "$OS" = "unknown" ]
57 echo "#############################################################################"
58 echo "# Sorry, but sgconf currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
59 echo "#############################################################################"
63 echo "#############################################################################"
64 echo " Building sgconf for $sys $release"
65 echo "#############################################################################"
67 STG_LIBS="conffiles.lib
72 if [ "$OS" = "linux" ]
80 DEFS="$DEFS -DFREE_BSD"
82 DEFS="$DEFS -DFREE_BSD5"
90 SHELL="/usr/local/bin/bash"
93 echo -n "Checking gcc... "
94 gcc --version > /dev/null 2> /dev/null
102 echo -n "Checking g++... "
103 g++ --version > /dev/null 2> /dev/null
112 echo -n "Checking endianess... "
113 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
114 gcc $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
118 echo "Endianess checking failed"
125 CXXFLAGS="$CXXFLAGS -DARCH_LE"
129 CXXFLAGS="$CXXFLAGS -DARCH_BE"
135 echo -n "Checking for -lexpat... "
136 echo "int main() { return 0; }" > build_check.c
137 gcc $CXXFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
149 if [ "$CHECK_EXPAT" != "yes" ]
151 echo "-lexpat not found!"
155 echo "OS=$OS" > $CONFFILE
156 echo "STG_TIME=yes" >> $CONFFILE
157 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
158 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
159 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
160 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
161 echo "ARCH=$ARCH" >> $CONFFILE
162 echo "CHECK_EXPAT=$CHECK_EXPAT" >> $CONFFILE
163 echo "DEFS=$DEFS" >> $CONFFILE
164 echo -n "STG_LIBS=" >> $CONFFILE
167 echo -n "$lib " >> $CONFFILE
170 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
171 echo "SHELL=$SHELL" >> $CONFFILE
172 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
173 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
174 echo "PREFIX=$PREFIX" >> $CONFFILE
175 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
176 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
177 echo "OWNER=$OWNER" >> $CONFFILE