5 # $Date: 2010/04/14 08:59:02 $
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="$CXXFLAGS -L/usr/local/lib"
39 if [ "$sys" = "Linux" ]
46 if [ "$sys" = "FreeBSD" ]
60 if [ "$OS" = "unknown" ]
62 echo "################################################################################"
63 echo "# Sorry, but sgauthstress currently supported by Linux, FreeBSD 4.x-8.x #"
64 echo "################################################################################"
68 echo "#############################################################################"
69 echo " Building sgauthstress for $sys $release"
70 echo "#############################################################################"
81 if [ "$OS" = "linux" ]
88 DEFS="$DEFS -DFREE_BSD"
91 DEFS="$DEFS -DFREE_BSD5"
111 echo -n "Checking CC... "
112 $CC --version > /dev/null 2> /dev/null
120 echo -n "Checking CXX... "
121 $CXX --version > /dev/null 2> /dev/null
125 echo "$CXX not found"
130 echo -n "Checking endianess... "
131 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
132 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
136 echo "Endianess checking failed"
143 CXXFLAGS="$CXXFLAGS -DARCH_LE"
144 CFLAGS="$CFLAGS -DARCH_LE"
148 CXXFLAGS="$CXXFLAGS -DARCH_BE"
149 CFLAGS="$CFLAGS -DARCH_BE"
156 echo -n "Checking for -lfbclient... "
157 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
168 echo -n "Checking for mysql_config... "
169 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
173 echo -n "Checking for -lmysqlclient... "
174 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
180 CHECK_MYSQLCLIENT=yes
186 echo -n "Checking for mysql_config --cflags... "
187 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
193 echo "[$MYSQL_CFLAGS]"
194 echo -n "Checking for mysql_config --libs_r... "
195 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
201 CHECK_MYSQLCLIENT=yes
202 echo "[$MYSQL_LDFLAGS]"
207 echo -n "Checking for pg_config... "
208 PG_VERSION=`pg_config --version 2> /dev/null`
212 echo -n "Checking for -lpq... "
213 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
225 echo -n "Checking for pg_config --includedir... "
226 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
233 echo -n "Checking for pg_config --libdir... "
234 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
248 if [ "$CHECK_FBCLIENT" = "yes" ]
256 if [ "$CHECK_PQ" = "yes" ]
262 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
268 echo "OS=$OS" > $CONFFILE
269 echo "STG_TIME=yes" >> $CONFFILE
270 echo "DEBUG=$DEBUG" >> $CONFFILE
271 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
272 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
273 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
274 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
275 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
276 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
277 echo "ARCH=$ARCH" >> $CONFFILE
278 echo "DEFS=$DEFS" >> $CONFFILE
279 echo -n "STG_LIBS=" >> $CONFFILE
282 echo -n "$lib " >> $CONFFILE
285 echo -n "PLUGINS=" >> $CONFFILE
286 for plugin in $PLUGINS
288 echo -n "$plugin " >> $CONFFILE
291 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
292 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
293 echo "CFLAGS=$CFLAGS" >> $CONFFILE
294 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
295 echo "PREFIX=$PREFIX" >> $CONFFILE
296 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
297 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
298 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
299 echo "OWNER=$OWNER" >> $CONFFILE