Allow configure to select valac version; fix #6704
We recognize the VALAC environment variable, or you can specify VALAC=whatever on the ./configure command line. Also, this cleans up some of the configure logic to be a little easier to read and edit.
This commit is contained in:
parent
2e97bd7a6c
commit
049af6b0dd
1 changed files with 51 additions and 34 deletions
85
configure
vendored
85
configure
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue