diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml deleted file mode 100644 index 0f9c9a2c5..000000000 --- a/.github/workflows/mingw.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: NetCDF-Build MinGW -on: [workflow_dispatch,push] - -jobs: - build: - runs-on: windows-latest - defaults: - run: - shell: msys2 {0} - steps: - - uses: actions/checkout@v2 - - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - install: git mingw-w64-x86_64-toolchain automake libtool autoconf make mingw-w64-x86_64-hdf5 unzip - - name: CI-Build - shell: msys2 {0} - run: | - echo 'Running in MSYS2!' - set -e - pwd - git clone --single-branch --branch moreosfixes.tmp https://github.com/DennisHeimbigner/netcdf-c.git - cd netcdf-c - autoreconf -i --force - ./configure --prefix=/builddir -enable-shared --disable-static --disable-plugins --disable-logging --disable-dap-remote-tests --disable-byterange - make -j LDFLAGS="-no-undefined -Wl,--export-all-symbols" - make check - diff --git a/.github/workflows/run_tests_win_mingw.yml b/.github/workflows/run_tests_win_mingw.yml index 919c50f23..913920a3a 100644 --- a/.github/workflows/run_tests_win_mingw.yml +++ b/.github/workflows/run_tests_win_mingw.yml @@ -7,7 +7,7 @@ name: Run MSYS2, MinGW64-based Tests -on: [ pull_request ] +on: [pull_request] jobs: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4df431e47..c0065c0ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1747,6 +1747,7 @@ CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP) CHECK_FUNCTION_EXISTS(strndup HAVE_STRNDUP) CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL) +CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) CHECK_FUNCTION_EXISTS(strtoull HAVE_STRTOULL) CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP) CHECK_FUNCTION_EXISTS(mktemp HAVE_MKTEMP) diff --git a/config.h.cmake.in b/config.h.cmake.in index d16a7204b..1754b7508 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -346,12 +346,6 @@ are set when opening a binary file on Windows. */ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H 1 -/* Define to 1 if you have the `strdup' function. */ -#cmakedefine HAVE_STRDUP 1 - -/* Define to 1 if you have the `strndup` function. */ -#cmakedefine HAVE_STRNDUP - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H 1 @@ -367,6 +361,15 @@ are set when opening a binary file on Windows. */ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIBGEN_H 1 +/* Define to 1 if you have the `strdup' function. */ +#cmakedefine HAVE_STRDUP 1 + +/* Define to 1 if you have the `strndup` function. */ +#cmakedefine HAVE_STRNDUP + +/* Define to 1 if you have the `strcasecmp` function. */ +#cmakedefine HAVE_STRCASECMP + /* Define to 1 if you have the `strlcat' function. */ #cmakedefine HAVE_STRLCAT 1 diff --git a/configure.ac b/configure.ac index a687c6036..fa7ebdf34 100644 --- a/configure.ac +++ b/configure.ac @@ -523,6 +523,45 @@ fi CFLAGS="$SAVECFLAGS" +### +# Libxml2 control block. +### + +AC_MSG_CHECKING([whether to search for and use external libxml2]) +AC_ARG_ENABLE([libxml2], + [AS_HELP_STRING([--disable-libxml2], + [disable detection and use of libxml2 in favor of the bundled ezxml interpreter])]) +test "x$enable_libxml2" = xno || enable_libxml2=yes +AC_MSG_RESULT([$enable_libxml2]) + +have_libxml2=no +if test "x$enable_libxml2" = xyes; then + # We can optionally use libxml2 for DAP4, if available + AC_CHECK_LIB([xml2],[xmlReadMemory],[have_libxml2=yes],[have_libxml2=no]) + if test "x$have_libxml2" = "xyes" ; then + AC_SEARCH_LIBS([xmlReadMemory],[xml2 xml2.dll cygxml2.dll], [],[]) + fi + if test "x$have_libxml2" = xyes; then + XML2FLAGS=`xml2-config --cflags` + AC_SUBST([XML2FLAGS],${XML2FLAGS}) + AC_DEFINE([HAVE_LIBXML2], [1], [if true, use libxml2]) + fi +fi + +if test "x$enable_libxml2" = xyes; then +XMLPARSER="libxml2" +else +XMLPARSER="tinyxml2 (bundled)" +fi + +# Need a condition and subst for this +AM_CONDITIONAL(ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) +AC_SUBST([XMLPARSER],[${XMLPARSER}]) + +### +# End Libxml2 block +### + # --enable-dap => enable-dap4 enable_dap4=$enable_dap AC_MSG_CHECKING([whether dap remote testing should be enabled]) @@ -1046,55 +1085,21 @@ AC_CHECK_FUNCS([strlcat snprintf strcasecmp fileno \ AC_CHECK_FUNCS([clock_gettime]) AC_CHECK_TYPES([struct timespec]) -# disable dap4 if netcdf-4 is disabled -#if test "x$enable_netcdf_4" = "xno" ; then +# disable dap4 if hdf5 is disabled if test "x$enable_hdf5" = "xno" ; then AC_MSG_WARN([netcdf-4 not enabled; disabling DAP4]) enable_dap4=no fi +if test "x$ISOSX" = xyes && "x$have_libxml2" = xno ; then + AC_MSG_ERROR([Error: OSX requires libxml2 => --disable-dap4.]) + enable_dap4=no +fi + if test "x$enable_dap4" = xyes; then AC_DEFINE([ENABLE_DAP4], [1], [if true, build DAP4 Client]) fi -### -# Libxml2 control block. -### - -AC_MSG_CHECKING([whether to search for and use external libxml2]) -AC_ARG_ENABLE([libxml2], - [AS_HELP_STRING([--disable-libxml2], - [disable detection and use of libxml2 in favor of the bundled ezxml interpreter])]) -test "x$enable_libxml2" = xno && enable_libxml2=yes -AC_MSG_RESULT($enable_libxml2) - -if test "x$enable_libxml2" = xyes; then - # We can optionally use libxml2 for DAP4, if available - AC_CHECK_LIB([xml2],[xmlReadMemory],[have_libxml2=yes],[have_libxml2=no]) - if test "x$have_libxml2" = "xyes" ; then - AC_SEARCH_LIBS([xmlReadMemory],[xml2 xml2.dll cygxml2.dll], [],[]) - fi - if test "x$have_libxml2" = xyes; then - XML2FLAGS=`xml2-config --cflags` - AC_SUBST([XML2FLAGS],${XML2FLAGS}) - AC_DEFINE([HAVE_LIBXML2], [1], [if true, use libxml2]) - fi -fi - -if test "x$enable_libxml2" = xyes; then -XMLPARSER="libxml2" -else -XMLPARSER="tinyxml2 (bundled)" -fi - -# Need a condition and subst for this -AM_CONDITIONAL(ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes]) -AC_SUBST([XMLPARSER],[${XMLPARSER}]) - -### -# End Libxml2 block -### - # check for useful, but not essential, memio support AC_CHECK_FUNCS([memmove getpagesize sysconf]) diff --git a/dap4_test/Makefile.am b/dap4_test/Makefile.am index 910783e64..ec5623094 100644 --- a/dap4_test/Makefile.am +++ b/dap4_test/Makefile.am @@ -10,6 +10,7 @@ include $(top_srcdir)/lib_flags.am #SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose #LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose #TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose +#TESTS_ENVIRONMENT = export SETX=1; # Note which tests depend on other tests. Necessary for make -j check. TEST_EXTENSIONS = .sh diff --git a/dap4_test/test_data.c b/dap4_test/test_data.c index 137d46e1e..000eca485 100644 --- a/dap4_test/test_data.c +++ b/dap4_test/test_data.c @@ -44,7 +44,7 @@ main(int argc, char** argv) snprintf(url,sizeof(url),"file://%s#dap4&debug=copy%s%s%s", argv[0], (argc >= 3 ? "&substratename=" : ""), - (argc >= 3 ? "argv[1]" : ""), + (argc >= 3 ? argv[1] : ""), #ifdef DEBUG "&log" #else diff --git a/include/ncconfigure.h b/include/ncconfigure.h index 3cc76cab0..cde14a94d 100644 --- a/include/ncconfigure.h +++ b/include/ncconfigure.h @@ -70,7 +70,7 @@ int snprintf(char*, size_t, const char*, ...); #ifndef HAVE_STRCASECMP #ifndef strcasecmp -int strcasecmp(const char*, const char*); +extern int strcasecmp(const char*, const char*); #endif #endif diff --git a/libncxml/Makefile.am b/libncxml/Makefile.am index 2156e560e..3866eae5b 100644 --- a/libncxml/Makefile.am +++ b/libncxml/Makefile.am @@ -29,12 +29,13 @@ endif EXTRA_DIST = CMakeLists.txt license.txt -# Download the tinyxml2 source +# Download and massage the tinyxml2 source REPO = https://github.com/leethomason/tinyxml2.git tinyxml2:: rm -fr ./tinyxml2 ./license.txt git clone --depth=1 ${REPO} cat tinyxml2/LICENSE.txt > ./license.txt cat tinyxml2/tinyxml2.h > ./tinyxml2.h - cat tinyxml2/tinyxml2.cpp > ./tinyxml2.cpp + sed -e 's/__BORLANDC__/__APPLE__/' < tinyxml2/tinyxml2.cpp \ + | sed -e 's/ptrdiff_t/long/g' > ./tinyxml2.cpp rm -fr tinyxml2 diff --git a/libncxml/tinyxml2.cpp b/libncxml/tinyxml2.cpp index 3cbe174c0..dd7bdca32 100644 --- a/libncxml/tinyxml2.cpp +++ b/libncxml/tinyxml2.cpp @@ -24,7 +24,7 @@ distribution. #include "tinyxml2.h" #include // yes, this one new style header, is in the Android SDK. -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__) +#if defined(ANDROID_NDK) || defined(__APPLE__) || defined(__QNXNTO__) # include # include #else @@ -476,7 +476,7 @@ const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) if ( *(p+1) == '#' && *(p+2) ) { unsigned long ucs = 0; TIXMLASSERT( sizeof( ucs ) >= 4 ); - ptrdiff_t delta = 0; + long delta = 0; unsigned mult = 1; static const char SEMICOLON = ';'; diff --git a/ncdump/tst_nccopy4.sh b/ncdump/tst_nccopy4.sh index 7b482a78b..81493b038 100755 --- a/ncdump/tst_nccopy4.sh +++ b/ncdump/tst_nccopy4.sh @@ -7,7 +7,6 @@ set -e # For a netCDF-4 build, test nccopy on netCDF files in this directory -echo "@@@@@@" if test -f tst_group_data${ext} ; then ${execdir}/tst_group_data ; fi if test -f tst_enum_data${ext} ; then ${execdir}/tst_enum_data ; fi if test -f tst_comp${ext} ; then ${execdir}/tst_comp ; fi diff --git a/nczarr_test/run_filter.sh b/nczarr_test/run_filter.sh index 08ce36d0a..78e3f0a7f 100755 --- a/nczarr_test/run_filter.sh +++ b/nczarr_test/run_filter.sh @@ -60,9 +60,6 @@ MISCPATH="${HDF5_PLUGIN_PATH}/${HDF5_PLUGIN_LIB}" if ! test -f ${BZIP2PATH} ; then echo "Unable to locate ${BZIP2PATH}"; exit 1; fi if ! test -f ${MISCPATH} ; then echo "Unable to locate ${MISCPATH}"; exit 1; fi -echo "@@@@@@@@@@@" -find ${HDF5_PLUGIN_PATH} - # Execute the specified tests testapi() {