diff --git a/configure b/configure index 245b9a83..4c30900c 100755 --- a/configure +++ b/configure @@ -10,32 +10,32 @@ DEFAULT_PREFIX="/usr/local" PREFIX=$DEFAULT_PREFIX configure_help() { - printf "Usage:\n" - printf "\t./configure [OPTIONS]...\n" - printf "\n" - printf "Options:\n" - - printf "\t-h, --help\t\tPrint this help and exit.\n" - - printf "\t--prefix=PREFIX\t\tPrepend PREFIX to program installation paths.\n" - printf "\t\t\t\t[%s]\n" $DEFAULT_PREFIX - - printf "\t--debug\n" - printf "\t\t\t\tBuild for debugging.\n" - - printf "\t--enable-ref-tracking\n" - printf "\t\t\t\tEnable reference tracking which is dumped to stdout when the program exits.\n" - - printf "\t--disable-schemas-compile\n" - printf "\t\t\t\tDisable compiling the GSettings schema.\n" - - printf "\t--disable-desktop-update\n" - printf "\t\t\t\tDisable desktop database update.\n" - - printf "\t--disable-icon-update\n" - printf "\t\t\t\tDisable icon cache update.\n" - - printf "\n" + cat <<- EOT + Usage: + ./configure [OPTIONS]... + + Options: + -h, --help Print this help and exit. + --prefix=PREFIX Prepend PREFIX to program installation paths. + [$DEFAULT_PREFIX] + --debug Build for debugging. + + --enable-ref-tracking + Enable reference tracking which is dumped to stdout when the program exits. + --disable-schemas-compile + Disable compiling the GSettings schema. + --disable-desktop-update + Disable desktop database update. + --disable-icon-update + Disable icon cache update. + + Some influential environment variables: + PKG_CONFIG_PATH Adds directories to pkg-config's search path. + PKG_CONFIG_LIBDIR Overrides pkg-config's built-in search path. + + VALAC Name of the vala compiler to use, e.g. "valac-0.18". + +EOT } abort() { @@ -46,10 +46,13 @@ abort() { while [ $# != 0 ] do - option=`echo $1 | sed 's/=.*//'` - if [ `echo $1 | grep '='` ] + if [[ "$1" = *=* ]] then - value=`echo $1 | sed 's/.*=//'` + option=${1%%=*} + value=${1#*=} + else + option=$1 + value= fi case $option in @@ -57,11 +60,7 @@ do exit 0 ;; - --prefix) if [ ! $value ] - then - abort $1 - fi - + --prefix) [ ! $value ] && abort $1 CMDLINE="${CMDLINE} -DCMAKE_INSTALL_PREFIX=${value}" ;; @@ -86,6 +85,10 @@ do CMDLINE="${CMDLINE} -DDESKTOP_UPDATE=OFF" ;; + VALAC) [ ! $value ] && abort $1 + VALAC=$value + ;; + *) abort $option ;; esac @@ -93,6 +96,20 @@ do shift done +# Verify use supplied vala executable +if [ -n "$VALAC" ] +then + VALA_EXECUTABLE=`type -p "$VALAC"` + + if [ -z "$VALA_EXECUTABLE" ] + then + printf "$VALAC is not an executable program.\n" + exit 1 + fi + + CMDLINE="${CMDLINE} -DVALA_EXECUTABLE='$VALA_EXECUTABLE'" +fi + # Verify cmake is installed # TODO: Check for minimum version number if ! cmake --version