Add curl/curl.h configure check and improve INSTALL#1265
Add curl/curl.h configure check and improve INSTALL#1265daviesrob merged 2 commits intosamtools:developfrom
Conversation
|
(This is the first |
|
Non-configure builds have required libcurl since 1.10 (d5a0887); as noted in #1177 (comment), the maintainers may consider that it's time to promote libcurl to being required at build-time by default in configure-based builds too. This would need a one-word change in configure.ac and the diff --git a/configure.ac b/configure.ac
index c6b09db..4391e92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,7 @@ AC_SYS_LARGEFILE
AC_ARG_ENABLE([libcurl],
[AS_HELP_STRING([--enable-libcurl],
[enable libcurl-based support for http/https/etc URLs])],
- [], [enable_libcurl=check])
+ [], [enable_libcurl=yes])
diff --git a/INSTALL b/INSTALL
index e8d0bea..1d77f7c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -148,12 +148,13 @@ various features and specify further optional external requirements:
---enable-libcurl
- Use libcurl (<http://curl.se/>) to implement network access to
- remote files via FTP, HTTP, HTTPS, etc. By default or with
- --enable-libcurl=check, configure will probe for libcurl and include
- this functionality if libcurl is available. Use --disable-libcurl
- to prevent this.
+--enable-libcurl=check
+--disable-libcurl
+ By default or with --enable-libcurl, HTSlib includes code that uses
+ libcurl (<http://curl.se/>) to implement network access to remote files
+ via FTP, HTTP, HTTPS, etc. Use --enable-libcurl=check to probe for
+ libcurl and include this functionality only if libcurl is available.
+ Use --disable-libcurl to omit this functionality. |
|
This doesn't quite work where the header can't be found, as it still defines It looks like this is because the default behaviour of diff --git a/configure.ac b/configure.ac
index c6b09db..53d03c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,7 +353,7 @@ libcurl=disabled
if test "$enable_libcurl" != no; then
libcurl_devel=ok
AC_CHECK_HEADER([curl/curl.h], [], [libcurl_devel="headers not found"], [;])
- AC_CHECK_LIB([curl], [curl_easy_pause], [],
+ AC_CHECK_LIB([curl], [curl_easy_pause], [:],
[AC_CHECK_LIB([curl], [curl_easy_init],
[libcurl_devel="library is too old (7.18+ required)"],
[libcurl_devel="library not found"])])Could you update the PR with this change, please, if you agree? |
As for zlib, bz2, lzma, and libdeflate, check that both headers and link library are present. In particular, this aids diagnosis in scenarios in which the compiler is made aware of the library via $CPPFLAGS/$LDFLAGS settings and only one of them is correct.
As for libdeflate, the (current) default for libcurl is to probe for the library and enable the facility accordingly. Document this, and mention --disable-libcurl. Also mention that --disable-FOO and --without-BAR options are also available but usually unneeded as they just reinforce the default.
|
D'oh, you're absolutely right, thanks. I usually test these by changing the checks to |
|
Thanks for the update. I can recommend throw-away virtual machines as very useful for tests that involve messing around with system files. |
|
Good point again — I have a stable of long-lived VMs running different platforms, but I'm mostly unpractised with (the UI for) making short-term throwaway clones of them for hacking on like this. Which, for developers, is probably half the point of using VMs… |
This addresses a configure issue and configure option documentation omissions from INSTALL uncovered by #1261:
Unlike the checks for other libraries, the libcurl check validated only that the link library libcurl.so/.dylib/etc is available, but did not validate that the headers are available. In the libcurl enabled applied by default? #1261 case, inconsistent LDFLAGS and CPPFLAGS settings meant that the link library was available to the linker but the headers were not available to the compiler, which should have been detected at configure time.
(It's not recorded in the commit messages, but I think the other
AC_CHECK_HEADER/AC_CHECK_LIBchecks may have been written thus precisely so that such environment variable problems could be detected.)The default behaviour of
--enable-libcurlwas not documented in INSTALL, and it was not clear that--enable/--disableand--with/--withoutoptions come in pairs.