./configure.ac: detect SSL in libcurl using curl-config
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Дилян Палаузов committed
Jun 28, 2016 at 12:04 UTC
924b7eb1c983c845203a5c2fd80fe499acff6e84
1 file changed
+11
-10
configure.ac
+11
-10
@@ -528,16 +528,6 @@ AC_CHECK_LIB([curl], [curl_global_init],
528
[NO_CURL=],
529
[NO_CURL=YesPlease])
530
531
-if test -z "${NO_CURL}" && test -z "${NO_OPENSSL}"; then
532
-
533
-AC_CHECK_LIB([curl], [Curl_ssl_init],
534
-[NEEDS_SSL_WITH_CURL=YesPlease],
535
-[NEEDS_SSL_WITH_CURL=])
536
-
537
-GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
538
-
539
-fi
540
-
531
GIT_UNSTASH_FLAGS($CURLDIR)
532
533
GIT_CONF_SUBST([NO_CURL])
@@ -550,6 +540,17 @@ AC_CHECK_PROG([CURL_CONFIG], [curl-config],
540
541
if test $CURL_CONFIG != no; then
542
GIT_CONF_SUBST([CURL_CONFIG])
543
+ if test -z "${NO_OPENSSL}"; then
544
+ AC_MSG_CHECKING([if Curl supports SSL])
545
+ if test $(curl-config --features|grep SSL) = SSL; then
546
+ NEEDS_SSL_WITH_CURL=YesPlease
547
+ AC_MSG_RESULT([yes])
548
+ else
549
+ NEEDS_SSL_WITH_CURL=
550
+ AC_MSG_RESULT([no])
551
+ fi
552
+ GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL])
553
+ fi
554
fi
555
556
fi