5 # $Date: 2010/04/14 08:59:02 $
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="$CXXFLAGS -L/usr/local/lib"
36 if [ "$sys" = "Linux" ]
43 if [ "$sys" = "FreeBSD" ]
57 if [ "$OS" = "unknown" ]
59 echo "################################################################################"
60 echo "# Sorry, but sgauthstress currently supported by Linux, FreeBSD 4.x-8.x #"
61 echo "################################################################################"
65 echo "#############################################################################"
66 echo " Building sgauthstress for $sys $release"
67 echo "#############################################################################"
78 if [ "$OS" = "linux" ]
85 DEFS="$DEFS -DFREE_BSD"
88 DEFS="$DEFS -DFREE_BSD5"
108 echo -n "Checking CC... "
109 $CC --version > /dev/null 2> /dev/null
117 echo -n "Checking CXX... "
118 $CXX --version > /dev/null 2> /dev/null
122 echo "$CXX not found"
127 echo -n "Checking endianess... "
128 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
129 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
133 echo "Endianess checking failed"
140 CXXFLAGS="$CXXFLAGS -DARCH_LE"
141 CFLAGS="$CFLAGS -DARCH_LE"
145 CXXFLAGS="$CXXFLAGS -DARCH_BE"
146 CFLAGS="$CFLAGS -DARCH_BE"
153 echo -n "Checking for -lfbclient... "
154 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
165 echo -n "Checking for mysql_config... "
166 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
170 echo -n "Checking for -lmysqlclient... "
171 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
177 CHECK_MYSQLCLIENT=yes
183 echo -n "Checking for mysql_config --cflags... "
184 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
190 echo "[$MYSQL_CFLAGS]"
191 echo -n "Checking for mysql_config --libs_r... "
192 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
198 CHECK_MYSQLCLIENT=yes
199 echo "[$MYSQL_LDFLAGS]"
204 echo -n "Checking for pg_config... "
205 PG_VERSION=`pg_config --version 2> /dev/null`
209 echo -n "Checking for -lpq... "
210 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
222 echo -n "Checking for pg_config --includedir... "
223 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
230 echo -n "Checking for pg_config --libdir... "
231 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
245 if [ "$CHECK_FBCLIENT" = "yes" ]
253 if [ "$CHECK_PQ" = "yes" ]
259 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
265 echo "OS=$OS" > $CONFFILE
266 echo "STG_TIME=yes" >> $CONFFILE
267 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
268 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
269 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
270 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
271 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
272 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
273 echo "ARCH=$ARCH" >> $CONFFILE
274 echo "DEFS=$DEFS" >> $CONFFILE
275 echo -n "STG_LIBS=" >> $CONFFILE
278 echo -n "$lib " >> $CONFFILE
281 echo -n "PLUGINS=" >> $CONFFILE
282 for plugin in $PLUGINS
284 echo -n "$plugin " >> $CONFFILE
287 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
288 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
289 echo "CFLAGS=$CFLAGS" >> $CONFFILE
290 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
291 echo "PREFIX=$PREFIX" >> $CONFFILE
292 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
293 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
294 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
295 echo "OWNER=$OWNER" >> $CONFFILE