+2000-05-05 Akim Demaille <akim@epita.fr>
+
+ 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 <akim@epita.fr>
AC_PREREQ understands `2.14a' as `2.141'.
# -----------------------------------------------------
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
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.
])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
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"
])])
# -----------------------------------------------------
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
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.
])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
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"
])])