diff options
Diffstat (limited to 'intl/icu/source/stubdata')
-rw-r--r-- | intl/icu/source/stubdata/BUILD.bazel | 24 | ||||
-rw-r--r-- | intl/icu/source/stubdata/Makefile.in | 163 | ||||
-rw-r--r-- | intl/icu/source/stubdata/sources.txt | 1 | ||||
-rw-r--r-- | intl/icu/source/stubdata/stubdata.cpp | 52 | ||||
-rw-r--r-- | intl/icu/source/stubdata/stubdata.h | 51 | ||||
-rw-r--r-- | intl/icu/source/stubdata/stubdata.vcxproj | 87 | ||||
-rw-r--r-- | intl/icu/source/stubdata/stubdata.vcxproj.filters | 27 |
7 files changed, 405 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Label="Globals"> + <ProjectGuid>{203EC78A-0531-43F0-A636-285439BDE025}</ProjectGuid> + </PropertyGroup> + <PropertyGroup Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseOfMfc>false</UseOfMfc> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <!-- The following import will include the 'default' configuration options for VS projects. --> + <Import Project="..\allinone\Build.Windows.ProjectConfiguration.props" /> + <!-- The following import will include the library configuration options for VS projects. --> + <Import Project="..\allinone\Build.Windows.Library.ProjectConfiguration.props" /> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <GenerateManifest>false</GenerateManifest> + <OutDir>.\$(Platform)\$(Configuration)\</OutDir> + <IntDir>.\$(Platform)\$(Configuration)\</IntDir> + <!-- The ICU projects use "Win32" to mean "x86", so we need to special case it. --> + <OutDir Condition="'$(Platform)'=='Win32'">.\x86\$(Configuration)\</OutDir> + <IntDir Condition="'$(Platform)'=='Win32'">.\x86\$(Configuration)\</IntDir> + <!-- Disable Incremental Linking for Release builds as it prevents Link-time Code Generation --> + <LinkIncremental Condition="'$(Configuration)'=='Debug'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)'=='Release'">false</LinkIncremental> + </PropertyGroup> + <!-- Options that are common to *all* project configurations --> + <ItemDefinitionGroup> + <Midl> + <TypeLibraryName>$(OutDir)\icudt.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <AdditionalIncludeDirectories>..\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>STUBDATA_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <DisableLanguageExtensions>true</DisableLanguageExtensions> + <WarningLevel>Level3</WarningLevel> + <CompileAs>Default</CompileAs> + <PrecompiledHeaderOutputFile>$(OutDir)/icudt.pch</PrecompiledHeaderOutputFile> + <AssemblerListingLocation>$(OutDir)/</AssemblerListingLocation> + <ObjectFileName>$(OutDir)/</ObjectFileName> + <ProgramDataBaseFileName>$(OutDir)/icudt.pdb</ProgramDataBaseFileName> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>STUBDATA_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ResourceCompile> + <PreLinkEvent> + <Command>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"</Command> + </PreLinkEvent> + <Link> + <NoEntryPoint>true</NoEntryPoint> + <SetChecksum>true</SetChecksum> + <TurnOffAssemblyGeneration>true</TurnOffAssemblyGeneration> + <!-- Note: stubdata is somewhat odd in that it doesn't suffix the Debug output DLL/LIB with a "d" like common/i18n/etc. --> + <OutputFile>..\..\$(IcuBinOutputDir)\icudt$(IcuMajorVersion).dll</OutputFile> + <ProgramDatabaseFile>.\..\..\$(IcuLibOutputDir)\icudt.pdb</ProgramDatabaseFile> + <ImportLibrary>..\..\$(IcuLibOutputDir)\icudt.lib</ImportLibrary> + </Link> + </ItemDefinitionGroup> + <!-- Options that are common to all 'Debug' project configurations --> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> + <ClCompile> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + </ClCompile> + </ItemDefinitionGroup> + <!-- Options that are common to all 'Release' project configurations --> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> + <ClCompile> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="stubdata.cpp" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\data\misc\icudata.rc"> + <AdditionalIncludeDirectories>../common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ResourceCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{0ee0463f-dec0-4224-af0c-52babad261c1}</UniqueIdentifier> + <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{a9df809d-9699-4284-97a0-a7e71522eac3}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{981a212f-ebc5-4f1e-be28-06ce5e90ecca}</UniqueIdentifier> + <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="stubdata.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\data\misc\icudata.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project> |