#!/usr/bin/env bash # # # This is not generated by autoconf or similar, just handcoded, since we don't # need this much complexity # Our configuration for the makefiles !! PREFIX="/usr" SYSCONF="/etc" LIBNAME=libiwdb DISTNAME=dbclasses DISTDIR=dbclasses VERSION=0.6.0 # include the check function library . ./conf/functions # internal configuration and needed versions CONFLOG=config.log DEBUG=0 CONFIG_H=./include/config.h SRCDIRS="src" LIBS=-lpthread LIBLIBS="-lpthread -lpqxx -liwear_core" INCLUDES="-I \$(TOPDIR)/include/" EXTRACLEANFILES="test doxygen.log libiwdb* src/*.ao" STERILFILES="*.tag lib/*.a lib/*.so* include/config.h makefile.conf" STERILDIRS="doc/html" # Files to be linked together to the library LIBFILES_src=" debugmoduledb.o dummydb.o iwdb.o optionguard.o recordset.o" PQLIBFILES="iwpgdb.o pgrecordset.o" MYSQLLIBFILES="" # do the prechecks, among others it tells us the os type class . ./conf/common_precheck # Minimum required version of libpq and postgresql stuff #MIN_MAKE="3.78" #MIN_GCC="3.3.0" #MIN_GPP="3.3.0" MIN_PG="7.3.4" MIN_PQX="2.1.3" MIN_IWEAR="0.6.0" echo "Starting automagix config script" > $CONFLOG set -- $(read_config_cache $@) echo -e "$TUK$0 $@ $NOR" # simple command line parameter parsing {{{ prev= option=--`echo $prev | sed 's/_/-/g'` optarg=`expr "x$option" : 'x[^=]*=\(.*\)'` for option do # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi optarg=`expr "x$option" : 'x[^=]*=\(.*\)'` . ./conf/common_optionparse # These are the module specific options case $option in --with-pq-libs=* | --with-pq-lib=* | --with-pq-li=* | --with-pq-l=*) PG_LIBDIR=$optarg ;; --with-pq-include=* | --with-pq-includ=* | --with-pq-inclu=* | --with-pq-incl=* | --with-pq-inc=* | --with-pq-in=* | --with-pq-i=*) PG_INCLUDE=$optarg ;; --with-pqxx-libs=* | --with-pqxx-lib=* | --with-pqxx-li=* | --with-pqxx-l=*) PQXX_LIBDIR=$optarg ;; --with-pqxx-include=* | --with-pqxx-includ=* | --with-pqxx-inclu=* | --with-pqxx-incl=* | --with-pqxx-inc=* | --with-pqxx-in=* | --with-pqxx-i=*) PQXX_INCLUDE=$optarg ;; -force-dummy | --force-dumm | --force-dum | --force-du | --force-d | --force- | --force | --forc | --for | --fo | --f) DUMMY=yes ;; esac # This file contains the loop end as well as the common variable setting and the default case . ./conf/common_optiondefaults done # }}} eval PREFIX='$PREFIX' eval SYSCONF='$SYSCONF' set_dirs if [ ! -z "$HELP" ] then # echo "help" # echo -e "Unrecognized argument \"$1\"\n" . ./conf/common_help common_help echo -e "" echo -e "Project specific flags:" echo -e "Fine Tuning of library and include directories:" echo -e "\t--with-pq-libs=DIR\tThe directory where libpq.so can be found" echo -e "\t--with-pq-include=DIR\tThe directory where the libpq includes can be found" echo -e "\t--with-pqxx-libs=DIR\tThe directory where libpqxx.so can be found" echo -e "\t--with-pqxx-include=DIR\tThe directory where libpqxx.so includes can be found" echo -e "" cleanup; exit 0 fi ############################################################################## # GCC Version ############################################################################## write_config_cache $@ check_dynlib #check_gcc $MIN_GCC if [ $BAIL == "yes" ] then echo "Your GCC is too old and does not support proper ISO C" exit 1 fi #check_gpp $MIN_GPP if [ $BAIL == "yes" ] then echo "Your G++ is too old and does not support proper ISO C++" exit 1 fi ############################################################################## # gmake Version ############################################################################## #check_gmake $MIN_MAKE if [ $BAIL == "yes" ] then exit 1 fi check_pkg_config ############################################################################## # PostgreSQL libs Version ############################################################################## check_pgsql $MIN_PG if [ $BAIL == "yes" ] then exit 1 fi check_libpq if [ $BAIL == "yes" ] then exit 1 fi check_libpqxx $MIN_PQX if [ $BAIL == "yes" ] then exit 1 fi check_iwear $MIN_IWEAR if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_doxygen BAIL=no check_echo #check_dlopen set_debug $DEBUG LIBFILES_src="$LIBFILES_src $PQLIBFILES" gen_makefile makefile.conf gen_config $CONFIG_H echo -e "\nConfiguration :\n" echo -e "PREFIX\t\t$PREFIX" echo -e "SYSCONF\t\t$SYSCONF" echo -e "LIBDIR\t\t$PREFIX/lib" cat <