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 -ggdb3 -W -Wall -I/usr/local/include"
22 LDFLAGS="$LDFLAGS -L/usr/local/lib"
24 if [ "$sys" = "Linux" ]
31 if [ "$sys" = "FreeBSD" ]
45 if [ "$OS" = "unknown" ]
47 echo "#############################################################################"
48 echo "# Sorry, but convertor currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
49 echo "#############################################################################"
53 echo "#############################################################################"
54 echo " Building convertor for $sys $release"
55 echo "#############################################################################"
66 if [ "$OS" = "linux" ]
73 DEFS="$DEFS -DFREE_BSD"
76 DEFS="$DEFS -DFREE_BSD5"
96 echo -n "Checking CC... "
97 $CC --version > /dev/null 2> /dev/null
105 echo -n "Checking CXX... "
106 $CXX --version > /dev/null 2> /dev/null
110 echo "$CXX not found"
115 echo -n "Checking endianess... "
116 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
117 $CC $CFLAGS $LDFLAGS -L/usr/lib/mysql -L/usr/local/lib/mysql build_check.c -o fake > /dev/null 2> /dev/null
121 echo "Endianess checking failed"
128 CXXFLAGS="$CXXFLAGS -DARCH_LE"
129 CFLAGS="$CFLAGS -DARCH_LE"
133 CXXFLAGS="$CXXFLAGS -DARCH_BE"
134 CFLAGS="$CFLAGS -DARCH_BE"
140 echo -n "Checking for -lfbclient... "
141 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
152 echo -n "Checking for mysql_config... "
153 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
157 echo -n "Checking for -lmysqlclient... "
158 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
164 CHECK_MYSQLCLIENT=yes
170 echo -n "Checking for mysql_config --cflags... "
171 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
177 echo "[$MYSQL_CFLAGS]"
178 echo -n "Checking for mysql_config --libs_r... "
179 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
185 CHECK_MYSQLCLIENT=yes
186 echo "[$MYSQL_LDFLAGS]"
191 echo -n "Checking for pg_config... "
192 PG_VERSION=`pg_config --version 2> /dev/null`
196 echo -n "Checking for -lpq... "
197 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
209 echo -n "Checking for pg_config --includedir... "
210 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
217 echo -n "Checking for pg_config --libdir... "
218 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
232 if [ "$CHECK_FBCLIENT" = "yes" ]
240 if [ "$CHECK_PQ" = "yes" ]
246 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
252 echo "OS=$OS" > $CONFFILE
253 echo "STG_TIME=yes" >> $CONFFILE
254 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
255 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
256 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
257 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
258 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
259 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
260 echo "ARCH=$ARCH" >> $CONFFILE
261 echo "CHECK_FBCLIENT=$CHECK_FBCLIENT" >> $CONFFILE
262 echo "DEFS=$DEFS" >> $CONFFILE
263 echo -n "STG_LIBS=" >> $CONFFILE
266 echo -n "$lib " >> $CONFFILE
269 echo -n "PLUGINS=" >> $CONFFILE
270 for plugin in $PLUGINS
272 echo -n "$plugin " >> $CONFFILE
275 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
276 echo "CFLAGS=$CFLAGS" >> $CONFFILE
277 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
278 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
279 echo "PREFIX=$PREFIX" >> $CONFFILE
280 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
281 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
282 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
283 echo "OWNER=$OWNER" >> $CONFFILE
284 echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
286 mkdir -p ../stargazer/modules