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