#!/bin/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" DISTNAME=iwlocator LIBNAME=lib$DISTNAME DISTDIR=iwlocator VERSION=0.8.0 #include it . ./conf/functions SRCDIRS="src" LIBS=-lpthread LIBLIBS="-liwdb -liwsens" INCLUDES="-I \$(TOPDIR)/include/" EXTRACLEANFILES="test doxygen.log libiw*" STERILFILES="*.tag lib/*.a lib/*.so* include/config.h makefile.conf" STERILDIRS="doc/html" MIN_GPP="3.3.1" MIN_GCC="3.3.0" MIN_MAKE="3.79" MIN_IWSENS="0.3.0" MIN_IWDB="0.4.0" # Files to be linked together to the library WIRELESS=" apinfo.o iwlib.o qinfo.o optionguard.o rangeinfo.o wlanlocator.o wlocation.o " LIBFILES_src=" dummylocator.o fixedlocator.o location.o locationmanager.o locator.o locatorevent.o $WIRELESS " #ncextra.o # internal configuration and needed versions CONFLOG=config.log DEBUG=0 CONFIG_H=./include/config.h echo "Starting automagix config script" > $CONFLOG set -- $(read_config_cache $@) echo -e "$TUK$0 $@ $NOR" # "stolen" from autoconf 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[^=]*=\(.*\)'` case $option in -no-pkg-config | --no-pkg-config | --no-pkg-config | --no-pkg-confi | --no-pkg-conf | --no-pkg-con | --no-pkg-co | --no-pkg-c | --no-pkg- | --no-pkg | --no-pk | --no-p) NO_PKG_CONFIG=yes ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) prev=PREFIX ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) PREFIX="$optarg" ;; --debug=*) DEBUG="$optarg" ;; --no-static | --no-stati | --no-stat) NOSTATLIB=true ;; -help | --help | --hel | --he | -h) HELP=yes ;; *=*) envvar=`expr "x$option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $envvar" >&2 { (exit 1); exit 1; }; } optarg=`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$envvar='$optarg'" export $envvar ;; *) echo "Unrecognized option: $option" exit 1 ;; esac 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--no-static\tPrevents the static library archive (lib/$LIBNAME.a) from beeing build" echo -e "" echo -e "Debug Options:" echo -e "\t--debug=#\tCompilation debuglevel." echo -e "This value also influences the way the library is compiled." echo -e "The possible values for it are:" echo -e "" echo -e "0 - Don't debug. No debugging information will be compiled in, and the maximum" echo -e " optimization will be applied." echo -e "1 - Compile in debug information (-ggdb3). Don't change optimization." echo -e "2 - Compile with debug information, but dont optimize." echo -e "3 - Compile with debug information and set additional debug defines" echo -e "4 - Compile with debug information, additional debug defines " echo -e " and libmudflap support. (Note: your compiler needs to support mudflap)" echo -e "" echo -e "Other Options:" echo -e "\t--no-pkg-config\tSkippes any search for pkg-config" 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_ostype check_dynlib check_gcc $MIN_GCC check_exit $BAIL ############################################################################## # GCC Version ############################################################################## check_gpp $MIN_GPP check_exit $BAIL ############################################################################## # gmake Version ############################################################################## check_gmake $MIN_MAKE if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_echo check_doxygen BAIL=no ############################################################################## # pkg-config Version ############################################################################## check_pkg_config check_pgsql 7.3.0 # need to check here too because of sql scripts and cmds. #check_iwear $MIN_IWEAR if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_iwsens $MIN_IWSENS if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_iwdb $MIN_IWDB if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_iwidl ############################################################################## # wireless headers ############################################################################## check_wireless if [ $BAIL == "yes" ] then cleanup; exit 1 fi if [ "$HAVE_WIRELESS" != "yes" ] then logecho "Removing wireless code from build set" # echo "Old libfiles : " # echo $LIBFILES_src for wf in $WIRELESS do logecho "Removing $wf" LIBFILES_src=$( echo $LIBFILES_src | sed "s/$wf//g" ) done # echo "New libfiles : " # echo $LIBFILES_src fi set_debug $DEBUG 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 <