#!/usr/bin/env bash #!/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" LIBNAME=libiwremote DISTNAME=iwremote DISTDIR=iwremote VERSION=0.7.0 # include the check function library . ./conf/functions CONFLOG=config.log DEBUG=0 CONFIG_H=./include/config.h check_ostype SRCDIRS="src" TRANSDIRS="src parser include" LIBS=-lpthread LIBLIBS="-liwear_core -liwear_net" INCLUDES="-I \$(TOPDIR)/include/" EXTRACLEANFILES="test doxygen.log libiw* parser/idlparser.cc parser/*.o parser/idlparser.hh parser/idlparser.o* parser/idlparser.yy.cc parser/idlparser.yy.hh parser/idlparser.yy.o* src/sensorserver.* src/sensorcommon.* src/sensorclient.* plugins/callprovider/socketprovider.o plugins/searchprovider/rpcsearchprovider.o" STERILFILES="*.tag lib/*.a lib/*.so* include/config.h makefile.conf" STERILDIRS= # Files to be linked together to the library LIBFILES_src=" chainsecurityprovider.o callmanager.o callprovider.o pluginloader.o remoteconnection.o remoteobject.o optionguard.o rootartano.o scheduledcall.o socketprovider.o socketremoteconnection.o xdrstream.o remotedescriptor.o rpcsearchcommon.o rpcsearchclient.o rpcsearchserver.o rpcsearchprovider.o " # internal configuration and needed versions # the minimal required version of some things. theyre used later and here for a # better overwiew MIN_IWEAR="0.7.0" MIN_MAKE="3.78" MIN_GCC="3.3.0" MIN_GPP="3.3.1" MIN_SSL="0.9.7a" MIN_BOOST="1.32.0" # # End of configurable stuff # echo "Starting automagix config script" > $CONFLOG check_sed if [ $BAIL == "yes" ] then cleanup; exit 1 fi set -- $(read_config_cache $@) echo "$0 $@" # "stolen" from autoconf {{{ ac_prev= ac_option=--`echo $ac_prev | sed 's/_/-/g'` ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` case $ac_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 ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf | --syscon | --sysco | --sysc | --sys | --sy | --s) ac_prev=SYSCONF ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=* | --s=*) SYSCONF="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=PREFIX ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) PREFIX="$ac_optarg" ;; -force-gpp | --force-gpp | --force-gp) FORCEGPP=yes ;; -force-make | --force-make | --force-mak | --force-ma | --force-m) FORCEMAKE=yes ;; -force-gcc | --force-gcc | --force-gc) FORCEGCC=yes ;; --debug=*) DEBUG="$ac_optarg" ;; --no-static | --no-stati | --no-stat) NOSTATLIB=true ;; -help | --help | --hel | --he | -h) HELP=yes ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (cleanup; exit 1); cleanup; exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; 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 "" 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--force-gcc=yes\tForces configure to accept current C compiler version" echo -e "\t--force-gpp=yes\tForces configure to accept current C++ compiler version" 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 $PREFIX" echo -e "\t--help\t\tDisplays this help screen" echo -e "" echo -e "Some influential environment variables:" echo -e " CC C compiler command" echo -e " CFLAGS C compiler flags" echo -e " CPPFLAGS C++ Compiler flags, e.g. -I if you have" echo -e " headers in a nonstandard directory " echo -e " CPP C++ Compiler" echo -e "" echo -e "Use these variables to override the choices made by \`configure' or to help" echo -e "it to find libraries and programs with nonstandard names/locations." cleanup; exit 0 fi write_config_cache $@ ############################################################################## # GCC Version ############################################################################## check_ostype check_dynlib check_gcc $MIN_GCC if [ $BAIL == "yes" ] then echo "Your GCC is too old and does not support proper ISO C" cleanup; exit 1 fi ############################################################################## # GCC Version ############################################################################## check_gpp $MIN_GPP if [ $BAIL == "yes" ] then echo "Your GCC is too old and does not support proper ISO C++" cleanup; exit 1 fi ############################################################################## # gmake Version ############################################################################## check_gmake $MIN_MAKE if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_dlopen if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_strnlen #check_strcasestr #check_vasprintf #check_strerror_r check_echo ############################################################################## # pkg-config Version ############################################################################## check_pkg_config #check_xerces $MIN_XERCES check_iwear $MIN_IWEAR if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_pgsql 7.3.2 if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_boost $MIN_BOOST if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_libpqxx 2.1.3 #check_ssl $MIN_SSL if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_glib2 $MIN_GLIB2 if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_linc if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_orbit2 $MIN_ORBIT2 if [ $BAIL == "yes" ] then cleanup; exit 1 fi #check_orbitcpp $MIN_ORBITCPP if [ $BAIL == "yes" ] then cleanup; exit 1 fi check_doxygen BAIL=no 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" echo -e "\nWe are ready to compile. Type \"gmake lnk\" and then \"gmake\" or \"gmake install\" to create and then install the software. If you plan to develop then \"gmake dep\" is a usefull feature too"