From sanpei@yy.cs.keio.ac.jp  Fri Apr 18 03:14:54 1997
Received: from titanium.yy.cs.keio.ac.jp (titanium.yy.cs.keio.ac.jp [131.113.47.73])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA22562
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Apr 1997 03:14:35 -0700 (PDT)
Received: from lavender.yy.cs.keio.ac.jp (lavender.yy.cs.keio.ac.jp [131.113.47.22]) by titanium.yy.cs.keio.ac.jp (8.8.4+2.7Wbeta4/3.5Wpl3) with ESMTP id TAA10922 for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Apr 1997 19:14:16 +0900 (JST)
Received: (from sanpei@localhost) by lavender.yy.cs.keio.ac.jp (8.7.6/3.5Wpl3) id TAA01544; Fri, 18 Apr 1997 19:14:16 +0900 (JST)
Message-Id: <199704181014.TAA01544@lavender.yy.cs.keio.ac.jp>
Date: Fri, 18 Apr 1997 19:14:16 +0900 (JST)
From: sanpei@yy.cs.keio.ac.jp
Reply-To: sanpei@yy.cs.keio.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: setlocale problem in lang/perl5
X-Send-Pr-Version: 3.2

>Number:         3322
>Category:       ports
>Synopsis:       setlocale problem in lang/perl5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 18 03:20:03 PDT 1997
>Closed-Date:    Mon Aug 31 11:32:51 PDT 1998
>Last-Modified:  Mon Aug 31 11:33:28 PDT 1998
>Originator:     MIHIRA Yoshiro
>Release:        FreeBSD 2.2-961014-SNAP i386
>Organization:
Keio Univ. Japan
>Environment:

	  If set environment variable LANG to except ``C,''
	for example ``ja_JP.EUC.''

>Description:

  I think current perl5 ports has two problems.

(I) Setlocale problem
	(1) setlocale function is used in perl5.
	(2) shared library which has setlocale is libc and libxpg4.
	    setlocale in libc is only support LANG C.
	    on the other, setlocale in libxpg4 is support other
	    LANGs, one is ja_JP.EUC.
	(3) And perl5 is linked only libc, not libxpg4.
	(4) If set environment variable LANG to ja_JP.EUC, perl5
	    outputted some warnings.

	Solution
	    link libxpg4 (before libc.)

	* This problem was still solved in japanese/perl5.

(II) Patch for 2 files was mixed one patch file(patch-aa)
	    I separate patch file for each file to be patched.
		patch-aa to ``Configure'' file
		(new)patch-ae to ``installperl'' file

>How-To-Repeat:
	(1) install lang/perl5 packages.

	(2) set enviroment variable LANG ja_JP.EUC (for example with tcsh)
		> setenv LANG ja_JP.EUC

	(3) execute perl
	* > /usr/local/bin/perl -v
	* lavender: {147} perl -v
	* warning: setlocale(LC_CTYPE, "") failed.
	* warning: LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "ja_JP.EUC",
	* warning: falling back to the "C" locale.
	* <omit>

>Fix:

please apply below path.
	
diff -u -rN perl5.org/patches/patch-aa perl5/patches/patch-aa
--- perl5.org/patches/patch-aa	Sun Jul 14 04:29:47 1996
+++ perl5/patches/patch-aa	Sun Apr 13 14:22:55 1997
@@ -1,5 +1,5 @@
---- perl5.002.ORG/Configure	Tue Feb 27 23:06:34 1996
-+++ Configure	Sat Mar 16 11:21:52 1996
+--- Configure.orig	Mon Mar 25 15:04:01 1996
++++ Configure	Sun Apr 13 14:22:45 1997
 @@ -85,11 +85,12 @@
  PATH=.$p_$PATH
  export PATH
@@ -18,49 +18,12 @@
  
  : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
  if test -f /hp-ux -a -f /bin/ksh; then
-*** installperl.orig	Mon Jun 24 22:08:25 1996
---- installperl	Wed Jun 26 22:21:05 1996
-***************
-*** 89,95 ****
-  &safe_unlink("$installbin/sperl$ver$exe_ext");
-  if ($d_dosuid) {
-      &cmd("cp suidperl$exe_ext $installbin/sperl$ver$exe_ext");
-!     &chmod(04711, "$installbin/sperl$ver$exe_ext");
-  }
-  
-  exit 0 if $versiononly;
---- 89,95 ----
-  &safe_unlink("$installbin/sperl$ver$exe_ext");
-  if ($d_dosuid) {
-      &cmd("cp suidperl$exe_ext $installbin/sperl$ver$exe_ext");
-!     &chmod(04111, "$installbin/sperl$ver$exe_ext");
-  }
-  
-  exit 0 if $versiononly;
-***************
-*** 203,212 ****
-  	      ((readlink "$mainperldir/perl$exe_ext") eq "$binexp/perl$exe_ext"));
-      }
-      if ((! $mainperl_is_instperl) &&
-! 	(&yn("Many scripts expect perl to be installed as " .
-! 	     "$mainperldir/perl.\n" . 
-! 	     "Do you wish to have $mainperldir/perl be the same as\n" .
-! 	     "$binexp/perl? [y] ")))
-      {	
-  	unlink("$mainperldir/perl$exe_ext");
-  	eval 'link("$installbin/perl$exe_ext", "$mainperldir/perl$exe_ext")' ||
---- 203,216 ----
-  	      ((readlink "$mainperldir/perl$exe_ext") eq "$binexp/perl$exe_ext"));
-      }
-      if ((! $mainperl_is_instperl) &&
-! 	0)
-! #	Disable Perl5 from 'taking' over from the system Perl.
-! #	(nasty hack, but it is only for the FreeBSD build, so WTH.
-! #
-! #	(&yn("Many scripts expect perl to be installed as " .
-! #	     "$mainperldir/perl.\n" . 
-! #	     "Do you wish to have $mainperldir/perl be the same as\n" .
-! #	     "$binexp/perl? [y] ")))
-      {	
-  	unlink("$mainperldir/perl$exe_ext");
-  	eval 'link("$installbin/perl$exe_ext", "$mainperldir/perl$exe_ext")' ||
+@@ -708,7 +709,7 @@
+ : List of libraries we want.
+ libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
+ libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
+-libswanted="$libswanted ucb bsd BSD PW x"
++libswanted="xpg4 $libswanted ucb bsd BSD PW x"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
diff -u -rN perl5.org/patches/patch-ae perl5/patches/patch-ae
--- perl5.org/patches/patch-ae	Thu Jan  1 09:00:00 1970
+++ perl5/patches/patch-ae	Sun Apr 13 14:22:21 1997
@@ -0,0 +1,30 @@
+--- installperl.orig	Tue Jun 25 05:08:25 1996
++++ installperl	Sun Apr 13 14:20:30 1997
+@@ -89,7 +89,7 @@
+ &safe_unlink("$installbin/sperl$ver$exe_ext");
+ if ($d_dosuid) {
+     &cmd("cp suidperl$exe_ext $installbin/sperl$ver$exe_ext");
+-    &chmod(04711, "$installbin/sperl$ver$exe_ext");
++    &chmod(04111, "$installbin/sperl$ver$exe_ext");
+ }
+ 
+ exit 0 if $versiononly;
+@@ -203,10 +203,14 @@
+ 	      ((readlink "$mainperldir/perl$exe_ext") eq "$binexp/perl$exe_ext"));
+     }
+     if ((! $mainperl_is_instperl) &&
+-	(&yn("Many scripts expect perl to be installed as " .
+-	     "$mainperldir/perl.\n" . 
+-	     "Do you wish to have $mainperldir/perl be the same as\n" .
+-	     "$binexp/perl? [y] ")))
++	0)
++#	Disable Perl5 from 'taking' over from the system Perl.
++#	(nasty hack, but it is only for the FreeBSD build, so WTH.
++#
++#	(&yn("Many scripts expect perl to be installed as " .
++#	     "$mainperldir/perl.\n" . 
++#	     "Do you wish to have $mainperldir/perl be the same as\n" .
++#	     "$binexp/perl? [y] ")))
+     {	
+ 	unlink("$mainperldir/perl$exe_ext");
+ 	eval 'link("$installbin/perl$exe_ext", "$mainperldir/perl$exe_ext")' ||
>Release-Note:
>Audit-Trail:

From: asami@vader.cs.berkeley.edu (Satoshi Asami)
To: FreeBSD-gnats-submit@freefall.FreeBSD.org, sanpei@yy.cs.keio.ac.jp
Cc:  Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Fri, 18 Apr 1997 03:50:15 -0700 (PDT)

  * (II) Patch for 2 files was mixed one patch file(patch-aa)
 
 Don't know about other stuff, but this is not a problem.  What you
 can NOT do is to patch one file from multiple patchfiles.
 
 Satoshi

From: MIHIRA "Sanpei" Yoshiro <sanpei@yy.cs.keio.ac.jp>
To: asami@vader.cs.berkeley.edu
Cc: FreeBSD-gnats-submit@freefall.FreeBSD.org
Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Fri, 18 Apr 1997 20:16:15 +0900

 > * (II) Patch for 2 files was mixed one patch file(patch-aa)
 >
 >Don't know about other stuff, but this is not a problem.  What you
 >can NOT do is to patch one file from multiple patchfiles.
 
   Yes, it is not problem to compile. 
   I think if separate this patch file(patch-aa), maintain of this
 ports is easier than existing style.
   And I also know diff files of ports CVS tree is much larger, if
 do.
 
   I don't mind whether separete or not :-)
 
 Yoshiro MIHIRA

From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= <ache@nagual.ru>
To: sanpei@yy.cs.keio.ac.jp
Cc: FreeBSD-gnats-submit@freebsd.org,
        GNATS Management <gnats@freefall.freebsd.org>,
        freebsd-ports@freefall.freebsd.org
Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Fri, 18 Apr 1997 17:48:03 +0400 (MSD)

 On Fri, 18 Apr 1997 sanpei@yy.cs.keio.ac.jp wrote:
 
 > 	(1) setlocale function is used in perl5.
 > 	(2) shared library which has setlocale is libc and libxpg4.
 > 	    setlocale in libc is only support LANG C.
 > 	    on the other, setlocale in libxpg4 is support other
 > 	    LANGs, one is ja_JP.EUC.
 > 	(3) And perl5 is linked only libc, not libxpg4.
 > 	(4) If set environment variable LANG to ja_JP.EUC, perl5
 > 	    outputted some warnings.
 > 
 > 	Solution
 > 	    link libxpg4 (before libc.)
 
 It is possible only if perl5 fully support 16bit wide characters
 and string, if not, it breaks perl5 badly.
 
 -- 
 Andrey A. Chernov
 <ache@null.net>
 http://www.nagual.ru/~ache/
 

From: MIHIRA "Sanpei" Yoshiro <sanpei@yy.cs.keio.ac.jp>
To: ache@nagual.ru
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Mon, 21 Apr 1997 11:14:51 +0900

 >On Fri, 18 Apr 1997 sanpei@yy.cs.keio.ac.jp wrote:
 >
 >> 	(1) setlocale function is used in perl5.
 >> 	(2) shared library which has setlocale is libc and libxpg4.
 >> 	    setlocale in libc is only support LANG C.
 >> 	    on the other, setlocale in libxpg4 is support other
 >> 	    LANGs, one is ja_JP.EUC.
 >> 	(3) And perl5 is linked only libc, not libxpg4.
 >> 	(4) If set environment variable LANG to ja_JP.EUC, perl5
 >> 	    outputted some warnings.
 >> 
 >> 	Solution
 >> 	    link libxpg4 (before libc.)
 >
 >It is possible only if perl5 fully support 16bit wide characters
 >and string, if not, it breaks perl5 badly.
 
   OK, I hope to append some notice about this warnings to pkg/DESCR
 file.
 
 ---
 Yoshiro MIHIRA
 Keio Univ. Japan
Responsible-Changed-From-To: freebsd-ports->markm 
Responsible-Changed-By: asami 
Responsible-Changed-When: Tue Jun 3 19:05:04 PDT 1997 
Responsible-Changed-Why:  
He's the maintainer. 

From: MIHIRA "Sanpei" Yoshiro <sanpei@yy.cs.keio.ac.jp>
To: ache@nagual.ru
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Sat, 12 Jul 1997 00:47:41 +0900

 >On Fri, 18 Apr 1997 sanpei@yy.cs.keio.ac.jp wrote:
 >
 >> 	(1) setlocale function is used in perl5.
 >> 	(2) shared library which has setlocale is libc and libxpg4.
 >> 	    setlocale in libc is only support LANG C.
 >> 	    on the other, setlocale in libxpg4 is support other
 >> 	    LANGs, one is ja_JP.EUC.
 >> 	(3) And perl5 is linked only libc, not libxpg4.
 >> 	(4) If set environment variable LANG to ja_JP.EUC, perl5
 >> 	    outputted some warnings.
 >> 
 >> 	Solution
 >> 	    link libxpg4 (before libc.)
 >
 ache>It is possible only if perl5 fully support 16bit wide characters
 ache>and string, if not, it breaks perl5 badly.
 
   I think, if perl5 does not support 16bit wide characters, it is
 not needed to use setlocale function and configure with -U d_setlocale.
 
   Is it right?
 ---
 Yoshiro MIHIRA
 Ph.D Candidate, Yamamoto Lab.
 Department of Computer Science
 Keio University. Yokohama, Japan

From: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= <ache@nagual.pp.ru>
To: MIHIRA Sanpei Yoshiro <sanpei@yy.cs.keio.ac.jp>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/3322: setlocale problem in lang/perl5
Date: Fri, 11 Jul 1997 23:07:33 +0400 (MSD)

 On Sat, 12 Jul 1997, MIHIRA Sanpei Yoshiro wrote:
 
 >   I think, if perl5 does not support 16bit wide characters, it is
 > not needed to use setlocale function and configure with -U d_setlocale.
 > 
 >   Is it right?
 
 If you completely disable setlocale, you'll disable it for 8bit locales
 too which is unwanted effect. 
 
 The solution will be: not run perl in 16bit environment, i.e. change
 LANG to C before running perl programs with 'use locale' pragma
 or setlocale() calls.
 
 -- 
 Andrey A. Chernov
 <ache@null.net>
 http://www.nagual.pp.ru/~ache/
 
State-Changed-From-To: open->closed 
State-Changed-By: markm 
State-Changed-When: Mon Aug 31 11:32:51 PDT 1998 
State-Changed-Why:  
Current perl5 fixes this. 
>Unformatted:
