2004-12-10 Stepan Kasal * 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. Index: lib/m4sugar/m4sh.m4 =================================================================== RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v retrieving revision 1.123 diff -u -r1.123 m4sh.m4 --- lib/m4sugar/m4sh.m4 10 Dec 2004 07:08:52 -0000 1.123 +++ lib/m4sugar/m4sh.m4 13 Dec 2004 08:33:21 -0000 @@ -658,7 +658,7 @@ # 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 @@ -864,35 +864,24 @@ ])# 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 address@hidden:@! /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