autoconf
[Top][All Lists]
Advanced

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

AC_DEFINE* with 2 args discouraged?


From: Ralf Wildenhues
Subject: AC_DEFINE* with 2 args discouraged?
Date: Mon, 1 Dec 2003 09:10:09 +0100
User-agent: Mutt/1.4.1i

Hi there,

I have a library package which uses AC_CONFIG_HEADERS to create a
non-installed generic config.h header as well as an installed header
providing (very few) configuration options for the library, with the
#define's suitably named (e.g. _LIBFOO_FEATURE_BAZ).
My intent is to autoheader-create config.h.in with the generic results
and use my self-written libfoo_conf.h.in, therefore I use things like
  AC_DEFINE([_LIBFOO_FEATURE_BAZ], 1)
(or AC_DEFINE_UNQUOTED) for the substitutions, without a third
parameter as not to have a template in config.h.in, but define the
variable anyway.  I feel only defining things once will make the
build process less error-prone.

Now current CVS autoheader (2.59a) gives me
|autoheader: warning: missing template: _LIBFOO_FEATURE_BAZ
|autoheader: Use AC_DEFINE([_LIBFOO_FEATURE_BAZ], [], [Description])

Is this deprecated usage?  How is my goal best accomplished?
Is having duplicate sets of defines in config.h/libfoo_conf.h the
solution of choice?  Then I'd suggest the description in
info '(autoconf.info)Defining Symbols' to be more precise (where
only the usage with one parameter is explicitly discouraged).

Regards,
Ralf

Test case:
$ cat >configure.ac <<EOF
AC_INIT([libfoo], [0.1], address@hidden)
AC_CONFIG_SRCDIR([libfoo_conf.h.in])
AC_CONFIG_HEADERS([config.h libfoo_conf.h])
AC_PROG_CC
AC_DEFINE([_LIBFOO_FEATURE_BAZ], 1)
AC_OUTPUT
EOF
$ cat >libfoo_conf.h.in <<EOF
/* define if you want feature baz */
#undef _LIBFOO_FEATURE_BAZ
EOF
$ autoreconf -vi
[...]
autoheader: warning: missing template: _LIBFOO_FEATURE_BAZ
autoheader: Use AC_DEFINE([_LIBFOO_FEATURE_BAZ], [], [Description])




reply via email to

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