Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Compared with the NetCDF version 4.8.1 in MXE, NetCDF 4.9.2 includes several bug fixes for mingw and various other improvements.
XML library
NetCDF uses libxml2 when available, so this has been added to the MXE dependencies. Building static libraries requires the preprocessor macro
LIBXML_STATIC
to be defined, so this has been added to the arguments passed tocmake
.hdf5 library names
The existing MXE package contains a hack to remove
-static|-shared
suffixes from hdf5 library names, as explained in #2948 . This issue seems to be avoided by passing optionHDF5_NO_FIND_PACKAGE_CONFIG_FILE
to the FindHDF5 module in cmake. The option causes FindHDF5 to ignore thehdf5-config.cmake
file created by the hdf5 installation, where the problem seems to originate, and the module searches for the hdf5 libraries instead.pkg-config file
The
netcdf.pc
file created by NetCDF does not contain all of the libraries needed for static linking. As a workaround, this PR provides a patch that adds aRequires.private
field tonetcdf.pc.in
, which refers to the pkg-config files for dependencies. The patch also removes theLibs.private
field, otherwise the libraries are linked in the wrong order. The resultingnetcdf.pc
allows the test program to be linked using only flags and libraries returned by the command'$(TARGET)-pkg-config' $(PKG) --cflags --libs
.