From 4ed08f2d993ac735efea1ce254ea3d37d0ee8520 Mon Sep 17 00:00:00 2001 From: Amber Date: Thu, 9 Apr 2026 06:48:28 +0000 Subject: [PATCH] update expat step2 Signed-off-by: Amber --- BUILD.gn | 82 ++++++++++++++++ bundle.json | 42 ++++++++ include/expat_config/expat_config.h | 142 ++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+) create mode 100644 BUILD.gn create mode 100644 bundle.json create mode 100644 include/expat_config/expat_config.h diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..87dadaf --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. + +import("//build/config/config.gni") +import("//build/ohos.gni") + +config("expat_config") { + cflags = [ + "-Wno-incompatible-pointer-types", + "-Werror", + "-Wno-strict-prototypes", + "-Wimplicit-function-declaration", + ] + defines = [ "XML_STATIC" ] +} + +config("expat_public_config") { + include_dirs = [ + "expat/lib", + "include/expat_config", + ] +} + +ohos_shared_library("expat") { + _src = "expat" + + public = [ "$_src/lib/expat.h" ] + + sources = [ + "$_src/lib/ascii.h", + "$_src/lib/asciitab.h", + "$_src/lib/expat_external.h", + "$_src/lib/iasciitab.h", + "$_src/lib/internal.h", + "$_src/lib/latin1tab.h", + "$_src/lib/nametab.h", + "$_src/lib/siphash.h", + "$_src/lib/utf8tab.h", + "$_src/lib/winconfig.h", + "$_src/lib/xmlparse.c", + "$_src/lib/xmlrole.c", + "$_src/lib/xmlrole.h", + "$_src/lib/xmltok.c", + "$_src/lib/xmltok.h", + "$_src/lib/xmltok_impl.h", + ] + + configs = [ ":expat_config" ] + public_configs = [ ":expat_public_config" ] + + part_name = "expat" + subsystem_name = "thirdparty" +} + +ohos_static_library("expat_static") { + _src = "expat" + + public = [ "$_src/lib/expat.h" ] + + sources = [ + "$_src/lib/ascii.h", + "$_src/lib/asciitab.h", + "$_src/lib/expat_external.h", + "$_src/lib/iasciitab.h", + "$_src/lib/internal.h", + "$_src/lib/latin1tab.h", + "$_src/lib/nametab.h", + "$_src/lib/siphash.h", + "$_src/lib/utf8tab.h", + "$_src/lib/winconfig.h", + "$_src/lib/xmlparse.c", + "$_src/lib/xmlrole.c", + "$_src/lib/xmlrole.h", + "$_src/lib/xmltok.c", + "$_src/lib/xmltok.h", + "$_src/lib/xmltok_impl.h", + ] + + configs = [ ":expat_config" ] + public_configs = [ ":expat_public_config" ] + part_name = "expat" + subsystem_name = "thirdparty" +} \ No newline at end of file diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..136d9d9 --- /dev/null +++ b/bundle.json @@ -0,0 +1,42 @@ +{ + "name": "@ohos/expat", + "description": "Expat is an XML parser library", + "version": "7.0", + "license": "MIT", + "publishAs": "code-segment", + "segment": { + "destPath": "third_party/expat" + }, + "dirs": {}, + "scripts": {}, + "readmePath": { + "en": "README" + }, + "component": { + "name": "expat", + "subsystem": "thirdparty", + "syscap": [], + "features": [], + "adapted_system_type": ["standard"], + "rom": "", + "ram": "", + "deps": { + "components": [], + "third_party": [] + }, + "build": { + "sub_component": [ + "//third_party/expat:expat" + ], + "inner_kits": [ + { + "name": "//third_party/expat:expat" + }, + { + "name": "//third_party/expat:expat_static" + } + ], + "test": [] + } + } +} \ No newline at end of file diff --git a/include/expat_config/expat_config.h b/include/expat_config/expat_config.h new file mode 100644 index 0000000..6312899 --- /dev/null +++ b/include/expat_config/expat_config.h @@ -0,0 +1,142 @@ +/* expat_config.h. Generated from expat_config.h.in by configure. */ +/* expat_config.h.in. Generated from configure.ac by autoheader. */ + +#ifndef EXPAT_CONFIG_H +#define EXPAT_CONFIG_H 1 + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* 1234 = LILENDIAN, 4321 = BIGENDIAN */ +#define BYTEORDER 1234 +/* Define to 1 if you have the `arc4random' function. */ +/* #undef HAVE_ARC4RANDOM */ + +/* Define to 1 if you have the `arc4random_buf' function. */ +/* #define HAVE_ARC4RANDOM_BUF 1 */ + +/* define if the compiler supports basic C++11 syntax */ +#define HAVE_CXX11 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrandom' function. */ +/* #define HAVE_GETRANDOM 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `bsd' library (-lbsd). */ +/* #undef HAVE_LIBBSD */ + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have `syscall' and `SYS_getrandom'. */ +/* #define HAVE_SYSCALL_GETRANDOM 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "expat" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "expat" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "expat 2.6.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "expat" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.6.3" + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "2.6.3" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to allow retrieving the byte offsets for attribute names and values. + */ +/* #undef XML_ATTR_INFO */ + +/* Define to specify how much context to retain around the current parse + point, 0 to disable. */ +#define XML_CONTEXT_BYTES 1024 + +/* Define to include code reading entropy from `/dev/urandom'. */ +#define XML_DEV_URANDOM 1 + +/* Define to make parameter entity parsing functionality available. */ +#define XML_DTD 1 + +/* Define as 1/0 to enable/disable support for general entities. */ +#define XML_GE 1 + +/* Define to make XML Namespaces functionality available. */ +#define XML_NS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +#endif // ndef EXPAT_CONFIG_H