bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_PATH_PROG ignores the variable


From: Stepan Kasal
Subject: AC_PATH_PROG ignores the variable
Date: Fri, 5 Nov 2004 14:03:07 +0100
User-agent: Mutt/1.4.1i

Hello,

I think I have found a bug in AC_PATH_PROG.  If the variable is set but
doesn't look like full path, AC_PATH_PROG ignores it.

The manual says:
 - Macro: AC_PATH_PROG (VARIABLE, PROG-TO-CHECK-FOR,
          [VALUE-IF-NOT-FOUND], [PATH])
     Like `AC_CHECK_PROG', but set VARIABLE to the entire path of
     PROG-TO-CHECK-FOR if found.

But if I set eg. PYTHON=python2.1 (not the last version) then
        AC_CHECK_PROG(PYTHON, python, ...)
respects it, while
        AC_PATH_PROG(PYTHON, python, ...)
ignores it and proceeds as if the variable were empty and finds "python"
instead of "python2.1".

I think that AC_PATH_PROG should con tain something like the following:

AC_CACHE_VAL([ac_cv_path_$1],
[case $$1 in
  [[\\/]]* | ?:[[\\/]]*)
    ac_cv_path_$1="$$1";; # Let the user override the test with a path.
  ?*) ac_word="$$1";;
esac
_AS_PATH_WALK([$4],
[for ac_exec_ext in '' $ac_executable_extensions; do
  if AS_EXECUTABLE_P(["$as_dir/$ac_word$ac_exec_ext"]); then
    ac_cv_path_$1="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" 
>&AS_MESSAGE_LOG_FD
    break 2
  fi
done])
if test -z "$ac_cv_path_$1" && test "x$$1" != x; then
  AC_MSG_ERROR("Cannot find $$1 required by \$$1")
fi
dnl If no 3rd arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
m4_ifvaln([$3],
[  test -z "$ac_cv_path_$1" && ac_cv_path_$1="$3"])])

What do you think?
        Stepan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]