Commit Graph

3125 Commits

Author SHA1 Message Date
Jim Hague 7adc1fc4ab Remove copyright notices copied from existing files in error. 2019-10-25 15:51:30 +01:00
Jim Hague dbad46c516 Correct ordering of project and includes. 2019-10-24 17:49:23 +01:00
Jim Hague 9dcd8482f5 Add stub only mode, on by default.
If disabled, it needs to drag in libunbound. So do all that.
2019-10-24 17:40:37 +01:00
Jim Hague 530c8c5e8e Use BSD library we found directly, and mark its path as advanced, as per other libraries. 2019-10-24 17:32:05 +01:00
Jim Hague 072bdd9a6b Pay attention to hint directories for Check.
Allow specifying a base hint directory, and look there and in include/libs underneath it.
2019-10-24 17:30:41 +01:00
Jim Hague e8eafdfa44 Rearrange includes, to CTest and thus BUILD_TESTING is always present.
We can then use BUILD_TESTING to control whether to build the test executables or not.
2019-10-24 17:29:30 +01:00
Jim Hague e4c2ddb401 Present more user friendly name for the native stub DNSSEC option. 2019-10-24 14:29:20 +01:00
Jim Hague 55a0456b67 Add cipher configuration options. 2019-10-24 14:21:25 +01:00
Jim Hague def0f1d714 Ensure some option values get defined in the config header. 2019-10-24 14:07:43 +01:00
Jim Hague e4333b13df Add debug message options. 2019-10-24 13:43:20 +01:00
Jim Hague 7fd7bda000 Add current date option. 2019-10-24 12:19:51 +01:00
Jim Hague 74bbfc02fa Ensure library locations are all marked as advanced options. 2019-10-24 12:04:27 +01:00
Jim Hague 3b44cd8f38 Minor formatting nit. 2019-10-24 11:57:34 +01:00
Jim Hague b5f260376e Expose file paths as options. 2019-10-24 11:57:16 +01:00
Jim Hague 07e617579d Add fd setsize configuration. 2019-10-24 11:15:41 +01:00
Jim Hague 5f3d5191b0 Make visible existing options that are visible in autoconf.
Also punctuate option text consistently.
2019-10-24 11:14:20 +01:00
Jim Hague 60eb113770 Add options ENABLE_STATIC and ENABLE_SHARED.
Stick a cautious toe in the water of CMake options, and add enabling/disabling shared/static library builds, because that's easy.
2019-10-24 10:51:28 +01:00
Jim Hague d447999c60 Add check for check library, and if found add the main test module.
Note that tests_dict/list/stub_async/namespaces are built, but not run. I don't know why.
2019-10-23 18:33:50 +01:00
Jim Hague 24e2d1acbf Includes are specified by the library interfaces. 2019-10-23 18:30:26 +01:00
Jim Hague 9acdc1cbb5 Resolv.conf location mustn't have prefix. It's so the library can find the system resolver.
If you add a prefix, getdns doesn't get any upstreams configured and test failures abound.
2019-10-23 18:28:54 +01:00
Jim Hague 2414d31951 Properly sort out exporting the include directory for in-tree builds but not for out of tree builds. 2019-10-22 15:42:06 +01:00
Jim Hague 165078a50d Improve manpage processing robustness.
Fix regex to expressly check for starting ., and switch to regex match for SH lines to stop any potential problems with training spaces or multiple spaces before section name.
2019-10-22 14:47:49 +01:00
Jim Hague ea1111d899 Add installation of work done so far.
The install is equivalent to the autoconf install with no options.

Note that where the autoconf adds copies of manual pages renamed to individual APIs via a script manpgaltnames (in doc), this functionality is now done in pure CMake, to ensure it works on Windows.

Also note there is no 'make uninstall'. See https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake.
2019-10-22 14:32:44 +01:00
Jim Hague c6e5ef6330 Set SONAME matching autoconf build on shared library for GNU ld. 2019-10-21 17:25:48 +01:00
Jim Hague 2c06e8b8ac Remove unused items. 2019-10-21 16:54:55 +01:00
Jim Hague a884426c6e Suggest C11 for the tools as well as the library. 2019-10-21 16:54:40 +01:00
Jim Hague 9682b4d41c Do platform versioning from single version source.
Now I understand what dark stuff libtool gets up to, just do the same at the platform level.
2019-10-21 13:51:19 +01:00
Jim Hague 41741f6cc4 Rather than listing in a variable, list sources, libs etc directly on targets. 2019-10-21 13:32:05 +01:00
Jim Hague 87177cc103 Add a Windows implementation of getdns_context_set_resolvconf().
Have it return GETDNS_RETURN_NOT_IMPLEMENTED. This function is listed in the shared library exports, and it's part of the official API, so we need it.
2019-10-18 19:04:17 +01:00
Jim Hague 73e9c32655 First pass at adding shared libraries to the current static library build.
* I can't find out where the .so version number currently produced by the autoconf build comes from, so for the moment supply it explicitly.
* Include a version in the Windows DLL. But Windows can only grok major[.minor]. So also supply one of those.
* On Windows, we need a .lib for the .dll, and a static .lib. These, obviously, need different names. So add _static onto the name of the static lib.
* Only build the objects once, so explicitly build both with PIC.
* Only export the explicit list of symbols from the shared library. This has to be done a different way on GNU ld, Mac linker and Windows.
* Although I have left the tools being linked statically, I have tested with dynamic linking. getdns_query uses gettimeofday(), which isn't on Windows. With a static link, it just happens to find it in the getdns library, as the symbols aren't filtered. But this doesn't work for shared use, when they are. So explicitly add the compat implementation into the getdns_query sources.
2019-10-18 18:54:09 +01:00
Jim Hague 4304bb7017 Be a little more modern CMake. 2019-10-18 11:28:39 +01:00
Jim Hague 4df33630ea Let CMake know about the target language. 2019-10-18 11:27:19 +01:00
Jim Hague 878fd0583f Jump off the fence on policy CMP0075.
The new behaviour is benign for us, so go with it if available.
2019-10-17 17:22:51 +01:00
Jim Hague 11e621b758 Regularise use or not of space between else/endif and (). Always have a space. 2019-10-17 17:21:58 +01:00
Jim Hague 97227f9bd7 Temporarily (I hope) redirect ssl_dane submodule to my patched repo. 2019-10-16 11:25:07 +01:00
Jim Hague 4da88601d9 Add getdns_server_mon to the build. 2019-10-16 10:42:05 +01:00
Jim Hague ec62d87fca Correct target dependencies exported by the getdns library and used by getdns_query. 2019-10-16 10:35:18 +01:00
Jim Hague effd229ef6 Don't dump includes of OpenSSL headers into config.h.
Where they are required, they are included in the source files.
2019-10-16 10:34:36 +01:00
Jim Hague 55d6b47ed1 Correct target dependencies.
And improve a variable name.
2019-10-16 10:29:29 +01:00
Jim Hague cd62f2b716 Don't include OpenSSL headers in config.h.
Add an include of stdlib.h to various files that were relying on config.h to drag it in. I don't think config.h should be pulling in standard C headers.
2019-10-15 18:37:10 +01:00
Jim Hague 8362a183e8 Remove use of pkg-config to see if libbsd is present.
Instead check for the library directly.In the process, fix the detection of the declarations and functions in libbsd so they work.
2019-10-15 18:35:06 +01:00
Jim Hague a2d09d2be5 Fix type warning on Windows. 2019-10-15 16:56:34 +01:00
Jim Hague e45f569603 Add getdns_query to CMake build. 2019-10-15 16:56:12 +01:00
Jim Hague 73e8e4653d Update to latest fix of ssl_dane.c for Windows. 2019-10-15 16:55:16 +01:00
Jim Hague dd70108558 Windows does not have mkstemp(). Add compat version.
The compat version is Windows-specific.
2019-10-15 16:54:13 +01:00
Jim Hague 323d76d7ae Add the rest of the compat functions to the build, if required.
Remove any preprocess guards from the sources, and only include them in the build if required. Add some additional required Windows libraries.
2019-10-15 16:53:03 +01:00
Jim Hague 5db0d03b13 Enable building on Windows with Visual Studio.
The change mostly consists of removing or replacing non-standard (usually POSIX) header includes.

Guards for replacements for inet_ntop(), inet_pton() and gettimeofday() are updated; the first two are macros on Windows, so the guards are changed to HAVE_DECL. gettimeofday() is present on MinGW builds but not Visual Studio, so that has a function check.
2019-10-15 10:09:17 +01:00
Jim Hague b8df26194e Add symbols for target endianness. 2019-10-14 09:47:03 +01:00
Jim Hague d1dca186bc Add Posix/XOpen support flags for Unix builds that aren't FreeBSD. 2019-10-14 09:45:38 +01:00
Jim Hague 7a0a2f712d Add support for building on Windows.
This should support both native Visual Studio builds and MinGW builds.
2019-10-14 09:44:28 +01:00