8ae002
From af67490e3e2ad2a32c1bcfac8923c025ac247518 Mon Sep 17 00:00:00 2001
8ae002
From: Stefan Liebler <stli@linux.vnet.ibm.com>
8ae002
Date: Mon, 7 Nov 2016 15:05:28 +0100
8ae002
Subject: [PATCH 01/17] S390: Get rid of make warning: overriding recipe for
8ae002
 target gconv-modules.
8ae002
8ae002
Upstream commit c70e9913d2fc2d0bf6a3ca98a4dece759d40a4ec
8ae002
8ae002
This patch introduces a way to provide an architecture dependent gconv-modules
8ae002
file. Before this patch, the gconv-modules file was normally installed from
8ae002
src-dir/iconvdata/gconv-modules. The S390 Makefile had overridden the
8ae002
installation recipe (with a make warning) in order to install the
8ae002
gconv-module-s390 file from build-dir.
8ae002
The iconvdata/Makefile provides another recipe, which copies the gconv-modules
8ae002
file from src to build dir, which are used by the testcases.
8ae002
Thus the testcases does not use the currently build s390-modules.
8ae002
8ae002
This patch uses build-dir/iconvdata/gconv-modules for installation, which
8ae002
is generated by concatenating src-dir/iconvdata/gconv-modules and the
8ae002
architecture specific one. The latter one can be specified by setting the variable
8ae002
sysdeps-gconv-modules in sysdeps/.../Makefile.
8ae002
8ae002
The architecture specific gconv-modules file is emitted before the common one
8ae002
because these modules aren't used in all possible conversions. E.g. the converting
8ae002
from INTERNAL to UTF-16 used the common UTF-16.so module instead of UTF16_UTF32_Z9.so.
8ae002
8ae002
This way, the s390-Makefile does not need to override the recipe for gconv-modules
8ae002
and no warning is emitted anymore.
8ae002
Since we no longer support empty objpfx the conditional test in iconvdata/Makefile
8ae002
is removed.
8ae002
8ae002
ChangeLog:
8ae002
8ae002
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules):
8ae002
	Install file from $(objpfx)gconv-modules.
8ae002
	($(objpfx)gconv-modules): Concatenate architecture specific file
8ae002
	in variable sysdeps-gconv-modules and gconv-modules in src dir.
8ae002
	* sysdeps/s390/gconv-modules: New file.
8ae002
	* sysdeps/s390/s390-64/Makefile: ($(inst_gconvdir)/gconv-modules):
8ae002
	Deleted.
8ae002
	($(objpfx)gconv-modules-s390): Deleted.
8ae002
	(sysdeps-gconv-modules): New variable.
8ae002
---
8ae002
 iconvdata/Makefile            |  6 ++---
8ae002
 sysdeps/s390/gconv-modules    | 50 ++++++++++++++++++++++++++++++++++++++++++
8ae002
 sysdeps/s390/s390-64/Makefile | 51 +------------------------------------------
8ae002
 3 files changed, 53 insertions(+), 54 deletions(-)
8ae002
 create mode 100644 sysdeps/s390/gconv-modules
8ae002
8ae002
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
8ae002
index a99539e..e2624de 100644
8ae002
--- a/iconvdata/Makefile
8ae002
+++ b/iconvdata/Makefile
8ae002
@@ -244,7 +244,7 @@ headers: $(addprefix $(objpfx), $(generated-modules:=.h))
8ae002
 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
8ae002
     $(inst_gconvdir)/%: $(objpfx)% $(+force)
8ae002
 	$(do-install-program)
8ae002
-$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
8ae002
+$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules $(+force)
8ae002
 	$(do-install)
8ae002
 ifeq (no,$(cross-compiling))
8ae002
 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
8ae002
@@ -319,7 +319,5 @@ do-tests-clean common-mostlyclean: tst-tables-clean
8ae002
 tst-tables-clean:
8ae002
 	-rm -f $(objpfx)tst-*.table $(objpfx)tst-EUC-TW.irreversible
8ae002
 
8ae002
-ifdef objpfx
8ae002
 $(objpfx)gconv-modules: gconv-modules
8ae002
-	cp $^ $@
8ae002
-endif
8ae002
+	cat $(sysdeps-gconv-modules) $^ > $@
8ae002
diff --git a/sysdeps/s390/gconv-modules b/sysdeps/s390/gconv-modules
8ae002
new file mode 100644
8ae002
index 0000000..7021105
8ae002
--- /dev/null
8ae002
+++ b/sysdeps/s390/gconv-modules
8ae002
@@ -0,0 +1,50 @@
8ae002
+# GNU libc iconv configuration.
8ae002
+# Copyright (C) 1997-2016 Free Software Foundation, Inc.
8ae002
+# This file is part of the GNU C Library.
8ae002
+
8ae002
+# The GNU C Library is free software; you can redistribute it and/or
8ae002
+# modify it under the terms of the GNU Lesser General Public
8ae002
+# License as published by the Free Software Foundation; either
8ae002
+# version 2.1 of the License, or (at your option) any later version.
8ae002
+
8ae002
+# The GNU C Library is distributed in the hope that it will be useful,
8ae002
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
8ae002
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8ae002
+# Lesser General Public License for more details.
8ae002
+
8ae002
+# You should have received a copy of the GNU Lesser General Public
8ae002
+# License along with the GNU C Library; if not, see
8ae002
+# <http://www.gnu.org/licenses/>.
8ae002
+
8ae002
+# All lines contain the following information:
8ae002
+
8ae002
+# If the lines start with `module'
8ae002
+#  fromset:	either a name triple or a regular expression triple.
8ae002
+#  toset:	a name triple or an expression with \N to get regular
8ae002
+#		expression matching results.
8ae002
+#  filename:	filename of the module implementing the transformation.
8ae002
+#		If it is not absolute the path is made absolute by prepending
8ae002
+#		the directory the configuration file is found in.
8ae002
+#  cost:	optional cost of the transformation.  Default is 1.
8ae002
+
8ae002
+# If the lines start with `alias'
8ae002
+#  alias:	alias name which is not really recognized.
8ae002
+#  name:	the real name of the character set
8ae002
+
8ae002
+# S/390 hardware accelerated modules
8ae002
+#	from			to			module			cost
8ae002
+module	ISO-8859-1//		IBM037//		ISO-8859-1_CP037_Z900	1
8ae002
+module	IBM037//		ISO-8859-1//		ISO-8859-1_CP037_Z900	1
8ae002
+module	ISO-10646/UTF8/		UTF-32//		UTF8_UTF32_Z9		1
8ae002
+module	UTF-32BE//		ISO-10646/UTF8/		UTF8_UTF32_Z9		1
8ae002
+module	ISO-10646/UTF8/		UTF-32BE//		UTF8_UTF32_Z9		1
8ae002
+module	UTF-16BE//		UTF-32//		UTF16_UTF32_Z9		1
8ae002
+module	UTF-32BE//		UTF-16//		UTF16_UTF32_Z9		1
8ae002
+module	INTERNAL		UTF-16//		UTF16_UTF32_Z9		1
8ae002
+module	UTF-32BE//		UTF-16BE//		UTF16_UTF32_Z9		1
8ae002
+module	INTERNAL		UTF-16BE//		UTF16_UTF32_Z9		1
8ae002
+module	UTF-16BE//		UTF-32BE//		UTF16_UTF32_Z9		1
8ae002
+module	UTF-16BE//		INTERNAL		UTF16_UTF32_Z9		1
8ae002
+module	UTF-16BE//		ISO-10646/UTF8/		UTF8_UTF16_Z9		1
8ae002
+module	ISO-10646/UTF8/		UTF-16//		UTF8_UTF16_Z9		1
8ae002
+module	ISO-10646/UTF8/		UTF-16BE//		UTF8_UTF16_Z9		1
8ae002
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
8ae002
index 939e947..bb958bd 100644
8ae002
--- a/sysdeps/s390/s390-64/Makefile
8ae002
+++ b/sysdeps/s390/s390-64/Makefile
8ae002
@@ -39,54 +39,5 @@ $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) : \
8ae002
 $(inst_gconvdir)/%.so: $(objpfx)%.so $(+force)
8ae002
 	$(do-install-program)
8ae002
 
8ae002
-$(objpfx)gconv-modules-s390: gconv-modules $(+force)
8ae002
-	cp $< $@
8ae002
-	echo >> $@
8ae002
-	echo "# S/390 hardware accelerated modules" >> $@
8ae002
-	echo -n "module	ISO-8859-1//		IBM037//	" >> $@
8ae002
-	echo "	ISO-8859-1_CP037_Z900	1" >> $@
8ae002
-	echo -n "module	IBM037//		ISO-8859-1//	" >> $@
8ae002
-	echo "	ISO-8859-1_CP037_Z900	1" >> $@
8ae002
-	echo -n "module	ISO-10646/UTF8/		UTF-32//	" >> $@
8ae002
-	echo "	UTF8_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-32BE//		ISO-10646/UTF8/	" >> $@
8ae002
-	echo "	UTF8_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	ISO-10646/UTF8/		UTF-32BE//	" >> $@
8ae002
-	echo "	UTF8_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-16BE//		UTF-32//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-32BE//		UTF-16//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	INTERNAL		UTF-16//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-32BE//		UTF-16BE//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	INTERNAL		UTF-16BE//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-16BE//		UTF-32BE//	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-16BE//		INTERNAL	" >> $@
8ae002
-	echo "	UTF16_UTF32_Z9		1" >> $@
8ae002
-	echo -n "module	UTF-16BE//		ISO-10646/UTF8/	" >> $@
8ae002
-	echo "	UTF8_UTF16_Z9		1" >> $@
8ae002
-	echo -n "module	ISO-10646/UTF8/		UTF-16//	" >> $@
8ae002
-	echo "	UTF8_UTF16_Z9		1" >> $@
8ae002
-	echo -n "module	ISO-10646/UTF8/		UTF-16BE//	" >> $@
8ae002
-	echo "	UTF8_UTF16_Z9		1" >> $@
8ae002
-
8ae002
-$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules-s390 $(+force)
8ae002
-	$(do-install)
8ae002
-ifeq (no,$(cross-compiling))
8ae002
-# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
8ae002
-# if this libc has more gconv modules than the previously installed one.
8ae002
-	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
8ae002
-	   LC_ALL=C LANGUAGE=C \
8ae002
-	   $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
8ae002
-	   $(common-objpfx)iconv/iconvconfig \
8ae002
-	     $(addprefix --prefix=,$(install_root)); \
8ae002
-	fi
8ae002
-else
8ae002
-	@echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
8ae002
-endif
8ae002
-
8ae002
+sysdeps-gconv-modules = ../sysdeps/s390/gconv-modules
8ae002
 endif
8ae002
-- 
8ae002
1.8.3.1
8ae002