Skip to content

Commit

Permalink
Update Xalan-C 1.12
Browse files Browse the repository at this point in the history
IB-6609

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Nov 19, 2020
1 parent 170040d commit 7c04045
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 68 deletions.
45 changes: 0 additions & 45 deletions patches/xalan-CMakeLists.txt

This file was deleted.

37 changes: 19 additions & 18 deletions prepare_osx_build_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -e

XERCES_DIR=xerces-c-3.2.3
XALAN_DIR=xalan_c-1.12
XMLSEC_DIR=xml-security-c-2.0.2
XSD=xsd-4.0.0-i686-macosx
OPENSSL_DIR=openssl-1.1.1h
Expand Down Expand Up @@ -123,15 +124,16 @@ function xerces {
}

function xalan {
echo Building xalan-c-1.11
if [ ! -f xalan_c-1.11-src.tar.gz ]; then
curl -O -L https://archive.apache.org/dist/xalan/xalan-c/sources/xalan_c-1.11-src.tar.gz
echo Building ${XALAN_DIR}
if [ ! -f ${XALAN_DIR}.tar.gz ]; then
curl -O -L https://archive.apache.org/dist/xalan/xalan-c/sources/${XALAN_DIR}.tar.gz
fi
rm -rf xalan-c-1.11
tar xf xalan_c-1.11-src.tar.gz
cd xalan-c-1.11/c
cp ../../patches/xalan-CMakeLists.txt src/CMakeLists.txt
cp ../../patches/MsgCreator src
rm -rf ${XALAN_DIR}
tar xf ${XALAN_DIR}.tar.gz
pushd ${XALAN_DIR}
sed -ie 's!add_subdirectory(samples)!!' CMakeLists.txt
sed -ie 's!add_subdirectory(Tests)!!' CMakeLists.txt
sed -ie 's!add_subdirectory(docs/doxygen)!!' CMakeLists.txt
case "${ARGS}" in
*android*)
cmake \
Expand All @@ -140,10 +142,9 @@ function xalan {
-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=${TARGET_PATH} \
-DCMAKE_ANDROID_ARCH_ABI=${ARCH_ABI} \
-DCMAKE_INSTALL_PREFIX=${TARGET_PATH} \
-DXercesC_ROOT=${TARGET_PATH} \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=NO \
src && make -s && sudo make install
. && make -s && sudo make install
;;
*ios*|*simulator*)
cmake \
Expand All @@ -152,25 +153,24 @@ function xalan {
-DCMAKE_OSX_SYSROOT=${SYSROOT} \
-DCMAKE_OSX_ARCHITECTURES="${ARCHS// /;}" \
-DCMAKE_INSTALL_PREFIX=${TARGET_PATH} \
-DXercesC_ROOT=${TARGET_PATH} \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=NO \
src && make -s && sudo make install
. && make -s && sudo make install
;;
*)
cmake \
-DCMAKE_MACOSX_RPATH=NO \
-DCMAKE_INSTALL_PREFIX=${TARGET_PATH} \
-DXercesC_ROOT=${TARGET_PATH} \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=YES \
src && make -s && sudo make install
sudo install_name_tool -id ${TARGET_PATH}/lib/libxalanMsg.111.0.dylib ${TARGET_PATH}/lib/libxalanMsg.dylib
sudo install_name_tool -id ${TARGET_PATH}/lib/libxalan-c.111.0.dylib ${TARGET_PATH}/lib/libxalan-c.dylib
sudo install_name_tool -change libxalanMsg.111.0.dylib ${TARGET_PATH}/lib/libxalanMsg.111.0.dylib ${TARGET_PATH}/lib/libxalan-c.dylib
. && make -s && sudo make install
sudo install_name_tool -id ${TARGET_PATH}/lib/libxalanMsg.112.dylib ${TARGET_PATH}/lib/libxalanMsg.dylib
sudo install_name_tool -id ${TARGET_PATH}/lib/libxalan-c.112.dylib \
-change libxalanMsg.112.dylib ${TARGET_PATH}/lib/libxalanMsg.112.dylib \
${TARGET_PATH}/lib/libxalan-c.dylib
;;
esac
cd ../..
popd
}

function xml_security {
Expand All @@ -183,6 +183,7 @@ function xml_security {
cd ${XMLSEC_DIR}
sed -ie 's!as_fn_error $? "cannot run test program while cross compiling!$as_echo_n "cannot run test program while cross compiling!' configure
sed -ie 's!#define XSEC_EXPORT!#define XSEC_EXPORT __attribute__ ((visibility("default")))!' xsec/framework/XSECDefs.hpp
sed -ie 's!XALAN_USING_XALAN(\(.*\))!using xalanc::\1;!' xsec/*/*.cpp* xsec/*/*.hpp
CFLAGS="${CFLAGS} -fvisibility=hidden" \
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden" \
xerces_CFLAGS="-I${TARGET_PATH}/include" xerces_LIBS="-L${TARGET_PATH}/lib -lxalanMsg -lxalan-c -lxerces-c" \
Expand Down
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,29 +364,29 @@ if( FRAMEWORK )
COMMAND install_name_tool -id 'libxalanMsg.dylib'
$<TARGET_FILE_DIR:digidocpp>/Libraries/libxalanMsg.dylib
COMMAND install_name_tool -id 'libxalan-c.dylib'
-change '${LIBPATH}/libxalanMsg.111.0.dylib' '@loader_path/libxalanMsg.dylib'
-change '${LIBPATH}/libxalanMsg.112.dylib' '@loader_path/libxalanMsg.dylib'
-change '${LIBPATH}/libxerces-c-3.2.dylib' '@loader_path/libxerces-c.dylib'
$<TARGET_FILE_DIR:digidocpp>/Libraries/libxalan-c.dylib
COMMAND install_name_tool -id 'libxml-security-c.dylib'
-change '${LIBPATH}/libcrypto.1.1.dylib' '@loader_path/libcrypto.dylib'
-change '${LIBPATH}/libssl.1.1.dylib' '@loader_path/libssl.dylib'
-change '${LIBPATH}/libxerces-c-3.2.dylib' '@loader_path/libxerces-c.dylib'
-change '${LIBPATH}/libxalan-c.111.0.dylib' '@loader_path/libxalan-c.dylib'
-change '${LIBPATH}/libxalanMsg.111.0.dylib' '@loader_path/libxalanMsg.dylib'
-change '${LIBPATH}/libxalan-c.112.dylib' '@loader_path/libxalan-c.dylib'
-change '${LIBPATH}/libxalanMsg.112.dylib' '@loader_path/libxalanMsg.dylib'
$<TARGET_FILE_DIR:digidocpp>/Libraries/libxml-security-c.dylib
COMMAND install_name_tool
-change '${LIBPATH}/libcrypto.1.1.dylib' '@loader_path/Libraries/libcrypto.dylib'
-change '${LIBPATH}/libssl.1.1.dylib' '@loader_path/Libraries/libssl.dylib'
-change '${LIBPATH}/libxerces-c-3.2.dylib' '@loader_path/Libraries/libxerces-c.dylib'
-change '${LIBPATH}/libxml-security-c.20.dylib' '@loader_path/Libraries/libxml-security-c.dylib'
-change '${LIBPATH}/libxalan-c.111.0.dylib' '@loader_path/Libraries/libxalan-c.dylib'
-change '${LIBPATH}/libxalan-c.112.dylib' '@loader_path/Libraries/libxalan-c.dylib'
$<TARGET_FILE:digidocpp>
COMMAND install_name_tool
-change '${LIBPATH}/libcrypto.1.1.dylib' '@executable_path/../Libraries/libcrypto.dylib'
-change '${LIBPATH}/libssl.1.1.dylib' '@executable_path/../Libraries/libssl.dylib'
-change '${LIBPATH}/libxerces-c-3.2.dylib' '@executable_path/../Libraries/libxerces-c.dylib'
-change '${LIBPATH}/libxml-security-c.20.dylib' '@executable_path/../Libraries/libxml-security-c.dylib'
-change '${LIBPATH}/libxalan-c.111.0.dylib' '@executable_path/../Libraries/libxalan-c.dylib'
-change '${LIBPATH}/libxalan-c.112.dylib' '@executable_path/../Libraries/libxalan-c.dylib'
$<TARGET_FILE_DIR:digidocpp>/Resources/digidoc-tool
COMMAND touch $<TARGET_FILE:digidoc-tool>
)
Expand Down
5 changes: 5 additions & 0 deletions src/Container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ DIGIDOCPP_WARNING_PUSH
DIGIDOCPP_WARNING_DISABLE_GCC("-Wunused-parameter")
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
DIGIDOCPP_WARNING_POP
#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR < 12
XALAN_USING_XALAN(XPathEvaluator)
XALAN_USING_XALAN(XalanTransformer)
#else
using xalanc::XPathEvaluator;
using xalanc::XalanTransformer;
#endif
#endif

#define XSD_CXX11
Expand Down

0 comments on commit 7c04045

Please sign in to comment.