diff options
author | Alexey Neyman <stilor@att.net> | 2018-04-28 16:41:16 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2018-04-29 12:06:54 -0700 |
commit | 74979fb19b2c7220dab4196c0d34e0c29b341b09 (patch) | |
tree | 6ae4685ef53ec2b10593fe19fc1397bc8619f311 /m4/ctng_version_check.m4 | |
parent | 0f34b0ebf0651fd26fde1646ac1fb4031e0c57a2 (diff) | |
download | crosstool-ng-74979fb19b2c7220dab4196c0d34e0c29b341b09.tar.gz crosstool-ng-74979fb19b2c7220dab4196c0d34e0c29b341b09.tar.bz2 crosstool-ng-74979fb19b2c7220dab4196c0d34e0c29b341b09.zip |
Add checking for *sum and unzip
Also improve logging (add an ability to log commands/files/environment variables
to config.log)
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'm4/ctng_version_check.m4')
-rw-r--r-- | m4/ctng_version_check.m4 | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/m4/ctng_version_check.m4 b/m4/ctng_version_check.m4 index 703661b6..4518e0c1 100644 --- a/m4/ctng_version_check.m4 +++ b/m4/ctng_version_check.m4 @@ -11,14 +11,27 @@ AC_DEFUN([CTNG_PROG_VERSION], CTNG_WITH_DEPRECATED([$3], [$1]) AC_ARG_VAR([$1], [Specify the full path to $2]) ctng_version_$1_ok=false - AC_CACHE_CHECK([for $3], [ac_cv_path_$1], - [AC_PATH_PROGS_FEATURE_CHECK([$1], [$4], - [[ver=$($ac_path_$1 --version 2>/dev/null| $EGREP $5) - test -z "$ac_cv_path_$1" && ac_cv_path_$1=$ac_path_$1 - test -n "$ver" && ac_cv_path_$1="$ac_path_$1" ac_path_$1_found=: ctng_version_$1_ok=:]])]) + # If a variable is already set, check if it an absolute path and convert if not. + # Autoconf's AC_PATH_PROGS* macros just blindly trust $1 to be correct - but + # AWK is set to just the command name by AC_INIT. AS_IF([test -n "$$1"], - [[ver=$($ac_cv_path_$1 --version 2>/dev/null| $EGREP $5) - test -n "$ver" && ctng_version_$1_ok=:]]) + [ac_cv_path_$1="$$1" + CTNG_PATH_ABSNAME([ac_cv_path_$1]) + CTNG_MSG_LOG_ENVVAR([ac_cv_path_$1]) + ver=$($ac_cv_path_$1 --version 2>/dev/null) + CTNG_MSG_LOG([looking for '[$5]' regexp in]) + CTNG_MSG_LOG_ENVVAR([ver], [version info for $ac_cv_path_$1]) + ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]') + test -n "$ver" && ctng_version_$1_ok=:], + [AC_CACHE_CHECK([for $3], [ac_cv_path_$1], + [AC_PATH_PROGS_FEATURE_CHECK([$1], [$4], + [CTNG_MSG_LOG_ENVVAR([ac_path_$1], [checking $1 at]) + ver=$($ac_path_$1 --version 2>/dev/null) + CTNG_MSG_LOG([looking for '[$5]' regexp in]) + CTNG_MSG_LOG_ENVVAR([ver], [version info]) + ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]') + test -z "$ac_cv_path_$1" && ac_cv_path_$1=$ac_path_$1 + test -n "$ver" && ac_cv_path_$1="$ac_path_$1" ac_path_$1_found=: ctng_version_$1_ok=:])])]) AC_MSG_CHECKING([for $2]) AS_IF([$ctng_version_$1_ok], [AC_MSG_RESULT([yes])], |