I was getting the following error while compiling:
```
netcdf-c/libnczarr/zutil.c:544:26: error: called object 'strlen' is not a function or function pointer
544 | if(dnamep) *dnamep = strdup(dname);
| ^~~~~~
netcdf-c/libnczarr/zutil.c:533:68: note: declared here
533 | ncz_nctype2dtype(nc_type nctype, int endianness, int purezarr, int strlen, char** dnamep)
| ~~~~^~~~~~
```
My interpretation is that strdup() is implemented as a macro
which calls strlen() the standard C function, and when that
macro is being substituted here the call to strlen tries
to "call" the integer variable named strlen.
Resolving this by renaming the integer variable to "len"
instead of "strlen", avoiding a conflict with a standard
C library function name.
The use of this function currently runs into problems with multiple definitions: once for each file including ncconfigure.h. Defining this as static rather than extern should hide the definitions from each other.
static inline would still be closer to the definition as a macro, but that requires a #define to work on all platforms (not all compilers have inline yet).
The previous working version specified just -version-info, and specified it for every plugin separately.
This moves -version-info to AM_LDFLAGS and removes -avoid-version from the (previously unused) AM_LDFLAGS.
Cross-compilation targeting MacOS uses -version-info to determine suffix, so hopefully this gets the MacOS tests passing.
Attempting to add a filter to a netCDF file using `nccopy` results in
a file without `_Filter` attribute set. I suspect this is a problem
with HDF5, but I don't remember why and never got around to testing
that. The rest of the plugin tests pass, so I'm telling the test
runner to expect this one test to fail and see if there are other
failures.
Don't install test plugins; don't install any plugins if not
requested.
DEV: Remove plugins installed to ALTPLUGINDIR.
These get put in the build tree if ENABLE_PLUGIN_DIR is not true.
I want to remove these first, then look into skipping the plugins
directory if plugins are disabled.
DEV: don't install plugins if there's no install dir
Still build them, since they might be needed for tests, but don't mark them for install.
BLD, FIX: Add -rpath to noinst plugin links.
Since I stopped installing the plugins, I need to manually add `-rpath` to their link line so `libtool` actually bothers linking them.
Most changes are to get plugins working.
libdispatchdreg.c went in in unidata/netcdf-c#2460,
after I'd done it here.
Summary of individual changes below.
BLD: Remove declspec(dllexport); in dreg.c.
By removing the explicit handling, the automatic handling
(equivalent to --export-all-symbols with recent GNU tools)
will be enabled again, so the generated library will have
more than one function exported.
BLD: Link plugins against libnetcdf on Cygwin.
BLD: Add AM_LDFLAGS to plugin _LDFLAGS to pass -no-undefined.
BLD: Link ncz*filters plugins against libnetcdf.
BLD: Add AM_LDFLAGS to test plugin _LDFLAGS.
Also move rpath from AM_LDFLAGS to test plugin _LDFLAGS.
TST: Don't run nczarr_test/run_specific_filters.sh on Cygwin.
It takes over half an hour to complete, where the others take a minute or less.
TST: Try to find the hanging Cygwin test.