[Top][All Lists]

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

Re: Multiply exported Gnulib symbols

From: Bruno Haible
Subject: Re: Multiply exported Gnulib symbols
Date: Sun, 26 Aug 2007 13:49:40 +0200
User-agent: KMail/1.5.4

Ludovic Courtès wrote:
> >    We work around such problems by doing the override at the preprocessor
> >    level, rather than at the link level. I.e. on a system where strcasecmp
> >    is or may be defined at libc level, gnulib does
> >      #define strcasecmp rpl_strcasecmp
> >    and defines rpl_strcasecmp.
> From what I can see, `strcasecmp ()' is precisely one of the few symbols
> not handled this way in `string_.h':
>   extern int strcasecmp (char const *s1, char const *s2);
>   #endif
> Was it intended or should it be changed to something similar to, e.g.,
> the way `strndup' is handled?

It was intended: On no system we know does strcasecmp() work incorrectly.
So, either it is there and gnulib provides at most the declaration, or it is
missing and gnulib provides 'strcasecmp'. No
  #define strcasecmp rpl_strcasecmp
is needed here.

> > 3) Two different libraries, say, libguile and libgettextpo, using auxiliary
> >    functions from gnulib. It may happen that libguile and libgettextpo both
> >    define rpl_strcasecmp, and that this leads to link-time issues.
> >
> >    For this we have nothing prepackaged in gnulib-tool, but there is a
> >    Makefile snippet that does the necessary #defines, i.e.
> >       #define rpl_strcasecmp scm_strcasecmp
> >    in guile's config.h, and
> >       #define rpl_strcasecmp libgettextpo_strcasecmp
> >    in libgettextpo's config.h. You find this code in the 'config.h' rule in
> >    
> > http://cvs.savannah.gnu.org/viewvc/gettext/gettext-tools/libgettextpo/Makefile.am?revision=1.13&root=gettext&view=text
> I second Simon's request to integrate it in Gnulib.  :-)

That would be the wrong place. It needs to be integrated into automake,
more precisely into automake's support of libtool. automake should allow
to specify subsets libfoo_la_SOURCES_HIDDEN of libfoo_la_SOURCES, and
libfoo_la_LIBADD_HIDDEN of libfoo_la_LIBADD, such that the exported symbols
of these parts get prefixed with 'libfoo_'.


reply via email to

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