[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_DEFINE defaulting to 1
From: |
Akim Demaille |
Subject: |
Re: AC_DEFINE defaulting to 1 |
Date: |
11 Sep 2002 17:23:02 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| Hi,
| Le Wed, Sep 11, 2002 at 09:24:29AM +0200, Akim Demaille a écrit:
| > > If you can give me 24 hours, I have some copy editing of
| > > the Peter documentation in progress.
| > Great :) Thanks!
|
| As I just told you, I found something wrong:
|
| >From the doc:
|
| AC_DEFINE (variable, [value], [description]) Macro
| Define C preprocessor variable variable. If value is given, set
| variable to that value (verbatim), otherwise set it to 1.
|
|
| cassis:~$ cat configure.ac
| AC_INIT
| AC_CONFIG_HEADERS(config.h)
| AC_DEFINE(HAVE_PTHREAD,,[Define if we use pthread.h.])
| AC_OUTPUT
|
| cassis:~$ autoheader --version
| autoheader (GNU Autoconf) 2.53c
|
| cassis:~$ autoheader
| autoheader: `config.h.in' is created
|
| cassis:~$ ./configure
| configure: creating ./config.status
| config.status: creating config.h
|
|
| cassis:~$ cat config.h
| /* config.h. Generated by configure. */
| /* config.h.in. Generated from configure.ac by autoheader. */
|
| /* Define if we use pthread.h. */
| #define HAVE_PTHREAD
|
| /* Define to the address where bug reports for this package
| * should be sent. */
| #define PACKAGE_BUGREPORT ""
|
|
|
| HAVE_PTHREAD is not defined as it should if I follow the doc...
| Doc problem, or something else ? If we have to explicitly specify
| the "1", it would be good to know... I mean, it works just fine
| if I explicitly specify AC_DEFINE(HAVE_PTHREAD,1,[Define if we
| use pthread.h.])... But lots of packages out there use the first.
|
| So ?
So I think the doc should be fixed: I see no reason to prevent someone
from just defining to nothing :(
And as a matter of fact, was is wrong is the way AC_DEFINE invocations
are presented: it is the form with no argument at all that defines to
1:
| /tmp % cat configure.ac
| AC_INIT
| AC_CONFIG_HEADER(config.h)
| AC_DEFINE(TOTO, , [Doc de TOTO.])
| if false; then
| AC_DEFINE(TATA, 42, [Doc de TATA.])
| fi
| AC_DEFINE(TATA)
| AC_OUTPUT
| /tmp % autoreconf -v
| autoreconf: working in `.'
| autoreconf: running: aclocal --output=aclocal.m4t
| autoreconf: configure.ac: not using Gettext
| autoreconf: configure.ac: not using Libtool
| autoreconf: running: /usr/local/bin/autoconf
| autoreconf: running: /usr/local/bin/autoheader
| autoheader: `config.h.in' is unchanged
| autoreconf: configure.ac: not using Automake
| /tmp % ./configure
| configure: creating ./config.status
| config.status: creating config.h
| /tmp % cat config.h
| /* config.h. Generated by configure. */
| /* config.h.in. Generated from configure.ac by autoheader. */
|
| /* Define to the address where bug reports for this package should be sent. */
| #define PACKAGE_BUGREPORT ""
|
| /* Define to the full name of this package. */
| #define PACKAGE_NAME ""
|
| /* Define to the full name and version of this package. */
| #define PACKAGE_STRING ""
|
| /* Define to the one symbol short name of this package. */
| #define PACKAGE_TARNAME ""
|
| /* Define to the version of this package. */
| #define PACKAGE_VERSION ""
|
| /* Doc de TATA. */
| #define TATA 1
|
| /* Doc de TOTO. */
| #define TOTO
2.13 behaves the same way.