This is the mail archive of the libc-hacker@sources.redhat.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]

make check with static only builds



With the help of Andreas Schwab I've fixed the localedata tests to run
also with when doing a static only build.

I've also fixed a bug in gen-locale when building in the
sourcedirectory.

Is the patch ok to commit?

Andreas

2000-07-11  Andreas Schwab  <schwab@suse.de>

	* Makeconfig (run-program-prefix): New rule.
	(built-program-cmd): Use run-program-prefix.

2000-07-11  Andreas Jaeger  <aj@suse.de>

	* Makefile (locale_test_suite): Always run test suite.
	($(addprefix $(objpfx),$(CTYPE_FILES))): Add extra parameter for
	gen-locale.sh.
	(do-collate-test): Likewise.
	(do-tst-fmon): Likewise.
	(do-tst-locale): Likewise.
	(do-tst-rpmatch): Likewise.
	(do-tst-trans): Likewise.
	(do-tst-mbswcs): Likewise.
	(do-tst-ctype): Likewise.

	* sort-test.sh: Rewrite to work with static only builds.
	* tst-ctype.sh: Likewise.
	* tst-fmon.sh: Likewise.
	* tst-locale.sh: Likewise.
	* tst-msbwcs.sh: Likewise.
	* tst-rpmatch.sh: Likewise.
	* tst-trans.sh: Likewise.

	* gen-locale.sh (locfile): Fix it for building with
	sourcedir==builddir and for static only builds.

============================================================
Index: Makeconfig
--- Makeconfig	2000/06/27 01:20:01	1.239
+++ Makeconfig	2000/07/11 15:57:21
@@ -475,20 +475,18 @@
 # How to run a program we just linked with our library.
 # The program binary is assumed to be $(word 2,$^).
 built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
-ifneq (yes,$(build-shared))
-built-program-cmd = $(built-program-file)
-else
+ifeq (yes,$(build-shared))
 comma = ,
 sysdep-library-path = \
 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
 				       $(filter -Wl$(comma)-rpath-link=%,\
 						$(sysdep-LDFLAGS)))))
-define built-program-cmd
-$(elf-objpfx)$(rtld-installed-name) \
-	--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	$(built-program-file)
-endef
+run-program-prefix = $(elf-objpfx)$(rtld-installed-name) \
+		     --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path))
+else
+run-program-prefix =
 endif
+built-program-cmd = $(run-program-prefix) $(built-program-file)
 
 ifndef LD
 LD := ld -X
============================================================
Index: localedata/Makefile
--- localedata/Makefile	2000/07/01 15:36:25	1.65
+++ localedata/Makefile	2000/07/11 15:57:21
@@ -76,7 +76,6 @@
 include ../Makeconfig
 
 ifeq (no,$(cross-compiling))
-ifeq (yes,$(build-shared))
 locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl            \
 		     tst_iswctype tst_iswdigit tst_iswgraph            \
 		     tst_iswlower tst_iswprint tst_iswpunct            \
@@ -94,7 +93,6 @@
 
 tests = $(locale_test_suite)
 endif
-endif
 
 # Files to install.
 install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \
@@ -117,7 +115,6 @@
 
 
 ifeq (no,$(cross-compiling))
-ifeq (yes,$(build-shared))
 # We have to generate locales
 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
@@ -130,9 +127,9 @@
 # Dependency for the locale files.  We actually make it depend only on
 # one of the files.
 $(addprefix $(objpfx),$(CTYPE_FILES)): %: \
-  gen-locale.sh Makefile $(common-objpfx)locale/localedef \
+  gen-locale.sh $(common-objpfx)locale/localedef Makefile \
   $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS))
-	@$(SHELL) -e gen-locale.sh $(common-objpfx) $@
+	@$(SHELL) -e gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@
 
 $(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: \
   $(addprefix $(objpfx),$(CTYPE_FILES))
@@ -143,27 +140,26 @@
        do-tst-mbswcs do-tst-ctype
 do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
 		 $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx) $(test-input)
+	$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input)
 do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data do-collate-test \
 	     $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx) tst-fmon.data
-do-tst-locale: tst-locale.sh $(ld-test-srcs) \
+	$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data
+do-tst-locale: tst-locale.sh $(common-objpfx)locale/localedef $(ld-test-srcs) \
 	       $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx)
+	$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
 do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon \
 		$(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx)
+	$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
 do-tst-trans: tst-trans.sh $(objpfx)tst-trans \
 	      $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx)
+	$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
 do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \
 	       $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \
 	       $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx)
+	$(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)'
 do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test \
 	      $(addprefix $(objpfx),$(CTYPE_FILES))
-	$(SHELL) -e $< $(common-objpfx)
-endif
+	$(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)'
 endif
 
 # Sometimes the whole collection of locale files should be installed.
============================================================
Index: localedata/gen-locale.sh
--- localedata/gen-locale.sh	2000/07/01 05:18:07	1.3
+++ localedata/gen-locale.sh	2000/07/11 15:57:21
@@ -19,6 +19,7 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx="$1"; shift
+localedef="$1"; shift
 locfile="$1"; shift
 
 generate_locale ()
@@ -27,8 +28,7 @@
     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 \
+    ${localedef} --quiet -c -f $charmap -i $input \
       ${common_objpfx}localedata/$out
 
     if [ $? -ne 0 ]; then
@@ -38,8 +38,9 @@
     fi
 }
 
-locale=`echo $locfile|sed 's|.*/\([^/.]*\)[.].*/LC_CTYPE|\1|'`
-charmap=`echo $locfile|sed 's|.*/[^/.]*[.]\(.*\)/LC_CTYPE|\1|'`
+locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'`
+locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'`
+charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'`
 
 echo "Generating locale $locale.$charmap: this might take a while..."
 generate_locale $charmap $locale $locale.$charmap
============================================================
Index: localedata/sort-test.sh
--- localedata/sort-test.sh	2000/06/29 19:10:40	1.7
+++ localedata/sort-test.sh	2000/07/11 15:57:21
@@ -1,6 +1,7 @@
 #! /bin/sh
 
 common_objpfx=$1; shift
+run_program_prefix=$1; shift
 lang=$*
 
 id=${PPID:-100}
@@ -11,13 +12,13 @@
 for l in $lang; do
   cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \
-   LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   LC_ALL=$l ${run_program_prefix} \
    ${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=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+   LC_ALL=$l ${run_program_prefix} \
    ${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-ctype.sh
--- localedata/tst-ctype.sh	2000/06/30 04:06:14	1.7
+++ localedata/tst-ctype.sh	2000/07/11 15:57:21
@@ -19,6 +19,7 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1; shift
+tst_ctype=$1; shift
 status=0
 
 # Run the test programs.
@@ -30,8 +31,7 @@
     input=/dev/null
   fi
   LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-  LC_ALL=$loc ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-    ${common_objpfx}localedata/tst-ctype < $input \
+  LC_ALL=$loc ${tst_ctype} < $input \
     >> ${common_objpfx}localedata/tst-ctype.out || status=1
 done
 
============================================================
Index: localedata/tst-fmon.sh
--- localedata/tst-fmon.sh	2000/07/04 08:22:15	1.9
+++ localedata/tst-fmon.sh	2000/07/11 15:57:21
@@ -25,7 +25,8 @@
 esac
 
 common_objpfx=$1
-datafile=$2
+run_program_prefix=$2
+datafile=$3
 
 here=`pwd`
 
@@ -37,19 +38,17 @@
     fn=charmaps/ISO-8859-1
     I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
     LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
-    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-    ${common_objpfx}locale/localedef \
+    ${run_program_prefix} ${common_objpfx}locale/localedef \
     --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns
 done
 
 # Run the tests.
-IFS="	"                # This is a TAB
-while read locale format value expect; do
+# There's a TAB for IFS
+while IFS="	" read locale format value expect; do
     if [ -n "$format" ]; then
 	LOCPATH=${common_objpfx}localedata \
 	GCONV_PATH=${common_objpfx}/iconvdata \
-	${common_objpfx}elf/ld.so --library-path $common_objpfx \
-        ${common_objpfx}localedata/tst-fmon \
+	${run_program_prefix} ${common_objpfx}localedata/tst-fmon \
 	    "$locale" "$format" "$value" "$expect"
 	if [ $? -eq 0 ]; then
 	    if [ $DEBUG -eq 1 ]; then
============================================================
Index: localedata/tst-locale.sh
--- localedata/tst-locale.sh	2000/07/04 08:21:58	1.10
+++ localedata/tst-locale.sh	2000/07/11 15:57:21
@@ -20,6 +20,7 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1; shift
+localedef=$1; shift
 
 test_locale ()
 {
@@ -32,8 +33,7 @@
     fi
     I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \
     LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \
-    ${common_objpfx}elf/ld.so --library-path $common_objpfx \
-    ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \
+    ${localedef} --quiet -c -f $charmap -i $input \
       ${rep} ${common_objpfx}localedata/$out
 
     if [ $? -ne 0 ]; then
============================================================
Index: localedata/tst-mbswcs.sh
--- localedata/tst-mbswcs.sh	2000/06/29 19:10:40	1.7
+++ localedata/tst-mbswcs.sh	2000/07/11 15:57:21
@@ -19,33 +19,29 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1; shift
+run_program_prefix=$1; shift
 
 status=0
 
 # Run the test programs.
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
-  ${common_objpfx}localedata/tst-mbswcs1 \
+${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \
   > ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
-  ${common_objpfx}localedata/tst-mbswcs2 \
+${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
-  ${common_objpfx}localedata/tst-mbswcs3 \
+${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
-  ${common_objpfx}localedata/tst-mbswcs4 \
+${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
-  ${common_objpfx}localedata/tst-mbswcs5 \
+${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \
   >> ${common_objpfx}localedata/tst-mbswcs.out || status=1
 
 exit $status
============================================================
Index: localedata/tst-rpmatch.sh
--- localedata/tst-rpmatch.sh	2000/06/30 04:05:20	1.5
+++ localedata/tst-rpmatch.sh	2000/07/11 15:57:21
@@ -20,14 +20,14 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1
-IFS="&"
+tst_rpmatch=$2
+
 rc=0
-while read locale string result dummy; do
+while IFS=\& read locale string result dummy; do
     if [ "$locale" != "#" ]; then
 	LOCPATH=${common_objpfx}localedata \
 	GCONV_PATH=${common_objpfx}/iconvdata \
-	${common_objpfx}elf/ld.so --library-path $common_objpfx \
-	${common_objpfx}localedata/tst-rpmatch $locale $string $result \
+	${tst_rpmatch} $locale $string $result \
 	|| exit 1
     fi
 done <<EOF
============================================================
Index: localedata/tst-trans.sh
--- localedata/tst-trans.sh	2000/06/26 00:30:03	1.7
+++ localedata/tst-trans.sh	2000/07/11 15:57:21
@@ -19,10 +19,11 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 common_objpfx=$1
+run_program_prefix=$2
 
 # Generate the necessary locale data.
 I18NPATH=. GCONV_PATH=${common_objpfx}/iconvdata \
-${common_objpfx}elf/ld.so --library-path $common_objpfx \
+${run_program_prefix} \
 ${common_objpfx}locale/localedef --quiet \
 -i tests/trans.def -f charmaps/ISO-8859-1 \
 ${common_objpfx}localedata/tt_TT ||
@@ -30,7 +31,7 @@
 
 # Run the test program.
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=tt_TT ${common_objpfx}elf/ld.so --library-path $common_objpfx \
+LC_ALL=tt_TT ${run_program_prefix} \
 ${common_objpfx}localedata/tst-trans > ${common_objpfx}localedata/tst-trans.out
 
 exit $?

-- 
 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]