Re: Suggestion: AC_DEFINE -> m4_pattern_allow

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

 



>>> "Akim" == Akim Demaille <akim@xxxxxxxxxxxxx> writes:

Hi!

Some time ago I sent this message for which I had no answer.

 > I have this package at hand, say FooBar, which installs a prefixed
 > form of config.h.  Its own macros are, of course, named FB_*, which is
 > m4_pattern_forbidden.  But then I have to explicitly m4_pattern_allow
 > all my FB_PACKAGE_VERSION etc.

 > I suggest that the AC_DEFINE family explicitly allow its $1.

 > Thanks.

I suggest that Automake provide the same feature for AM_CONDITIONAL:

| AC_DEFUN([AM_CONDITIONAL],
| [AC_PREREQ(2.52)dnl
|  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
| 	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
| AC_SUBST([$1_TRUE])
| AC_SUBST([$1_FALSE])
| if $2; then
|   $1_TRUE=
|   $1_FALSE='#'
| else
|   $1_TRUE='#'
|   $1_FALSE=
| fi
| AC_CONFIG_COMMANDS_PRE(
| [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|   AC_MSG_ERROR([[conditional "$1" was never defined.
| Usually this means the macro was only invoked conditionally.]])
| fi])])

Sadly enough $1 does appear here... only in the (last) error message.
But still, if I AM_CONDITIONAL([FB_BAZ_USED], ...), I will be warned
by autoconf from terrible m4_pattern_* things.

Of course in the present case one would like to flag this precise
occurrence of $1.  Maybe something like m4_patsubst([$1],
[^\(.\)\(.*\)$], [\1@&t@\2]) (untested) should be it.  Or
m4_patsubst(quote($1)...) instead (usual dirty issues with M4 not
providing means to safely evaluate...).

Actually it might be useful to introduce m4_pattern_protect in
m4sugar, defined as above, as it is quite useful to disarm a specific
occurrence of a nasty token.



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux