Add configure option --with-curl (check for libcurl by default)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-02-10 22:54:58 +01:00
parent f1b9e326d0
commit 2ba3f69667

View File

@ -462,11 +462,24 @@ AC_CHECK_TYPES([long long int])
# Test auxiliary packages # Test auxiliary packages
# ---------------------------------------- # ----------------------------------------
AC_ARG_WITH([curl],
AS_HELP_STRING([--with-curl],
[Build with libcurl which supports processing an image URL @<:@default=check@:>@]
))
AM_CONDITIONAL([HAVE_LIBCURL], false)
AS_IF([test "x$with_curl" != xno], [
PKG_CHECK_MODULES([libcurl], [libcurl], [have_libcurl=true], [have_libcurl=false]) PKG_CHECK_MODULES([libcurl], [libcurl], [have_libcurl=true], [have_libcurl=false])
AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl) AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl)
if $have_libcurl; then if $have_libcurl; then
AC_DEFINE([HAVE_LIBCURL], [1], [Enable libcurl]) AC_DEFINE([HAVE_LIBCURL], [1], [Enable libcurl])
else
AS_IF([test "x$with_curl" != xcheck], [
AC_MSG_FAILURE(
[--with-curl was given, but test for libcurl failed])
])
fi fi
])
PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false]) PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false])
if $have_lept; then if $have_lept; then