bug-gnulib
[Top][All Lists]
Advanced

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

Re: module libposix


From: Bruno Haible
Subject: Re: module libposix
Date: Thu, 16 Sep 2010 23:04:05 +0200
User-agent: KMail/1.9.9

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.

> 4. The various other headers that are determined to be needed as
>     replacements for the system headers should be installed, too,

Yes. You can hack this into a Makefile.am.

>     as $(prefix)/include/gnulib/....

Or as $(prefix)/include/*.h, I would say. Assuming people don't pass
--prefix=/usr, of course :-)

> 6. Some date stamp version should be inserted into config.h
>    Despite all the caveats about feature tests vs. version tests,
>    the basic idea with gnulib is that it is pretty much a single
>    branch project.  Consequently, needed features appear by
>    a particular date (version id).  The whole idea is to largely
>    remove feature tests from individual projects*.

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

copnfigure.ac:
  AC_CONFIG_FILES([lib/libposix/version.h:lib/libposix/version.in.h])

lib/Makefile.am:
  # libposix/version.h is public.
  nobase_nodist_include_HEADERS += libposix/version.h

lib/libposix/version.in.h:
===============================================================================
/* Meta information about GNU libposix.
   Copyright (C) 2009-2010 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#ifndef _LIBPOSIX_VERSION_H
#define _LIBPOSIX_VERSION_H


#ifdef __cplusplus
extern "C" {
#endif


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


#ifdef __cplusplus
}
#endif


#endif /* _LIBPOSIX_VERSION_H */
===============================================================================

> * 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).

Bruno



reply via email to

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