+2004-12-13 Stepan Kasal <kasal@ucw.cz>
+
+ * lib/m4sugar/m4sh.m4 (AS_EXECUTABLE_P): Use test -f && test -x
+ on platforms where it works.
+ (_AS_TEST_PREPARE): Test for ``test -x''.
+ (_AS_BROKEN_TEST_PREPARE): Nuke.
+
2004-12-13 Stepan Kasal <kasal@ucw.cz>
* lib/m4sugar/m4sh.m4 (AS_TMPDIR): Move the trap commands ...
# Check whether a file is executable.
m4_defun([AS_EXECUTABLE_P],
[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
+{ test -f $1 && $as_executable_p $1; }dnl
])# AS_EXECUTABLE_P
])# AS_MKDIR_P
-# _AS_BROKEN_TEST_PREPARE
-# -----------------------
-# FIXME: This does not work and breaks way too many things.
-#
+# _AS_TEST_PREPARE
+# ----------------
# Find out ahead of time whether we want test -x (preferred) or test -f
# to check whether a file is executable.
-m4_defun([_AS_BROKEN_TEST_PREPARE],
+m4_defun([_AS_TEST_PREPARE],
[# Find out how to test for executable files. Don't use a zero-byte file,
# as systems may use methods other than mode bits to determine executability.
cat >conf$$.file <<_ASEOF
-@%:@! /bin/sh
+#! /bin/sh
exit 0
_ASEOF
chmod +x conf$$.file
if test -x conf$$.file >/dev/null 2>&1; then
as_executable_p="test -x"
-elif test -f conf$$.file >/dev/null 2>&1; then
- as_executable_p="test -f"
else
- AS_ERROR([cannot check whether a file is executable on this system])
+ as_executable_p=:
fi
rm -f conf$$.file
-])# _AS_BROKEN_TEST_PREPARE
-
-
-# _AS_TEST_PREPARE
-# ----------------
-m4_defun([_AS_TEST_PREPARE],
-[as_executable_p="test -f"
])# _AS_TEST_PREPARE