From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- intl/icu/source/stubdata/BUILD.bazel | 24 ++++ intl/icu/source/stubdata/Makefile.in | 163 ++++++++++++++++++++++ intl/icu/source/stubdata/sources.txt | 1 + intl/icu/source/stubdata/stubdata.cpp | 52 +++++++ intl/icu/source/stubdata/stubdata.h | 51 +++++++ intl/icu/source/stubdata/stubdata.vcxproj | 87 ++++++++++++ intl/icu/source/stubdata/stubdata.vcxproj.filters | 27 ++++ 7 files changed, 405 insertions(+) create mode 100644 intl/icu/source/stubdata/BUILD.bazel create mode 100644 intl/icu/source/stubdata/Makefile.in create mode 100644 intl/icu/source/stubdata/sources.txt create mode 100644 intl/icu/source/stubdata/stubdata.cpp create mode 100644 intl/icu/source/stubdata/stubdata.h create mode 100644 intl/icu/source/stubdata/stubdata.vcxproj create mode 100644 intl/icu/source/stubdata/stubdata.vcxproj.filters (limited to 'intl/icu/source/stubdata') diff --git a/intl/icu/source/stubdata/BUILD.bazel b/intl/icu/source/stubdata/BUILD.bazel new file mode 100644 index 0000000000..20344ef499 --- /dev/null +++ b/intl/icu/source/stubdata/BUILD.bazel @@ -0,0 +1,24 @@ +# © 2021 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +# This file defines Bazel targets for the ICU4C "stubdata" library header and source files. + +load("@rules_cc//cc:defs.bzl", "cc_library") + +package( + default_visibility = ["//visibility:public"], +) + +# When compiling code in the `common` dir, the constant +# `U_COMMON_IMPLEMENTATION` needs to be defined. See +# https://unicode-org.github.io/icu/userguide/howtouseicu#c-with-your-own-build-system . + +cc_library( + name = "stubdata", + srcs = ["stubdata.cpp"], + hdrs = ["stubdata.h"], + deps = ["//icu4c/source/common:headers"], + local_defines = [ + "U_COMMON_IMPLEMENTATION", + ], +) diff --git a/intl/icu/source/stubdata/Makefile.in b/intl/icu/source/stubdata/Makefile.in new file mode 100644 index 0000000000..cf20510304 --- /dev/null +++ b/intl/icu/source/stubdata/Makefile.in @@ -0,0 +1,163 @@ +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html +#****************************************************************************** +# +# Copyright (C) 1999-2015, International Business Machines +# Corporation and others. All Rights Reserved. +# +#****************************************************************************** +## Makefile.in for ICU stubdata +## Stephen F. Booth + +## Source directory information +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ + +top_builddir = .. + +## All the flags and other definitions are included here. +include $(top_builddir)/icudefs.mk + +## Build directory information +subdir = stubdata + +## Extra files to remove for 'make clean' +CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB) + +## Target information + +TARGET_STUBNAME=$(DATA_STUBNAME) + +ifneq ($(ENABLE_STATIC),) +TARGET = $(STUBDATA_LIBDIR)$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A) +endif + + +ifneq ($(ENABLE_SHARED),) +SO_TARGET = $(STUBDATA_LIBDIR)$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(STUB_SUFFIX).$(SO) +ALL_SO_TARGETS = $(FINAL_SO_TARGET) $(MIDDLE_SO_TARGET) $(SO_TARGET) $(BATCH_STUB_TARGET) $(SHARED_OBJECT) +endif + + +ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) + +DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS) +DYNAMICCFLAGS = $(SHAREDLIBCFLAGS) +DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS) + +CPPFLAGS += -I$(top_srcdir)/common $(LIBCPPFLAGS) +LDFLAGS += $(LDFLAGSICUDT) + +SOURCES = $(shell cat $(srcdir)/sources.txt) +OBJECTS = $(SOURCES:.cpp=.o) + +## Header files to install +HEADERS = + +STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O)) + +DEPS = $(OBJECTS:.o=.d) + +-include Makefile.local + +## List of phony targets +.PHONY : all all-local install install-local clean clean-local \ +distclean distclean-local install-library dist \ +dist-local check check-local check-exhaustive + +## 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 + +check-exhaustive: check + +all-local: $(ALL_TARGETS) + +install-local: install-library + +install-library: all-local + $(MKINSTALLDIRS) $(DESTDIR)$(libdir) +ifneq ($(ENABLE_STATIC),) + $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir) +endif +ifneq ($(ENABLE_SHARED),) +# For MinGW, do we want the DLL to go in the bin location? +ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) + $(MKINSTALLDIRS) $(DESTDIR)$(bindir) + $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(bindir) +else + $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir) +ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET)) +ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET)) + cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET)) +endif +endif +endif +ifneq ($(IMPORT_LIB_EXT),) + $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir) +ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB)) + cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB)) +endif +ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB)) + cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB)) +endif +endif +endif + +dist-local: + +clean-local: + test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) + $(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) + +distclean-local: clean-local + $(RMV) Makefile + +check-local: + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +ifneq ($(ENABLE_STATIC),) +$(TARGET): $(STATIC_OBJECTS) + $(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^ + $(RANLIB) $@ +endif + +ifneq ($(ENABLE_SHARED),) +$(SHARED_OBJECT): $(OBJECTS) +ifeq ($(BUILD_HOST_ICU),AIX_GCC) + $(SHLIB.c) $(LD_SONAME) $(OUTOPT)libicudata.so $^ $(LIBS) + mv libicudata.so $@ +else + $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS) +endif +ifeq ($(ENABLE_RPATH),YES) +ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),) + $(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET)) +endif +endif + +ifeq ($(OS390BATCH),1) +$(BATCH_STUB_TARGET): $(OBJECTS) + $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS) +endif # OS390BATCH +endif # ENABLE_SHARED + +ifeq (,$(MAKECMDGOALS)) +-include $(DEPS) +else +ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),) +-include $(DEPS) +endif +endif + diff --git a/intl/icu/source/stubdata/sources.txt b/intl/icu/source/stubdata/sources.txt new file mode 100644 index 0000000000..1bbb2677ef --- /dev/null +++ b/intl/icu/source/stubdata/sources.txt @@ -0,0 +1 @@ +stubdata.cpp diff --git a/intl/icu/source/stubdata/stubdata.cpp b/intl/icu/source/stubdata/stubdata.cpp new file mode 100644 index 0000000000..0fa2b170eb --- /dev/null +++ b/intl/icu/source/stubdata/stubdata.cpp @@ -0,0 +1,52 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/****************************************************************************** +* +* Copyright (C) 2001, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: stubdata.cpp +* +* Define initialized data that will build into a valid, but empty +* ICU data library. Used to bootstrap the ICU build, which has these +* dependencies: +* ICU Common library depends on ICU data +* ICU data requires data building tools. +* ICU data building tools require the ICU common library. +* +* The stub data library (for which this file is the source) is sufficient +* for running the data building tools. +*/ + +#include "stubdata.h" + +extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT alignas(16) = { + 32, /* headerSize */ + 0xda, /* magic1, (see struct MappedData in udata.c) */ + 0x27, /* magic2 */ + { /*UDataInfo */ + sizeof(UDataInfo), /* size */ + 0, /* reserved */ + +#if U_IS_BIG_ENDIAN + 1, +#else + 0, +#endif + + U_CHARSET_FAMILY, + sizeof(char16_t), + 0, /* reserved */ + {0x54, 0x6f, 0x43, 0x50}, /* data format identifier: "ToCP" */ + {1, 0, 0, 0}, /* format version major, minor, milli, micro */ + {0, 0, 0, 0} /* dataVersion */ + }, + { 's', 't', 'u', 'b', 'd', 'a', 't', 'a' }, /* Padding[8] */ + 0, /* count */ + 0, /* Reserved */ + { /* TOC structure */ + 0 , 0 /* name and data entries. Count says there are none, */ + /* but put one in just in case. */ + } +}; diff --git a/intl/icu/source/stubdata/stubdata.h b/intl/icu/source/stubdata/stubdata.h new file mode 100644 index 0000000000..429a647102 --- /dev/null +++ b/intl/icu/source/stubdata/stubdata.h @@ -0,0 +1,51 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/****************************************************************************** +* +* Copyright (C) 2001, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: stubdata.h +* +* This header file is intended to be internal and only included in the +* accompanying implementation file. This file declares a single entry +* point for visibility of tools like TAPI. +* +* Define initialized data that will build into a valid, but empty +* ICU data library. Used to bootstrap the ICU build, which has these +* dependencies: +* ICU Common library depends on ICU data +* ICU data requires data building tools. +* ICU data building tools require the ICU common library. +* +* The stub data library (for which this file is the source) is sufficient +* for running the data building tools. +*/ + +#ifndef __STUBDATA_H__ +#define __STUBDATA_H__ + +#include "unicode/utypes.h" +#include "unicode/udata.h" +#include "unicode/uversion.h" + +typedef struct alignas(16) { + uint16_t headerSize; + uint8_t magic1, magic2; + UDataInfo info; + char padding[8]; + uint32_t count, reserved; + /* + const struct { + const char *const name; + const void *const data; + } toc[1]; + */ + uint64_t fakeNameAndData[2]; /* TODO: Change this header type from */ + /* pointerTOC to OffsetTOC. */ +} ICU_Data_Header; + +extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT; + +#endif /* __STUBDATA_H__ */ diff --git a/intl/icu/source/stubdata/stubdata.vcxproj b/intl/icu/source/stubdata/stubdata.vcxproj new file mode 100644 index 0000000000..d5108b4941 --- /dev/null +++ b/intl/icu/source/stubdata/stubdata.vcxproj @@ -0,0 +1,87 @@ + + + + {203EC78A-0531-43F0-A636-285439BDE025} + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + false + .\$(Platform)\$(Configuration)\ + .\$(Platform)\$(Configuration)\ + + .\x86\$(Configuration)\ + .\x86\$(Configuration)\ + + true + false + + + + + $(OutDir)\icudt.tlb + + + ..\common;%(AdditionalIncludeDirectories) + STUBDATA_BUILD;%(PreprocessorDefinitions) + true + Level3 + Default + $(OutDir)/icudt.pch + $(OutDir)/ + $(OutDir)/ + $(OutDir)/icudt.pdb + + + STUBDATA_BUILD;%(PreprocessorDefinitions) + + + echo "File with stubdata build time, used as a dependency to trigger fresh data build, since stubdata dll will overwrite the real one." > "$(ProjectDir)stubdatabuilt.txt" + + + true + true + true + + ..\..\$(IcuBinOutputDir)\icudt$(IcuMajorVersion).dll + .\..\..\$(IcuLibOutputDir)\icudt.pdb + ..\..\$(IcuLibOutputDir)\icudt.lib + + + + + + MultiThreadedDebugDLL + + + + + + MultiThreadedDLL + + + + + + + + ../common;%(AdditionalIncludeDirectories) + + + + + + diff --git a/intl/icu/source/stubdata/stubdata.vcxproj.filters b/intl/icu/source/stubdata/stubdata.vcxproj.filters new file mode 100644 index 0000000000..da86a1b2f0 --- /dev/null +++ b/intl/icu/source/stubdata/stubdata.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {0ee0463f-dec0-4224-af0c-52babad261c1} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a9df809d-9699-4284-97a0-a7e71522eac3} + h;hpp;hxx;hm;inl + + + {981a212f-ebc5-4f1e-be28-06ce5e90ecca} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Resource Files + + + -- cgit v1.2.3