From 9584b4fa3bcb8e8a52d43160ef0e595a1da16846 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 18 Mar 2024 15:37:17 -0500 Subject: [PATCH] Replace ENABLE_LIBXML2 with NETCDF_ENABLE_LIBXML2 --- .github/workflows/run_tests_osx.yml | 4 ++-- .github/workflows/run_tests_ubuntu.yml | 4 ++-- CMakeLists.txt | 2 +- RELEASE_NOTES.md | 2 +- cmake/dependencies.cmake | 4 ++-- config.h.cmake.in | 2 +- configure.ac | 2 +- lib_flags.am | 2 +- libncxml/Makefile.am | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run_tests_osx.yml b/.github/workflows/run_tests_osx.yml index c081177cd..4e8faa5b6 100644 --- a/.github/workflows/run_tests_osx.yml +++ b/.github/workflows/run_tests_osx.yml @@ -375,7 +375,7 @@ jobs: run: | mkdir build cd build - LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE + LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE - name: Print Summary shell: bash -l {0} @@ -450,7 +450,7 @@ jobs: run: | mkdir build cd build - LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} + LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - name: Print Summary shell: bash -l {0} diff --git a/.github/workflows/run_tests_ubuntu.yml b/.github/workflows/run_tests_ubuntu.yml index 0ab29a390..7137d724f 100644 --- a/.github/workflows/run_tests_ubuntu.yml +++ b/.github/workflows/run_tests_ubuntu.yml @@ -440,7 +440,7 @@ jobs: run: | mkdir build cd build - LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE + LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE - name: Print Summary shell: bash -l {0} @@ -521,7 +521,7 @@ jobs: run: | mkdir build cd build - LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=FALSE -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} + LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=FALSE -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - name: Print Summary shell: bash -l {0} diff --git a/CMakeLists.txt b/CMakeLists.txt index 747a95fe1..e3560afe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -737,7 +737,7 @@ if(NOT ENABLE_S3) endif() endif() -option(ENABLE_LIBXML2 "Link against libxml2 if it is available, use the packaged tinyxml2 parser otherwise." ON) +option(NETCDF_ENABLE_LIBXML2 "Link against libxml2 if it is available, use the packaged tinyxml2 parser otherwise." ON) set(XMLPARSER "tinyxml2 (bundled)") if(NOT NETCDF_ENABLE_BYTERANGE AND NETCDF_ENABLE_HDF5_ROS3) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 52f62d56a..95aaf9a4e 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -207,7 +207,7 @@ for domain specific info such as used by GDAL/Zarr. See [Github #2278](https://g * [Enhancement] Improve support for msys2+mingw platform. See [Github #2171](https://github.com/Unidata/netcdf-c/pull/2171). * [Bug Fix] Clean up the various inter-test dependencies in ncdump for CMake. See [Github #2168](https://github.com/Unidata/netcdf-c/pull/2168). * [Bug Fix] Fix use of non-aws appliances. See [Github #2152](https://github.com/Unidata/netcdf-c/pull/2152). -* [Enhancement] Added options to suppress the new behavior from [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135). The options for `cmake` and `configure` are, respectively `-DENABLE_LIBXML2` and `--(enable/disable)-libxml2`. Both of these options defaul to 'on/enabled'. When disabled, the bundled `ezxml` XML interpreter is used regardless of whether `libxml2` is present on the system. +* [Enhancement] Added options to suppress the new behavior from [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135). The options for `cmake` and `configure` are, respectively `-DNETCDF_ENABLE_LIBXML2` and `--(enable/disable)-libxml2`. Both of these options defaul to 'on/enabled'. When disabled, the bundled `ezxml` XML interpreter is used regardless of whether `libxml2` is present on the system. * [Enhancement] Support optional use of libxml2, otherwise default to ezxml. See [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135) -- H/T to [Egbert Eich](https://github.com/e4t). * [Bug Fix] Fix several os related errors. See [Github #2138](https://github.com/Unidata/netcdf-c/pull/2138). * [Enhancement] Support byte-range reading of netcdf-3 files stored in private buckets in S3. See [Github #2134](https://github.com/Unidata/netcdf-c/pull/2134) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 27bd1e10e..9c06490ef 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -430,7 +430,7 @@ endif() # LibXML ################################ # see if we have libxml2 -if(ENABLE_LIBXML2) +if(NETCDF_ENABLE_LIBXML2) find_package(LibXml2) if(LibXml2_FOUND) set(HAVE_LIBXML2 TRUE) @@ -442,7 +442,7 @@ if(ENABLE_LIBXML2) else() set(HAVE_LIBXML2 FALSE) endif() -endif(ENABLE_LIBXML2) +endif(NETCDF_ENABLE_LIBXML2) ################################ # MPI diff --git a/config.h.cmake.in b/config.h.cmake.in index 537140ae0..6e5e2a69c 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -302,7 +302,7 @@ are set when opening a binary file on Windows. */ #cmakedefine HAVE_LIBMFHDF 1 /* Define to 1 if you have the libxml2 library. */ -#cmakedefine ENABLE_LIBXML2 1 +#cmakedefine NETCDF_ENABLE_LIBXML2 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1 diff --git a/configure.ac b/configure.ac index e75e427e4..66760d0b9 100644 --- a/configure.ac +++ b/configure.ac @@ -596,7 +596,7 @@ XMLPARSER="tinyxml2 (bundled)" fi # Need a condition and subst for this -AM_CONDITIONAL(ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) +AM_CONDITIONAL(NETCDF_ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) AC_SUBST([XMLPARSER],[${XMLPARSER}]) ### diff --git a/lib_flags.am b/lib_flags.am index a54e32c5e..d3a2cdba6 100644 --- a/lib_flags.am +++ b/lib_flags.am @@ -21,7 +21,7 @@ if ENABLE_S3_AWS AM_LDFLAGS += -lstdc++ endif -if ! ENABLE_LIBXML2 +if ! NETCDF_ENABLE_LIBXML2 # => tinyxml2 AM_LDFLAGS += -lstdc++ endif diff --git a/libncxml/Makefile.am b/libncxml/Makefile.am index f5fab3b10..3cc7af75d 100644 --- a/libncxml/Makefile.am +++ b/libncxml/Makefile.am @@ -11,7 +11,7 @@ include $(top_srcdir)/lib_flags.am -if ENABLE_LIBXML2 +if NETCDF_ENABLE_LIBXML2 AM_CPPFLAGS += ${XML2FLAGS} endif @@ -20,7 +20,7 @@ noinst_LTLIBRARIES = libncxml.la libncxml_la_LIBADD = libncxml_la_LDFLAGS = -if ENABLE_LIBXML2 +if NETCDF_ENABLE_LIBXML2 libncxml_la_SOURCES = ncxml_xml2.c else AM_CXXFLAGS = -std=c++11