5 # $Date: 2010/05/09 12:39:01 $
6 ######################################################
8 # Installation path prefix
12 # Binaries access bits
16 # Data files access bits
24 # Binaries and data files owner
28 # Name of the firebird's group
29 # Need for chown directory with firebird db
31 FIREBIRD_GROUP=firebird
34 # Firebird must have priviledges to read/write for specified path
36 DB_ADDRESS="localhost:/var/stargazer/stargazer.fdb"
39 # This user must have priviledges to create database
47 # Full path to isql utility
48 # Note: Debian users have to specify path to isql-fb utility
50 FIREBIRD_ISQL="/opt/firebird/bin/isql"
54 release=`uname -r | cut -b1`
56 CONFFILE="../../Makefile.conf"
57 VAR_DIR="./inst/var/stargazer"
58 MIN_XMLRPCC_VERSION="1.06.27"
59 XMLRPC_FEATURES="c++2 abyss-server"
71 CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall"
78 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
79 LDFLAGS="$LDFLAGS -L/usr/local/lib"
81 if [ "$sys" = "Linux" ]
85 ETC_DIR="./inst/linux/etc/stargazer"
89 if [ "$sys" = "FreeBSD" ]
99 ETC_DIR="./inst/freebsd/etc/stargazer"
103 if [ "$OS" = "unknown" ]
105 echo "#############################################################################"
106 echo "# Sorry, but stargazer currently supported by Linux, FreeBSD 4.x, 5.x, 6.x #"
107 echo "#############################################################################"
111 echo "#############################################################################"
112 echo " Building STG 2.4 for $sys $release"
113 echo "#############################################################################"
125 PLUGINS="authorization/ao
126 authorization/inetaccess
127 configuration/sgconfig
135 if [ "$OS" = "linux" ]
146 DEFS="$DEFS -DFREE_BSD"
149 DEFS="$DEFS -DFREE_BSD5"
150 if [ "$OS" = "bsd7" ]
158 capture/ether_freebsd
159 capture/divert_freebsd"
160 SHELL="/usr/local/bin/bash"
173 echo -n "Checking CC... "
174 $CC --version > /dev/null 2> /dev/null
182 echo -n "Checking CXX... "
183 $CXX --version > /dev/null 2> /dev/null
187 echo "$CXX not found"
192 echo -n "Checking endianess... "
193 echo "int main() { int probe = 0x00000001; return *(char *)&probe; }" > build_check.c
194 $CC $CFLAGS $LDFLAGS build_check.c -o fake
198 echo "Endianess checking failed"
205 CXXFLAGS="$CXXFLAGS -DARCH_LE"
206 CFLAGS="$CFLAGS -DARCH_LE"
210 CXXFLAGS="$CXXFLAGS -DARCH_BE"
211 CFLAGS="$CFLAGS -DARCH_BE"
217 echo -n "Checking for -lexpat... "
218 echo "int main() { return 0; }" > build_check.c
219 $CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null
230 echo -n "Checking for -lfbclient... "
231 $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null
242 echo -n "Checking for mysql_config... "
243 MYSQL_VERSION=`mysql_config --version 2> /dev/null`
247 echo -n "Checking for -lmysqlclient... "
248 $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null
254 CHECK_MYSQLCLIENT=yes
260 echo -n "Checking for mysql_config --cflags... "
261 MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null`
267 echo "[$MYSQL_CFLAGS]"
268 echo -n "Checking for mysql_config --libs_r... "
269 MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null`
275 CHECK_MYSQLCLIENT=yes
276 echo "[$MYSQL_LDFLAGS]"
281 echo -n "Checking for pg_config... "
282 PG_VERSION=`pg_config --version 2> /dev/null`
286 echo -n "Checking for -lpq... "
287 $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null
299 echo -n "Checking for pg_config --includedir... "
300 PG_CFLAGS=`pg_config --includedir 2> /dev/null`
307 echo -n "Checking for pg_config --libdir... "
308 PG_LDFLAGS=`pg_config --libdir 2> /dev/null`
320 echo -n "Checking for xmlrpc-c-config... "
321 XMLRPCC_VERSION=`xmlrpc-c-config $XMLRPC_FEATURES --version 2> /dev/null`
325 echo -n "Checking for -lxmlrpc... "
326 $CC $CFLAGS $LDFLAGS build_check.c -lxmlrpc $LIB_THREAD -o fake > /dev/null 2> /dev/null
336 elif [ "$XMLRPCC_VERSION" \< "$MIN_XMLRPCC_VERSION" ]
338 echo "no (need at least $MIN_XMLRPCC_VERSION, actual $XMLRPCC_VERSION)";
341 echo "yes (version $XMLRPCC_VERSION)";
342 echo -n "Checking for xmlrpc-c-config --cflags... "
343 XMLRPC_CFLAGS=`xmlrpc-c-config $XMLRPC_FEATURES --cflags 2> /dev/null`
349 echo "[$XMLRPC_CFLAGS]"
350 echo -n "Checking for xmlrpc-c-config --libs... "
351 XMLRPC_LDFLAGS=`xmlrpc-c-config $XMLRPC_FEATURES --libs 2> /dev/null`
358 echo "[$XMLRPC_LDFLAGS]"
365 if [ "$CHECK_EXPAT" != "yes" ]
367 echo "-lexpat not found!"
371 if [ "$CHECK_FBCLIENT" = "yes" ]
379 if [ "$CHECK_PQ" = "yes" ]
385 if [ "$CHECK_MYSQLCLIENT" = "yes" ]
391 if [ "$CHECK_XMLRPC" = "yes" ]
394 configuration/rpcconfig"
397 echo "OS=$OS" > $CONFFILE
398 echo "STG_TIME=yes" >> $CONFFILE
399 echo "DIR_BUILD=$BUILD_DIR" >> $CONFFILE
400 echo "DIR_LIB=\$(DIR_BUILD)/../../lib" >> $CONFFILE
401 echo "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs" >> $CONFFILE
402 echo "DIR_INCLUDE=\$(DIR_BUILD)/../../include" >> $CONFFILE
403 echo "DIR_MOD=\$(DIR_BUILD)/modules" >> $CONFFILE
404 echo "DIR_PLUGINS=\$(DIR_BUILD)/plugins" >> $CONFFILE
405 echo "ARCH=$ARCH" >> $CONFFILE
406 echo "CHECK_EXPAT=$CHECK_EXPAT" >> $CONFFILE
407 echo "CHECK_FBCLIENT=$CHECK_FBCLIENT" >> $CONFFILE
408 echo "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT" >> $CONFFILE
409 echo "CHECK_PQ=$CHECK_PQ" >> $CONFFILE
410 echo "CHECK_XMLRPC=$CHECK_XMLRPC" >> $CONFFILE
411 echo "DEFS=$DEFS" >> $CONFFILE
412 echo -n "STG_LIBS=" >> $CONFFILE
415 echo -n "$lib " >> $CONFFILE
418 echo -n "PLUGINS=" >> $CONFFILE
419 for plugin in $PLUGINS
421 echo -n "$plugin " >> $CONFFILE
424 echo "SHELL=$SHELL" >> $CONFFILE
425 echo "CXXFLAGS=$CXXFLAGS" >> $CONFFILE
426 echo "CFLAGS=$CFLAGS" >> $CONFFILE
427 echo "LDFLAGS=$LDFLAGS" >> $CONFFILE
428 echo "LIB_THREAD=$LIB_THREAD" >> $CONFFILE
429 echo "PREFIX=$PREFIX" >> $CONFFILE
430 echo "BIN_MODE=$BIN_MODE" >> $CONFFILE
431 echo "DATA_MODE=$DATA_MODE" >> $CONFFILE
432 echo "DIR_MODE=$DIR_MODE" >> $CONFFILE
433 echo "OWNER=$OWNER" >> $CONFFILE
434 echo "VAR_DIR=$VAR_DIR" >> $CONFFILE
435 echo "ETC_DIR=$ETC_DIR" >> $CONFFILE
436 echo "DB_ADDRESS=$DB_ADDRESS" >> $CONFFILE
437 echo "DB_USER=$DB_USER" >> $CONFFILE
438 echo "DB_PASSWORD=$DB_PASSWORD" >> $CONFFILE
439 echo "FIREBIRD_ISQL=$FIREBIRD_ISQL" >> $CONFFILE
440 echo "FIREBIRD_GROUP=$FIREBIRD_GROUP" >> $CONFFILE
444 if [ "$1" != "debug" ]
448 echo -e "\n\n\nDebug build. Type $MAKE explicitly"