From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- intl/icu/source/tools/gencmn/Makefile.in | 96 +++++++++++++++ intl/icu/source/tools/gencmn/gencmn.8.in | 131 +++++++++++++++++++++ intl/icu/source/tools/gencmn/gencmn.c | 126 ++++++++++++++++++++ intl/icu/source/tools/gencmn/gencmn.vcxproj | 80 +++++++++++++ .../icu/source/tools/gencmn/gencmn.vcxproj.filters | 22 ++++ intl/icu/source/tools/gencmn/sources.txt | 1 + 6 files changed, 456 insertions(+) create mode 100644 intl/icu/source/tools/gencmn/Makefile.in create mode 100644 intl/icu/source/tools/gencmn/gencmn.8.in create mode 100644 intl/icu/source/tools/gencmn/gencmn.c create mode 100644 intl/icu/source/tools/gencmn/gencmn.vcxproj create mode 100644 intl/icu/source/tools/gencmn/gencmn.vcxproj.filters create mode 100644 intl/icu/source/tools/gencmn/sources.txt (limited to 'intl/icu/source/tools/gencmn') diff --git a/intl/icu/source/tools/gencmn/Makefile.in b/intl/icu/source/tools/gencmn/Makefile.in new file mode 100644 index 0000000000..bb7fc4e7b4 --- /dev/null +++ b/intl/icu/source/tools/gencmn/Makefile.in @@ -0,0 +1,96 @@ +## Makefile.in for ICU - tools/gencmn +## Copyright (C) 2016 and later: Unicode, Inc. and others. +## License & terms of use: http://www.unicode.org/copyright.html +## Copyright (c) 1999-2011, International Business Machines Corporation and +## others. All Rights Reserved. +## Steven R. Loomis + +## Source directory information +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ + +top_builddir = ../.. + +include $(top_builddir)/icudefs.mk + +## Build directory information +subdir = tools/gencmn + +TARGET_STUB_NAME = gencmn + +SECTION = 8 + +MAN_FILES = $(TARGET_STUB_NAME).$(SECTION) + + +## Extra files to remove for 'make clean' +CLEANFILES = *~ $(DEPS) $(MAN_FILES) + +## Target information +TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT) + +CPPFLAGS += -I$(top_srcdir)/common -I$(srcdir)/../toolutil +LIBS = $(LIBICUTOOLUTIL) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M) + +SOURCES = $(shell cat $(srcdir)/sources.txt) +OBJECTS = $(SOURCES:.c=.o) + +DEPS = $(OBJECTS:.o=.d) + +## List of phony targets +.PHONY : all all-local install install-local clean clean-local \ +distclean distclean-local dist dist-local check check-local install-man + +## Clear suffix list +.SUFFIXES : + +## List of standard targets +all: all-local +install: install-local +clean: clean-local +distclean : distclean-local +dist: dist-local +check: all check-local + +all-local: $(TARGET) $(MAN_FILES) + +install-local: all-local install-man + $(MKINSTALLDIRS) $(DESTDIR)$(sbindir) + $(INSTALL) $(TARGET) $(DESTDIR)$(sbindir) + +install-man: $(MAN_FILES) + $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION) + $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION) + +dist-local: + +clean-local: + test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) + $(RMV) $(TARGET) $(OBJECTS) + +distclean-local: clean-local + $(RMV) Makefile + +check-local: all-local + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(TARGET) : $(OBJECTS) + $(LINK.cc) $(OUTOPT)$@ $^ $(LIBS) + $(POST_BUILD_STEP) + +%.$(SECTION): $(srcdir)/%.$(SECTION).in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +ifeq (,$(MAKECMDGOALS)) +-include $(DEPS) +else +ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),) +-include $(DEPS) +endif +endif + diff --git a/intl/icu/source/tools/gencmn/gencmn.8.in b/intl/icu/source/tools/gencmn/gencmn.8.in new file mode 100644 index 0000000000..c48fbeeab6 --- /dev/null +++ b/intl/icu/source/tools/gencmn/gencmn.8.in @@ -0,0 +1,131 @@ +.\" Hey, Emacs! This is -*-nroff-*- you know... +.\" +.\" gencmn.8: manual page for the gencmn utility +.\" +.\" Copyright (C) 2016 and later: Unicode, Inc. and others. +.\" License & terms of use: http://www.unicode.org/copyright.html +.\" Copyright (C) 2000-2001 IBM, Inc. and others. +.\" +.\" Manual page by Yves Arrouye . +.\" +.TH GENCMN 8 "5 November 2001" "ICU MANPAGE" "ICU @VERSION@ Manual" +.SH NAME +.B gencmn +\- generate an ICU memory-mappable data file +.SH SYNOPSIS +.B gencmn +[ +.BR "\-h\fP, \fB\-?\fP, \fB\-\-help" +] +[ +.BR "\-v\fP, \fB\-\-verbose" +] +[ +.BR "\-c\fP, \fB\-\-copyright" +| +.BI "\-C\fP, \fB\-\-comment" " comment" +] +[ +.BI "\-d\fP, \fB\-\-destdir" " destination" +] +[ +.BI "\-n\fP, \fB\-\-name" " name" +] +[ +.BI "\-t\fP, \fB\-\-type" " fileext" +] +[ +.BI "\-S\fP, \fB\-\-source" +] +[ +.BI "\-e\fP, \fB\-\-entrypoint" " name" +] +.I maxsize +[ +.I listfilename +] +.SH DESCRIPTION +.B gencmn +takes a set of files and packages them as an ICU memory-mappable data +file. The resulting data file can then be used directly by ICU. +.PP +.B gencmn +reads a list of files to be packaged from either the +supplied +.I listfilename +file, or from its standard output. It packages all the files from +the list that are not bigger than +.I maxsize +bytes, except if +.I maxsize +is 0, which indicates that there is no size limit on files. +.SH OPTIONS +.TP +.BR "\-h\fP, \fB\-?\fP, \fB\-\-help" +Print help about usage and exit. +.TP +.BR "\-v\fP, \fB\-\-verbose" +Display extra informative messages during execution. +.TP +.BR \-c\fP, \fB\-\-copyright +Include the ICU copyright notice in the resulting data. +.TP +.BI "\-C\fP, \fB\-\-comment" " comment" +Include the specified +.I comment +in the resulting data instead of the ICU copyright notice. +.TP +.BI "\-d\fP, \fB\-\-destdir" " destination" +Set the destination directory to +.IR destination . +The default destination directory is specified by the environment variable +.BR ICU_DATA . +.TP +.BI "\-n\fP, \fB\-\-name" " name" +Set the data name to +.I name +instead of the default. This name is also used as the base name of the +output. The default name is made of the +.I icudt +prefix, followed by a two-digit version number corresponding to +the current version of the ICU release, and a single letter indicating +the endianness of the data (the letter +.I b +indicated big endian data, and the letter +.I l +indicates little endian ones). +.TP +.BI "\-t\fP, \fB\-\-type" " type" +Use +.I type +as the type of the data. This type is also used as the extension of +the generated data file. The default type ie +.IR dat . +.TP +.BI "\-S\fP, \fB\-\-source" +Write a C source file with the table of contents of the data. +.TP +.BI "\-e\fP, \fB\-\-entrypoint" " name" +Set the data entry point (used for linking against the data in a +shared library form) to +.IR name . +The default entry point name is made of the data (set by the +.BI "\-n\fP, \fB\-\-name" +option) followed by an underscore and the type of the data (set by the +.BI "\-t\fP, \fB\-\-type" +option). +.SH ENVIRONMENT +.TP 10 +.B ICU_DATA +Specifies the directory containing ICU data. Defaults to +.BR @thepkgicudatadir@/@PACKAGE@/@VERSION@/ . +Some tools in ICU depend on the presence of the trailing slash. It is thus +important to make sure that it is present if +.B ICU_DATA +is set. +.SH VERSION +@VERSION@ +.SH COPYRIGHT +Copyright (C) 2000-2001 IBM, Inc. and others. +.SH SEE ALSO +.BR decmn (8) diff --git a/intl/icu/source/tools/gencmn/gencmn.c b/intl/icu/source/tools/gencmn/gencmn.c new file mode 100644 index 0000000000..77f0c20c61 --- /dev/null +++ b/intl/icu/source/tools/gencmn/gencmn.c @@ -0,0 +1,126 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* +* Copyright (C) 1999-2016, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: gencmn.c +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 1999nov01 +* created by: Markus W. Scherer +* +* This program reads a list of data files and combines them +* into one common, memory-mappable file. +*/ + +#include +#include +#include "unicode/utypes.h" +#include "unicode/putil.h" +#include "cmemory.h" +#include "cstring.h" +#include "filestrm.h" +#include "toolutil.h" +#include "unicode/uclean.h" +#include "unewdata.h" +#include "uoptions.h" +#include "putilimp.h" +#include "pkg_gencmn.h" + +static UOption options[]={ +/*0*/ UOPTION_HELP_H, +/*1*/ UOPTION_HELP_QUESTION_MARK, +/*2*/ UOPTION_VERBOSE, +/*3*/ UOPTION_COPYRIGHT, +/*4*/ UOPTION_DESTDIR, +/*5*/ UOPTION_DEF( "comment", 'C', UOPT_REQUIRES_ARG), +/*6*/ UOPTION_DEF( "name", 'n', UOPT_REQUIRES_ARG), +/*7*/ UOPTION_DEF( "type", 't', UOPT_REQUIRES_ARG), +/*8*/ UOPTION_DEF( "source", 'S', UOPT_NO_ARG), +/*9*/ UOPTION_DEF( "entrypoint", 'e', UOPT_REQUIRES_ARG), +/*10*/UOPTION_SOURCEDIR, +}; + +extern int +main(int argc, char* argv[]) { + UBool sourceTOC, verbose; + uint32_t maxSize; + + U_MAIN_INIT_ARGS(argc, argv); + + /* preset then read command line options */ + argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options); + + /* error handling, printing usage message */ + if(argc<0) { + fprintf(stderr, + "error in command line argument \"%s\"\n", + argv[-argc]); + } else if(argc<2) { + argc=-1; + } + + if(argc<0 || options[0].doesOccur || options[1].doesOccur) { + FILE *where = argc < 0 ? stderr : stdout; + + /* + * Broken into chucks because the C89 standard says the minimum + * required supported string length is 509 bytes. + */ + fprintf(where, + "%csage: %s [ -h, -?, --help ] [ -v, --verbose ] [ -c, --copyright ] [ -C, --comment comment ] [ -d, --destdir dir ] [ -n, --name filename ] [ -t, --type filetype ] [ -S, --source tocfile ] [ -e, --entrypoint name ] maxsize listfile\n", argc < 0 ? 'u' : 'U', *argv); + if (options[0].doesOccur || options[1].doesOccur) { + fprintf(where, "\n" + "Read the list file (default: standard input) and create a common data\n" + "file from specified files. Omit any files larger than maxsize, if maxsize > 0.\n"); + fprintf(where, "\n" + "Options:\n" + "\t-h, -?, --help this usage text\n" + "\t-v, --verbose verbose output\n" + "\t-c, --copyright include the ICU copyright notice\n" + "\t-C, --comment comment include a comment string\n" + "\t-d, --destdir dir destination directory\n"); + fprintf(where, + "\t-n, --name filename output filename, without .type extension\n" + "\t (default: " U_ICUDATA_NAME ")\n" + "\t-t, --type filetype type of the destination file\n" + "\t (default: \" dat \")\n" + "\t-S, --source tocfile write a .c source file with the table of\n" + "\t contents\n" + "\t-e, --entrypoint name override the c entrypoint name\n" + "\t (default: \"_\")\n"); + } + return argc<0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR; + } + + sourceTOC=options[8].doesOccur; + + verbose = options[2].doesOccur; + + maxSize=(uint32_t)uprv_strtoul(argv[1], NULL, 0); + + createCommonDataFile(options[4].doesOccur ? options[4].value : NULL, + options[6].doesOccur ? options[6].value : NULL, + options[9].doesOccur ? options[9].value : options[6].doesOccur ? options[6].value : NULL, + options[7].doesOccur ? options[7].value : NULL, + options[10].doesOccur ? options[10].value : NULL, + options[3].doesOccur ? U_COPYRIGHT_STRING : options[5].doesOccur ? options[5].value : NULL, + argc == 2 ? NULL : argv[2], + maxSize, sourceTOC, verbose, NULL); + + return 0; +} +/* + * Hey, Emacs, please set the following: + * + * Local Variables: + * indent-tabs-mode: nil + * End: + * + */ diff --git a/intl/icu/source/tools/gencmn/gencmn.vcxproj b/intl/icu/source/tools/gencmn/gencmn.vcxproj new file mode 100644 index 0000000000..94c18b6ac5 --- /dev/null +++ b/intl/icu/source/tools/gencmn/gencmn.vcxproj @@ -0,0 +1,80 @@ + + + + {A8D36F8D-09E6-4174-91C3-7BEAA9C3F04F} + + + Application + false + MultiByte + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false + + + + + $(OutDir)/gencmn.tlb + + + Level3 + Default + true + ..\..\common;..\toolutil;%(AdditionalIncludeDirectories) + $(OutDir)/gencmn.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/gencmn.pdb + + + Console + $(OutDir)/gencmn.exe + ..\..\..\$(IcuLibOutputDir);%(AdditionalLibraryDirectories) + + + copy "$(TargetPath)" ..\..\..\$(IcuBinOutputDir) + ..\..\..\$(IcuBinOutputDir)\$(TargetFileName);%(Outputs) + + + + + + true + MultiThreadedDebugDLL + + + icuucd.lib;icutud.lib;%(AdditionalDependencies) + + + + + + MultiThreadedDLL + true + + + icuuc.lib;icutu.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/intl/icu/source/tools/gencmn/gencmn.vcxproj.filters b/intl/icu/source/tools/gencmn/gencmn.vcxproj.filters new file mode 100644 index 0000000000..d69b206638 --- /dev/null +++ b/intl/icu/source/tools/gencmn/gencmn.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {5be5a226-8538-4456-89d2-b20fb1906561} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {56407937-8dde-450c-b05f-115430ced4a1} + h;hpp;hxx;hm;inl + + + {7de2655e-2d51-47cf-8e41-c3fe55c0f921} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + \ No newline at end of file diff --git a/intl/icu/source/tools/gencmn/sources.txt b/intl/icu/source/tools/gencmn/sources.txt new file mode 100644 index 0000000000..6ffa7777aa --- /dev/null +++ b/intl/icu/source/tools/gencmn/sources.txt @@ -0,0 +1 @@ +gencmn.c -- cgit v1.2.3