- getdns_context_create with set_from_os set will simply call these
functions with the defaults
+ filechg_check is simplified somewhat (reducting memory management)
+ get OpenSSL version version via get_api_information()
You need autoconf 2.70 (or 2.69 plus patch as in Debian) for runstatedir to be automatically in the configure script. This adds a always-present config option.
When libbsd is found on the system during the configure, the result
of `pkg-config --cflags libbsd-overlay` is added to `CFLAGS`:
`-DLIBBSD_OVERLAY -isystem /usr/include/bsd`
The result of `pkg-config --libs libbsd-overlay` is added to `LIBS`,
but not to `STUBBY_LIBS`, which is used when linking stubby.
Because of the new `CFLAGS`, the preprocessor replaces the call to
`getopt()` in stubby.c with a call to `bsd_getop()`:
```
#ifdef LIBBSD_OVERLAY
#undef getopt
#define getopt(argc, argv, optstr) bsd_getopt(argc, argv, optstr)
#endif
```
But since `-lbsd` has not been added to `STUBBY_LIBS`, the linking of
stubby fails with an unresolved symbol:
```
../libtool --tag=CC --mode=link gcc -o stubby stubby.lo convert_yaml_to_json.lo gbuffer.lo -lyaml libgetdns.la
libtool: link: gcc -o .libs/stubby .libs/stubby.o .libs/convert_yaml_to_json.o .libs/gbuffer.o -lyaml ./.libs/libgetdns.so
/usr/bin/ld: .libs/stubby.o: undefined reference to symbol 'bsd_getopt@@LIBBSD_0.0'
/usr/lib/libbsd.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```
Simply adding the result of `pkg-config --libs libbsd-overlay` to
`STUBBY_LIBS` in addition to `LIBS` fixes the issue.
The previous strategy for Windows of checking for sigset_t and if it failed repeating the check with -D_POSIX did not work as expected. Autoconf found the second instance of the test, thought it was the same as the first, and used the cached result from the first. It was only because a typo did not reset CFLAGS back, so always adding _POSIX, that this worked with mingw.
Change instead to checking for sigset_t and if that fails for _sigset_t, and in config.h if sigset_t does not exist but _sigset_t does then typedef _sigset_t to sigset_t. Also amend the implementation of sigfillset() to cast to sigset_t not _sigset_t; it may not be just mingw that doesn't have sigfilleset().
Also, ensure signal.h is one of the headers included when checking for sigset_t. It's the header Posix says sigset_t is defined in...
Add new extra functions getdns_yaml2(dict|list|bindata|value)(). These are like their getdns_str2() counterparts, but take YAML input rather than JSON.
YAML introduces a new dependency, on libyaml. YAML can be disabled at configuration time, in which case the dependency is removed.
Modify getdns_query such that if a configuration file name includes ".yaml" it will be processed as a YAML configuration, not a JSON configuration.
Internally, getdns_yaml2*() work by passing the YAML string through a simple translation to JSON. At present, this translation assumes that configuration is the only use case, and so will error if the outer layer of the YAML input is not a map. This in effect means that at present all getdns_yaml2*() functions apart from getdns_yaml2dict() will give an error on the YAML translation to JSON.