5 # $Date: 2010/04/14 08:59:02 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
28 CFLAGS="$CFLAGS -ggdb3 -W -Wall"
29 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
37 CFLAGS="$CFLAGS -I/usr/local/include"
38 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
39 LDFLAGS="$LDFLAGS -L/usr/local/lib"
41 if [ "$sys" = "Linux" ]
48 if [ "$sys" = "FreeBSD" ]
62 if [ "$OS" = "unknown" ]
64 printf "################################################################################\n"
65 printf "# Sorry, but sgauthstress currently supported by Linux, FreeBSD 4.x-8.x #\n"
66 printf "################################################################################\n"
70 printf "#############################################################################\n"
71 printf " Building sgauthstress for $sys $release\n"
72 printf "#############################################################################\n"
83 if [ "$OS" = "linux" ]
90 DEFS="$DEFS -DFREE_BSD"
93 DEFS="$DEFS -DFREE_BSD5"
113 printf "Checking CC... "
114 $CC --version > /dev/null 2> /dev/null
118 printf "$CC not found\n"
122 printf "Checking CXX... "
123 $CXX --version > /dev/null 2> /dev/null
127 printf "$CXX not found\n"
132 printf "Checking endianess... "
133 printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c
134 $CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null
138 printf "Endianess checking failed\n"
145 CXXFLAGS="$CXXFLAGS -DARCH_LE"
146 CFLAGS="$CFLAGS -DARCH_LE"
147 printf "Little Endian\n"
150 CXXFLAGS="$CXXFLAGS -DARCH_BE"
151 CFLAGS="$CFLAGS -DARCH_BE"
152 printf "Big Endian\n"
158 printf "Checking for -lfbclient... "
159 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
170 printf "Checking for mysql_config... "
171 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
175 printf "Checking for -lmysqlclient... "
176 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
182 CHECK_MYSQLCLIENT=yes
188 printf "Checking for mysql_config --cflags... "
189 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
195 printf "[$MYSQL_CFLAGS]\n"
196 printf "Checking for mysql_config --libs_r... "
197 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
203 CHECK_MYSQLCLIENT=yes
204 printf "[$MYSQL_LDFLAGS]\n"
209 printf "Checking for pg_config... "
210 PG_VERSION=`pg_config --version 2> /dev/null`
214 printf "Checking for -lpq... "
215 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
227 printf "Checking for pg_config --includedir... "
228 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
234 printf "[$PG_CFLAGS]\n"
235 printf "Checking for pg_config --libdir... "
236 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
243 printf "[$PG_LDFLAGS]\n"
250 if [ "$CHECK_FBCLIENT" = "yes" ]
258 if [ "$CHECK_PQ" = "yes" ]
264 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
270 printf "OS=$OS\n" > $CONFFILE
271 printf "STG_TIME=yes\n" >> $CONFFILE
272 printf "DEBUG=$DEBUG\n" >> $CONFFILE
273 printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE
274 printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE
275 printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE
276 printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE
277 printf "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules\n" >> $CONFFILE
278 printf "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins\n" >> $CONFFILE
279 printf "ARCH=$ARCH\n" >> $CONFFILE
280 printf "DEFS=$DEFS\n" >> $CONFFILE
281 printf "STG_LIBS=" >> $CONFFILE
284 printf "$lib " >> $CONFFILE
286 printf "\n" >> $CONFFILE
287 printf "PLUGINS=" >> $CONFFILE
288 for plugin in $PLUGINS
290 printf "$plugin " >> $CONFFILE
292 printf "\n" >> $CONFFILE
293 printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE
294 printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE
295 printf "CFLAGS=$CFLAGS\n" >> $CONFFILE
296 printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE
297 printf "PREFIX=$PREFIX\n" >> $CONFFILE
298 printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE
299 printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE
300 printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE
301 printf "OWNER=$OWNER\n" >> $CONFFILE