b6c903
commit fc5bfade69ca12d034967dc6b929dbe3dd715172
b6c903
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
b6c903
Date:   Mon Jun 7 14:22:20 2021 +0530
b6c903
b6c903
    iconvdata: Move gconv-modules configuration to gconv-modules.conf
b6c903
    
b6c903
    Move all gconv-modules configuration files to gconv-modules.conf.
b6c903
    That is, the S390 extensions now become gconv-modules-s390.conf.  Move
b6c903
    both configuration files into gconv-modules.d.
b6c903
    
b6c903
    Now GCONV_PATH/gconv-modules is read only for backward compatibility
b6c903
    for third-party gconv modules directories.
b6c903
    
b6c903
    Reviewed-by: DJ Delorie <dj@redhat.com>
b6c903
b6c903
# Conflicts:
b6c903
#	iconvdata/Makefile
b6c903
b6c903
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
b6c903
index 32656ad31d9b434b..fc403e8abe3cc11f 100644
b6c903
--- a/iconvdata/Makefile
b6c903
+++ b/iconvdata/Makefile
b6c903
@@ -136,10 +136,13 @@ charmaps = ../localedata/charmaps
b6c903
 extra-modules-left := $(modules)
b6c903
 include extra-module.mk
b6c903
 
b6c903
+gconv-modules = gconv-modules.conf
b6c903
+modpfx = $(objpfx)gconv-modules.d/
b6c903
 
b6c903
 extra-objs	+= $(modules.so)
b6c903
 install-others	= $(addprefix $(inst_gconvdir)/, $(modules.so))	\
b6c903
-		  $(inst_gconvdir)/gconv-modules
b6c903
+		  $(addprefix $(inst_gconvdir)/gconv-modules.d/, \
b6c903
+			      $(gconv-modules))
b6c903
 
b6c903
 # We can build the conversion tables for numerous charsets automatically.
b6c903
 
b6c903
@@ -181,7 +184,7 @@ generated += $(generated-modules:=.h) $(generated-modules:=.stmp) \
b6c903
 	     iconv-test.out iconv-rules tst-loading.mtrace	 \
b6c903
 	     mtrace-tst-loading.out tst-tables.out iconv-test.xxx
b6c903
 ifdef objpfx
b6c903
-generated += gconv-modules
b6c903
+generated += $(addprefix gconv-modules.d/,$(gconv-modules))
b6c903
 endif
b6c903
 
b6c903
 # Rules to generate the headers.
b6c903
@@ -249,7 +252,8 @@ headers: $(addprefix $(objpfx), $(generated-modules:=.h))
b6c903
 $(addprefix $(inst_gconvdir)/, $(modules.so)): \
b6c903
     $(inst_gconvdir)/%: $(objpfx)% $(+force)
b6c903
 	$(do-install-program)
b6c903
-$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules $(+force)
b6c903
+$(addprefix $(inst_gconvdir)/gconv-modules.d/, $(gconv-modules)): \
b6c903
+    $(inst_gconvdir)/gconv-modules.d/%: $(modpfx)% $(+force)
b6c903
 	$(do-install)
b6c903
 ifeq (no,$(cross-compiling))
b6c903
 # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
b6c903
@@ -297,29 +301,30 @@ $(objpfx)mtrace-tst-loading.out: $(objpfx)tst-loading.out
b6c903
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-loading.mtrace > $@; \
b6c903
 	$(evaluate-test)
b6c903
 
b6c903
-$(objpfx)bug-iconv1.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv1.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)bug-iconv2.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv2.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
 $(objpfx)bug-iconv3: $(libdl)
b6c903
-$(objpfx)bug-iconv3.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv3.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)bug-iconv5.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv5.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)tst-loading.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)tst-loading.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			  $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)tst-iconv4.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)tst-iconv4.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)tst-iconv7.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)bug-iconv10.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv10.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			  $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)bug-iconv12.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv12.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			  $(addprefix $(objpfx),$(modules.so))
b6c903
-$(objpfx)bug-iconv14.out: $(objpfx)gconv-modules \
b6c903
+$(objpfx)bug-iconv14.out: $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			  $(addprefix $(objpfx),$(modules.so))
b6c903
 
b6c903
-$(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
b6c903
+$(objpfx)iconv-test.out: run-iconv-test.sh \
b6c903
+			 $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so)) \
b6c903
 			 $(common-objdir)/iconv/iconv_prog TESTS
b6c903
 	iconv_modules="$(modules)" \
b6c903
@@ -327,7 +332,8 @@ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
b6c903
 		 '$(run-program-env)' > $@; \
b6c903
 	$(evaluate-test)
b6c903
 
b6c903
-$(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
b6c903
+$(objpfx)tst-tables.out: tst-tables.sh \
b6c903
+			 $(addprefix $(modpfx), $(gconv-modules)) \
b6c903
 			 $(addprefix $(objpfx),$(modules.so)) \
b6c903
 			 $(objpfx)tst-table-from $(objpfx)tst-table-to
b6c903
 	$(SHELL) $< $(common-objpfx) $(common-objpfx)iconvdata/ \
b6c903
@@ -340,5 +346,8 @@ do-tests-clean common-mostlyclean: tst-tables-clean
b6c903
 tst-tables-clean:
b6c903
 	-rm -f $(objpfx)tst-*.table $(objpfx)tst-EUC-TW.irreversible
b6c903
 
b6c903
-$(objpfx)gconv-modules: gconv-modules
b6c903
-	cat $(sysdeps-gconv-modules) $^ > $@
b6c903
+$(modpfx):
b6c903
+	mkdir -p $@
b6c903
+
b6c903
+$(modpfx)%: % $(modpfx)
b6c903
+	cp $< $@
b6c903
diff --git a/iconvdata/gconv-modules b/iconvdata/gconv-modules.conf
b6c903
similarity index 100%
b6c903
rename from iconvdata/gconv-modules
b6c903
rename to iconvdata/gconv-modules.conf
b6c903
diff --git a/localedata/Makefile b/localedata/Makefile
b6c903
index 14fcc37fed21e740..a5ca7a31f43d50c3 100644
b6c903
--- a/localedata/Makefile
b6c903
+++ b/localedata/Makefile
b6c903
@@ -179,7 +179,7 @@ install-others := $(addprefix $(inst_i18ndir)/, \
b6c903
 			      $(locales))
b6c903
 endif
b6c903
 
b6c903
-tests: $(objdir)/iconvdata/gconv-modules
b6c903
+tests: $(objdir)/iconvdata/gconv-modules.d/gconv-modules.conf
b6c903
 
b6c903
 tests-static += tst-langinfo-newlocale-static tst-langinfo-setlocale-static
b6c903
 
b6c903
@@ -442,5 +442,5 @@ $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
b6c903
 bug-setlocale1-ENV-only = LOCPATH=$(objpfx) LC_CTYPE=de_DE.UTF-8
b6c903
 bug-setlocale1-static-ENV-only = $(bug-setlocale1-ENV-only)
b6c903
 
b6c903
-$(objdir)/iconvdata/gconv-modules:
b6c903
+$(objdir)/iconvdata/gconv-modules.d/gconv-modules.conf:
b6c903
 	$(MAKE) -C ../iconvdata subdir=iconvdata $@
b6c903
diff --git a/sysdeps/s390/Makefile b/sysdeps/s390/Makefile
b6c903
index 8bc82e523f9049db..5c8e1170b4d799ba 100644
b6c903
--- a/sysdeps/s390/Makefile
b6c903
+++ b/sysdeps/s390/Makefile
b6c903
@@ -21,13 +21,25 @@ lib := iconvdata
b6c903
 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
b6c903
 
b6c903
 extra-objs      += $(addsuffix .so, $(s390x-iconv-modules))
b6c903
-install-others  += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
b6c903
+install-others  += $(patsubst %, $(inst_gconvdir)/%.so, \
b6c903
+				 $(s390x-iconv-modules)) \
b6c903
+		   $(inst_gconvdir)/gconv-modules.d/gconv-modules-s390.conf
b6c903
 
b6c903
 $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules)) : \
b6c903
 $(inst_gconvdir)/%.so: $(objpfx)%.so $(+force)
b6c903
 	$(do-install-program)
b6c903
 
b6c903
-sysdeps-gconv-modules = ../sysdeps/s390/gconv-modules
b6c903
+ifdef objpfx
b6c903
+generated += gconv-modules.d/gconv-modules-s390.conf
b6c903
+endif
b6c903
+
b6c903
+$(inst_gconvdir)/gconv-modules.d/gconv-modules-s390.conf: \
b6c903
+		$(modpfx)gconv-modules-s390.conf $(+force)
b6c903
+	$(do-install)
b6c903
+
b6c903
+$(modpfx)gconv-modules-s390.conf: ../sysdeps/s390/gconv-modules-s390.conf \
b6c903
+				  $(modpfx)
b6c903
+	cp $< $@
b6c903
 endif
b6c903
 
b6c903
 ifeq ($(subdir),string)
b6c903
diff --git a/sysdeps/s390/gconv-modules b/sysdeps/s390/gconv-modules-s390.conf
b6c903
similarity index 100%
b6c903
rename from sysdeps/s390/gconv-modules
b6c903
rename to sysdeps/s390/gconv-modules-s390.conf