Skip to contentSkip to conversation

e2fsprogs: Introduce script used to generate utf8data.h

PATCH Applied Gabriel Krisman Bertazi 2 participants 3 messages Dec 3, 2018 – Dec 9, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsprogs: Introduce script used to generate utf8data.h

The mkutf8data program was written by SGI for the kernel. We integrate it here, but it should be kept in sync with the kernel code, when applicable. The header generated by this script is also included in this repository, such that we don't have to carry the UCD files too. They are only necessary when the header has to be recreated (for instance, to update the Unicode version supported)

The mkutf8data is not a dependency of utf8data.h because we don't want the utf8data.h rule to be called after a make clean that would remove mkutf8data. It is simpler to call it from inside the rule, and make sure we only trigger the utf8data.h rule if we really need to, particularly if we decide not to integrate the ucd files in the tree.

The UCD files are not distributed along with this commit, but we add information on how to fetch them.

---
 MCONFIG.in             |    8 +
 lib/ext2fs/Makefile.in |   14 +-
 util/Makefile.in       |   10 +-
 util/mkutf8data.c      | 3392 ++++++++++++++++++++++++++++++++++++++++
 util/ucd/README        |   37 +
 5 files changed, 3457 insertions(+), 4 deletions(-)
 create mode 100644 util/mkutf8data.c
 create mode 100644 util/ucd/README
MCONFIG.in +8 -0
index 7ca86ac6b269..d24f7ef2cb7c 100644
@@ -182,6 +182,14 @@ DEP_SUBSTITUTE= $(top_builddir)/util/subst $(SUBST_CONF)
 $(top_builddir)/util/subst:
 	cd $(top_builddir)/util ; $(MAKE) subst
 
+#
+# Script for generating utf8data.h
+#
+MKUTF8DATA=$(top_builddir)/util/mkutf8data
+
+$(top_builddir)/util/mkutf8data:
+	 $(MAKE) -C $(top_builddir)/util mkutf8data
+
 #
 # Script for installing symlinks (for shared libraries)
 #
lib/ext2fs/Makefile.in +13 -1
index 5e8907630a05..1510fc72ccec 100644
@@ -620,6 +620,18 @@ $(top_builddir)/$(my_dir)/ext2_types.h: $(srcdir)/ext2_types.h.in \
 		$(top_builddir)/config.status
 	cd $(top_builddir); CONFIG_FILES=$(my_dir)/ext2_types.h ./config.status
 
+$(srcdir)/utf8data.h:
+	$(Q) $(MAKE) $(MKUTF8DATA)
+	$(E) "MKUTF8DATA $@"
+	$(Q) $(MKUTF8DATA) -a $(top_srcdir)/util/ucd/DerivedAge-11.0.0.txt \
+		-c $(top_srcdir)/util/ucd/DerivedCombiningClass-11.0.0.txt \
+		-p $(top_srcdir)/util/ucd/DerivedCoreProperties-11.0.0.txt \
+		-d $(top_srcdir)/util/ucd/UnicodeData-11.0.0.txt \
+		-f $(top_srcdir)/util/ucd/CaseFolding-11.0.0.txt \
+		-n $(top_srcdir)/util/ucd/NormalizationCorrections-11.0.0.txt \
+		-t $(top_srcdir)/util/ucd/NormalizationTest-11.0.0.txt \
+		-o $@
+
 # +++ Dependency line eater +++
 # 
 # Makefile dependencies follow.  This must be the last section in
@@ -1419,4 +1431,4 @@ do_journal.o: $(top_srcdir)/debugfs/do_journal.c $(top_builddir)/lib/config.h \
  $(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h \
  $(top_srcdir)/debugfs/journal.h $(srcdir)/../../e2fsck/jfs_user.h
 $(NLS_OBJS): $(srcdir)/nls.h
-nls_ascii-norm.o: $(srcdir)/utf8n.h $(srcdir)/utf8data.h $(srcdir)/nls.h
+nls_utf8-norm.o: $(srcdir)/utf8n.h $(srcdir)/utf8data.h $(srcdir)/nls.h
util/Makefile.in +7 -3
index 96117d9e0019..f3fb3c6b7cf4 100644
@@ -9,7 +9,7 @@ top_builddir = ..
 my_dir = util
 INSTALL = @INSTALL@
 
-SRCS = $(srcdir)/subst.c
+SRCS = $(srcdir)/subst.c $(srcdir)/mkutf8data.c
 
 @MCONFIG@
 
@@ -19,7 +19,7 @@ SRCS = $(srcdir)/subst.c
 	$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
 	$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
 
-PROGS=		subst symlinks
+PROGS=		subst symlinks mkutf8data
 
 all:: $(PROGS) gen-tarball
 
@@ -33,6 +33,10 @@ subst: subst.o
 	$(E) "	LD $@"
 	$(Q) $(BUILD_CC) $(BUILD_LDFLAGS) -o subst subst.o
 
+mkutf8data: mkutf8data.o
+	$(E) "	LD $@"
+	$(Q) $(BUILD_CC) $(BUILD_LDFLAGS) -o mkutf8data mkutf8data.o
+
 copy_sparse: copy_sparse.o
 	$(E) "	LD $@"
 	$(Q) $(BUILD_CC) $(BUILD_LDFLAGS) -o copy_sparse copy_sparse.o
@@ -53,7 +57,7 @@ tarballs: gen-tarball
 
 clean::
 	$(RM) -f $(PROGS) \#* *.s *.o *.a *~ core *.tar.gz gen-tarball \
-		copy-sparse dirpaths.h install-symlink
+		copy-sparse dirpaths.h install-symlink mkutf8data
 
 mostlyclean: clean
 
util/mkutf8data.c new file +3392 -0

2,929 lines not on this page · raw message

util/ucd/README new file +37 -0
new file mode 100644
index 000000000000..9fed514084b7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.0.rc2

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 13 lines · Gabriel Krisman Bertazi

The mkutf8data program was written by SGI for the kernel. We integrate it here, but it should be kept in sync with the kernel code, when applicable. The header generated by this script is also included in this repository, such that we don't have to carry the UCD files too. They are only necessary when the header has to be recreated (for instance, to update the Unicode version supported)

The mkutf8data is not a dependency of utf8data.h because we don't want the utf8data.h rule to be called after a make clean that would remove mkutf8data. It is simpler to call it from inside the rule, and make sure we only trigger the utf8data.h rule if we really need to, particularly if we decide not to integrate the ucd files in the tree.

Quoted 4 lines

The UCD files are not distributed along with this commit, but we add information on how to fetch them.

Thanks, applied, with one minor fixup:

Quoted 5 lines
util/ucd/README new file +0 -0
new file mode 100644
index 000000000000..9fed514084b7

...

util/ucd/README line 33

Quoted 6 lines
util/ucd/README new file +6 -0
+md5sums
+
+  414436796cf097df55f798e1585448ee  CaseFolding-11.0.0.txt
+  6032a595fbb782694456491d86eecfac  DerivedAge-11.0.0.txt
+  3240997d671297ac754ab0d27577acf7  DerivedCombiningClass-11.0.0.txt
+  d41d8cd98f00b204e9800998ecf8427e  DerivedCombiningClass.txt
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^

This looks like a leftover, so I removed it.

- Ted

#2 lore raw
Quoted 35 lines · Theodore Y. Ts'o
Quoted 13 lines · Gabriel Krisman Bertazi

The mkutf8data program was written by SGI for the kernel. We integrate it here, but it should be kept in sync with the kernel code, when applicable. The header generated by this script is also included in this repository, such that we don't have to carry the UCD files too. They are only necessary when the header has to be recreated (for instance, to update the Unicode version supported)

The mkutf8data is not a dependency of utf8data.h because we don't want the utf8data.h rule to be called after a make clean that would remove mkutf8data. It is simpler to call it from inside the rule, and make sure we only trigger the utf8data.h rule if we really need to, particularly if we decide not to integrate the ucd files in the tree.

Quoted 4 lines

The UCD files are not distributed along with this commit, but we add information on how to fetch them.

Thanks, applied, with one minor fixup:

Quoted 5 lines
util/ucd/README new file +0 -0
new file mode 100644
index 000000000000..9fed514084b7

...

util/ucd/README line 33

Quoted 6 lines
util/ucd/README new file +6 -0
+md5sums
+
+  414436796cf097df55f798e1585448ee  CaseFolding-11.0.0.txt
+  6032a595fbb782694456491d86eecfac  DerivedAge-11.0.0.txt
+  3240997d671297ac754ab0d27577acf7  DerivedCombiningClass-11.0.0.txt
+  d41d8cd98f00b204e9800998ecf8427e  DerivedCombiningClass.txt
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 1 line

This looks like a leftover, so I removed it.

Indeed.

Thanks for applying.

Signature · 1 line
Gabriel Krisman Bertazi