Subject: Re: My Latest Error (gettext)
To: None <tech-pkg@netbsd.org>
From: Amitai Schlair <schmonz@schmonz.com>
List: tech-pkg
Date: 07/21/2002 16:17:24
"Jeffrey Putsch" <jdputsch@attbi.com> wrote:

> On Saturday, July 20, 2002, at 06:38  PM, Randy Beaudreault wrote:
> 
> > cc -I/usr/pkgsrc/devel/gettext/work/.buildlink/include -O -o gettext
> > gettextp.o -L/usr/pkgsrc/devel/gettext/work/.buildlink/lib
> > ../lib/libnlsut.a -lintl /usr/bin/ld: Undefined symbols: __tolower
> 
> Yup. I had to add a file (I called it patches/patch-local-jp) with these
> contents:
> 
> --- intl/l10nflist.c.orig       Sat Apr 20 00:14:00 2002
> +++ intl/l10nflist.c    Sat Apr 20 00:14:06 2002
> @@ -382,7 +382,7 @@
> 
>       for (cnt = 0; cnt < name_len; ++cnt)
>        if (isalpha (codeset[cnt]))
> -         *wp++ = _tolower (codeset[cnt]);
> +         *wp++ = tolower (codeset[cnt]);
>        else if (isdigit (codeset[cnt]))
>          *wp++ = codeset[cnt];

I committed this change to pkgsrc for the sake of correctness, but it
doesn't fix the build for me:

/bin/sh ../libtool --mode=link cc -pipe
-I/Volumes/NetBSD/pkgsrc/devel/gettext/work/.buildlink/include -g
-L/Volumes/NetBSD/pkgsrc/devel/gettext/work/.buildlink/lib -o gettext
gettextp.o ../lib/libnlsut.a
-L/Volumes/NetBSD/pkgsrc/devel/gettext/work/.buildlink/lib  -lintl
cc -pipe -I/Volumes/NetBSD/pkgsrc/devel/gettext/work/.buildlink/include -g
-o gettext gettextp.o
-L/Volumes/NetBSD/pkgsrc/devel/gettext/work/.buildlink/lib ../lib/libnlsut.a
-lintl
/usr/bin/ld: Undefined symbols:
__tolower

If I add "-flat_namespace -undefined suppress", it proceeds just fine. I
suspect that libtool should have emitted these flags to the compiler, and am
investigating libtool.

- Amitai