git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] ./configure.ac: Detect SSL in libcurl using curl-config
@ 2016-06-28 12:04 Дилян Палаузов
  2016-06-28 16:32 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Дилян Палаузов @ 2016-06-28 12:04 UTC (permalink / raw)
  To: git

The API of libcurl does not mention Curl_ssl_init() and when curl is built
with -flto, the Curl_ssl_init symbol is not exported.

https://curl.haxx.se/libcurl/using/ suggests calling
  curl-config --feature | grep SSL
to see, if the installed curl has SSL support.  Another approach would
be calling curl_version_info and checking the returned struct.

This patch removes the check for the Curl_ssl_init exported symbol from
libcurl and uses curl-config to detect SSL support in libcurl.

Signed-Off-By: Дилян Палаузов <git-dpa@aegee.org>
---
 configure.ac | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index c279025..5e9ba59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -528,16 +528,6 @@ AC_CHECK_LIB([curl], [curl_global_init],
 [NO_CURL=],
 [NO_CURL=YesPlease])
 
-if test -z "${NO_CURL}" && test -z "${NO_OPENSSL}"; then
-
-AC_CHECK_LIB([curl], [Curl_ssl_init],
-[NEEDS_SSL_WITH_CURL=YesPlease],
-[NEEDS_SSL_WITH_CURL=])
-
-GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
-
-fi
-
 GIT_UNSTASH_FLAGS($CURLDIR)
 
 GIT_CONF_SUBST([NO_CURL])
@@ -550,6 +540,17 @@ AC_CHECK_PROG([CURL_CONFIG], [curl-config],
 
 if test $CURL_CONFIG != no; then
     GIT_CONF_SUBST([CURL_CONFIG])
+    if test -z "${NO_OPENSSL}"; then
+      AC_MSG_CHECKING([if Curl supports SSL])
+      if test $(curl-config --features|grep SSL) = SSL; then
+         NEEDS_SSL_WITH_CURL=YesPlease
+         AC_MSG_RESULT([yes])
+      else
+         NEEDS_SSL_WITH_CURL=
+         AC_MSG_RESULT([no])
+      fi
+      GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
+    fi
 fi
 
 fi
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ./configure.ac: Detect SSL in libcurl using curl-config
  2016-06-28 12:04 [PATCH] ./configure.ac: Detect SSL in libcurl using curl-config Дилян Палаузов
@ 2016-06-28 16:32 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2016-06-28 16:32 UTC (permalink / raw)
  To: Дилян Палаузов
  Cc: git

Дилян Палаузов  <git-dpa@aegee.org> writes:

> The API of libcurl does not mention Curl_ssl_init() and when curl is built
> with -flto, the Curl_ssl_init symbol is not exported.
>
> https://curl.haxx.se/libcurl/using/ suggests calling
>   curl-config --feature | grep SSL
> to see, if the installed curl has SSL support.  Another approach would
> be calling curl_version_info and checking the returned struct.
>
> This patch removes the check for the Curl_ssl_init exported symbol from
> libcurl and uses curl-config to detect SSL support in libcurl.
>
> Signed-Off-By: Дилян Палаузов <git-dpa@aegee.org>
> ---

This is a tangent, but the patch made me notice [*1*] that a user
cannot build Git without libcurl support if curl is installed on the
system, with something like:

	$ ./configure NO_CURL=NoThanks

I do not know if that is a problem (it certainly is NOT a new
problem introduced by your change).

Anyway, will queue.

Thanks.

[Footnote]

*1* The updated code does not have any branch based on $NO_CURL the
    original used to have, even though it does branch on
    $NO_OPENSSL, which is why I got curious.

>  configure.ac | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index c279025..5e9ba59 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -528,16 +528,6 @@ AC_CHECK_LIB([curl], [curl_global_init],
>  [NO_CURL=],
>  [NO_CURL=YesPlease])
>  
> -if test -z "${NO_CURL}" && test -z "${NO_OPENSSL}"; then
> -
> -AC_CHECK_LIB([curl], [Curl_ssl_init],
> -[NEEDS_SSL_WITH_CURL=YesPlease],
> -[NEEDS_SSL_WITH_CURL=])
> -
> -GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
> -
> -fi
> -
>  GIT_UNSTASH_FLAGS($CURLDIR)
>  
>  GIT_CONF_SUBST([NO_CURL])
> @@ -550,6 +540,17 @@ AC_CHECK_PROG([CURL_CONFIG], [curl-config],
>  
>  if test $CURL_CONFIG != no; then
>      GIT_CONF_SUBST([CURL_CONFIG])
> +    if test -z "${NO_OPENSSL}"; then
> +      AC_MSG_CHECKING([if Curl supports SSL])
> +      if test $(curl-config --features|grep SSL) = SSL; then
> +         NEEDS_SSL_WITH_CURL=YesPlease
> +         AC_MSG_RESULT([yes])
> +      else
> +         NEEDS_SSL_WITH_CURL=
> +         AC_MSG_RESULT([no])
> +      fi
> +      GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
> +    fi
>  fi
>  
>  fi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-28 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28 12:04 [PATCH] ./configure.ac: Detect SSL in libcurl using curl-config Дилян Палаузов
2016-06-28 16:32 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).