diff --git a/ports/azure-storage-common-cpp/fix-dependency-libxml2.patch b/ports/azure-storage-common-cpp/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..d7f933d4991120 --- /dev/null +++ b/ports/azure-storage-common-cpp/fix-dependency-libxml2.patch @@ -0,0 +1,36 @@ +diff --git a/sdk/storage/azure-storage-common/CMakeLists.txt b/sdk/storage/azure-storage-common/CMakeLists.txt +index 285ae93..697de72 100644 +--- a/sdk/storage/azure-storage-common/CMakeLists.txt ++++ b/sdk/storage/azure-storage-common/CMakeLists.txt +@@ -27,7 +27,7 @@ if(NOT AZ_ALL_LIBRARIES) + endif() + + find_package(Threads REQUIRED) +-find_package(LibXml2 REQUIRED) ++find_package(libxml2 CONFIG REQUIRED) + + set( + AZURE_STORAGE_COMMON_HEADER +@@ -79,8 +79,7 @@ target_include_directories( + ) + + target_link_libraries(azure-storage-common PUBLIC Azure::azure-core) +-target_include_directories(azure-storage-common PRIVATE ${LIBXML2_INCLUDE_DIRS}) +-target_link_libraries(azure-storage-common PRIVATE ${LIBXML2_LIBRARIES}) ++target_link_libraries(azure-storage-common PRIVATE LibXml2::LibXml2) + + if(WIN32) + target_link_libraries(azure-storage-common PRIVATE bcrypt) +diff --git a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in +index bfc3563..6e05f1a 100644 +--- a/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in ++++ b/sdk/storage/azure-storage-common/vcpkg/Config.cmake.in +@@ -4,7 +4,7 @@ + @PACKAGE_INIT@ + + include(CMakeFindDependencyMacro) +-find_dependency(LibXml2) ++find_dependency(libxml2 CONFIG) + find_dependency(Threads) + find_dependency(azure-core-cpp) + diff --git a/ports/azure-storage-common-cpp/portfile.cmake b/ports/azure-storage-common-cpp/portfile.cmake index 38a907c1bcac28..ca5d681081cc42 100644 --- a/ports/azure-storage-common-cpp/portfile.cmake +++ b/ports/azure-storage-common-cpp/portfile.cmake @@ -3,6 +3,7 @@ vcpkg_from_github( REPO Azure/azure-sdk-for-cpp REF azure-storage-common_12.0.0-beta.10 SHA512 f49f74c9a6d7b80b0f7c8a9b9d2e4595dc304439d30c8c83f520833f81ef7d3480b858ada61c12f76e82eea7960eb155453b0acdcea143f163a12d567adbf18d + PATCHES fix-dependency-libxml2.patch ) vcpkg_cmake_configure( diff --git a/ports/azure-storage-common-cpp/vcpkg.json b/ports/azure-storage-common-cpp/vcpkg.json index c26b2d4189972a..321bc7df98bb23 100644 --- a/ports/azure-storage-common-cpp/vcpkg.json +++ b/ports/azure-storage-common-cpp/vcpkg.json @@ -1,7 +1,7 @@ { "name": "azure-storage-common-cpp", "version-semver": "12.0.0-beta.10", - "port-version": 1, + "port-version": 2, "description": [ "Microsoft Azure Common Storage SDK for C++", "This library provides common Azure Storage-related abstractions for Azure SDK." diff --git a/ports/azure-storage-cpp/CONTROL b/ports/azure-storage-cpp/CONTROL index 08c09f0296399a..5b3ec8c143bdcd 100644 --- a/ports/azure-storage-cpp/CONTROL +++ b/ports/azure-storage-cpp/CONTROL @@ -1,5 +1,6 @@ Source: azure-storage-cpp Version: 7.5.0 +Port-Version: 1 Build-Depends: cpprestsdk[core], atlmfc (windows), boost-log (!windows&!uwp), boost-locale (!windows&!uwp), libxml2 (!windows&!uwp), libuuid (!windows&!uwp&!osx), gettext (osx) Description: Microsoft Azure Storage Client SDK for C++ A client library for working with Microsoft Azure storage services including blobs, files, tables, and queues. This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data, the file service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client. diff --git a/ports/azure-storage-cpp/fix-dependency-libxml2.patch b/ports/azure-storage-cpp/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..583fc8d3828970 --- /dev/null +++ b/ports/azure-storage-cpp/fix-dependency-libxml2.patch @@ -0,0 +1,30 @@ +diff --git a/Microsoft.WindowsAzure.Storage/CMakeLists.txt b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +index ac9e65d..7b9d82a 100644 +--- a/Microsoft.WindowsAzure.Storage/CMakeLists.txt ++++ b/Microsoft.WindowsAzure.Storage/CMakeLists.txt +@@ -48,7 +48,7 @@ if(UNIX) + + find_package(UUID REQUIRED) + find_package(Casablanca REQUIRED) +- find_package(LibXML2 REQUIRED) ++ find_package(libxml2 CONFIG REQUIRED) + + if(BUILD_TESTS) + find_package(UnitTest++ REQUIRED) +@@ -142,11 +142,14 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries) + + set(AZURESTORAGE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/includes) +-set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${LibXML2_INCLUDE_DIR}) ++set(AZURESTORAGE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CASABLANCA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS}) + + + set(AZURESTORAGE_LIBRARY azurestorage) +-set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${UUID_LIBRARIES} ${LibXML2_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) ++set(AZURESTORAGE_LIBRARIES ${AZURESTORAGE_LIBRARY} ${CASABLANCA_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK} ${OPENSSL_LIBRARIES} ${UUID_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) ++if (UNIX) ++ list(APPEND AZURESTORAGE_LIBRARIES LibXml2::LibXml2) ++endif() + + # Set version numbers centralized + set (AZURESTORAGE_VERSION_MAJOR 7) diff --git a/ports/azure-storage-cpp/portfile.cmake b/ports/azure-storage-cpp/portfile.cmake index 2b23123b26ebc7..ba67bf581c9c53 100644 --- a/ports/azure-storage-cpp/portfile.cmake +++ b/ports/azure-storage-cpp/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF v7.5.0 SHA512 83eabcaf2114c8af1cabbc96b6ef2b57c934a06f68e7a870adf336feaa19edd57aedaf8507d5c40500e46d4e77f5059f9286e319fe7cadeb9ffc8fa018fb030c HEAD_REF master + PATCHES fix-dependency-libxml2.patch ) vcpkg_configure_cmake( diff --git a/ports/collada-dom/CONTROL b/ports/collada-dom/CONTROL index 9b61361534d353..bc13bbb08dd197 100644 --- a/ports/collada-dom/CONTROL +++ b/ports/collada-dom/CONTROL @@ -1,6 +1,6 @@ Source: collada-dom Version: 2.5.0 -Port-Version: 4 +Port-Version: 5 Homepage: https://github.com/rdiankov/collada-dom Description: The COLLADA Document Object Model (DOM) is an application programming interface (API) that provides a C++ object representation of a COLLADA XML instance document. Build-Depends: zlib, libxml2, minizip, pcre, uriparser, boost-filesystem, boost-system diff --git a/ports/collada-dom/fix-dependency-libxml2.patch b/ports/collada-dom/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..0cbf1207b76699 --- /dev/null +++ b/ports/collada-dom/fix-dependency-libxml2.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f044d3..ff92070 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -207,9 +207,10 @@ if( NOT ZLIB_FOUND ) + set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dom/external-libs/zlib-1.2.5) + endif() + +-find_package(LibXml2) ++find_package(libxml2 CONFIG REQUIRED) ++set(LIBXML2_FOUND 1) + if( LIBXML2_FOUND ) +- include_directories(${LIBXML2_INCLUDE_DIR}) ++ include_directories(${LIBXML2_INCLUDE_DIRS}) + add_definitions(${LIBXML2_DEFINITIONS} -DDOM_INCLUDE_LIBXML) + message(STATUS "libxml2 found") + else() diff --git a/ports/collada-dom/portfile.cmake b/ports/collada-dom/portfile.cmake index 84c236dab08fc7..da8a67faf6325f 100644 --- a/ports/collada-dom/portfile.cmake +++ b/ports/collada-dom/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( use-uriparser.patch use-vcpkg-minizip.patch fix-shared-keyword.patch + fix-dependency-libxml2.patch ) vcpkg_configure_cmake( diff --git a/ports/commsdsl/fix-dependency-libxml2.patch b/ports/commsdsl/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..ba6cd1442f8a83 --- /dev/null +++ b/ports/commsdsl/fix-dependency-libxml2.patch @@ -0,0 +1,27 @@ +diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt +index eaacb7a..cba902c 100644 +--- a/lib/src/CMakeLists.txt ++++ b/lib/src/CMakeLists.txt +@@ -6,10 +6,10 @@ while (TRUE) + break() + endif () + +- find_package(LibXml2 QUIET) +- if (LIBXML2_FOUND) ++ find_package(libxml2 CONFIG QUIET) ++ if (1) + # Find again just to display info +- find_package(LibXml2 REQUIRED) ++ find_package(libxml2 CONFIG REQUIRED) + break() + endif () + +@@ -123,7 +123,7 @@ endif () + set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${COMMSDSL_VERSION}) + + target_include_directories(${PROJECT_NAME} +- PRIVATE ${LIBXML2_INCLUDE_DIR} ++ PRIVATE ${LIBXML2_INCLUDE_DIRS} + PUBLIC $ + INTERFACE $ + ) diff --git a/ports/commsdsl/portfile.cmake b/ports/commsdsl/portfile.cmake index df428c0f88089d..618f1f383a270a 100644 --- a/ports/commsdsl/portfile.cmake +++ b/ports/commsdsl/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF v3.6 SHA512 80fab2e567191a468a079dd9964a651293d8e7996141a973e77d4bdfaa96bfc346156f50ce484be1dc2b3d9e661cccce0e712c70876f7b322bc459f81a328496 HEAD_REF master + PATCHES fix-dependency-libxml2.patch ) vcpkg_configure_cmake( diff --git a/ports/commsdsl/vcpkg.json b/ports/commsdsl/vcpkg.json index c01c9e27d2f216..b2a293eb061551 100644 --- a/ports/commsdsl/vcpkg.json +++ b/ports/commsdsl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "commsdsl", "version-string": "3.6.0", - "port-version": 1, + "port-version": 2, "description": "DSL schemas parser and code generator for CommsChampion Ecosystem", "homepage": "https://commschamp.github.io/", "documentation": "https://github.com/commschamp/commsdsl", diff --git a/ports/gdal/dependency_win.cmake b/ports/gdal/dependency_win.cmake index 6bb6202d2f04d2..1728c733d970b9 100644 --- a/ports/gdal/dependency_win.cmake +++ b/ports/gdal/dependency_win.cmake @@ -73,9 +73,14 @@ macro(find_dependency_win) set(WEBP_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/webpd.lib" ) # Setup libxml2 libraries + include path - set(XML2_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" ) - set(XML2_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib" ) - set(XML2_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib" ) + set(XML2_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include/libxml2" ) + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(XML2_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib" ) + set(XML2_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2d.lib" ) + else() + set(XML2_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2s.lib" ) + set(XML2_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2sd.lib" ) + endif() # Setup liblzma libraries + include path set(LZMA_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" ) diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index 971e9b205f3b74..8ca70fa7359b20 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,6 +1,7 @@ { "name": "gdal", "version-semver": "3.2.2", + "port-version": 1, "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data", "homepage": "https://gdal.org", "supports": "!arm", diff --git a/ports/libarchive/fix-dependencies.patch b/ports/libarchive/fix-dependencies.patch index 0d3213c6766f52..698e43cf5ff95f 100644 --- a/ports/libarchive/fix-dependencies.patch +++ b/ports/libarchive/fix-dependencies.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 39b5333..8164d8f 100644 +index 6a1dc1f..85b5050 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -433,7 +433,7 @@ MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) +@@ -436,7 +436,7 @@ MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) # Find BZip2 # IF(ENABLE_BZip2) @@ -11,7 +11,7 @@ index 39b5333..8164d8f 100644 ELSE() SET(BZIP2_FOUND FALSE) # Override cached value ENDIF() -@@ -462,27 +462,15 @@ MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) +@@ -465,27 +465,15 @@ MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) # Find LZMA # IF(ENABLE_LZMA) @@ -42,7 +42,7 @@ index 39b5333..8164d8f 100644 ELSE(LIBLZMA_FOUND) # LZMA not found and will not be used. ENDIF(LIBLZMA_FOUND) -@@ -555,22 +543,15 @@ IF(ENABLE_LZ4) +@@ -558,22 +546,15 @@ IF(ENABLE_LZ4) SET(LZ4_FIND_QUIETLY TRUE) ENDIF (LZ4_INCLUDE_DIR) @@ -69,7 +69,7 @@ index 39b5333..8164d8f 100644 # # TODO: test for static library. # -@@ -586,25 +566,20 @@ IF(ENABLE_ZSTD) +@@ -589,25 +570,20 @@ IF(ENABLE_ZSTD) SET(ZSTD_FIND_QUIETLY TRUE) ENDIF (ZSTD_INCLUDE_DIR) @@ -105,7 +105,7 @@ index 39b5333..8164d8f 100644 ENDIF(ZSTD_FOUND) MARK_AS_ADVANCED(CLEAR ZSTD_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR ZSTD_LIBRARY) -@@ -773,11 +742,11 @@ ENDIF(ENABLE_NETTLE) +@@ -776,11 +752,11 @@ ENDIF(ENABLE_NETTLE) # (Except on Mac, where OpenSSL is deprecated.) # IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") @@ -121,7 +121,7 @@ index 39b5333..8164d8f 100644 ENDIF(OPENSSL_FOUND) ELSE() SET(OPENSSL_FOUND FALSE) # Override cached value -@@ -896,7 +865,6 @@ main(int argc, char **argv) +@@ -899,7 +875,6 @@ main(int argc, char **argv) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) @@ -129,16 +129,16 @@ index 39b5333..8164d8f 100644 ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) -@@ -1128,7 +1096,7 @@ ENDIF(ENABLE_ICONV) +@@ -1131,7 +1106,7 @@ ENDIF(ENABLE_ICONV) # Find Libxml2 # IF(ENABLE_LIBXML2) - FIND_PACKAGE(LibXml2) -+ FIND_PACKAGE(LibXml2 REQUIRED) ++ FIND_PACKAGE(libxml2 CONFIG REQUIRED) ELSE() SET(LIBXML2_FOUND FALSE) ENDIF() -@@ -1432,8 +1400,7 @@ CHECK_C_SOURCE_COMPILES( +@@ -1435,8 +1410,7 @@ CHECK_C_SOURCE_COMPILES( MAJOR_IN_SYSMACROS) CMAKE_PUSH_CHECK_STATE() diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index e441bdea26d20f..a30dda374c6bc6 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES bzip2 ENABLE_BZip2 libxml2 ENABLE_LIBXML2 lz4 ENABLE_LZ4 diff --git a/ports/libarchive/vcpkg-cmake-wrapper.cmake.in b/ports/libarchive/vcpkg-cmake-wrapper.cmake.in index e0712d3e2aa546..2bdea2ade75901 100644 --- a/ports/libarchive/vcpkg-cmake-wrapper.cmake.in +++ b/ports/libarchive/vcpkg-cmake-wrapper.cmake.in @@ -9,7 +9,7 @@ if(@ENABLE_BZip2@) find_dependency(BZip2) endif() if(@ENABLE_LIBXML2@) - find_dependency(LibXml2) + find_dependency(libxml2 CONFIG) endif() if(@ENABLE_LZ4@) find_dependency(lz4) diff --git a/ports/libarchive/vcpkg.json b/ports/libarchive/vcpkg.json index 6258f226db0eb6..1e1ad9f9284b0f 100644 --- a/ports/libarchive/vcpkg.json +++ b/ports/libarchive/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libarchive", "version-semver": "3.4.3", - "port-version": 5, + "port-version": 6, "description": "Library for reading and writing streaming archives", "homepage": "https://github.com/libarchive/libarchive", "supports": "!uwp", diff --git a/ports/libcroco/CMakeLists.txt b/ports/libcroco/CMakeLists.txt index f8e8a71058eb68..f1385941774c49 100644 --- a/ports/libcroco/CMakeLists.txt +++ b/ports/libcroco/CMakeLists.txt @@ -4,7 +4,7 @@ project(libcroco C) find_package(Iconv REQUIRED) find_package(Intl REQUIRED) find_package(unofficial-glib CONFIG REQUIRED) -find_package(LibXml2 REQUIRED) +find_package(libxml2 CONFIG REQUIRED) if(NOT WIN32) find_package(Threads REQUIRED) endif() @@ -70,13 +70,13 @@ set(CMAKE_DEBUG_POSTFIX "d") add_library(croco-0.6 ${SOURCES}) -target_include_directories(croco-0.6 PRIVATE ${GLIB_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) +target_include_directories(croco-0.6 PRIVATE ${GLIB_INCLUDE_DIR}) target_link_libraries(croco-0.6 PRIVATE unofficial::glib::gio unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject - ${LIBXML2_LIBRARIES} ${Intl_LIBRARIES} Iconv::Iconv + LibXml2::LibXml2 ${Intl_LIBRARIES} Iconv::Iconv ) install(TARGETS croco-0.6 @@ -130,7 +130,7 @@ include(CMakeFindDependencyMacro) find_dependency(Intl) find_dependency(Iconv) find_dependency(unofficial-glib CONFIG) -find_dependency(LibXml2) +find_dependency(libxml2 CONFIG) if(NOT WIN32) find_dependency(Threads) endif() diff --git a/ports/libcroco/CONTROL b/ports/libcroco/CONTROL index bb1ea8fd29376b..cf566c7001ad96 100644 --- a/ports/libcroco/CONTROL +++ b/ports/libcroco/CONTROL @@ -1,5 +1,5 @@ Source: libcroco Version: 0.6.13 -Port-Version: 2 +Port-Version: 3 Description: A standalone css2 parsing and manipulation library Build-Depends: glib, libxml2 diff --git a/ports/libosmscout/fix-find-iconv.patch b/ports/libosmscout/fix-find-iconv.patch new file mode 100644 index 00000000000000..f1ac2ce7dc4bee --- /dev/null +++ b/ports/libosmscout/fix-find-iconv.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/features.cmake b/cmake/features.cmake +index 8b5563e..19d639d 100644 +--- a/cmake/features.cmake ++++ b/cmake/features.cmake +@@ -152,7 +152,11 @@ if (${PROTOBUF_FOUND} AND NOT EXISTS ${PROTOBUF_PROTOC_EXECUTABLE}) + set(PROTOBUF_FOUND FALSE) + endif() + find_package(ZLIB) +-find_package(iconv) ++find_package(Iconv REQUIRED) ++set(ICONV_FOUND 1) ++set(ICONV_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS}) ++set(ICONV_LIBRARIES ${Iconv_LIBRARIES}) ++ + find_package(LibLZMA) + find_package(PNG QUIET) + find_package(Cairo QUIET) diff --git a/ports/libosmscout/portfile.cmake b/ports/libosmscout/portfile.cmake index 20125753c1330b..5bf0e2ec71943d 100644 --- a/ports/libosmscout/portfile.cmake +++ b/ports/libosmscout/portfile.cmake @@ -4,10 +4,14 @@ vcpkg_from_github( REF c81e1d9a0f69cc5b93588dbe330b2af587162c5f SHA512 d6ddbc49dd40b1f938ae2cd1ea9342cab0a52db46bf7ed6716111a91d0a38acba12ff2e273d457db51fc240d578a5b849af77b53e600482cf52c3b22306f8c45 HEAD_REF master + PATCHES fix-find-iconv.patch ) +file(REMOVE ${SOURCE_PATH}/cmake/Findiconv.cmake) + if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES cairo OSMDCOUT_BUILD_MAP_CAIRO directx OSMDCOUT_BUILD_MAP_DIRECTX gdi OSMDCOUT_BUILD_MAP_GDI @@ -15,6 +19,7 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) ) else() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES cairo OSMDCOUT_BUILD_MAP_CAIRO svg OSMDCOUT_BUILD_MAP_SVG ) diff --git a/ports/libosmscout/vcpkg.json b/ports/libosmscout/vcpkg.json index 7a80efed0c3209..85deb8d5795b9c 100644 --- a/ports/libosmscout/vcpkg.json +++ b/ports/libosmscout/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libosmscout", "version-string": "1.1.1", + "port-version": 1, "description": "libosmscout offers applications simple, high-level interfaces for offline location and POI lokup, rendering and routing functionalities based on OpenStreetMap (OSM) data.", "homepage": "http://libosmscout.sourceforge.net/", "documentation": "http://libosmscout.sourceforge.net/documentation/", diff --git a/ports/librsvg/CMakeLists.txt b/ports/librsvg/CMakeLists.txt index b3b3ca892e4763..94fa92c4c1f651 100644 --- a/ports/librsvg/CMakeLists.txt +++ b/ports/librsvg/CMakeLists.txt @@ -4,7 +4,7 @@ project(librsvg C) find_package(unofficial-cairo CONFIG REQUIRED) find_package(unofficial-libcroco CONFIG REQUIRED) find_package(unofficial-glib CONFIG REQUIRED) -find_package(LibXml2 REQUIRED) +find_package(libxml2 CONFIG REQUIRED) if(CMAKE_SYSTEM_NAME MATCHES "Windows") find_library(PANGO_LIB pango-1.0) find_library(PANGO_CAIRO_LIB pangocairo-1.0) @@ -116,7 +116,7 @@ target_link_libraries(rsvg-2.40 PRIVATE unofficial::glib::glib unofficial::glib::gmodule unofficial::glib::gobject - ${LIBXML2_LIBRARIES} + LibXml2::LibXml2 ${PANGO_LIB} ${PANGO_CAIRO_LIB} ${GDK_PIXBUF_LIB} diff --git a/ports/librsvg/CONTROL b/ports/librsvg/CONTROL index 380186c6eccec0..b26ed9d696424a 100644 --- a/ports/librsvg/CONTROL +++ b/ports/librsvg/CONTROL @@ -1,5 +1,6 @@ Source: librsvg -Version: 2.40.20-2 +Version: 2.40.20 +Port-Version: 3 Homepage: https://gitlab.gnome.org/GNOME/librsvg Description: A small library to render Scalable Vector Graphics (SVG) Build-Depends: cairo, pango, gdk-pixbuf, libcroco \ No newline at end of file diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL index 654ea75bd13702..1d3a17e0a909ef 100644 --- a/ports/libsbml/CONTROL +++ b/ports/libsbml/CONTROL @@ -1,5 +1,6 @@ Source: libsbml Version: 5.18.0 +Port-Version: 1 Description: A library for reading / writing SBML files Default-Features: expat,comp,fbc,groups,layout,render,libxml2 Supports: !uwp diff --git a/ports/libsbml/fix-dependency-libxml2.patch b/ports/libsbml/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..b950ab9de00c82 --- /dev/null +++ b/ports/libsbml/fix-dependency-libxml2.patch @@ -0,0 +1,61 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ceb8f18..932e216 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -464,7 +464,8 @@ endif(WITH_EXPAT) + # + set(USE_LIBXML OFF) + if(WITH_LIBXML) +- if (NOT LIBXML_LIBRARY) ++ find_package(libxml2 CONFIG REQUIRED) ++ if (0) + find_library(LIBXML_LIBRARY + NAMES libxml2.lib xml2 + PATHS /usr/lib /usr/local/lib +@@ -473,7 +474,7 @@ if(WITH_LIBXML) + ) + endif() + +- if (NOT LIBXML_INCLUDE_DIR) ++ if (0) + find_path(LIBXML_INCLUDE_DIR + NAMES libxml/parser.h + PATHS ${LIBSBML_DEPENDENCY_DIR}/include +@@ -491,10 +492,10 @@ if(WITH_LIBXML) + set(USE_LIBXML ON) + + set(LIBSBML_XML_LIBRARY "libxml2") +- set(LIBSBML_XML_LIBRARY_INCLUDE ${LIBXML_INCLUDE_DIR}) +- set(LIBSBML_XML_LIBRARY_LIBS ${LIBXML_LIBRARY}) ++ set(LIBSBML_XML_LIBRARY_INCLUDE ${LIBXML2_INCLUDE_DIRS}) ++ set(LIBSBML_XML_LIBRARY_LIBS ${LIBXML2_LIBRARIES}) + +- if(NOT EXISTS "${LIBXML_INCLUDE_DIR}/libxml/parser.h") ++ if(0) + message(FATAL_ERROR + "The include directory specified for libxml appears to be invalid. + It should contain the file libxml/parser.h, but it does not.") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 11158db..c61cb2b 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -496,7 +496,8 @@ if (LIBSBML_SHARED_VERSION) + VERSION ${LIBSBML_VERSION_MAJOR}.${LIBSBML_VERSION_MINOR}.${LIBSBML_VERSION_PATCH}) + endif() + +-target_link_libraries(${LIBSBML_LIBRARY} ${LIBSBML_LIBS} ${EXTRA_LIBS}) ++target_include_directories(${LIBSBML_LIBRARY} PRIVATE ${LIBXML2_INCLUDE_DIRS}) ++target_link_libraries(${LIBSBML_LIBRARY} ${LIBSBML_LIBS} ${EXTRA_LIBS} ${LIBXML2_LIBRARIES}) + + INSTALL(TARGETS ${LIBSBML_LIBRARY} EXPORT ${LIBSBML_LIBRARY}-config + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +@@ -533,7 +534,8 @@ if (WIN32 AND NOT CYGWIN) + set_target_properties(${LIBSBML_LIBRARY}-static PROPERTIES COMPILE_DEFINITIONS "LIBLAX_STATIC=1;LIBSBML_STATIC=1") + endif(WIN32 AND NOT CYGWIN) + +-target_link_libraries(${LIBSBML_LIBRARY}-static ${LIBSBML_LIBS} ${EXTRA_LIBS}) ++target_include_directories(${LIBSBML_LIBRARY}-static PRIVATE ${LIBXML2_INCLUDE_DIRS}) ++target_link_libraries(${LIBSBML_LIBRARY}-static ${LIBSBML_LIBS} ${EXTRA_LIBS} ${LIBXML2_LIBRARIES}) + + INSTALL(TARGETS ${LIBSBML_LIBRARY}-static + EXPORT ${LIBSBML_LIBRARY}-static-config diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index ed7749daa979b7..1a284635a53fc6 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -7,13 +7,16 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} - PATCHES fix-linkage-type.patch + PATCHES + fix-linkage-type.patch + fix-dependency-libxml2.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC_LIBRARY) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES comp ENABLE_COMP fbc ENABLE_FBC groups ENABLE_GROUPS @@ -50,7 +53,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja + PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} -DWITH_EXPAT=${WITH_EXPAT} -DWITH_LIBXML=${WITH_LIBXML} diff --git a/ports/libspatialite/CONTROL b/ports/libspatialite/CONTROL index 6ab4b3f4fd97b4..a44f701dc38116 100644 --- a/ports/libspatialite/CONTROL +++ b/ports/libspatialite/CONTROL @@ -1,6 +1,6 @@ Source: libspatialite Version: 5.0.0 -Port-Version: 1 +Port-Version: 2 Homepage: https://www.gaia-gis.it/gaia-sins/libspatialite-sources Description: SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities. Build-Depends: libxml2, sqlite3, geos, proj4, zlib, freexl, libiconv, librttopo diff --git a/ports/libspatialite/fix-dependency-libxml2.patch b/ports/libspatialite/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..19b486b2218d53 --- /dev/null +++ b/ports/libspatialite/fix-dependency-libxml2.patch @@ -0,0 +1,13 @@ +diff --git a/makefile.vc b/makefile.vc +index 51c1e03..7e48111 100644 +--- a/makefile.vc ++++ b/makefile.vc +@@ -92,7 +92,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + + SPATIALITE_DLL = spatialite$(VERSION).dll + +-CFLAGS = /nologo -I.\src\headers -I.\src\topology \ ++CFLAGS = /nologo -I.\src\headers -I.\src\topology -I$(LIBXML2_INC)\ + -I. $(OPTFLAGS) + + default: all diff --git a/ports/libspatialite/portfile.cmake b/ports/libspatialite/portfile.cmake index 84c49da3a72f0a..b747bc2e2c64b0 100644 --- a/ports/libspatialite/portfile.cmake +++ b/ports/libspatialite/portfile.cmake @@ -11,21 +11,32 @@ vcpkg_extract_source_archive_ex( PATCHES fix-makefiles.patch fix-linux-configure.patch + fix-dependency-libxml2.patch ) if (VCPKG_TARGET_IS_WINDOWS) if(VCPKG_CRT_LINKAGE STREQUAL dynamic) set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib") set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib") - set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib") - set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib") + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib" ) + set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2d.lib" ) + else() + set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2s.lib" ) + set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2sd.lib" ) + endif() set(LIBRTTOPO_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/librttopo.lib") set(LIBRTTOPO_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/librttopo.lib") else() set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib") set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib") - set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib") - set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib") + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib" ) + set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2d.lib ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib" ) + else() + set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2s.lib ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib" ) + set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2sd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib" ) + endif() set(LIBRTTOPO_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/librttopo.lib") set(LIBRTTOPO_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/librttopo.lib") endif() @@ -65,6 +76,7 @@ if (VCPKG_TARGET_IS_WINDOWS) SOURCE_PATH ${SOURCE_PATH} OPTIONS "CL_FLAGS=/DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" + "LIBXML2_INC=${CURRENT_INSTALLED_DIR}/include/libxml2" OPTIONS_RELEASE ${OPTIONS_RELEASE} OPTIONS_DEBUG @@ -106,7 +118,7 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) # Build in UNIX AUTOCONFIG OPTIONS "LIBS=-lpthread -ldl -lm -l${STDLIB}" - "LIBXML2_CFLAGS=-I\"${CURRENT_INSTALLED_DIR}/include\"" + "LIBXML2_CFLAGS=-I\"${CURRENT_INSTALLED_DIR}/include/libxml2\"" "--enable-rttopo" "--enable-gcp" "--enable-geocallbacks" diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt index da1fcd7fcc81b0..05647fb478f3a8 100644 --- a/ports/libxml2/CMakeLists.txt +++ b/ports/libxml2/CMakeLists.txt @@ -1,176 +1,792 @@ -cmake_minimum_required(VERSION 3.8) -project(libxml2 C) +cmake_minimum_required(VERSION 3.15) + +project(libxml2 VERSION 2.9.10 LANGUAGES C) + +include(CheckCSourceCompiles) +include(CheckFunctionExists) +include(CheckIncludeFiles) +include(CheckLibraryExists) +include(CheckStructHasMember) +include(CheckSymbolExists) +include(CMakePackageConfigHelpers) include(GNUInstallDirs) -set(WITH_TRIO 0 CACHE BOOL "Add trio support") -set(WITH_THREADS 1 CACHE BOOL "Add multithread support") -set(WITH_THREAD_ALLOC 0 CACHE BOOL "Add per-thread memory") -set(WITH_TREE 1 CACHE BOOL "Add the DOM like tree manipulation APIs") -set(WITH_OUTPUT 1 CACHE BOOL "Add the serialization support") -set(WITH_PUSH 1 CACHE BOOL "Add the PUSH parser interfaces") -set(WITH_READER 1 CACHE BOOL "Add the xmlReader parsing interface") -set(WITH_PATTERN 1 CACHE BOOL "Add the xmlPattern selection interface") -set(WITH_WRITER 1 CACHE BOOL "Add the xmlWriter saving interface") -set(WITH_SAX1 1 CACHE BOOL "Add the older SAX1 interface") -set(WITH_VALID 1 CACHE BOOL "Add the DTD validation support") -set(WITH_HTML 1 CACHE BOOL "Add the HTML support") -set(WITH_LEGACY 1 CACHE BOOL "Add deprecated APIs for compatibility") -set(WITH_C14N 1 CACHE BOOL "Add the Canonicalization support") -set(WITH_CATALOG 1 CACHE BOOL "Add the Catalog support") -set(WITH_DOCB 1 CACHE BOOL "Add Docbook SGML support") -set(WITH_XPATH 1 CACHE BOOL "Add the XPATH support") -set(WITH_XPTR 1 CACHE BOOL "Add the XPointer support") -set(WITH_XINCLUDE 1 CACHE BOOL "Add the XInclude support") -set(WITH_ICONV 1 CACHE BOOL "Add ICONV support") -set(WITH_ICU 0 CACHE BOOL "Add ICU support") -set(WITH_ISO8859X 1 CACHE BOOL "Add ISO8859X support if no iconv") -set(WITH_DEBUG 1 CACHE BOOL "Add the memory debugging module") -set(WITH_MEM_DEBUG 0 CACHE BOOL "Add the memory debugging module") -set(WITH_RUN_DEBUG 0 CACHE BOOL "Add the runtime debugging module") -set(WITH_REGEXPS 1 CACHE BOOL "Add Regular Expressions support") -set(WITH_SCHEMAS 1 CACHE BOOL "Add Relax-NG and Schemas support") -set(WITH_SCHEMATRON 1 CACHE BOOL "Add Schematron support") -set(WITH_MODULES 1 CACHE BOOL "Add the dynamic modules support") -set(WITH_ZLIB 1 CACHE BOOL "Add zlib support") -set(WITH_LZMA 1 CACHE BOOL "Add liblzma support") -set(WITH_HTTP 1 CACHE BOOL "Add the HTTP support") -set(WITH_FTP 1 CACHE BOOL "Add the FTP support") - -option(INSTALL_HEADERS "Install public header files" ON) - -set(MODULE_EXTENSION ".so") - -set(CMAKE_SHARED_LIBRARY_PREFIX) -set(CMAKE_STATIC_LIBRARY_PREFIX) - -find_package(ZLIB REQUIRED) -find_package(LibLZMA REQUIRED) -find_package(Iconv REQUIRED) - -file(GLOB SOURCES *.c) -list(FILTER SOURCES EXCLUDE REGEX "/(run|test|trio)[^/]*$") -list(FILTER SOURCES EXCLUDE REGEX "xml(lint|catalog).c$") -list(FILTER SOURCES EXCLUDE REGEX "rngparser\.c$") - -# Generate xmlexports with fixed definition of LIBXML_STATIC -file(READ include/libxml/xmlexports.h XMLEXPORTS_H) -if(BUILD_SHARED_LIBS) - string(REPLACE "!defined(LIBXML_STATIC)" "1" XMLEXPORTS_H "${XMLEXPORTS_H}") -else() - string(REPLACE "!defined(LIBXML_STATIC)" "0" XMLEXPORTS_H "${XMLEXPORTS_H}") + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +set(LIBXML2_WITH_AUTOMATA ON) +option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON) +option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON) +option(LIBXML2_WITH_DEBUG "Add the debugging module" ON) +option(LIBXML2_WITH_DOCB "Add Docbook SGML support" ON) +set(LIBXML2_WITH_EXPR ON) +option(LIBXML2_WITH_FTP "Add the FTP support" ON) +option(LIBXML2_WITH_HTML "Add the HTML support" ON) +option(LIBXML2_WITH_HTTP "Add the HTTP support" ON) +option(LIBXML2_WITH_ICONV "Add ICONV support" ON) +option(LIBXML2_WITH_ICU "Add ICU support" OFF) +option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" ON) +option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" ON) +option(LIBXML2_WITH_LZMA "Use liblzma" ON) +option(LIBXML2_WITH_MEM_DEBUG "Add the memory debugging module" OFF) +option(LIBXML2_WITH_MODULES "Add the dynamic modules support" ON) +option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON) +option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" ON) +option(LIBXML2_WITH_PROGRAMS "Build programs" ON) +option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON) +option(LIBXML2_WITH_PYTHON "Build Python bindings" ON) +option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON) +option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON) +option(LIBXML2_WITH_RUN_DEBUG "Add the runtime debugging module" OFF) +option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON) +option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON) +option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON) +option(LIBXML2_WITH_TESTS "Build tests" ON) +option(LIBXML2_WITH_THREADS "Add multithread support" ON) +option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF) +option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON) +set(LIBXML2_WITH_TRIO OFF) +set(LIBXML2_WITH_UNICODE ON) +option(LIBXML2_WITH_VALID "Add the DTD validation support" ON) +option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON) +option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON) +option(LIBXML2_WITH_XPATH "Add the XPATH support" ON) +option(LIBXML2_WITH_XPTR "Add the XPointer support" ON) +option(LIBXML2_WITH_ZLIB "Use libz" ON) +set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite") + +if(LIBXML2_WITH_ICONV) + find_package(Iconv REQUIRED) endif() -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/xmlexports.h "${XMLEXPORTS_H}") -if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - configure_file(include/win32config.h config.h COPYONLY) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - configure_file("${PORT_DIR}/config.osx.h" config.h COPYONLY) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - configure_file("${PORT_DIR}/config.linux.h" config.h COPYONLY) -else() - message(FATAL_ERROR "No config.h checked in for the target platform. Please run ./configure for libxml2 and add the resulting config.h into this port.") +if(LIBXML2_WITH_ICU) + find_package(ICU REQUIRED COMPONENTS data i18n uc) endif() -message(STATUS "Reading version info from configure.ac") +if(LIBXML2_WITH_LZMA) + find_package(liblzma CONFIG REQUIRED) +endif() -file(STRINGS "configure.ac" - _libxml_version_defines REGEX "LIBXML_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") +if(LIBXML2_WITH_PYTHON) + check_include_files(unistd.h HAVE_UNISTD_H) + check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL) + if(HAVE_UNISTD_H AND HAVE_F_GETFL) + find_package(Python COMPONENTS Interpreter Development REQUIRED) + else() + find_package(Python2 COMPONENTS Interpreter Development REQUIRED) + add_library(Python::Python ALIAS Python2::Python) + set(Python_EXECUTABLE ${Python2_EXECUTABLE}) + set(Python_SITEARCH ${Python2_SITEARCH}) + endif() + set(LIBXML2_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory") +endif() -foreach(ver ${_libxml_version_defines}) - if(ver MATCHES "LIBXML_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") - set(LIBXML_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}" CACHE INTERNAL "") - endif() +if(LIBXML2_WITH_THREADS) + find_package(Threads REQUIRED) +endif() + +if(LIBXML2_WITH_ZLIB) + find_package(ZLIB REQUIRED) +endif() + +foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_DOCB WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MEM_DEBUG WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_RUN_DEBUG WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_TRIO WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_ZLIB) + if(LIBXML2_${VARIABLE}) + set(${VARIABLE} 1) + else() + set(${VARIABLE} 0) + endif() endforeach() -set(VERSION ${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}) -math(EXPR LIBXML_VERSION_NUMBER - "${LIBXML_MAJOR_VERSION} * 10000 + ${LIBXML_MINOR_VERSION} * 100 + ${LIBXML_MICRO_VERSION}") +set(LIBXML_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) +set(LIBXML_MINOR_VERSION ${PROJECT_VERSION_MINOR}) +set(LIBXML_MICRO_VERSION ${PROJECT_VERSION_PATCH}) + +set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}") +set(LIBXML_VERSION ${LIBXML_MAJOR_VERSION}0${LIBXML_MINOR_VERSION}0${LIBXML_MICRO_VERSION}) +set(LIBXML_VERSION_STRING "${LIBXML_VERSION}") +set(LIBXML_VERSION_EXTRA "") +set(LIBXML_VERSION_NUMBER ${LIBXML_VERSION}) + +set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}") -message(STATUS "LIBXML_MAJOR_VERSION: ${LIBXML_MAJOR_VERSION}") -message(STATUS "LIBXML_MINOR_VERSION: ${LIBXML_MINOR_VERSION}") -message(STATUS "LIBXML_MICRO_VERSION: ${LIBXML_MICRO_VERSION}") -message(STATUS "VERSION: ${VERSION}") -message(STATUS "LIBXML_VERSION_NUMBER: ${LIBXML_VERSION_NUMBER}") +set(PACKAGE "libxml2") +set(PACKAGE_BUGREPORT "xml@gnome.org") +set(PACKAGE_NAME "libxml2") +set(PACKAGE_STRING "libxml2 ${VERSION}") +set(PACKAGE_TARNAME "libxml2") +set(PACKAGE_URL "http://www.xmlsoft.org/") +set(PACKAGE_VERSION ${VERSION}) -if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(WITH_CATALOG 0) - set(WITH_MODULES 0) +if(LIBLZMA_FOUND) + list(APPEND CMAKE_REQUIRED_LIBRARIES LibLZMA::LibLZMA) endif() -message(STATUS "Generating xmlversion.h") +if(Threads_FOUND) + list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads) +endif() -configure_file(include/libxml/xmlversion.h.in include/libxml/xmlversion.h) +if(ZLIB_FOUND) + list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) +endif() -add_library(libxml2 ${SOURCES}) -if(INSTALL_HEADERS) - file(GLOB PUBLIC_HEADERS include/libxml/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/libxml/xmlversion.h) - list(FILTER PUBLIC_HEADERS EXCLUDE REGEX "xmlexports\\.h$") - list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/xmlexports.h) +if(MSVC) + configure_file(include/win32config.h config.h COPYONLY) +else() + check_c_source_compiles(" + void __attribute__((destructor)) + f(void) {} + int main(void) { return 0; } + " ATTRIBUTE_DESTRUCTOR) + check_c_source_compiles(" + #include + int main() { (void) gethostbyname((const char*) \"\"); return 0; } + " GETHOSTBYNAME_ARG_CAST_CONST) + if(NOT GETHOSTBYNAME_ARG_CAST_CONST) + set(GETHOSTBYNAME_ARG_CAST "(char *)") + else() + set(GETHOSTBYNAME_ARG_CAST "/**/") + endif() + check_include_files(arpa/inet.h HAVE_ARPA_INET_H) + check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H) + check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h;sys/types.h" HAVE_SS_FAMILY) + check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h;sys/types.h" HAVE_BROKEN_SS_FAMILY) + if(HAVE_BROKEN_SS_FAMILY) + set(ss_family __ss_family) + endif() + check_function_exists(class HAVE_CLASS) + check_include_files(ctype.h HAVE_CTYPE_H) + check_include_files(dirent.h HAVE_DIRENT_H) + check_include_files(dlfcn.h HAVE_DLFCN_H) + check_library_exists(dl dlopen "" HAVE_DLOPEN) + check_include_files(dl.h HAVE_DL_H) + check_include_files(errno.h HAVE_ERRNO_H) + check_include_files(fcntl.h HAVE_FCNTL_H) + check_function_exists(finite HAVE_FINITE) + check_include_files(float.h HAVE_FLOAT_H) + check_function_exists(fpclass HAVE_FPCLASS) + check_function_exists(fprintf HAVE_FPRINTF) + check_function_exists(fp_class HAVE_FP_CLASS) + check_function_exists(ftime HAVE_FTIME) + check_function_exists(getaddrinfo HAVE_GETADDRINFO) + check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) + check_include_files(inttypes.h HAVE_INTTYPES_H) + check_function_exists(isascii HAVE_ISASCII) + check_function_exists(isinf HAVE_ISINF) + check_function_exists(isnan HAVE_ISNAN) + check_function_exists(isnand HAVE_ISNAND) + check_library_exists(history append_history "" HAVE_LIBHISTORY) + check_library_exists(lzma lzma_code "" HAVE_LIBLZMA) + check_library_exists(pthread pthread_join "" HAVE_LIBPTHREAD) + check_library_exists(readline readline "" HAVE_LIBREADLINE) + check_library_exists(z gzread "" HAVE_LIBZ) + check_include_files(limits.h HAVE_LIMITS_H) + check_function_exists(localtime HAVE_LOCALTIME) + check_include_files(lzma.h HAVE_LZMA_H) + check_include_files(malloc.h HAVE_MALLOC_H) + check_include_files(math.h HAVE_MATH_H) + check_include_files(memory.h HAVE_MEMORY_H) + check_function_exists(mmap HAVE_MMAP) + check_function_exists(munmap HAVE_MUNMAP) + check_symbol_exists(DIR ndir.h HAVE_NDIR_H) + check_include_files(netdb.h HAVE_NETDB_H) + check_include_files(netinet/in.h HAVE_NETINET_IN_H) + check_include_files(poll.h HAVE_POLL_H) + check_function_exists(printf HAVE_PRINTF) + check_include_files(pthread.h HAVE_PTHREAD_H) + check_function_exists(putenv HAVE_PUTENV) + check_function_exists(rand HAVE_RAND) + check_function_exists(rand_r HAVE_RAND_R) + check_include_files(resolv.h HAVE_RESOLV_H) + check_library_exists(dld shl_load "" HAVE_SHLLOAD) + check_function_exists(signal HAVE_SIGNAL) + check_include_files(signal.h HAVE_SIGNAL_H) + check_function_exists(snprintf HAVE_SNPRINTF) + check_function_exists(sprintf HAVE_SPRINTF) + check_function_exists(srand HAVE_SRAND) + check_function_exists(sscanf HAVE_SSCANF) + check_function_exists(stat HAVE_STAT) + check_include_files(stdarg.h HAVE_STDARG_H) + check_include_files(stdint.h HAVE_STDINT_H) + check_include_files(stdlib.h HAVE_STDLIB_H) + check_function_exists(strftime HAVE_STRFTIME) + check_include_files(strings.h HAVE_STRINGS_H) + check_include_files(string.h HAVE_STRING_H) + check_symbol_exists(DIR sys/dir.h HAVE_SYS_DIR_H) + check_include_files(sys/mman.h HAVE_SYS_MMAN_H) + check_symbol_exists(DIR sys/ndir.h HAVE_SYS_NDIR_H) + check_include_files(sys/select.h HAVE_SYS_SELECT_H) + check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) + check_include_files(sys/stat.h HAVE_SYS_STAT_H) + check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H) + check_include_files(sys/time.h HAVE_SYS_TIME_H) + check_include_files(sys/types.h HAVE_SYS_TYPES_H) + check_function_exists(time HAVE_TIME) + check_include_files(time.h HAVE_TIME_H) + check_include_files(unistd.h HAVE_UNISTD_H) + check_function_exists(va_copy HAVE_VA_COPY) + check_function_exists(vfprintf HAVE_VFPRINTF) + check_function_exists(vsnprintf HAVE_VSNPRINTF) + check_function_exists(vsprintf HAVE_VSPRINTF) + check_function_exists(__va_copy HAVE___VA_COPY) + check_c_source_compiles(" + #include + #include + extern + #ifdef __cplusplus + \"C\" + #endif + #if defined(__STDC__) || defined(__cplusplus) + size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft); + #else + size_t iconv(); + #endif + int main() { return 0; } + " ICONV_CONST_TEST) + if(NOT ICONV_CONST_TEST) + set(ICONV_CONST "const") + endif() + set(LT_OBJDIR ".libs/") + check_c_source_compiles(" + #include + #include + int main() { (void) send(1, (const char*) \"\", 1, 1); return 0; } + " SEND_ARG2_CAST_CONST) + if(NOT SEND_ARG2_CAST_CONST) + set(SEND_ARG2_CAST "(char *)") + else() + set(SEND_ARG2_CAST "/**/") + endif() + check_include_files("float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS) + check_c_source_compiles(" + #include + void a(va_list* ap) {}; + int main() { va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1; return 0; } + " VA_LIST_IS_ARRAY_TEST) + if(VA_LIST_IS_ARRAY_TEST) + set(VA_LIST_IS_ARRAY FALSE) + else() + set(VA_LIST_IS_ARRAY TRUE) + endif() + check_c_source_compiles(" + #include + #include + #include + int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; } + " XML_SOCKLEN_T_SOCKLEN_T) + if(XML_SOCKLEN_T_SOCKLEN_T) + set(XML_SOCKLEN_T socklen_t) + else() + check_c_source_compiles(" + #include + #include + #include + int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; } + " XML_SOCKLEN_T_SIZE_T) + if(XML_SOCKLEN_T_SIZE_T) + set(XML_SOCKLEN_T size_t) + else() + check_c_source_compiles(" + #include + #include + #include + int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; } + " XML_SOCKLEN_T_INT) + set(XML_SOCKLEN_T int) + endif() + endif() + configure_file(config.h.cmake.in config.h) +endif() + +set( + LIBXML2_HDRS + include/libxml/c14n.h + include/libxml/catalog.h + include/libxml/chvalid.h + include/libxml/debugXML.h + include/libxml/dict.h + include/libxml/DOCBparser.h + include/libxml/encoding.h + include/libxml/entities.h + include/libxml/globals.h + include/libxml/hash.h + include/libxml/HTMLparser.h + include/libxml/HTMLtree.h + include/libxml/list.h + include/libxml/nanoftp.h + include/libxml/nanohttp.h + include/libxml/parser.h + include/libxml/parserInternals.h + include/libxml/pattern.h + include/libxml/relaxng.h + include/libxml/SAX.h + include/libxml/SAX2.h + include/libxml/schemasInternals.h + include/libxml/schematron.h + include/libxml/threads.h + include/libxml/tree.h + include/libxml/uri.h + include/libxml/valid.h + include/libxml/xinclude.h + include/libxml/xlink.h + include/libxml/xmlIO.h + include/libxml/xmlautomata.h + include/libxml/xmlerror.h + include/libxml/xmlexports.h + include/libxml/xmlmemory.h + include/libxml/xmlmodule.h + include/libxml/xmlreader.h + include/libxml/xmlregexp.h + include/libxml/xmlsave.h + include/libxml/xmlschemas.h + include/libxml/xmlschemastypes.h + include/libxml/xmlstring.h + include/libxml/xmlunicode.h + include/libxml/xmlwriter.h + include/libxml/xpath.h + include/libxml/xpathInternals.h + include/libxml/xpointer.h +) + +set( + LIBXML2_SRCS + buf.c + c14n.c + catalog.c + chvalid.c + debugXML.c + dict.c + encoding.c + entities.c + error.c + globals.c + hash.c + HTMLparser.c + HTMLtree.c + legacy.c + list.c + nanoftp.c + nanohttp.c + parser.c + parserInternals.c + pattern.c + relaxng.c + SAX.c + SAX2.c + schematron.c + threads.c + tree.c + uri.c + valid.c + xinclude.c + xlink.c + xmlIO.c + xmlmemory.c + xmlmodule.c + xmlreader.c + xmlregexp.c + xmlsave.c + xmlschemas.c + xmlschemastypes.c + xmlstring.c + xmlunicode.c + xmlwriter.c + xpath.c + xpointer.c + xzlib.c +) + +if(WIN32) + list(APPEND LIBXML2_SRCS win32/libxml2.rc) + file( + WRITE + ${CMAKE_CURRENT_BINARY_DIR}/rcVersion.h + "#define LIBXML_MAJOR_VERSION ${LIBXML_MAJOR_VERSION}\n" + "#define LIBXML_MINOR_VERSION ${LIBXML_MINOR_VERSION}\n" + "#define LIBXML_MICRO_VERSION ${LIBXML_MICRO_VERSION}\n" + "#define LIBXML_DOTTED_VERSION \"${VERSION}\"\n" + ) +endif() + +if(LIBXML2_WITH_SAX1) + list(APPEND LIBXML2_SRCS DOCBparser.c) +endif() + +if(LIBXML2_WITH_TRIO) + list(APPEND LIBXML2_SRCS trio.c triostr.c) +endif() + +add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS}) + +if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(LibXml2 INTERFACE LIBXML_STATIC) + set(XML_CFLAGS "-DLIBXML_STATIC") +endif() + +if(LIBXML2_WITH_THREADS) + target_compile_definitions(LibXml2 PRIVATE _REENTRANT) + if(WIN32) + target_compile_definitions(LibXml2 PRIVATE HAVE_WIN32_THREADS) + endif() +endif() + +target_include_directories( + LibXml2 + PUBLIC + $ + $ + $/${CMAKE_INSTALL_INCLUDEDIR}/libxml2> +) + +if(HAVE_DLOPEN) + target_link_libraries(LibXml2 PRIVATE dl) + set(MODULE_PLATFORM_LIBS "-ldl") +endif() + +if(HAVE_SHLLOAD) + target_link_libraries(LibXml2 PRIVATE dld) + set(MODULE_PLATFORM_LIBS "-ldld") +endif() + +if(UNIX) + target_link_libraries(LibXml2 PRIVATE m) + set(M_LIBS "-lm") +endif() + +if(WIN32) + target_link_libraries(LibXml2 PRIVATE ws2_32) + target_compile_options(LibXml2 PRIVATE /wd4996) + set(WIN32_EXTRA_LIBADD "-lws2_32") +endif() - set_target_properties(libxml2 PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") +if(LIBXML2_WITH_ICONV) + target_include_directories(LibXml2 PUBLIC ${Iconv_INCLUDE_DIRS}) + target_link_libraries(LibXml2 PUBLIC ${Iconv_LIBRARIES}) + if(NOT Iconv_IS_BUILT_IN) + set(ICONV_LIBS "-liconv") + endif() endif() -target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBLZMA_INCLUDE_DIRS}) -get_property(LIBRARIES TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES) -if(LIBRARIES) - set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "") - foreach(LIBRARY ${LIBRARIES}) - # Since `libc.so` has no SONAME, CMake maps e.g. `/usr/lib/x86_64-linux-gnu/libc.so` to `-llibc`. - # This is not found: it should be mapped to `-lc`. - if(LIBRARY MATCHES "/libc\\.so$") - set_property(TARGET Iconv::Iconv APPEND PROPERTY INTERFACE_LINK_LIBRARIES "c") + +if(LIBXML2_WITH_ICU) + target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc) + if(WIN32) + set(ICU_LIBS "-licudt -licuin -licuuc") + else() + set(ICU_LIBS "-licudata -licui18n -licuuc") + endif() +endif() + +if(LIBXML2_WITH_LZMA) + target_link_libraries(LibXml2 PRIVATE liblzma::liblzma) + if (CMAKE_BUILD_TYPE STREQUAL Debug) + set(LZMA_LIBS "-llzmad") + else() + set(LZMA_LIBS "-llzma") + endif() +endif() + +if(LIBXML2_WITH_THREADS) + target_link_libraries(LibXml2 PRIVATE Threads::Threads) + set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT}) +endif() + +if(LIBXML2_WITH_ZLIB) + target_link_libraries(LibXml2 PRIVATE ZLIB::ZLIB) + if (WIN32) + if (CMAKE_BUILD_TYPE STREQUAL Debug) + set(Z_LIBS "-lzlibd") else() - set_property(TARGET Iconv::Iconv APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${LIBRARY}") + set(Z_LIBS "-lzlib") endif() - endforeach() + else() + set(Z_LIBS "-lz") + endif() endif() -target_link_libraries(libxml2 PRIVATE - Iconv::Iconv - ZLIB::ZLIB - ${LIBLZMA_LIBRARIES} + +set_target_properties( + LibXml2 + PROPERTIES + IMPORT_PREFIX lib + OUTPUT_NAME xml2 + POSITION_INDEPENDENT_CODE ON + PREFIX lib + VERSION ${PROJECT_VERSION} ) -if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - target_include_directories(libxml2 PRIVATE win32/vc10) - target_link_libraries(libxml2 PRIVATE - wsock32.lib - ws2_32.lib - ) - target_compile_definitions(libxml2 PRIVATE - -DHAVE_WIN32_THREADS - _WINSOCK_DEPRECATED_NO_WARNINGS - ) - target_sources(libxml2 PRIVATE win32/libxml2.rc) +set(xml_output_name xml2) + +if(MSVC) + if(BUILD_SHARED_LIBS) + set_target_properties( + LibXml2 + PROPERTIES + DEBUG_POSTFIX d + ) + if (CMAKE_BUILD_TYPE STREQUAL Debug) + set(xml_output_name ${xml_output_name}d) + endif() + else() + set_target_properties( + LibXml2 + PROPERTIES + DEBUG_POSTFIX sd + MINSIZEREL_POSTFIX s + RELEASE_POSTFIX s + RELWITHDEBINFO_POSTFIX s + ) + if (CMAKE_BUILD_TYPE STREQUAL Debug) + set(xml_output_name ${xml_output_name}sd) + else() + set(xml_output_name ${xml_output_name}s) + endif() + endif() +endif() + +if (WIN32) configure_file(rcVersion.h.in include/rcVersion.h @ONLY) endif() -target_compile_definitions(libxml2 PRIVATE - -D_CRT_SECURE_NO_DEPRECATE - -D_CRT_NONSTDC_NO_DEPRECATE - -D_REENTRANT - -DNOLIBTOOL - -DHAVE_ZLIB_H - -DHAVE_LZMA_H +install(FILES ${LIBXML2_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) + +install( + TARGETS LibXml2 + EXPORT LibXml2 + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime ) -if(NOT BUILD_SHARED_LIBS) - target_compile_definitions(libxml2 PRIVATE -DLIBXML_STATIC) + +if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug) +endif() + +if(LIBXML2_WITH_PROGRAMS) + set( + PROGRAMS + xmlcatalog + xmllint + ) + foreach(PROGRAM ${PROGRAMS}) + add_executable(${PROGRAM} ${PROGRAM}.c) + target_link_libraries(${PROGRAM} LibXml2) + if(HAVE_LIBHISTORY) + target_link_libraries(${PROGRAM} history) + endif() + if(HAVE_LIBREADLINE) + target_link_libraries(${PROGRAM} readline) + endif() + install(TARGETS ${PROGRAM} EXPORT LibXml2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs) + endforeach() +endif() + +if(LIBXML2_WITH_TESTS) + enable_testing() + set( + TESTS + runxmlconf + runsuite + testapi + testAutomata + testC14N + testchar + testdict + testHTML + testModule + testlimits + testReader + testrecurse + testRegexp + testRelax + testSAX + testSchemas + testURI + testXPath + ) + foreach(TEST ${TESTS}) + add_executable(${TEST} ${TEST}.c) + target_link_libraries(${TEST} LibXml2) + endforeach() + if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml) + add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR}) + endif() + if(NOT WIN32) + add_test(NAME testapi COMMAND testapi) + endif() + add_test(NAME testchar COMMAND testchar) + add_test(NAME testdict COMMAND testdict) + add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + if(Threads_FOUND) + set( + TESTS_THREADS + runtest + testThreads + ) + foreach(TEST ${TESTS_THREADS}) + add_executable(${TEST} ${TEST}.c) + if(WIN32) + target_compile_definitions(${TEST} PRIVATE HAVE_WIN32_THREADS) + endif() + target_link_libraries(${TEST} LibXml2 Threads::Threads) + endforeach() + add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + endif() endif() -set(TARGET_INSTALL_OPTIONS) -if(INSTALL_HEADERS) - set(TARGET_INSTALL_OPTIONS PUBLIC_HEADER DESTINATION include/libxml) +if(LIBXML2_WITH_PYTHON) + execute_process( + COMMAND + ${Python_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py + ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml + ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml + WORKING_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR} + ) + file(READ python/libxml.py LIBXML_PY) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML_PY}") + file(READ ${CMAKE_CURRENT_BINARY_DIR}/libxml2class.py LIBXML2CLASS_PY) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML2CLASS_PY}") + configure_file(${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in libxml2.py COPYONLY) + add_library( + LibXml2Mod + libxml2-py.c + libxml2-py.h + python/libxml.c + python/libxml_wrap.h + python/types.c + ) + target_include_directories( + LibXml2Mod + PUBLIC + $ + ) + target_link_libraries(LibXml2Mod LibXml2 Python::Python) + set_target_properties( + LibXml2Mod + PROPERTIES + IMPORT_PREFIX lib + OUTPUT_NAME xml2mod + PREFIX lib + VERSION ${PROJECT_VERSION} + ) + install( + TARGETS LibXml2Mod + ARCHIVE DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT development + LIBRARY DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime NAMELINK_COMPONENT development + RUNTIME DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime + ) + if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug) + endif() + install(FILES python/drv_libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime) endif() -install(TARGETS libxml2 - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ${TARGET_INSTALL_OPTIONS} +install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation) +install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation) +install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE) + +configure_package_config_file( + libxml2-config.cmake.cmake.in libxml2-config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION} ) -# pkgconfig -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix "\${prefix}") -set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) -set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) -set(XML_INCLUDEDIR "-I\"\${includedir}\"") +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION} + COMPONENT development +) + +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY ExactVersion +) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION} + COMPONENT development +) + +install( + EXPORT LibXml2 + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION} + NAMESPACE LibXml2:: + FILE libxml2-export.cmake + COMPONENT development +) + +configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) +if(MSVC) + configure_file(include/libxml/xmlwin32version.h.in libxml/xmlwin32version.h) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlwin32version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) +endif() + +if(LIBXML2_WITH_PYTHON) + set(prefix "${CMAKE_INSTALL_PREFIX}") + configure_file(python/setup.py.in setup.py @ONLY) +endif() + +set(XML_INCLUDEDIR "-I\${includedir}/libxml2") +set(XML_LIBDIR "-L\${libdir}") +set(XML_LIBS "-lxml2") +set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_LIBS} ${ICONV_LIBS} ${ICU_LIBS} ${M_LIBS}") + +file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}") +string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}") + +set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}") +set(exec_prefix "\${prefix}") +set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") +set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/libxml-2.0.pc DESTINATION lib/pkgconfig) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development) + +set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..") +configure_file(xml2-config.in xml2-config @ONLY) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development) + +set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2") +set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}") +configure_file(xml2Conf.sh.in xml2Conf.sh @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml2Conf.sh DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development) + +set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime) +set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime) +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${PACKAGE_TARNAME}-dev") +set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel") +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL}) +set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_DEBIAN_PACKAGE_SECTION "devel") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils") +set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-utils") +set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs") +set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING}) +set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL}) +set(CPACK_PACKAGE_CONTACT ${PACKAGE_BUGREPORT}) +set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING}) +set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}") +set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION}) +set(CPACK_PACKAGE_VERSION_MAJOR ${LIBXML_MAJOR_VERSION}) +set(CPACK_PACKAGE_VERSION_MINOR ${LIBXML_MINOR_VERSION}) +set(CPACK_PACKAGE_VERSION_PATCH ${LIBXML_MICRO_VERSION}) +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/Copyright) +set(CPACK_RPM_COMPONENT_INSTALL ON) +set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_NAME}-devel") +set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_NAME}") +set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") +set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME}) +set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL}) +set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils") +set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}") +set(CPACK_RPM_runtime_PACKAGE_NAME "${PACKAGE_NAME}") +set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils") + +include(CPack) \ No newline at end of file diff --git a/ports/libxml2/config.h.cmake.in b/ports/libxml2/config.h.cmake.in new file mode 100644 index 00000000000000..932e6a09f790f1 --- /dev/null +++ b/ports/libxml2/config.h.cmake.in @@ -0,0 +1,288 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if __attribute__((destructor)) is accepted */ +#cmakedefine ATTRIBUTE_DESTRUCTOR 1 + +/* Type cast for the gethostbyname() argument */ +#cmakedefine GETHOSTBYNAME_ARG_CAST @GETHOSTBYNAME_ARG_CAST@ + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ARPA_NAMESER_H 1 + +/* Whether struct sockaddr::__ss_family exists */ +#cmakedefine HAVE_BROKEN_SS_FAMILY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H 1 + +/* Have dlopen based dso */ +#cmakedefine HAVE_DLOPEN 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DL_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `fprintf' function. */ +#cmakedefine HAVE_FPRINTF 1 + +/* Define to 1 if you have the `ftime' function. */ +#cmakedefine HAVE_FTIME 1 + +/* Define if getaddrinfo is there */ +#cmakedefine HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isascii' function. */ +#cmakedefine HAVE_ISASCII 1 + +/* Define if isinf is there */ +#cmakedefine HAVE_ISINF 1 + +/* Define if isnan is there */ +#cmakedefine HAVE_ISNAN 1 + +/* Define if history library is there (-lhistory) */ +#cmakedefine HAVE_LIBHISTORY 1 + +/* Define if pthread library is there (-lpthread) */ +#cmakedefine HAVE_LIBPTHREAD 1 + +/* Define if readline library is there (-lreadline) */ +#cmakedefine HAVE_LIBREADLINE 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localtime' function. */ +#cmakedefine HAVE_LOCALTIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LZMA_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MALLOC_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MATH_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#cmakedefine HAVE_MMAP 1 + +/* Define to 1 if you have the `munmap' function. */ +#cmakedefine HAVE_MUNMAP 1 + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#cmakedefine HAVE_NDIR_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_POLL_H 1 + +/* Define to 1 if you have the `printf' function. */ +#cmakedefine HAVE_PRINTF 1 + +/* Define if is there */ +#cmakedefine HAVE_PTHREAD_H 1 + +/* Define to 1 if you have the `putenv' function. */ +#cmakedefine HAVE_PUTENV 1 + +/* Define to 1 if you have the `rand' function. */ +#cmakedefine HAVE_RAND 1 + +/* Define to 1 if you have the `rand_r' function. */ +#cmakedefine HAVE_RAND_R 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_RESOLV_H 1 + +/* Have shl_load based dso */ +#cmakedefine HAVE_SHLLOAD 1 + +/* Define to 1 if you have the `signal' function. */ +#cmakedefine HAVE_SIGNAL 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#cmakedefine HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `sprintf' function. */ +#cmakedefine HAVE_SPRINTF 1 + +/* Define to 1 if you have the `srand' function. */ +#cmakedefine HAVE_SRAND 1 + +/* Define to 1 if you have the `sscanf' function. */ +#cmakedefine HAVE_SSCANF 1 + +/* Define to 1 if you have the `stat' function. */ +#cmakedefine HAVE_STAT 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strftime' function. */ +#cmakedefine HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#cmakedefine HAVE_SYS_DIR_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#cmakedefine HAVE_SYS_NDIR_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `time' function. */ +#cmakedefine HAVE_TIME 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H 1 + +/* Whether va_copy() is available */ +#cmakedefine HAVE_VA_COPY 1 + +/* Define to 1 if you have the `vfprintf' function. */ +#cmakedefine HAVE_VFPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#cmakedefine HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `vsprintf' function. */ +#cmakedefine HAVE_VSPRINTF 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_ZLIB_H 1 + +/* Whether __va_copy() is available */ +#cmakedefine HAVE___VA_COPY 1 + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST @ICONV_CONST@ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#cmakedefine LT_OBJDIR "@LT_OBJDIR@" + +/* Name of package */ +#define PACKAGE "@PACKAGE@" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "@PACKAGE_NAME@" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PACKAGE_VERSION@" + +/* Type cast for the send() function 2nd arg */ +#cmakedefine SEND_ARG2_CAST @SEND_ARG2_CAST@ + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS 1 + +/* Support for IPv6 */ +#cmakedefine SUPPORT_IP6 1 + +/* Define if va_list is an array type */ +#cmakedefine VA_LIST_IS_ARRAY 1 + +/* Version number of package */ +#cmakedefine VERSION "@VERSION@" + +/* Determine what socket length (socklen_t) data type is */ +#cmakedefine XML_SOCKLEN_T @XML_SOCKLEN_T@ + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#cmakedefine _UINT32_T @_UINT32_T@ + +/* ss_family is not defined here, use __ss_family instead */ +#cmakedefine ss_family @ss_family@ + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#cmakedefine uint32_t @uint32_t@ diff --git a/ports/libxml2/config.linux.h b/ports/libxml2/config.linux.h deleted file mode 100644 index d029e95cfa5d11..00000000000000 --- a/ports/libxml2/config.linux.h +++ /dev/null @@ -1,56 +0,0 @@ -#define GETHOSTBYNAME_ARG_CAST /**/ -#define HAVE_ANSIDECL_H 1 -#define HAVE_ARPA_INET_H 1 -#define HAVE_ARPA_NAMESER_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_DIRENT_H 1 -#define HAVE_DLFCN_H 1 -#define HAVE_DLOPEN /**/ -#define HAVE_ERRNO_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_FTIME 1 -#define HAVE_GETADDRINFO /**/ -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_ISASCII 1 -#define HAVE_LIMITS_H 1 -#define HAVE_LOCALTIME 1 -#define HAVE_LZMA_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MMAP 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_POLL_H 1 -#define HAVE_PTHREAD_H /**/ -#define HAVE_PUTENV 1 -#define HAVE_RAND 1 -#define HAVE_RAND_R 1 -#define HAVE_RESOLV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_SRAND 1 -#define HAVE_STAT 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_MMAN_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TIME 1 -#define HAVE_TIME_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_VA_COPY 1 -#define HAVE_ZLIB_H 1 -#define ICONV_CONST -#define SEND_ARG2_CAST /**/ -#define SUPPORT_IP6 /**/ -#define VA_LIST_IS_ARRAY 1 -#define XML_SOCKLEN_T socklen_t diff --git a/ports/libxml2/config.osx.h b/ports/libxml2/config.osx.h deleted file mode 100644 index 95d83edc1fd232..00000000000000 --- a/ports/libxml2/config.osx.h +++ /dev/null @@ -1,54 +0,0 @@ -#define GETHOSTBYNAME_ARG_CAST /**/ -#define HAVE_ARPA_INET_H 1 -#define HAVE_ARPA_NAMESER_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_DIRENT_H 1 -#define HAVE_DLFCN_H 1 -#define HAVE_DLOPEN /**/ -#define HAVE_ERRNO_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_FTIME 1 -#define HAVE_GETADDRINFO /**/ -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_ISASCII 1 -#define HAVE_LIMITS_H 1 -#define HAVE_LOCALTIME 1 -#define HAVE_LZMA_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MMAP 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_POLL_H 1 -#define HAVE_PTHREAD_H /**/ -#define HAVE_PUTENV 1 -#define HAVE_RAND 1 -#define HAVE_RAND_R 1 -#define HAVE_RESOLV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_SRAND 1 -#define HAVE_STAT 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_MMAN_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TIME 1 -#define HAVE_TIME_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_VA_COPY 1 -#define HAVE_ZLIB_H 1 -#define ICONV_CONST -#define SEND_ARG2_CAST /**/ -#define SUPPORT_IP6 /**/ -#define VA_LIST_IS_ARRAY 1 -#define XML_SOCKLEN_T socklen_t diff --git a/ports/libxml2/fix-pkgconfig.patch b/ports/libxml2/fix-pkgconfig.patch new file mode 100644 index 00000000000000..b295988ff73574 --- /dev/null +++ b/ports/libxml2/fix-pkgconfig.patch @@ -0,0 +1,12 @@ +diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in +index 2653a7c..7e09ba7 100644 +--- a/libxml-2.0.pc.in ++++ b/libxml-2.0.pc.in +@@ -8,6 +8,6 @@ Name: libXML + Version: @VERSION@ + Description: libXML library version2. + Requires: +-Libs: -L${libdir} -lxml2 ++Libs: -L${libdir} -l@xml_output_name@ + Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ + Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/ports/libxml2/libxml2-config.cmake.cmake.in b/ports/libxml2/libxml2-config.cmake.cmake.in new file mode 100644 index 00000000000000..76e5ba1f060c21 --- /dev/null +++ b/ports/libxml2/libxml2-config.cmake.cmake.in @@ -0,0 +1,124 @@ +# libxml2-config.cmake +# -------------------- +# +# Libxml2 cmake module. +# This module sets the following variables: +# +# :: +# +# LIBXML2_INCLUDE_DIR - Directory where LibXml2 headers are located. +# LIBXML2_INCLUDE_DIRS - list of the include directories needed to use LibXml2. +# LIBXML2_LIBRARY - path to the LibXml2 library. +# LIBXML2_LIBRARIES - xml2 libraries to link against. +# LIBXML2_DEFINITIONS - the compiler switches required for using LibXml2. +# LIBXML2_VERSION_MAJOR - The major version of libxml2. +# LIBXML2_VERSION_MINOR - The minor version of libxml2. +# LIBXML2_VERSION_PATCH - The patch version of libxml2. +# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4") +# LIBXML2_MODULES - whether libxml2 has dso support +# LIBXML2_XMLLINT_EXECUTABLE - path to the XML checking tool xmllint coming with LibXml2 + +include("${CMAKE_CURRENT_LIST_DIR}/libxml2-export.cmake") + +@PACKAGE_INIT@ + +set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@) +set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@) +set(LIBXML2_VERSION_PATCH @LIBXML_MICRO_VERSION@) +set(LIBXML2_VERSION_STRING "@VERSION@") +set(LIBXML2_INSTALL_PREFIX ${PACKAGE_PREFIX_DIR}) +set(LIBXML2_INCLUDE_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@/libxml2) +set(LIBXML2_LIBRARY_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@) + +macro(select_library_location target basename) + foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB) + get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG) + get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL) + get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE) + get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO) + + if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE) + set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE}) + elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO) + set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO}) + elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL) + set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL}) + elseif(${basename}_${property}_RELEASE) + set(${basename}_LIBRARY ${${basename}_${property}_RELEASE}) + elseif(${basename}_${property}_RELWITHDEBINFO) + set(${basename}_LIBRARY ${${basename}_${property}_RELWITHDEBINFO}) + elseif(${basename}_${property}_MINSIZEREL) + set(${basename}_LIBRARY ${${basename}_${property}_MINSIZEREL}) + elseif(${basename}_${property}_DEBUG) + set(${basename}_LIBRARY ${${basename}_${property}_DEBUG}) + endif() + endforeach() +endmacro() + +macro(select_executable_location target basename) + get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG) + get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL) + get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE) + get_target_property(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO ${target} IMPORTED_LOCATION_RELWITHDEBINFO) + + if(${basename}_IMPORTED_LOCATION_RELEASE) + set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELEASE}) + elseif(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO) + set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELWITHDEBINFO}) + elseif(${basename}_IMPORTED_LOCATION_MINSIZEREL) + set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_MINSIZEREL}) + elseif(${basename}_IMPORTED_LOCATION_DEBUG) + set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG}) + endif() +endmacro() + +select_library_location(LibXml2::LibXml2 LIBXML2) + +set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY}) +set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) + +include(CMakeFindDependencyMacro) + +if(@LIBXML2_WITH_ICONV@) + find_dependency(Iconv) + list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES}) + list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS}) +endif() +set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) + +if(NOT @BUILD_SHARED_LIBS@) + set(LIBXML2_DEFINITIONS -DLIBXML_STATIC) + + if(@LIBXML2_WITH_THREADS@) + find_dependency(Threads) + list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + endif() + + if(@LIBXML2_WITH_ICU@) + find_dependency(ICU) + list(APPEND LIBXML2_LIBRARIES ICU::data ICU::i18n ICU::uc) + endif() + + if(@LIBXML2_WITH_LZMA@) + find_dependency(liblzma CONFIG) + list(APPEND LIBXML2_LIBRARIES liblzma::liblzma) + endif() + + if(@LIBXML2_WITH_ZLIB@) + find_dependency(ZLIB) + list(APPEND LIBXML2_LIBRARIES ZLIB::ZLIB) + endif() + + if(UNIX) + list(APPEND LIBXML2_LIBRARIES m) + endif() + + if(WIN32) + list(APPEND LIBXML2_LIBRARIES ws2_32) + endif() +endif() + +# whether libxml2 has dso support +set(LIBXML2_MODULES @LIBXML2_WITH_MODULES@) + +mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLLINT_EXECUTABLE) diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index dc1d6d174d853a..755793293d6da2 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -1,14 +1,26 @@ +set(LIBXML2_VER 2.9.10) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GNOME/libxml2 - REF v2.9.10 + REF v${LIBXML2_VER} SHA512 de8d7c6c90f9d0441747deec320c4887faee1fd8aff9289115caf7ce51ab73b6e2c4628ae7eaad4a33a64561d23a92fd5e8a5afa7fa74183bdcd9a7b06bc67f1 HEAD_REF master + PATCHES + fix-pkgconfig.patch ) +# Official configure files file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.cmake.in DESTINATION ${SOURCE_PATH}) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/libxml2-config.cmake.cmake.in DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/rcVersion.h.in DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools LIBXML2_WITH_PROGRAMS +) + if (VCPKG_TARGET_IS_UWP) message(WARNING "Feature network couldn't be enabled on UWP, disable http and ftp automatically.") set(ENABLE_NETWORK 0) @@ -19,16 +31,22 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS - -DPORT_DIR=${CMAKE_CURRENT_LIST_DIR} - -DWITH_HTTP=${ENABLE_NETWORK} - -DWITH_FTP=${ENABLE_NETWORK} - OPTIONS_DEBUG - -DINSTALL_HEADERS=OFF + OPTIONS ${FEATURE_OPTIONS} + -DLIBXML2_WITH_LZMA=ON + -DLIBXML2_WITH_ICONV=ON + -DLIBXML2_WITH_ZLIB=ON + -DLIBXML2_WITH_ICU=OFF + -DLIBXML2_WITH_PYTHON=OFF + -DLIBXML2_WITH_TESTS=OFF + OPTIONS_RELEASE + -DLIBXML2_WITH_DEBUG=OFF + -DLIBXML2_WITH_MEM_DEBUG=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libxml2-${LIBXML2_VER}) + if(VCPKG_TARGET_IS_WINDOWS) if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libxml-2.0.pc" "-lxml2" "-llibxml2") @@ -39,9 +57,16 @@ vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +if ("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES xmlcatalog xmllint AUTO_CLEAN) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/xml2-config ${CURRENT_PACKAGES_DIR}/share/${PORT}/xml2-config) +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libxml2/usage b/ports/libxml2/usage deleted file mode 100644 index fd94c4b4e442da..00000000000000 --- a/ports/libxml2/usage +++ /dev/null @@ -1,5 +0,0 @@ -The package libxml2 is compatible with built-in CMake targets: - - find_package(LibXml2 REQUIRED) - target_include_directories(main PRIVATE ${LIBXML2_INCLUDE_DIR}) - target_link_libraries(main PRIVATE ${LIBXML2_LIBRARIES}) diff --git a/ports/libxml2/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake index 405b94670762ea..c711e89753572c 100644 --- a/ports/libxml2/vcpkg-cmake-wrapper.cmake +++ b/ports/libxml2/vcpkg-cmake-wrapper.cmake @@ -1,33 +1,3 @@ -_find_package(${ARGS}) -if(LibXml2_FOUND) - find_package(LibLZMA) - find_package(ZLIB) - include(SelectLibraryConfigurations) - find_library(ICONV_LIBRARY_DEBUG NAMES iconvd libiconvd iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH) - find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) - find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib) - find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) - find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) - find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib) - select_library_configurations(ICONV) - select_library_configurations(CHARSET) - list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES}) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND LIBXML2_LIBRARIES m) - endif() - if(ICONV_LIBRARIES) - list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES}) - if(TARGET LibXml2::LibXml2) - target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ) - endif() - endif() - if(CHARSET_LIBRARIES) - list(APPEND LIBXML2_LIBRARIES ${CHARSET_LIBRARIES}) - if(TARGET LibXml2::LibXml2) - target_link_libraries(LibXml2::LibXml2 INTERFACE ${CHARSET_LIBRARIES}) - endif() - endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - list(APPEND LIBXML2_LIBRARIES ws2_32) - endif() -endif() +cmake_policy(SET CMP0012 NEW) +cmake_policy(SET CMP0011 NEW) +_find_package(libxml2 CONFIG REQUIRED) \ No newline at end of file diff --git a/ports/libxml2/vcpkg.json b/ports/libxml2/vcpkg.json index c50456d60d7a53..4eddbf439340b6 100644 --- a/ports/libxml2/vcpkg.json +++ b/ports/libxml2/vcpkg.json @@ -1,12 +1,17 @@ { "name": "libxml2", "version-semver": "2.9.10", - "port-version": 6, + "port-version": 7, "description": "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform).", "homepage": "https://xmlsoft.org/", "dependencies": [ "libiconv", "liblzma", "zlib" - ] + ], + "features": { + "tools": { + "description": "Build programs" + } + } } diff --git a/ports/libxmlmm/CMakeLists.txt b/ports/libxmlmm/CMakeLists.txt index 721641a64be0bc..3a7be3aaa5b8bd 100644 --- a/ports/libxmlmm/CMakeLists.txt +++ b/ports/libxmlmm/CMakeLists.txt @@ -4,7 +4,7 @@ project(libxmlmm CXX) set(CMAKE_SHARED_LIBRARY_PREFIX) set(CMAKE_STATIC_LIBRARY_PREFIX) -find_package(LibXml2 REQUIRED) +find_package(libxml2 CONFIG REQUIRED) set(HEADERS_LIBXMLMM libxmlmm/Attribute.h @@ -38,8 +38,7 @@ set(SOURCES_LIBXMLMM ) add_library(libxmlmm ${SOURCES_LIBXMLMM}) -include_directories(${LIBXML2_INCLUDE_DIR}) -target_link_libraries (libxmlmm ${LIBXML2_LIBRARIES}) +target_link_libraries (libxmlmm LibXml2::LibXml2) set_target_properties(libxmlmm PROPERTIES CXX_STANDARD 17 diff --git a/ports/libxmlmm/CONTROL b/ports/libxmlmm/CONTROL index a943bcf289eec9..18d16ee4104e6b 100644 --- a/ports/libxmlmm/CONTROL +++ b/ports/libxmlmm/CONTROL @@ -1,5 +1,6 @@ Source: libxmlmm Version: 0.6.0 +Port-Version: 1 Homepage: https://github.com/rioki/libxmlmm Description: Libxmlmm is a C++ wrapper for libxml 2.0 that only relies on standard C++ and libxml2. Build-Depends: libxml2 diff --git a/ports/libxslt/0004-Fix-libxml2.patch b/ports/libxslt/0004-Fix-libxml2.patch new file mode 100644 index 00000000000000..b3d5e12ebac89b --- /dev/null +++ b/ports/libxslt/0004-Fix-libxml2.patch @@ -0,0 +1,99 @@ +diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc +index f803a74..37fc3e6 100644 +--- a/win32/Makefile.msvc ++++ b/win32/Makefile.msvc +@@ -63,8 +63,10 @@ LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) + LIBS = iconv.lib charset.lib ws2_32.lib + !if "$(DEBUG)" == "1" + LIBS = $(LIBS) zlibd.lib lzmad.lib ++XML2LIB = $(XML2_LIB_DBG) + !else + LIBS = $(LIBS) zlib.lib lzma.lib ++XML2LIB = $(XML2_LIB_REL) + !endif + + # The archiver and its options. +@@ -254,14 +256,14 @@ $(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) + $(LD) $(LDFLAGS) /DLL \ + /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ +- $(XSLT_OBJS) $(LIBS) libxml2.lib ++ $(XSLT_OBJS) $(LIBS) $(XML2LIB) + @$(_VC_MANIFEST_EMBED_DLL) + + #$(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) + # $(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \ + # /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ + # /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ +-# $(XSLT_OBJS) $(LIBS) libxml2.lib ++# $(XSLT_OBJS) $(LIBS) $(XML2LIB) + + # Creates the libxslt archive. + $(BINDIR)\$(XSLT_A) : $(BINDIR) $(XSLT_OBJS_A) +@@ -300,14 +302,14 @@ $(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) lib + $(LD) $(LDFLAGS) /DLL \ + /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ +- $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib ++ $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) $(XML2LIB) + @$(_VC_MANIFEST_EMBED_DLL) + + #$(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt + # $(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \ + # /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ + # /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ +-# $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib ++# $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) $(XML2LIB) + + # Creates the libexslt archive. + $(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta +@@ -321,14 +323,14 @@ $(UTILS_INTDIR) : + # An implicit rule for xsltproc and friends. + APPLIBS = $(LIBS) + !if "$(STATIC)" == "1" +-APPLIBS = $(LIBS) libxml2.lib ++APPLIBS = $(LIBS) $(XML2LIB) + {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \ + $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< + $(LD) $(LDFLAGS) /OUT:$@ $(XSLT_A) $(EXSLT_A) $(APPLIBS) $(UTILS_INTDIR)\$(