Re: [GNU Autoconf 2.60] testsuite: 3 120 failed

2007-02-11 Thread Ralf Wildenhues
Hello Paul, all,

http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/5266/focus=5549

* Paul Eggert wrote on Thu, Oct 12, 2006 at 09:45:24PM CEST:
 Ralf Wildenhues [EMAIL PROTECTED] writes:
 
  This patch kills $as_executable_p.  This breaks libtool.m4 from
  Libtool-1.5.22 (and possibly CVS HEAD, I haven't checked).
 
 OK, I installed this backward-compatibility hack.  I assume
 you'll be fixing libtool?
 
 2006-10-12  Paul Eggert  [EMAIL PROTECTED]
 
   * lib/m4sugar/m4sh.m4 (_AS_TEST_PREPARE): Set as_executable_p,
   for backward compatibility with Libtool 1.5.22.  Problem reported
   by Ralf Wildenhues.

Some things to be aware of here:

1) Libtool branch-1-5 aims to be compatible to Autoconf-2.50; also I aim
   to not add more unnecessary incompatibilities with Autoconf-2.13, as
   there are users who patch the missing bits to make it compatible with
   it.

2) Libtool (at least branch-1-5) aims to be compatible to Automake-1.4.

3) Autoconf-2.61b (CVS) still doesn't document AS_EXECUTABLE_P.

Do you think the approach below is safe enough?  Note I intentionally do
not use the _AS_TEST_PREPARE from 2.61: if you use new enough Autoconf,
then that is already defined and will be used.

Can I assume that AS_EXECUTABLE_P may eventually be made a public
Autoconf interface (then we could just do away with our copy of
_AS_TEST_PREPARE and AS_EXECUTABLE_P)?

Note CVS HEAD Libtool doesn't need this: it uses $as_executable_p only
in its version of AC_PROG_SED, which itself is not defined iff already
given by Autoconf.

OK to apply?

Cheers,
Ralf

2007-02-11  Ralf Wildenhues  [EMAIL PROTECTED]

* libtool.m4 (_AS_TEST_PREPARE, AS_EXECUTABLE_P): m4_defun
these macros, if undefined, with copies from Autoconf 2.59.
(LT_AC_PROG_SED): Use AS_EXECUTABLE_P, not $as_executable_p,
this is an internal Autoconf detail.

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.170
diff -u -r1.314.2.170 libtool.m4
--- libtool.m4  5 Feb 2007 19:40:53 -   1.314.2.170
+++ libtool.m4  11 Feb 2007 09:31:44 -
@@ -6483,6 +6483,26 @@
 [AC_CHECK_TOOL(RC, windres, no)
 ])
 
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# 
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[as_executable_p=test -f
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
 
 # NOTE: This macro has been submitted for inclusion into   #
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
@@ -6505,7 +6525,7 @@
   test -z $as_dir  as_dir=.
   for lt_ac_prog in sed gsed; do
 for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p $as_dir/$lt_ac_prog$ac_exec_ext; then
+  if AS_EXECUTABLE_P([$as_dir/$lt_ac_prog$ac_exec_ext]); then
 lt_ac_sed_list=$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext
   fi
 done


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: [GNU Autoconf 2.60] testsuite: 3 120 failed

2007-02-11 Thread Peter O'Gorman

[cutting autoconf-patches list]
On Feb 11, 2007, at 6:33 PM, Ralf Wildenhues wrote:



OK to apply?

+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# 
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[as_executable_p=test -f


Hi Ralf,

Could we test if test -x works and use that? I know that this is  
barely used, but it bugs me that test -f does not test for the  
executable bit :)


I think autoconf has this:

if test -x / /dev/null 21; then
   as_executable_p='test -x'
 else
  as_executable_p='test -f'
fi

Peter


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: [GNU Autoconf 2.60] testsuite: 3 120 failed

2007-02-11 Thread Ralf Wildenhues
Hi Peter,

Thanks for the quick review!

* Peter O'Gorman wrote on Sun, Feb 11, 2007 at 01:18:56PM CET:
 On Feb 11, 2007, at 6:33 PM, Ralf Wildenhues wrote:
 
 OK to apply?

 +m4_ifndef([_AS_TEST_PREPARE],
 +[m4_defun([_AS_TEST_PREPARE],
 +[as_executable_p=test -f

 Could we test if test -x works and use that? I know that this is  
 barely used, but it bugs me that test -f does not test for the  
 executable bit :)
 
 I think autoconf has this:

CVS Autoconf has something quite a bit more elaborate.  But I guess we
can at least do this much.  I'm installing the patch below.

Note that it doesn't define $as_test_x.

Cheers,
Ralf

2007-02-11  Ralf Wildenhues  [EMAIL PROTECTED]

* libtool.m4 (_AS_TEST_PREPARE, AS_EXECUTABLE_P): m4_defun
these macros, if undefined, with modified copies from Autoconf
2.59.
(LT_AC_PROG_SED): Use AS_EXECUTABLE_P, not $as_executable_p,
this is an internal Autoconf detail.

Index: libtool.m4
===
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.170
diff -u -r1.314.2.170 libtool.m4
--- libtool.m4  5 Feb 2007 19:40:53 -   1.314.2.170
+++ libtool.m4  11 Feb 2007 13:34:14 -
@@ -6483,6 +6483,30 @@
 [AC_CHECK_TOOL(RC, windres, no)
 ])
 
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# 
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / /dev/null 21; then
+  as_executable_p='test -x'
+else
+  as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
 
 # NOTE: This macro has been submitted for inclusion into   #
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
@@ -6505,7 +6529,7 @@
   test -z $as_dir  as_dir=.
   for lt_ac_prog in sed gsed; do
 for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p $as_dir/$lt_ac_prog$ac_exec_ext; then
+  if AS_EXECUTABLE_P([$as_dir/$lt_ac_prog$ac_exec_ext]); then
 lt_ac_sed_list=$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext
   fi
 done


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: [GNU Autoconf 2.60] testsuite: 3 120 failed

2007-02-11 Thread Bob Friesenhahn

On Sun, 11 Feb 2007, Peter O'Gorman wrote:


Hi Ralf,

Could we test if test -x works and use that? I know that this is barely used, 
but it bugs me that test -f does not test for the executable bit :)


I think autoconf has this:

if test -x / /dev/null 21; then
  as_executable_p='test -x'
else
 as_executable_p='test -f'
fi


I seem to recall that with some versions of the MSYS shell 'test -x' 
pretends to work (but does not).  It is best to make sure before 
depending on it.  Some systems don't support the notion of 
'executable' files.


Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/



___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool


Re: [GNU Autoconf 2.60] testsuite: 3 120 failed

2006-10-12 Thread Ralf Wildenhues
[ removing bug-autoconf, adding bug-libtool ]

Hello Paul,

* Paul Eggert wrote on Wed, Oct 11, 2006 at 11:52:13PM CEST:
 Stepan Kasal [EMAIL PROTECTED] writes:
 
  3) AS_EXECUTABLE_P is reduced to `test -x' (on modern hosts).
  (See the attached autoconf-20061009-bin-sh-3.patch.)
  IIRC, the current implementation of AS_EXECUTABLE_P is a result of a
  long discussion.  In particular, mere `test -x' was refused because
  it is true for a directory, and one might encounter a directory named
  `perl' somewhere in PATH.
 
 OK, but we should still have a macro that expands to plain test -x,
 since sometimes it is useful to test whether the installer has the
 x permission on a file or directory or whatever.
 
 I installed this patch instead; it preserves the semantics of
 AS_EXECUTABLE_P and adds a new macro AS_TEST_X that behaves like test -x.

This patch kills $as_executable_p.  This breaks libtool.m4 from
Libtool-1.5.22 (and possibly CVS HEAD, I haven't checked).
Yes, it uses $as_executable_p instead of AS_EXECUTABLE_P, but since
neither are documented, it's not even clear which would be worse.

If it were only for Libtool, it'd be bad enough but fixable (with some
pushing for another release soon), but google tells me there are more
problem candidates out there.

Apologies in advance for more such bugs out there; I know Libtool uses
quite a few undocumented Autoconf things (some of which are known), but
I haven't had the time to do an audit yet.  OTOH, I would be much more
inclined to do so if Autoconf documented more of m4sh.  (And yes, I very
well acknowledge that I was part in postponing those documentation
additions back then.)

Thank you,
Ralf

 2006-10-11  Paul Eggert  [EMAIL PROTECTED]
 
   * lib/m4sugar/m4sh.m4 (AS_TEST_X): New macro.
   (AS_EXECUTABLE_P): Use as_test_x rather than as_executable_p.
   (_AS_TEST_PREPARE): Set as_test_x rather than as_executable_p.
   Use a better substitute, by inspecting the output of ls
   rather than just using :.
   * lib/autoconf/general.m4 (_AC_LINK_IFELSE): Use AS_TEST_X
   rather than AS_EXECUTABLE_P, since we needn't worry about
   non-regular files here.


___
Bug-libtool mailing list
Bug-libtool@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-libtool