Subject: gettext-lib and glibc have same libintl definitions
To: tech-pkg@netbsd.org, <netbsd-help@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 11/25/2002 14:11:03
(I blind-carbon copied this email to M. Velikov, who has ported glibc to
NetBSD. Momchil, if you have any suggestions, I would appreciate it.)

Background: running Linux kernel with:
  glibc-2.2.5         The GNU C Library for Linux

This Linux system is using NetBSD's pkgsrc :)

This is my own glibc package, not tested under NetBSD, because it doesn't
include new fixes. Also, this is old version, because newer glibc required
gcc 3.

I also have gettext-lib-0.10.35nb1 installed.

When building popt (via pkgsrc), I received many messages like:

/usr/lib/libc.a(dcigettext.o): In function `transcmp':
/home/jeremy/netbsd/usr/pkgsrc/devel/glibc/work/glibc-2.2.5/intl/dcigettext.c(.d
ata+0x0): multiple definition of `_nl_current_default_domain'
/home/jeremy/netbsd/usr/pkgsrc/devel/popt/work/.buildlink/lib/libintl.a(dcgettex
t.o)(.data+0x0):/home/jeremy/netbsd/usr/pkgsrc/devel/gettext-lib/work/gettext-0.
10.35/intl/dcgettext.c: first defined here
/usr/lib/libc.a(dcigettext.o): In function `transcmp':
/home/jeremy/netbsd/usr/pkgsrc/devel/glibc/work/glibc-2.2.5/intl/dcigettext.c:24
6: multiple definition of `_nl_default_dirname'
/home/jeremy/netbsd/usr/pkgsrc/devel/popt/work/.buildlink/lib/libintl.a(dcgettex
t.o):/home/jeremy/netbsd/usr/pkgsrc/devel/gettext-lib/work/gettext-0.10.35/intl/
dcgettext.c:249: first defined here
/usr/lib/libc.a(loadmsgcat.o): In function `_nl_load_domain':
/home/jeremy/netbsd/usr/pkgsrc/devel/glibc/work/glibc-2.2.5/intl/loadmsgcat.c(.t
ext+0x270): multiple definition of `_nl_load_domain'
/home/jeremy/netbsd/usr/pkgsrc/devel/popt/work/.buildlink/lib/libintl.a(loadmsgc
at.o)(.text+0x0):/home/jeremy/netbsd/usr/pkgsrc/devel/gettext-lib/work/gettext-0
.10.35/intl/loadmsgcat.c: first defined here
/usr/bin/ld: Warning: size of symbol `_nl_load_domain' changed from 926 to
864 in /usr/lib/libc.a(loadmsgcat.o)

I believe this means that glibc and gettext-lib have duplicated
functionality.

Both provide include/libintl.h. I assume glibc provides the gettext-lib's
libintl within libc itself.

popt has:
BUILD_USES_MSGFMT=      yes
 and:
.include "../../devel/gettext-lib/buildlink2.mk"

Maybe I should add some pkgsrc option so if using glibc, then don't use
gettext-lib/buildlink2.mk or don't use /usr/lib/libintl.a?

Does anyone have any suggestions?

Thanks,

   Jeremy C. Reed
   http://bsd.reedmedia.net/

p.s. Is anyone interested in helping with or using Linux distro using
pkgsrc?