autoconf
[Top][All Lists]
Advanced

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

a patch for AC_CHECK_PROG bug


From: Peter Muir
Subject: a patch for AC_CHECK_PROG bug
Date: 14 Feb 2001 00:14:14 +0000

I stumbled on to this because I had an perl directory.
I know you probably have worked out your own fix and this probably
won't fit with your plans, but c'est la vie.

I wondered if overwriting the positional parameters was okay but some
other macros did it. I first trying setting a global but the test
cases check for changes in environment. Also I could have used a case
statement but I thought the eval might be more general.

Ciao



Index: debian/autoconf/ChangeLog
diff -u debian/autoconf/ChangeLog:1.1.1.6 debian/autoconf/ChangeLog:1.2
--- debian/autoconf/ChangeLog:1.1.1.6   Tue Feb 13 08:13:30 2001
+++ debian/autoconf/ChangeLog   Tue Feb 13 23:36:59 2001
@@ -1,3 +1,9 @@
+2001-02-13  Peter Muir  <address@hidden>
+
+       * m4sh.m4 (AS_EXECUTABLE_P, _AS_TEST_PREPARE):
+       If OS supports test -x and test -f use both.
+       * tests/m4sh.at: Verify AS_EXECUTABLE_P.
+
 2001-02-11  Jim Meyering  <address@hidden>
 
        Ensure that even `autoscan --version' fails when e.g.,
Index: debian/autoconf/m4sh.m4
diff -u debian/autoconf/m4sh.m4:1.1.1.2 debian/autoconf/m4sh.m4:1.2
--- debian/autoconf/m4sh.m4:1.1.1.2     Sat Feb 10 23:38:20 2001
+++ debian/autoconf/m4sh.m4     Tue Feb 13 21:12:12 2001
@@ -296,7 +296,8 @@
 # Check whether a file is executable.
 m4_defun([AS_EXECUTABLE_P],
 [m4_require([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
+set dummy $1
+eval "$as_executable_p"[]dnl
 ])# AS_EXECUTABLE_P
 
 
@@ -388,9 +389,13 @@
 _ASEOF
 chmod +x conftest.file
 if test -x conftest.file >/dev/null 2>&1; then
-  as_executable_p="test -x"
+  if test -f conftest.file >/dev/null 2>&1; then
+    as_executable_p='test -f [$]2 && test -x [$]2'
+  else
+    as_executable_p='test -x [$]2'
+  fi
 elif test -f conftest.file >/dev/null 2>&1; then
-  as_executable_p="test -f"
+  as_executable_p='test -f [$]2'
 else
   AS_ERROR([cannot check whether a file is executable on this system])
 fi
Index: debian/autoconf/tests/m4sh.at
diff -u debian/autoconf/tests/m4sh.at:1.1.1.2 debian/autoconf/tests/m4sh.at:1.2
--- debian/autoconf/tests/m4sh.at:1.1.1.2       Sat Feb 10 23:38:23 2001
+++ debian/autoconf/tests/m4sh.at       Tue Feb 13 21:12:13 2001
@@ -83,6 +83,46 @@
 AT_CLEANUP(configure 1 a)
 
 
+## --------------- ##
+## AS_EXECUTABLE_P ##
+## --------------- ##
+
+# Create dir.
+
+AT_SETUP([[AS_EXECUTABLE_P]])
+
+AT_DATA([configure.ac],
+[[AC_PLAIN_SCRIPT
+pwd=`pwd`
+set -e
+# Absolute
+mkdir a
+test -d "$pwd/a" ||
+  AC_MSG_ERROR([$pwd/a has not been properly created])
+AS_EXECUTABLE_P([a]) && AC_MSG_ERROR([directory recognized as executable file])
+echo '#! /bin/sh' >1
+echo 'exit 0' >>1
+test -f "$pwd/1" ||
+  AC_MSG_ERROR([$pwd/1 has not been properly created])
+chmod u+x "$pwd/1"
+test -x "$pwd/1" ||
+  AC_MSG_ERROR([$pwd/1 has not been properly chmod to user executable])
+AS_EXECUTABLE_P([1]) || 
+  AC_MSG_ERROR([executable file not recognized as executable file])
+chmod u-x "$pwd/1"
+test -x "$pwd/1" &&
+  AC_MSG_ERROR([$pwd/1 has not been properly chmod to user non-executable])
+AS_EXECUTABLE_P([1]) && 
+  AC_MSG_ERROR([non-executable file recognized as executable file])
+
+AS_EXIT(0)
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP(configure 1 a)
+
 
 
 ## ----------------------------- ##

-- 


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




reply via email to

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