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"
25 if [ "$sys" = "Linux" ]
32 if [ "$sys" = "FreeBSD" ]
46 if [ "$OS" = "unknown" ]
48 echo "#############################################################################"
49 echo "# Sorry, but convertor currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
50 echo "#############################################################################"
54 echo "#############################################################################"
55 echo " Building convertor for $sys $release"
56 echo "#############################################################################"
67 if [ "$OS" = "linux" ]
74 DEFS="$DEFS -DFREE_BSD"
77 DEFS="$DEFS -DFREE_BSD5"
97 echo -n "Checking CC... "
98 $CC --version > /dev/null 2> /dev/null
106 echo -n "Checking CXX... "
107 $CXX --version > /dev/null 2> /dev/null
111 echo "$CXX not found"
116 echo -n "Checking endianess... "
117 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
118 $CC $CFLAGS $LDFLAGS -L/usr/lib/mysql -L/usr/local/lib/mysql build_check.c -o fake > /dev/null 2> /dev/null
122 echo "Endianess checking failed"
129 CXXFLAGS="$CXXFLAGS -DARCH_LE"
130 CFLAGS="$CFLAGS -DARCH_LE"
134 CXXFLAGS="$CXXFLAGS -DARCH_BE"
135 CFLAGS="$CFLAGS -DARCH_BE"
141 echo -n "Checking for -lfbclient... "
142 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
153 echo -n "Checking for mysql_config... "
154 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
158 echo -n "Checking for -lmysqlclient... "
159 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
165 CHECK_MYSQLCLIENT=yes
171 echo -n "Checking for mysql_config --cflags... "
172 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
178 echo "[$MYSQL_CFLAGS]"
179 echo -n "Checking for mysql_config --libs_r... "
180 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
186 CHECK_MYSQLCLIENT=yes
187 echo "[$MYSQL_LDFLAGS]"
192 echo -n "Checking for pg_config... "
193 PG_VERSION=`pg_config --version 2> /dev/null`
197 echo -n "Checking for -lpq... "
198 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
210 echo -n "Checking for pg_config --includedir... "
211 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
218 echo -n "Checking for pg_config --libdir... "
219 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
233 if [ "$CHECK_FBCLIENT" = "yes" ]
241 if [ "$CHECK_PQ" = "yes" ]
247 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
253 echo "OS=$OS" > $CONFFILE
254 echo "STG_TIME=yes" >> $CONFFILE
255 echo "DEBUG=$DEBUG" >> $CONFFILE
256 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
257 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
258 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
259 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
260 echo "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules" >> $CONFFILE
261 echo "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins" >> $CONFFILE
262 echo "ARCH=$ARCH" >> $CONFFILE
263 echo "CHECK_FBCLIENT=$CHECK_FBCLIENT" >> $CONFFILE
264 echo "DEFS=$DEFS" >> $CONFFILE
265 echo -n "STG_LIBS=" >> $CONFFILE
268 echo -n "$lib " >> $CONFFILE
271 echo -n "PLUGINS=" >> $CONFFILE
272 for plugin in $PLUGINS
274 echo -n "$plugin " >> $CONFFILE
277 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
278 echo "CFLAGS=$CFLAGS" >> $CONFFILE
279 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
280 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
281 echo "PREFIX=$PREFIX" >> $CONFFILE
282 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
283 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
284 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
285 echo "OWNER=$OWNER" >> $CONFFILE
286 echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
288 mkdir -p ../stargazer/modules