delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/18/15:18:15

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 18 Sep 2002 15:22:05 -0400
From: Jason Tishler <jason AT tishler DOT net>
Subject: fetchmail 6.0.0 build problem due to gettext issue
To: Cygwin <cygwin AT cygwin DOT com>
Mail-followup-to: Cygwin <cygwin AT cygwin DOT com>
Message-id: <20020918192205.GA1764@tishler.net>
MIME-version: 1.0
User-Agent: Mutt/1.4i

I'm attempting to build fetchmail 6.0.0 so I can update the Cygwin
distribution to the latest version.  Unfortunately, configure does not
determine that gettext is in libintl as it should.  Note that
fetchmail's aclocal.m4 was changed between 5.9.13 (i.e., the last
version that I released) and 5.9.14 (i.e., the last version before
6.0.0).

The old (working) "GNU gettext in libintl" check used the following test
program:

    #include "confdefs.h"
    #include <libintl.h>
    extern int _nl_msg_cat_cntr;
    
    int
    main()
    {
        bindtextdomain ("", "");
        return (int) gettext ("") + _nl_msg_cat_cntr;
        return 0;
    }

while the new one uses the following:

    #include "confdefs.h"
    #include <libintl.h>
    extern int _nl_msg_cat_cntr;
    extern int *_nl_domain_bindings;
    extern
    #ifdef __cplusplus
    "C"
    #endif
    const char *_nl_expand_alias ();

    int
    main()
    {
        bindtextdomain ("", "");
        return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings +
            *_nl_expand_alias (0);
        return 0;
    }

The crux of the problem is the use of the _nl_domain_bindings symbol.
This is because libintl.dll.a exposes __imp___nl_domain_bindings__ (note
the trailing "__") and not __imp___nl_domain_bindings (note no trailing
"__").  Where as fetchmail's aclocal.m4 (and gettext's gettext.m4) use
_nl_domain_bindings instead of _nl_domain_bindings__.  Hence, an
undefined reference error occurs during the configure test as indicated
in config.log:

    configure:4124: checking for GNU gettext in libintl
    configure:4176: gcc -o conftest -O    conftest.c  -lintl -liconv 1>&5
    Warning: resolving __nl_msg_cat_cntr by linking to __imp___nl_msg_cat_cntr (auto-import)
    /mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/ccnoSBi9.o(.text+0x49):conftest.c: undefined reference to `_nl_domain_bindings'
    collect2: ld returned 1 exit status

Perusing the gettext source, I found the following:

    /* The internal variables in the standalone libintl.a must have different
       names than the internal variables in GNU libc, otherwise programs
       using libintl.a cannot be linked statically.  */
    #if !defined _LIBC
    # define _nl_default_dirname _nl_default_dirname__
    # define _nl_domain_bindings _nl_domain_bindings__
    #endif

The above explains why Cygwin's libintl is exposing symbols with
trailing "__" characters.

Any suggestions on how to best fix this build problem will be greatly
appreciated?

Thanks,
Jason

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019