bug-gnulib
[Top][All Lists]
Advanced

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

Re: module libposix


From: Bruce Korb
Subject: Re: module libposix
Date: Thu, 16 Sep 2010 14:29:14 -0700

Hi Bruno,

On Thu, Sep 16, 2010 at 2:04 PM, Bruno Haible <address@hidden> wrote:
> Hi Bruce,
>
>> >>  
>> >> <http://www.gnu.org/software/gnulib/manual/html_node/POSIX-Substitutes-Library.html>?
>> ...
>> 3. config.h needs to be installed.
>
> We try to make all .h files self-contained. Therefore we use
>  #if @HAVE_FOO@
> in the *.in.h files, not
>  #if HAVE_FOO
>
> But there are a couple of definitions from config.h which we haven't dealt
> with so far. Patches welcome.

Methinks the idea here would be to install system replacements into the include
directory IFF these replacements did something useful.  Perhaps I can fiddle
the installation sequence so a script parses everything.in.h to see if
the @HAVE-s
got replaced with 1's or 0's.  Ick.  Doable, but still.....

The final result should be that libposix client projects would place:
   -I$(prefix)/include/gnulib
in their CFLAGS.  That is why:

>>     as $(prefix)/include/gnulib/....
>
> Or as $(prefix)/include/*.h, I would say.

I would not say.  The -I thingey will cause these replacements to be
found first.

> Yes, a file libposix/version.h would be reasonable. Here's the idiom
> from libunistring:

I think I'd tweak it a bit so that:

> /* Version number: (major<<16) + (minor<<8) + subminor. */
> #define _LIBPOSIX_VERSION @HEXVERSION@
> extern const int _libposix_version; /* Likewise */

/* Version number: (year * 10000) + (month * 100) + day */
#define _LIBPOSIX_VERSION @DECVERSION@
extern int const _libposix_version;

the number is more humanly readable.  Dates are more easily
remembered than, say, "Which version added the WEXITSTATUS fix?"
If the answer is, "sometime way back in September 2010", then just
test for on or after the 20101001 version.  :)

>> * Clients of this libposix thing would thus have something along
>>   the lines of this in their configure.ac:
>>
>>   AC_CHECK_LIBPOSIX([2010.09.16],
>>     AC_MSG_ERROR([libposix is too old or not installed]))
>
> Yes, I agree with the idea. Of course this macro should use the 'havelib'
> module (so that --with-* options are offered and -rpath flags are handled
> automatically).

if the lib gets built as an object archive, then -rpath would not be needed.
One would hope that this library would be tiny enough so as not to be
worth the bother of making it a shared object...... :-D

 - Bruce



reply via email to

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