function common_help( )
{
	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--force-gcc\tForces configure to accept current C compiler version"
	echo -e "\t--force-gpp\tForces configure to accept current C++ compiler version"
	echo -e "\t--force-make\tForces configure to accept the current make version"
	echo -e "\t--no-pkg-config\tSkippes any search for pkg-config"
	echo -e "\t--prefix=<path>\tPath prefix to install the program into. default is $PREFIX"
	echo -e "\t--sysconfdir=<path>\tPath prefix for systemwide configurations."
	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 "  CXX         C++ Compiler"
	echo -e "  CFLAGS      C compiler flags"
	echo -e "  CXXLAGS     C++ Compiler flags, e.g. -I<include dir> if you have"
	echo -e "              headers in a nonstandard directory <include dir>"
	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."
}

function display_help()
{
    common_help
    echo -e ""
    echo -e "Project specific flags:"
    i=0
    while [[ $i < ${#PROJECT_HELP[*]} ]]
    do
	echo -e ${PROJECT_HELP[$i]}
	i=$(($i+1))
    done
}

global_function_index=0
function add_help()
{
    ARG=$*
    PROJECT_HELP[$global_function_index]=$ARG
    global_function_index=$((global_function_index+1))
}

function maybe_display_help()
{
    if [ ! -z "$HELP" ]
    then
	display_help
	cleanup
    fi
}


# vim: ft=sh