[Top][All Lists]

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

Re: how to use module `stdlib'

From: Simon Josefsson
Subject: Re: how to use module `stdlib'
Date: Mon, 18 Aug 2008 12:38:40 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Thien-Thi Nguyen <address@hidden> writes:

> I just did:
>   $ gnulib-tool --import stdlib
> Now i see in stdlib_h.m4 the definition:
> Some questions on how to properly use this module:
>   - What do i need to do wrt `gl_STDLIB_MODULE_INDICATOR'?

Nothing beyond what is normally required to use gnulib: i.e., invoke
gl_EARLY, gl_INIT and so on (all is explained in the last output from

>   - Is it enough to
>     - add to configure.in
>         gl_STDLIB_H

No, add gl_EARLY and gl_INIT instead.  They are in gnulib-*.m4, which
should be generated by gnulib-tool.  They set up the gnulib modules
properly, and will invoke gl_STDLIB_H if necessary.

Generally, see the chapter 'Invoking gnulib-tool' in the gnulib manual.

>     - convert the implementation file construct from:
>         #ifdef STDC_HEADERS
>         # include <stdlib.h>
>         ...
>         #endif
>       to:
>         #include <stdlib.h>
>         #ifdef STDC_HEADERS
>         ...
>         #endif
>       (that is, move the #include <stdlib.h> to top-level,
>       without any surrounding preprocessor conditionals)?


>   - Is it wise to remove `AC_HEADER_STDC' from configure.in?

In all of my projects, I assume standard C header files exists and never
had any reports of problems.  However, if your project is special and
needs to build on systems that doesn't have proper compilers and
libraries, you may want to use it.  My understanding is that this is
something of an autoconf antiquity.

Of course, if you remove AC_HEADER_STDC you should remove the
STDC_HEADERS checks as well.


reply via email to

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