This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Don't always generate test locales (patch for localedata/*)



Currently every time the testsuite is run, all needed test locales are
rebuild.  This takes quite some time since we're now building an UTF-8
locale.

I've reworked the Makefile and the scripts so that the locales are
only build when needed.

Ok to apply?

Andreas

2000-06-29  Andreas Jaeger  <aj@suse.de>

	* sort-test.sh: Set LC_ALL to full locale name.

	* Makefile (do-tst-ctype): Don't depend on do-tst-mbswcs.sh
	anymore.
	(LOCALES): New.
	($(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite)))): 
	Depend on locale files
	(LOCALE_FILES): New.
	(ALL_LC_FILES): New.
	(ALL_OBJ_LC_FILES): New
	($(ALL_OBJ_LC_FILES)): Generate locales automatically.

	* tst-ctype.sh: Don't generate locales here.
	* tst-mbswcs.sh: Likewise.
	* sort-test.sh: Likewise.

	* gen-locale.sh: New file to generate locales.

============================================================
Index: localedata/Makefile
--- localedata/Makefile	2000/06/29 10:35:32	1.59
+++ localedata/Makefile	2000/06/29 13:43:37
@@ -135,10 +135,27 @@
 do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
 	       $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5
 	$(SHELL) -e $< $(common-objpfx)
-do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test do-tst-mbswcs
+do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test
 	$(SHELL) -e $< $(common-objpfx)
-$(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: do-tst-ctype\
-	 do-tst-mbswcs
+
+# Theses locales are generated by gen-locale.sh
+LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
+	   en_US.ISO-8859-1 ja_JP.EUC-JP 
+
+LOCALE_FILES := LC_ADDRESS LC_IDENTIFICATION LC_MONETARY LC_PAPER       \
+		LC_COLLATE LC_MEASUREMENT LC_NAME LC_TELEPHONE LC_CTYPE \
+		LC_NUMERIC LC_TIME LC_MESSAGES/SYS_LC_MESSAGES
+
+ALL_LC_FILES := $(foreach locale, $(LOCALES), \
+			  $(addprefix $(locale)/, $(LOCALE_FILES)))
+
+ALL_OBJ_LC_FILES := $(addprefix $(objpfx), $(ALL_LC_FILES))
+
+$(ALL_OBJ_LC_FILES): gen-locale.sh Makefile charmaps/* locales/*
+	$(SHELL) -e gen-locale.sh $(common-objpfx)
+
+$(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: $(ALL_OBJ_LC_FILES)
+
 endif
 endif
 
============================================================
Index: localedata/tst-ctype.sh
--- localedata/tst-ctype.sh	2000/06/28 21:37:35	1.5
+++ localedata/tst-ctype.sh	2000/06/29 13:43:37
@@ -19,29 +19,6 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1; shift
-
-generate_locale ()
-{
-    charmap=$1
-    input=$2
-    out=$3
-    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-    ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
-      ${common_objpfx}localedata/$out
-
-    if [ $? -ne 0 ]; then
-	echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
-	     "Outputdir: \"${out}\" failed"
-	exit 1
-    fi
-}
-
-generate_locale EUC-JP ja_JP ja_JP.EUC-JP
-# XXX This is a hack for now.  We need the en_US.ANSI_X3.4-1968 locale
-# XXX elsewhere
-generate_locale ANSI_X3.4-1968 en_US en_US.ANSI_X3.4-1968
-
 status=0
 
 # Run the test programs.
============================================================
Index: localedata/sort-test.sh
--- localedata/sort-test.sh	2000/06/25 18:11:17	1.6
+++ localedata/sort-test.sh	2000/06/29 13:43:37
@@ -6,29 +6,18 @@
 id=${PPID:-100}
 here=`pwd`
 
-# Generate data files.
-for l in $lang; do
-  cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
-  cn=locales/$cns
-  fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
-  I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
-   ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-   ${common_objpfx}locale/localedef --quiet -i $cn -f $fn \
-   ${common_objpfx}localedata/$cns
-done
-
 # Run collation tests.
 status=0
 for l in $lang; do
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$cns ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
    ${common_objpfx}localedata/collate-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.out || status=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1
 
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$cns ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
    ${common_objpfx}localedata/xfrm-test $id < $cns.in \
    > ${common_objpfx}localedata/$cns.xout || status=1
   cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1
============================================================
Index: localedata/tst-mbswcs.sh
--- localedata/tst-mbswcs.sh	2000/06/26 00:29:41	1.6
+++ localedata/tst-mbswcs.sh	2000/06/29 13:43:37
@@ -20,25 +20,6 @@
 
 common_objpfx=$1; shift
 
-generate_locale ()
-{
-    charmap=$1
-    input=$2
-    out=$3
-    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
-    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-    ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
-      ${common_objpfx}localedata/$out
-
-    if [ $? -ne 0 ]; then
-	echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
-	     "Outputdir: \"${out}\" failed"
-	exit 1
-    fi
-}
-
-generate_locale UTF8 de_DE de_DE.UTF-8
-
 status=0
 
 # Run the test programs.
============================================================
Index: localedata/gen-locale.sh
--- localedata/gen-locale.sh	created
+++ localedata/gen-locale.sh	Thu Jun 29 15:28:15 2000	1.1
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Generate test locale files
+# Copyright (C) 2000 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+#
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with the GNU C Library; see the file COPYING.LIB.  If
+# not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+common_objpfx=$1; shift
+
+generate_locale ()
+{
+    charmap=$1
+    input=$2
+    out=$3
+    I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
+    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+    ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
+      ${common_objpfx}localedata/$out
+
+    if [ $? -ne 0 ]; then
+	echo "Charmap: \"${charmap}\" Inputfile: \"${input}\"" \
+	     "Outputdir: \"${out}\" failed"
+	exit 1
+    fi
+}
+
+generate_locale UTF8 de_DE de_DE.UTF-8
+generate_locale ISO-8859-1 de_DE de_DE.ISO-8859-1
+generate_locale ISO-8859-1 en_US en_US.ISO-8859-1
+generate_locale EUC-JP ja_JP ja_JP.EUC-JP
+generate_locale ANSI_X3.4-1968 en_US en_US.ANSI_X3.4-1968
+

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]