autoconf
[Top][All Lists]
Advanced

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

Bug in _AC_FEATURE_CHECK_LENGTH


From: Albert Chin
Subject: Bug in _AC_FEATURE_CHECK_LENGTH
Date: Wed, 17 Mar 2004 19:30:59 -0600
User-agent: Mutt/1.4i

While building automake-1.8.3 (based on autoconf 2.59a) on Solaris 9:
  checking for grep that handles long lines... 
  checking for egrep... configure: error: no acceptable egrep could be found in 
$PATH

In lib/autoconf/programs.m4 we have:
  AC_DEFUN([AC_PROG_GREP],
  ...
  m4_define([_AC_PROG_GREP],
  [_AC_PATH_PROG_FEATURE_CHECK([$1], [$2],
          [_AC_FEATURE_CHECK_LENGTH([ac_path_$1], [ac_cv_path_$1],
                  ["$ac_path_$1" '$1$'], [$1])])

_AC_PATH_PROG_FEATURE_CHECK is defined as:
  m4_define([_AC_PATH_PROG_FEATURE_CHECK],
  ...
  _AS_PATH_WALK([$4],
  [for ac_prog in $2; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      ac_path_$1="$as_dir/$ac_prog$ac_exec_ext"
      test -f "$ac_path_$1" || continue
      $3

_AC_FEATURE_CHECK_LENGTH is defined as:
  m4_define([_AC_FEATURE_CHECK_LENGTH],
  [if AS_EXECUTABLE_P(["$$1"]); then
    # Check for GNU $1 and select it if it is found.
    _AC_PATH_PROG_FLAVOR_GNU([$$1],
      [$2="$$1"
      break 2
    ])

The sh loop looks like:
  for as_dir in $PATH
  ...
    for ac_prog in grep ggrep; do
      for ac_exec_ext in '' $ac_executable_extensions; do
      ...
      if "$ac_path_GREP" --version 2>&1 < /dev/null | grep 'GNU' >/dev/null;
      then
        ac_cv_path_GREP="$ac_path_GREP"
        break 2
      fi

So, we need 'break 3', not 'break 2'. However, the 'break 2' in
_AC_FEATURE_CHECK_LENGTH seems rather brittle. Looks like we need to
get out of the loop without 'break', to avoid an assumption about how
deeply nested we are.

What should I do? Set a variable to exit the loop?

-- 
albert chin (address@hidden)




reply via email to

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