Hi everyone,

Back in July, I followed the thread "AC_DEFINE-descriptions with 2.14*"
which was concerned with whether or not you could only use literal
arguents to AC_DEFINE_UNQUOTED.  That discussion seemed to fizzle out
before the question was totally resolved, and I was hoping to revive
it.  

One thing that was asked for were real-life examples where the argument
to AC_DEFINE_UNQUOTED was a computed value - so I've got a couple.  In
the autoconf setup for the AFS workalike "arla", there are a several
pairs of m4 macros - the first takes a list of things to check and calls
the second with each element of the list in turn as an argument.  For
instance, "have-linux-kernel-types.m4" and "have-linux-kernel-type.m4".
In the second macro you find the line:

AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)

where "ac_tr_hdr" contains the name of the type being checked.  In fact
you also find a computed value being used as the argument for
AC_MSG_RESULT.  Both uses work just fine with autoconf-2.13; neither
works with CVS autoconf.  There are a few other very similar m4 macros
in the arla sources.

The docs do say that shell expansions will be performed on the argument
to AC_DEFINE_UNQUOTED, so I think the arla folks are properly relying on
advertised behavior.  This is the expected behavior, right?

Now, I can see that having computed arguments for AC_DEFINE_UNQUOTED
will jam a big, fat wrench into the new way that autoheader works, but
that's another issue.

Cheers,
Dave

-- 
David Morrison  Brookhaven National Laboratory  phone: 631-344-5840
                Physics Department, Bldg 510 C    fax: 631-344-3253
                          Upton, NY 11973-5000  email: [EMAIL PROTECTED]

Reply via email to