diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-26 18:33:53 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-05-26 18:33:53 +0200 |
commit | 7aa57aa228e88bf2b90f27ab75a9e86c7a6410a9 (patch) | |
tree | b03d677bda6602cbda0e6d71d07bbb265fd69fd1 | |
parent | 94314fce7cf1f93fad7f0b872c0623165f6b0fbb (diff) | |
download | crosstool-ng-7aa57aa228e88bf2b90f27ab75a9e86c7a6410a9.tar.gz crosstool-ng-7aa57aa228e88bf2b90f27ab75a9e86c7a6410a9.tar.bz2 crosstool-ng-7aa57aa228e88bf2b90f27ab75a9e86c7a6410a9.zip |
configure: add has_or_warn
By popular request, add a function to only warn on missing stuff.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rwxr-xr-x | configure | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -96,6 +96,7 @@ add_to_var_list() { # the error message to print if tool is missing # optional, defaults to: '${prog}: none found' # eg: err="'bash' 3.x or above was not found" +# Note: err may be printed by caller, not us check_for() { local val local item @@ -208,6 +209,23 @@ has_or_abort() { fi } +# This function checks for a tool, and warns if not found +# See check_for(), above, for how to call has_or_abort +# Note: if err is not set, then no error message is printed +has_or_warn() { + # We declare these 6 variables here, although they are + # set in check_for(), called below + local prog inc lib + local var ver err + + if ! check_for "$@"; then + printf "${err:+${err}\n}" + if [ -n "${var}" ]; then + printf -- "--> You can give the path to this tool using: --with-${var}=PATH\n" + fi + fi +} + do_help() { cat <<__EOF__ \`configure' configures crosstool-NG-${VERSION} to adapt to many kind of systems. |