autoconf-patches
[Top][All Lists]
Advanced

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

may Automake rely on _AC_SUBST_VARS?


From: Ralf Wildenhues
Subject: may Automake rely on _AC_SUBST_VARS?
Date: Mon, 6 Apr 2009 22:48:00 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Eric,

I would like to fix the remaining glitch in
<http://article.gmane.org/gmane.comp.sysutils.automake.patches/3528>
and one method I've been able to come up with was to rely on
_AC_SUBST_VARS.

This variable is undocumented, but has been used much before 2.62
(which is the Autoconf version current Automake requires).  Would
it be ok to rely on this undocumented variable, and push the patch
below to Autoconf?

Here's the code that I've come up with (relative to above), to use in
Automake:

diff --git a/m4/init.m4 b/m4/init.m4
index 559f395..6fae7b7 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -103,10 +103,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
 AM_BACKSLASH='\'
 AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
-AC_CONFIG_COMMANDS_PRE([AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])dnl
+AC_CONFIG_COMMANDS_PRE([
+dnl In Autoconf 2.62 and 2.63, _AC_SUBST_VARS is a simple string,
+dnl starting with 2.64 it will be a set with efficient access.
+  m4_ifdef([m4_set_contains],
+    [m4_set_contains([_AC_SUBST_VARS], [EXEEXT],
+       [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])],
+    [m4_if([m4_index([_AC_SUBST_VARS], [EXEEXT])], [-1], [],
+             [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])dnl
 ])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.


Alternatively, if that is not acceptable, then what would you suggest we
can use?  The goal is to kill the AM_CONDITIONAL code at the m4 level if
this package does not build executables at all.

Thanks,
Ralf

2009-04-06  Ralf Wildenhues  <address@hidden>

        * lib/autoconf/general.m4 (AC_SUBST): Document that
        Automake relies on `_AC_SUBST_VARS'.

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 83254ed..0c1f07d 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2166,6 +2166,7 @@ m4_define([AC_SUBST],
 [AC_SUBST_TRACE([$1])]dnl
 [m4_pattern_allow([^$1$])]dnl
 [m4_ifvaln([$2], [$1=$2])[]]dnl
+dnl Automake 1.11 relies on _AC_SUBST_VARS.
 [m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST
 
 




reply via email to

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