From 074844ce46774c72b1ed9506c5764eea026d3f3d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 28 Nov 2019 16:34:52 +0100 Subject: [PATCH] Show libcurl version `tesseract --version` now also shows the version of libcurl and related libraries if it was build with libcurl. The preprocessor macro HAVE_LIBCURL is now defined in config_auto.h. Signed-off-by: Stefan Weil --- Makefile.am | 4 +--- configure.ac | 5 ++++- src/api/tesseractmain.cpp | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index a2784a33..444cf0fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -114,9 +114,7 @@ libtesseract_api_la_CPPFLAGS += -I$(top_srcdir)/src/opencl libtesseract_api_la_CPPFLAGS += -I$(top_srcdir)/src/textord libtesseract_api_la_CPPFLAGS += -I$(top_srcdir)/src/viewer libtesseract_api_la_CPPFLAGS += -I$(top_srcdir)/src/wordrec -if HAVE_LIBCURL -libtesseract_api_la_CPPFLAGS += $(libcurl_CFLAGS) -DHAVE_LIBCURL -endif +libtesseract_api_la_CPPFLAGS += $(libcurl_CFLAGS) noinst_LTLIBRARIES += libtesseract_api.la diff --git a/configure.ac b/configure.ac index c2e1dc6f..951c2491 100644 --- a/configure.ac +++ b/configure.ac @@ -428,6 +428,9 @@ AC_CHECK_TYPES([mbstate_t],,, [#include "wchar.h"]) 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 PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false]) if $have_lept; then @@ -439,7 +442,7 @@ fi PKG_CHECK_MODULES([libarchive], [libarchive], [have_libarchive=true], [have_libarchive=false]) AM_CONDITIONAL([HAVE_LIBARCHIVE], [$have_libarchive]) if $have_libarchive; then - AC_DEFINE([HAVE_LIBARCHIVE], [], [Enable libarchive]) + AC_DEFINE([HAVE_LIBARCHIVE], [1], [Enable libarchive]) CPPFLAGS="$CPPFLAGS $libarchive_CFLAGS" fi diff --git a/src/api/tesseractmain.cpp b/src/api/tesseractmain.cpp index dfdee6b3..4a5e1b70 100644 --- a/src/api/tesseractmain.cpp +++ b/src/api/tesseractmain.cpp @@ -41,6 +41,9 @@ #if defined(HAVE_LIBARCHIVE) #include #endif +#if defined(HAVE_LIBCURL) +#include +#endif #if defined(_WIN32) #include @@ -148,7 +151,9 @@ static void PrintVersionInfo() { printf(" Found %s\n", archive_version_string()); # endif // ARCHIVE_VERSION_NUMBER #endif // HAVE_LIBARCHIVE - +#if defined(HAVE_LIBCURL) + printf(" Found %s\n", curl_version()); +#endif } static void PrintHelpForPSM() {