From 8105bc0b7312d76f6eca6be2db62696aa81d2c3f Mon Sep 17 00:00:00 2001 From: Apteryks Date: Fri, 17 Mar 2023 10:56:41 -0400 Subject: [PATCH] linux/configure.ac: Fix tesseract conditional problem. (#1504) Fixes #1503. Using tesseract-ocr's stock pkg-config, it would produce an error due to unquoted whitespace: $ test ! -z `pkg-config --libs-only-l --silence-errors tesseract` bash: test: syntax error: `-larchive' unexpected * linux/configure.ac: Use a positive test, and double-quote the $() command substitution. Co-authored-by: Carlos Fernandez Sanz --- docs/CHANGES.TXT | 1 + linux/configure.ac | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 7c34a2a8..6039547c 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -11,6 +11,7 @@ - Fix: missing `#` in color attribute of font tag - Fix: ffmpeg 5.0, tesseract 5.0 compatibility and remove deprecated methods - Fix: tesseract 5.x traineddata location in ocr +- Fix: fix autoconf tesseract detection problem (#1503) - Fix: add missing compile_info_real.h source to Autotools build 0.94 (2021-12-14) diff --git a/linux/configure.ac b/linux/configure.ac index 45fc11f3..118ee7fa 100644 --- a/linux/configure.ac +++ b/linux/configure.ac @@ -149,7 +149,7 @@ AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ]) AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ]) AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ]) -AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z `pkg-config --libs-only-l --silence-errors tesseract` ]) +AM_CONDITIONAL(TESSERACT_PRESENT, [ test -n "$(pkg-config --libs-only-l --silence-errors tesseract)" ]) AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test `ls -A /usr/include/tesseract | wc -l` -gt 0 ]) AM_CONDITIONAL(SYS_IS_LINUX, [ test `uname -s` = "Linux"]) AM_CONDITIONAL(SYS_IS_MAC, [ test `uname -s` = "Darwin"])