Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2000 10:58:37 +0930 (CST)
From:      Greg Lewis <glewis@trc.adelaide.edu.au>
To:        taguchi@tohoku.iij.ad.jp
Cc:        glewis@trc.adelaide.edu.au, freebsd-java@FreeBSD.ORG
Subject:   Re: Pre-alpha JDK 1.2.2 TimeZone (time) bug fixed!
Message-ID:  <200004270128.KAA48402@ares.trc.adelaide.edu.au>
In-Reply-To: <x5snw8z7sz.wl@hirose.tohoku.iij.ad.jp> from "taguchi@tohoku.iij.ad.jp" at "Apr 27, 2000 09:50:04 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Taguchi-san,

> > > src/freebsd/native/java/lang/java_props_md.c uses setlocale(3).
> > > So I think it's better that linling libxpg4.
> > > 
> > > makefiles/Defs-freebsd.gmk
> > > LDLIBS_COMMON = -lhpi$(SUFFIX) $(JVMLIB) -lgcc -lxpg4 -lc
> > >                                                ^^^^^^ add this.
> > > Thanks.
> > > Taguchi,T.
> > 
> > I must admit to not being very familiar with setlocale.  Could you please
> > elaborate as to why the version in libxpg4 is preferred?
> 
> In /usr/share/locale, there are many locale data.
> And libc includes setlocale(3).
> So many people think that we can use many many locales under the
> /usr/share/locale/.
> 
> But this is incorrect.
> Actuary, setlocale(3) in libc supports very few locales, such as default C,
> ,iso-8859-*, and so on. Asian locales, such as ja,kr, and chinese locales
> are NOT supported!
> 
> To support all locales under /usr/share/locale/, we must link libxgp4.
> 
> So current XFree86 applications link xpg4 defaultly.
> See /usr/X11R6/lib/X11/config/FreeBSD.cf.

Thanks for the explanation :).  I suggest we localise the change to
build/freebsd/java/java/GNUmakefile where libjava.so is built (this is
where java_props_md gets linked in).  E.g.

--- build/freebsd/java/java/GNUmakefile~        Tue Oct 12 02:58:50 1999
+++ build/freebsd/java/java/GNUmakefile Thu Apr 27 10:44:15 2000
@@ -106,7 +106,7 @@
        @echo "<<<Finished Recursively making javah."
 
 ifeq ($(PLATFORM),freebsd)
-OTHER_LDLIBS += -L../fdlibm -lfdlibm$(SUFFIX).$(ARCH) -lgcc
+OTHER_LDLIBS += -L../fdlibm -lfdlibm$(SUFFIX).$(ARCH) -lxpg4 -lgcc
 else
 LIBSOCKET = -lsocket
 OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl -L../fdlibm -lfdlibm$(SUFFIX).$(ARCH)

This should IMO, DTRT.  I see there is also a call to setlocale() in
awt_MToolkit.c which links into libawt.so, but this one sets the locale
to the default "C" locale which should be ok based on your explanation.
Comments?

> PS: My modification is not tested yet. Because I'm using FreeBSD-4.0-stable.
> Compilation was OK. But I can not test locale related features.

Right.  Time to get the next patchset out so you can :).

-- 
Greg Lewis 				glewis@trc.adelaide.edu.au
Computing Officer			+61 8 8303 5083
Teletraffic Research Centre


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004270128.KAA48402>