Strict option checking unless otherwise specified
Having option checking catches typos. Disabling the checking enable us to use the same build options for a bunch of packages even though they may not have the same dependencies.
This commit is contained in:
27
configure
vendored
27
configure
vendored
@@ -19,6 +19,7 @@ Optional Features:
|
||||
--disable-silent-rules print every compilation statement as executed
|
||||
--enable-system-debug put .debug files in global GDB debug dir
|
||||
[default=yes if prefix=/usr, no otherwise]
|
||||
--disable-option-checking ignore unrecognized --enable/--with options
|
||||
|
||||
Optional Packages:
|
||||
--with-dune-common=PATH use DUNE-common library from a specified location
|
||||
@@ -65,6 +66,14 @@ Try \`$0 --help' for more information
|
||||
EOF
|
||||
}
|
||||
|
||||
# exit only if option checking is enabled, otherwise ignore
|
||||
invalid_opt () {
|
||||
if [ "${option_check}" = "yes" ]; then
|
||||
invalid_arg $@
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# default values
|
||||
prefix=/usr/local
|
||||
buildtype=Debug
|
||||
@@ -74,6 +83,7 @@ pch_use=
|
||||
silent_rules=
|
||||
#debug_loc=" -DSYSTEM_DEBUG=OFF"
|
||||
debug_loc=
|
||||
option_check=yes
|
||||
|
||||
# this variable will get feature options
|
||||
FEATURES=
|
||||
@@ -130,10 +140,12 @@ while getopts -- ":-:" optchar; do
|
||||
rootvar="${pkgname^^}_PREFIX"
|
||||
;;
|
||||
*)
|
||||
rootvar="${pkgname}_DIR"
|
||||
invalid_opt --with-${pkgname}
|
||||
rootvar=""
|
||||
;;
|
||||
esac
|
||||
# add this to the list of existing features
|
||||
test -n "${rootvar}" && \
|
||||
FEATURES="${FEATURES} \"-D${rootvar}=${pkgloc}\""
|
||||
;;
|
||||
disable-*)
|
||||
@@ -147,6 +159,11 @@ while getopts -- ":-:" optchar; do
|
||||
esac
|
||||
# casing is of course different
|
||||
case "${pkgname}" in
|
||||
option-checking)
|
||||
option_check=no
|
||||
# special flag: don't disable any particular package
|
||||
pkgname=""
|
||||
;;
|
||||
debug)
|
||||
buildtype=Release
|
||||
# special flag: don't disable any particular package
|
||||
@@ -175,6 +192,10 @@ while getopts -- ":-:" optchar; do
|
||||
gxx11check)
|
||||
pkgname="CXX11Features"
|
||||
;;
|
||||
*)
|
||||
invalid_opt --disable-${pkgname}
|
||||
pkgname=""
|
||||
;;
|
||||
esac
|
||||
# only disable packages if the flag refers to a proper one
|
||||
test -n "${pkgname}" && \
|
||||
@@ -201,8 +222,8 @@ while getopts -- ":-:" optchar; do
|
||||
shared="OFF"
|
||||
;;
|
||||
*)
|
||||
invalid_arg --enable-${kind}
|
||||
exit 1
|
||||
invalid_opt --enable-${kind}
|
||||
shared=""
|
||||
;;
|
||||
esac
|
||||
test -n "${shared}" && \
|
||||
|
||||
Reference in New Issue
Block a user