#!/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=libiwear_dcag_mark_assistant DISTNAME=iwear_dcag_mark_assistant DISTDIR=iwear_dcag_mark_assistant VERSION=0.0.1 if [ ! -d ./lib ] then mkdir ./lib fi if [ ! -d ~/lib/plugins ] then mkdir ~/lib/plugins fi if [ ! -d ~/lib/plugins/applications ] then mkdir ~/lib/plugins/applications fi # include the check function library . ./conf/functions # internal configuration and needed versions CONFLOG=config.log DEBUG=0 CONFIG_H=./include/config.h SRCDIRS="src" LIBLIBS="-lpqxx -lgd" INCLUDES="-I \$(TOPDIR)/include/" EXTRACLEANFILES="test doxygen.log libiwear_dcag_mark_assistant* plugins_application/markassistant/dcagmarkassistant.o" STERILFILES="*.tag lib/*.a lib/*.so* plugins_application/markassistant/.depend* plugins_application/markassistant/lib/iwear_* include/config.h makefile.conf" STERILDIRS=doc # Files to be linked together to the library #dcagdb.o #markassistantmenufunctor.o #dcagmarkassistant.o LIBFILES_src=" check.o weldpointpicturedata.o car.o weldpoint.o markassistantmenufunctor.o dcagdatacsvreader.o dcagdatacsvwriter.o dcagmarkassistant.o dcagimagemark.o pointselector.o optionguard.o " # 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" 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 # 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" echo -e "Valid options are :" echo -e "" 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 "" echo -e "Other Options:" echo -e "\t--no-pkg-config\tSkippes any search for pkg-config" echo -e "\t--force-dummy\tForces the creation of dummy classes without real db functionality" echo -e "\t--prefix=\tPath prefix to install the program into. default is /usr" echo -e "\t--help\t\tDisplays this help screen" echo -e "" cleanup; exit 0 fi write_config_cache $@ ############################################################################## # GCC Version ############################################################################## 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_doxygen BAIL=no check_echo set_debug $DEBUG #check_dlopen LIBFILES_src="$LIBFILES_src" 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 "\nWe are ready to compile. Type \"gmake lnk\" and then \"gmake\" or \"gmake install\" to create and then install the software"