From 2ba3f6966767c05f1d14d34f1302a5e6df41a762 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 10 Feb 2021 22:54:58 +0100 Subject: [PATCH] Add configure option --with-curl (check for libcurl by default) Signed-off-by: Stefan Weil --- configure.ac | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index e15b04be..5a9a2678 100644 --- a/configure.ac +++ b/configure.ac @@ -462,11 +462,24 @@ AC_CHECK_TYPES([long long int]) # Test auxiliary packages # ---------------------------------------- -PKG_CHECK_MODULES([libcurl], [libcurl], [have_libcurl=true], [have_libcurl=false]) -AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl) -if $have_libcurl; then - AC_DEFINE([HAVE_LIBCURL], [1], [Enable libcurl]) -fi +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]) + AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl) + if $have_libcurl; then + 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 +]) PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false]) if $have_lept; then