Skip to content

Commit 8105bc0

Browse files
apterykscfsmp3
andauthored
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 <[email protected]>
1 parent ea4998f commit 8105bc0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/CHANGES.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Fix: missing `#` in color attribute of font tag
1212
- Fix: ffmpeg 5.0, tesseract 5.0 compatibility and remove deprecated methods
1313
- Fix: tesseract 5.x traineddata location in ocr
14+
- Fix: fix autoconf tesseract detection problem (#1503)
1415
- Fix: add missing compile_info_real.h source to Autotools build
1516

1617
0.94 (2021-12-14)

linux/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ AS_IF([ (test x$ocr = xtrue || test x$hardsubx = xtrue) && test ! $HAS_LEPT -gt
149149
AM_CONDITIONAL(HARDSUBX_IS_ENABLED, [ test x$hardsubx = xtrue ])
150150
AM_CONDITIONAL(OCR_IS_ENABLED, [ test x$ocr = xtrue || test x$hardsubx = xtrue ])
151151
AM_CONDITIONAL(FFMPEG_IS_ENABLED, [ test x$ffmpeg = xtrue ])
152-
AM_CONDITIONAL(TESSERACT_PRESENT, [ test ! -z `pkg-config --libs-only-l --silence-errors tesseract` ])
152+
AM_CONDITIONAL(TESSERACT_PRESENT, [ test -n "$(pkg-config --libs-only-l --silence-errors tesseract)" ])
153153
AM_CONDITIONAL(TESSERACT_PRESENT_RPI, [ test -d "/usr/include/tesseract" && test `ls -A /usr/include/tesseract | wc -l` -gt 0 ])
154154
AM_CONDITIONAL(SYS_IS_LINUX, [ test `uname -s` = "Linux"])
155155
AM_CONDITIONAL(SYS_IS_MAC, [ test `uname -s` = "Darwin"])

0 commit comments

Comments
 (0)