Subject: pkg/24211: lang/perl58 build fails if LANG is set
To: None <gnats-bugs@gnats.NetBSD.org>
From: Min Sik Kim <minskim@bawi.org>
List: netbsd-bugs
Date: 01/24/2004 02:22:18
>Number:         24211
>Category:       pkg
>Synopsis:       lang/perl58 build fails if LANG is set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 24 08:23:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Min Sik Kim
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
>Description:
Perl-5.8 runs a perl binary to figure out if it can use the binary.  A
proper perl binary is expected to return "VER_OK\n".  However, if LANG
is set, it dumps some warnings before it prints "VER_OK\n" as follows:

  perl: warning: Setting locale failed.
  perl: warning: Please check that your locale settings:
          LC_ALL = (unset),
          LANG = "en_US.UTF-8"
      are supported and installed on your system.
  perl: warning: Falling back to the standard locale ("C").
  VER_OK

Since perl58 uses the follwing condition, it rejects the binary if it
prints anything before "VER_OK\n".

  ($val =~ /^VER_OK/)

lang/perl5 doesn't have such a problem because it uses a less strict
condition: ($val =~ /VER_OK/).

>How-To-Repeat:

In lang/perl58,

% env LANG=en_US.UTF-8 make

>Fix:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/perl58/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile	2004/01/23 23:26:25	1.30
+++ Makefile	2004/01/24 08:18:25
@@ -93,6 +93,7 @@
 PERL5_CC=		${CC:T}
 .endif
 CONFIGURE_ARGS+=	-Dcc="${PERL5_CC}"
+MAKE_ENV+=		LANG=""
 
 .if ${OPSYS} == "Darwin"
 #
>Release-Note:
>Audit-Trail:
>Unformatted:
 Environment:
 System: NetBSD sulley.infnis.com 1.6ZH NetBSD 1.6ZH (SULLEY) #3: Fri Jan 16 16:57:45 CST 2004 root@sulley.infnis.com:/usr/obj/sys/arch/i386/compile/SULLEY i386
 Architecture: i386
 Machine: i386