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 "#############################################################################"
77 if [ "$OS" = "linux" ]
85 DEFS="$DEFS -DFREE_BSD"
88 DEFS="$DEFS -DFREE_BSD5"
96 SHELL="/usr/local/bin/bash"
99 echo -n "Checking CC... "
100 $CC --version > /dev/null 2> /dev/null
108 echo -n "Checking CXX... "
109 $CXX --version > /dev/null 2> /dev/null
113 echo "$CXX not found"
118 echo -n "Checking endianess... "
119 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
120 $CC $CXXFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
124 echo "Endianess checking failed"
131 CXXFLAGS="$CXXFLAGS -DARCH_LE"
135 CXXFLAGS="$CXXFLAGS -DARCH_BE"
142 echo -n "Checking for -lfbclient... "
143 $CC $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
154 echo -n "Checking for mysql_config... "
155 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
159 echo -n "Checking for -lmysqlclient... "
160 $CC $CXXFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
166 CHECK_MYSQLCLIENT=yes
172 echo -n "Checking for mysql_config --cflags... "
173 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
179 #CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
180 echo "[$MYSQL_CFLAGS]"
181 echo -n "Checking for mysql_config --libs_r... "
182 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
188 CHECK_MYSQLCLIENT=yes
189 #LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
190 echo "[$MYSQL_LDFLAGS]"
195 echo -n "Checking for pg_config... "
196 PG_VERSION=`pg_config --version 2> /dev/null`
200 echo -n "Checking for -lpq... "
201 $CC $CXXFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
213 echo -n "Checking for pg_config --includedir... "
214 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
221 echo -n "Checking for pg_config --libdir... "
222 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
236 if [ "$CHECK_FBCLIENT" = "yes" ]
244 if [ "$CHECK_PQ" = "yes" ]
250 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
256 echo "OS=$OS" > $CONFFILE
257 echo "STG_TIME=yes" >> $CONFFILE
258 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
259 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
260 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
261 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
262 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
263 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
264 echo "ARCH=$ARCH" >> $CONFFILE
265 echo "DEFS=$DEFS" >> $CONFFILE
266 echo -n "STG_LIBS=" >> $CONFFILE
269 echo -n "$lib " >> $CONFFILE
272 echo -n "PLUGINS=" >> $CONFFILE
273 for plugin in $PLUGINS
275 echo -n "$plugin " >> $CONFFILE
278 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
279 echo "SHELL=$SHELL" >> $CONFFILE
280 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
281 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
282 echo "PREFIX=$PREFIX" >> $CONFFILE
283 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
284 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
285 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
286 echo "OWNER=$OWNER" >> $CONFFILE