summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-09-11 15:40:02 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-11 15:40:02 +0300
commit7a9ad23a9ec80a37308ab75c23c67da57287dd80 (patch)
tree4d6f8e9e73cb609e407b218afc2dad762b42a3b3
parente58c68bd23bdc01bd0e4d999d2da4dc0e20a68a2 (diff)
Release version 3.2.4+1v3.2.4+1
Add support for config.libxerces_c.transcoder_icu variable Update .gitignore file
-rw-r--r--README-DEV11
-rw-r--r--libxerces-c/.gitignore1
-rw-r--r--libxerces-c/INSTALL6
-rw-r--r--libxerces-c/README-DEV2
-rw-r--r--libxerces-c/build/root.build26
-rw-r--r--libxerces-c/manifest14
-rw-r--r--libxerces-c/xercesc/buildfile40
-rw-r--r--libxerces-c/xercesc/config.h22
l---------libxerces-c/xercesc/util/Transcoders/MacOSUnicodeConverter1
l---------libxerces-c/xercesc/util/Transcoders/Win321
10 files changed, 102 insertions, 22 deletions
diff --git a/README-DEV b/README-DEV
index efb7421..c7933ce 100644
--- a/README-DEV
+++ b/README-DEV
@@ -92,6 +92,13 @@ We, however, disable the network support by default, replacing the
be able to enable network by setting the config.libxerces_c.network project
configuration variable to true.
+Also we use a native transcoder on Mac OS and Windows by default, replacing
+the --enable-transcoder-icu option with
+--enable-transcoder-macosunicodeconverter and --enable-transcoder-windows,
+respectively. The user, will still be able to enable the ICU transcoder by
+setting the config.libxerces_c.transcoder_icu project configuration variable
+to true.
+
Normally, when packaging a project, we need to replace some auto-generated
headers with our own implementations, deduce the compilation/linking options
and the source files to compile. For Xerces-C++ we can rely on the
@@ -114,8 +121,8 @@ $ ../configure --enable-netaccessor-curl --enable-transcoder-icu \
$ make V=1 >>build.log 2>&1
Note that on Windows, to reduce complexity, we may build the upstream package
-with the native network accessor and transcoder (rather than with the cURL-
-based network accessor and ICU-based transcoder).
+with the native network accessor (rather than with the cURL-based network
+accessor).
For MSVC:
diff --git a/libxerces-c/.gitignore b/libxerces-c/.gitignore
index 3dcc22f..d4a1da2 100644
--- a/libxerces-c/.gitignore
+++ b/libxerces-c/.gitignore
@@ -13,6 +13,7 @@
*.ifc
*.so
*.so.*
+*.dylib
*.dll
*.a
*.lib
diff --git a/libxerces-c/INSTALL b/libxerces-c/INSTALL
index ce836ee..ef4e54f 100644
--- a/libxerces-c/INSTALL
+++ b/libxerces-c/INSTALL
@@ -10,3 +10,9 @@ Note that by default libxerces-c is built without network support. To enable
it, run the following command instead:
$ bpkg build libxerces-c +{ config.libxerces_c.network=true }
+
+Also note that by default libxerces-c is built with a native transcoder on Mac
+OS and Windows. To enable the ICU transcoder, run the following command
+instead:
+
+$ bpkg build libxerces-c +{ config.libxerces_c.transcoder_icu=true }
diff --git a/libxerces-c/README-DEV b/libxerces-c/README-DEV
index 5ac21cd..5321a20 100644
--- a/libxerces-c/README-DEV
+++ b/libxerces-c/README-DEV
@@ -32,7 +32,7 @@ change tracking instructions below for details). As a bonus it also simplifies
the buildfile.
$ mkdir -p Transcoders NetAccessors MsgLoaders MutexManagers
-$ ln -s ../../../../upstream/src/xercesc/util/Transcoders/ICU Transcoders/
+$ ln -s ../../../../upstream/src/xercesc/util/Transcoders/{ICU,MacOSUnicodeConverter,Win32} Transcoders/
$ ln -s ../../../../upstream/src/xercesc/util/NetAccessors/Curl NetAccessors/
$ ln -s ../../../../upstream/src/xercesc/util/MsgLoaders/InMemory MsgLoaders/
$ ln -s ../../../../upstream/src/xercesc/util/MutexManagers/StdMutexMgr.{hpp,cpp} MutexManagers/
diff --git a/libxerces-c/build/root.build b/libxerces-c/build/root.build
index 85934ec..d61764c 100644
--- a/libxerces-c/build/root.build
+++ b/libxerces-c/build/root.build
@@ -1,13 +1,6 @@
# file : build/root.build
# license : Apache License 2.0; see accompanying LICENSE file
-# Enable network support so that the parser can download remote resources
-# (schemas, DTDs, etc).
-#
-# If enabled, then the libcurl library is used to access network resources.
-#
-config [bool] config.libxerces_c.network ?= false
-
# We rely on C99 in macro deductions (see xercesc/config.h and
# xercesc/util/Xerces_autoconf_config.hpp for details).
#
@@ -31,3 +24,22 @@ if ($c.target.system == 'win32-msvc')
if ($c.class == 'msvc')
cc.coptions += /wd4251 /wd4275 /wd4800
+
+# Enable network support so that the parser can download remote resources
+# (schemas, DTDs, etc).
+#
+# If enabled, then the libcurl library is used to access network resources.
+#
+config [bool] config.libxerces_c.network ?= false
+
+# We use ICU everywhere except on Mac OS and Windows where we by default
+# use native transcoders (but can still be forced to use ICU instead).
+#
+config [bool] config.libxerces_c.transcoder_icu ?= \
+ ($cxx.target.class != 'macos' && $cxx.target.class != 'windows')
+
+if! $config.libxerces_c.transcoder_icu
+{
+ assert ($cxx.target.class == 'macos' || $cxx.target.class == 'windows') \
+ "only ICU transcoder is supported on $cxx.target.class"
+}
diff --git a/libxerces-c/manifest b/libxerces-c/manifest
index 774e753..164f4bf 100644
--- a/libxerces-c/manifest
+++ b/libxerces-c/manifest
@@ -3,8 +3,9 @@ name: libxerces-c
# Note: remember to update doc-url below!
#
-version: 3.2.4
+version: 3.2.4+1
+language: c++
project: xerces-c
summary: Validating XML parsing and serialization C++ library
license: Apache-2.0 ; Apache License 2.0.
@@ -20,5 +21,12 @@ build-error-email: builds@build2.org
depends: * build2 >= 0.15.0
depends: * bpkg >= 0.15.0
depends: libcurl ^7.67.0 ? ($config.libxerces_c.network)
-depends: libicuuc >= 65.1.0
-depends: libicui18n >= 65.1.0
+depends: {libicuuc libicui18n} >= 65.1.0 ? ($config.libxerces_c.transcoder_icu)
+
+transcoder-icu-builds: macos windows
+transcoder-icu-build-config:
+\
+config.libxerces_c.transcoder_icu=true
+;
+Test with ICU transcoder on Mac OS and Windows.
+\
diff --git a/libxerces-c/xercesc/buildfile b/libxerces-c/xercesc/buildfile
index c50b091..15f61b1 100644
--- a/libxerces-c/xercesc/buildfile
+++ b/libxerces-c/xercesc/buildfile
@@ -2,25 +2,34 @@
# license : Apache License 2.0; see accompanying LICENSE file
network = $config.libxerces_c.network
+transcoder_icu = $config.libxerces_c.transcoder_icu
+
+intf_libs = # Interface dependencies.
+impl_libs = # Implementation dependencies.
# Note that the installed util/NetAccessors/Curl/CurlURLInputStream.hpp
# includes the libcurl headers.
#
if $network
- import intf_libs = libcurl%lib{curl}
+ import intf_libs += libcurl%lib{curl}
-import impl_libs = libicuuc%lib{icuuc}
-import impl_libs += libicui18n%lib{icui18n}
+if $transcoder_icu
+{
+ import impl_libs += libicuuc%lib{icuuc}
+ import impl_libs += libicui18n%lib{icui18n}
+}
lib{xerces-c}: {h }{config} \
{hxx txx cxx}{*/** -util/FileManagers/** \
-util/NetAccessors/** \
+ -util/Transcoders/** \
-util/XercesVersion} \
{hxx }{ util/XercesVersion}
tclass = $cxx.target.class
tsys = $cxx.target.system
+macos = ($tclass == 'macos')
windows = ($tclass == 'windows')
lib{xerces-c}: {h c}{stricmp strnicmp} \
@@ -30,6 +39,14 @@ lib{xerces-c}: util/FileManagers/{hxx cxx}{WindowsFileMgr}: include = $windows
lib{xerces-c}: util/NetAccessors/Curl/{hxx cxx}{*}: include = $network
+lib{xerces-c}: util/Transcoders/ICU/{hxx cxx}{*}: include = $transcoder_icu
+
+lib{xerces-c}: util/Transcoders/MacOSUnicodeConverter/{hxx cxx}{*}: \
+include = (!$transcoder_icu && $macos)
+
+lib{xerces-c}: util/Transcoders/Win32/{hxx cxx}{*}: \
+include = (!$transcoder_icu && $windows)
+
lib{xerces-c}: $intf_libs $impl_libs
# Include the generated version header into the distribution (so that we
@@ -55,6 +72,13 @@ util/hxx{XercesVersion}: util/in{XercesVersion} $src_root/manifest
if $network
cc.poptions += -DXERCES_USE_NETACCESSOR_CURL=1
+if $transcoder_icu
+ cc.poptions += -DXERCES_USE_TRANSCODER_ICU=1
+elif $macos
+ cc.poptions += -DXERCES_USE_TRANSCODER_MACOSUNICODECONVERTER=1
+elif $windows
+ cc.poptions += -DXERCES_USE_TRANSCODER_WINDOWS=1
+
cc.poptions += -DXERCES_BUILDING_LIBRARY -DHAVE_CONFIG_H -D_THREAD_SAFE
if $windows
@@ -110,6 +134,9 @@ switch $tclass, $tsys
#
cxx.aoptions += /IGNORE:4221
+ if! $transcoder_icu
+ cxx.libs += advapi32.lib
+
cxx.libs += ws2_32.lib
}
case 'linux'
@@ -120,6 +147,13 @@ switch $tclass, $tsys
cxx.libs += -lm -pthread
}
+ case 'macos'
+ {
+ if! $transcoder_icu
+ cxx.libs += -framework CoreServices
+
+ cxx.libs += -pthread
+ }
default
{
cxx.libs += -pthread
diff --git a/libxerces-c/xercesc/config.h b/libxerces-c/xercesc/config.h
index ab2ea78..53ae22e 100644
--- a/libxerces-c/xercesc/config.h
+++ b/libxerces-c/xercesc/config.h
@@ -23,19 +23,25 @@
# include <stdint.h> /* Requires C99. */
#endif
-/* Use the ICU transcoder.
+/* Transcoder.
+ *
+ * Note that depending on config.libxerces_c.transcoder_icu and
+ * cxx.target.class values one of the following macros is defined via the
+ * preprocessor option (see buildfile and root.build for details).
*/
+/*
#define XERCES_USE_TRANSCODER_ICU 1
-#undef XERCES_USE_TRANSCODER_GNUICONV
-#undef XERCES_USE_TRANSCODER_ICONV
#undef XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER
#undef XERCES_USE_TRANSCODER_WINDOWS
+*/
+#undef XERCES_USE_TRANSCODER_GNUICONV
+#undef XERCES_USE_TRANSCODER_ICONV
-/* Use the Curl net accessor.
+/* Net accessor.
*
* Note that the XERCES_USE_NETACCESSOR_CURL macro is defined via the
- * preprocessor option if the network support is enabled (see buildfile for
- * details).
+ * preprocessor option if the network support is enabled (see buildfile and
+ * root.build for details).
*/
/*
#define XERCES_USE_NETACCESSOR_CURL 1
@@ -91,6 +97,10 @@
# define HAVE_FTIME 1
# define HAVE_STRICMP 1
# define HAVE_STRNICMP 1
+# define HAVE_WCSICMP 1
+# define HAVE_WCSLWR 1
+# define HAVE_WCSNICMP 1
+# define HAVE_WCSUPR 1
# define XERCES_HAVE_INTRIN_H 1
# define XERCES_PATH_DELIMITER_BACKSLASH 1
# define XERCES_HAVE_CPUID_INTRINSIC 1
diff --git a/libxerces-c/xercesc/util/Transcoders/MacOSUnicodeConverter b/libxerces-c/xercesc/util/Transcoders/MacOSUnicodeConverter
new file mode 120000
index 0000000..5d4612d
--- /dev/null
+++ b/libxerces-c/xercesc/util/Transcoders/MacOSUnicodeConverter
@@ -0,0 +1 @@
+../../../../upstream/src/xercesc/util/Transcoders/MacOSUnicodeConverter \ No newline at end of file
diff --git a/libxerces-c/xercesc/util/Transcoders/Win32 b/libxerces-c/xercesc/util/Transcoders/Win32
new file mode 120000
index 0000000..6ec82cb
--- /dev/null
+++ b/libxerces-c/xercesc/util/Transcoders/Win32
@@ -0,0 +1 @@
+../../../../upstream/src/xercesc/util/Transcoders/Win32 \ No newline at end of file