5 # $Date: 2010/04/14 08:59:11 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
27 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
33 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
34 LDFLAGS="$LDFLAGS -L/usr/local/lib"
36 if [ "$sys" = "Linux" ]
43 if [ "$sys" = "FreeBSD" ]
57 if [ "$OS" = "unknown" ]
59 echo "#############################################################################"
60 echo "# Sorry, but sgconf currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
61 echo "#############################################################################"
65 echo "#############################################################################"
66 echo " Building sgconf for $sys $release"
67 echo "#############################################################################"
69 STG_LIBS="conffiles.lib
74 if [ "$OS" = "linux" ]
81 DEFS="$DEFS -DFREE_BSD"
83 DEFS="$DEFS -DFREE_BSD5"
103 echo -n "Checking CC... "
104 $CC --version > /dev/null 2> /dev/null
112 echo -n "Checking CXX... "
113 $CXX --version > /dev/null 2> /dev/null
117 echo "$CXX not found"
122 echo -n "Checking endianess... "
123 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
124 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
128 echo "Endianess checking failed"
135 CXXFLAGS="$CXXFLAGS -DARCH_LE"
136 CFLAGS="$CFLAGS -DARCH_LE"
140 CXXFLAGS="$CXXFLAGS -DARCH_BE"
141 CFLAGS="$CFLAGS -DARCH_BE"
147 echo -n "Checking for -lexpat... "
148 echo "int main() { return 0; }" > build_check.c
149 $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
161 if [ "$CHECK_EXPAT" != "yes" ]
163 echo "-lexpat not found!"
167 echo "OS=$OS" > $CONFFILE
168 echo "STG_TIME=yes" >> $CONFFILE
169 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
170 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
171 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
172 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
173 echo "ARCH=$ARCH" >> $CONFFILE
174 echo "CHECK_EXPAT=$CHECK_EXPAT" >> $CONFFILE
175 echo "DEFS=$DEFS" >> $CONFFILE
176 echo -n "STG_LIBS=" >> $CONFFILE
179 echo -n "$lib " >> $CONFFILE
182 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
183 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
184 echo "CFLAGS=$CFLAGS" >> $CONFFILE
185 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
186 echo "PREFIX=$PREFIX" >> $CONFFILE
187 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
188 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
189 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
190 echo "OWNER=$OWNER" >> $CONFFILE