5 # $Date: 2010/04/14 08:59:02 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
27 CXXFLAGS="$CXXFLAGS -g3 -W -Wall"
33 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
34 LDFLAGS="$CXXFLAGS -L/usr/local/lib"
36 if [ "$sys" = "Linux" ]
43 if [ "$sys" = "FreeBSD" ]
56 if [ "$OS" = "unknown" ]
58 echo "################################################################################"
59 echo "# Sorry, but sgauthstress currently supported by Linux, FreeBSD 4.x-8.x #"
60 echo "################################################################################"
64 echo "#############################################################################"
65 echo " Building sgauthstress for $sys $release"
66 echo "#############################################################################"
78 if [ "$OS" = "linux" ]
86 DEFS="$DEFS -DFREE_BSD"
89 DEFS="$DEFS -DFREE_BSD5"
97 SHELL="/usr/local/bin/bash"
100 echo -n "Checking gcc... "
101 gcc --version > /dev/null 2> /dev/null
109 echo -n "Checking g++... "
110 g++ --version > /dev/null 2> /dev/null
119 echo -n "Checking endianess... "
120 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
121 gcc $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
125 echo "Endianess checking failed"
132 CXXFLAGS="$CXXFLAGS -DARCH_LE"
136 CXXFLAGS="$CXXFLAGS -DARCH_BE"
143 echo -n "Checking for -lfbclient... "
144 gcc $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
155 echo -n "Checking for mysql_config... "
156 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
160 echo -n "Checking for -lmysqlclient... "
161 gcc $CXXFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
167 CHECK_MYSQLCLIENT=yes
173 echo -n "Checking for mysql_config --cflags... "
174 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
180 #CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
181 echo "[$MYSQL_CFLAGS]"
182 echo -n "Checking for mysql_config --libs_r... "
183 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
189 CHECK_MYSQLCLIENT=yes
190 #LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
191 echo "[$MYSQL_LDFLAGS]"
196 echo -n "Checking for pg_config... "
197 PG_VERSION=`pg_config --version 2> /dev/null`
201 echo -n "Checking for -lpq... "
202 gcc $CXXFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
214 echo -n "Checking for pg_config --includedir... "
215 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
222 echo -n "Checking for pg_config --libdir... "
223 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
237 if [ "$CHECK_FBCLIENT" = "yes" ]
245 if [ "$CHECK_PQ" = "yes" ]
251 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
257 echo "OS=$OS" > $CONFFILE
258 echo "STG_TIME=yes" >> $CONFFILE
259 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
260 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
261 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
262 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
263 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
264 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
265 echo "ARCH=$ARCH" >> $CONFFILE
266 echo "DEFS=$DEFS" >> $CONFFILE
267 echo -n "STG_LIBS=" >> $CONFFILE
270 echo -n "$lib " >> $CONFFILE
273 echo -n "PLUGINS=" >> $CONFFILE
274 for plugin in $PLUGINS
276 echo -n "$plugin " >> $CONFFILE
279 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
280 echo "SHELL=$SHELL" >> $CONFFILE
281 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
282 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
283 echo "PREFIX=$PREFIX" >> $CONFFILE
284 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
285 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
286 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
287 echo "OWNER=$OWNER" >> $CONFFILE