From: Akim Demaille Date: Fri, 5 May 2000 13:29:47 +0000 (+0000) Subject: AC_CHECK_PROG macro fails if REJECT value is set under Digital X-Git-Tag: autoconf-2.50~945 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5556110f0c3fca0c842e56644bcb299242bdbc05;p=thirdparty%2Fautoconf.git AC_CHECK_PROG macro fails if REJECT value is set under Digital Unix 4.0x and 5.0 because `"$@"' expands into an empty parameter (instead of nothing) when there are no positional parameters. From Nicolas Joly. * acgeneral.m4 (AC_CHECK_PROG, AC_CHECK_PROGS): Prefer `$$1' to `[$]$1', `$foo' to `[$]foo', `$[1]' to `[$]1', and `${1+"$[@]"}' to `"[$]@"'. --- diff --git a/ChangeLog b/ChangeLog index 2b1a3e6c4..91d564290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-05-05 Akim Demaille + + AC_CHECK_PROG macro fails if REJECT value is set under Digital + Unix 4.0x and 5.0 because `"$@"' expands into an empty parameter + (instead of nothing) when there are no positional parameters. + From Nicolas Joly. + + * acgeneral.m4 (AC_CHECK_PROG, AC_CHECK_PROGS): Prefer + `$$1' to `[$]$1', `$foo' to `[$]foo', `$[1]' to `[$]1', and + `${1+"$[@]"}' to `"[$]@"'. + 2000-05-04 Akim Demaille AC_PREREQ understands `2.14a' as `2.141'. diff --git a/acgeneral.m4 b/acgeneral.m4 index 3a1e6118f..8fec5fa9a 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -2431,11 +2431,11 @@ IFS=$ac_save_ifs # ----------------------------------------------------- AC_DEFUN(AC_CHECK_PROG, [# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 +set dummy $2; ac_word=$[2] AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_prog_$1, -[if test -n "[$]$1"; then - ac_cv_prog_$1="[$]$1" # Let the user override the test. +[if test -n "$$1"; then + ac_cv_prog_$1="$$1" # Let the user override the test. else ifval([$6], [ ac_prog_rejected=no ])dnl @@ -2451,16 +2451,16 @@ ifval([$6], done ifval([$6], [if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. - set dummy [$]ac_cv_prog_$1 + set dummy $ac_cv_prog_$1 shift - if test [$]# -gt 0; then + if test $[#] -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set $1 to just the basename; use the full file name. shift - set dummy "$ac_path" "[$]@" + set dummy "$ac_path" ${1+"$[@]"} shift - ac_cv_prog_$1="[$]@" + ac_cv_prog_$1="$[@]" ifelse([$2], [$4], [ else # Default is a loser. @@ -2472,14 +2472,14 @@ fi ])dnl dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_CHECK_PROGS will keep looking. -ifval([$4], [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" +ifval([$4], [ test -z "$ac_cv_prog_$1" && ac_cv_prog_$1="$4" ])dnl fi])dnl $1=$ac_cv_prog_$1 -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) +if test -n "$$1"; then + AC_MSG_RESULT([$$1]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi AC_SUBST($1)dnl ])# AC_CHECK_PROG @@ -2491,10 +2491,10 @@ AC_SUBST($1)dnl AC_DEFUN(AC_CHECK_PROGS, [for ac_prog in $2 do -AC_CHECK_PROG([$1], [$]ac_prog, [$]ac_prog, , [$4]) -test -n "[$]$1" && break +AC_CHECK_PROG([$1], $ac_prog, $ac_prog, , [$4]) +test -n "$$1" && break done -ifval([$3], [test -n "[$]$1" || $1="$3" +ifval([$3], [test -n "$$1" || $1="$3" ])]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 3a1e6118f..8fec5fa9a 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2431,11 +2431,11 @@ IFS=$ac_save_ifs # ----------------------------------------------------- AC_DEFUN(AC_CHECK_PROG, [# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 +set dummy $2; ac_word=$[2] AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_prog_$1, -[if test -n "[$]$1"; then - ac_cv_prog_$1="[$]$1" # Let the user override the test. +[if test -n "$$1"; then + ac_cv_prog_$1="$$1" # Let the user override the test. else ifval([$6], [ ac_prog_rejected=no ])dnl @@ -2451,16 +2451,16 @@ ifval([$6], done ifval([$6], [if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. - set dummy [$]ac_cv_prog_$1 + set dummy $ac_cv_prog_$1 shift - if test [$]# -gt 0; then + if test $[#] -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set $1 to just the basename; use the full file name. shift - set dummy "$ac_path" "[$]@" + set dummy "$ac_path" ${1+"$[@]"} shift - ac_cv_prog_$1="[$]@" + ac_cv_prog_$1="$[@]" ifelse([$2], [$4], [ else # Default is a loser. @@ -2472,14 +2472,14 @@ fi ])dnl dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_CHECK_PROGS will keep looking. -ifval([$4], [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" +ifval([$4], [ test -z "$ac_cv_prog_$1" && ac_cv_prog_$1="$4" ])dnl fi])dnl $1=$ac_cv_prog_$1 -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) +if test -n "$$1"; then + AC_MSG_RESULT([$$1]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi AC_SUBST($1)dnl ])# AC_CHECK_PROG @@ -2491,10 +2491,10 @@ AC_SUBST($1)dnl AC_DEFUN(AC_CHECK_PROGS, [for ac_prog in $2 do -AC_CHECK_PROG([$1], [$]ac_prog, [$]ac_prog, , [$4]) -test -n "[$]$1" && break +AC_CHECK_PROG([$1], $ac_prog, $ac_prog, , [$4]) +test -n "$$1" && break done -ifval([$3], [test -n "[$]$1" || $1="$3" +ifval([$3], [test -n "$$1" || $1="$3" ])])