5 # $Date: 2010/04/14 08:58:43 $
6 ######################################################
10 release=`uname -r | cut -b1`
12 CONFFILE="../../Makefile.conf"
18 VAR_DIR="./inst/var/stargazer"
21 CXXFLAGS="$CXXFLAGS -g3 -W -Wall -I/usr/local/include"
22 LDFLAGS="$LDFLAGS -L/usr/local/lib"
24 if [ "$sys" = "Linux" ]
31 if [ "$sys" = "FreeBSD" ]
44 if [ "$OS" = "unknown" ]
46 echo "#############################################################################"
47 echo "# Sorry, but convertor currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
48 echo "#############################################################################"
52 echo "#############################################################################"
53 echo " Building convertor for $sys $release"
54 echo "#############################################################################"
65 if [ "$OS" = "linux" ]
73 DEFS="$DEFS -DFREE_BSD"
76 DEFS="$DEFS -DFREE_BSD5"
84 SHELL="/usr/local/bin/bash"
87 echo -n "Checking CC... "
88 $CC --version > /dev/null 2> /dev/null
96 echo -n "Checking CXX... "
97 $CXX --version > /dev/null 2> /dev/null
101 echo "$CXX not found"
106 echo -n "Checking endianess... "
107 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
108 $CC $CXXFLAGS $LDFLAGS -L/usr/lib/mysql -L/usr/local/lib/mysql build_check.c -o fake > /dev/null 2> /dev/null
112 echo "Endianess checking failed"
119 CXXFLAGS="$CXXFLAGS -DARCH_LE"
123 CXXFLAGS="$CXXFLAGS -DARCH_BE"
129 echo -n "Checking for -lfbclient... "
130 $CC $CXXFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
141 echo -n "Checking for mysql_config... "
142 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
146 echo -n "Checking for -lmysqlclient... "
147 $CC $CXXFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
153 CHECK_MYSQLCLIENT=yes
159 echo -n "Checking for mysql_config --cflags... "
160 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
166 #CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
167 echo "[$MYSQL_CFLAGS]"
168 echo -n "Checking for mysql_config --libs_r... "
169 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
175 CHECK_MYSQLCLIENT=yes
176 #LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
177 echo "[$MYSQL_LDFLAGS]"
182 echo -n "Checking for pg_config... "
183 PG_VERSION=`pg_config --version 2> /dev/null`
187 echo -n "Checking for -lpq... "
188 $CC $CXXFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
200 echo -n "Checking for pg_config --includedir... "
201 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
208 echo -n "Checking for pg_config --libdir... "
209 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
223 if [ "$CHECK_FBCLIENT" = "yes" ]
231 if [ "$CHECK_PQ" = "yes" ]
237 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
243 echo "OS=$OS" > $CONFFILE
244 echo "STG_TIME=yes" >> $CONFFILE
245 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
246 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
247 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
248 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
249 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
250 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
251 echo "ARCH=$ARCH" >> $CONFFILE
252 echo "CHECK_FBCLIENT=$CHECK_FBCLIENT" >> $CONFFILE
253 echo "DEFS=$DEFS" >> $CONFFILE
254 echo -n "STG_LIBS=" >> $CONFFILE
257 echo -n "$lib " >> $CONFFILE
260 echo -n "PLUGINS=" >> $CONFFILE
261 for plugin in $PLUGINS
263 echo -n "$plugin " >> $CONFFILE
266 echo "SHELL=$SHELL" >> $CONFFILE
267 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
268 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
269 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
270 echo "PREFIX=$PREFIX" >> $CONFFILE
271 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
272 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
273 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
274 echo "OWNER=$OWNER" >> $CONFFILE
275 echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
277 mkdir -p ../stargazer/modules