Skip to content

Commit aa9f4b4

Browse files
committed
Add an option to compile tesseract without the code of the legacy OCR engine
1 parent 6f23ed3 commit aa9f4b4

30 files changed

+998
-258
lines changed

configure.ac

+14
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,20 @@ if test "$enable_graphics" = "no"; then
161161
AM_CONDITIONAL([GRAPHICS_DISABLED], true)
162162
fi
163163

164+
AC_MSG_CHECKING([--enable-legacy argument])
165+
AC_ARG_ENABLE([legacy],
166+
[
167+
AS_HELP_STRING([--enable-legacy],[enable the legacy OCR engine])
168+
AS_HELP_STRING([--disable-legacy], [disable the legacy OCR engine])
169+
],
170+
[enable_legacy=$enableval],
171+
[enable_legacy="yes"])
172+
AC_MSG_RESULT([$enable_legacy])
173+
if test "$enable_legacy" = "no"; then
174+
AC_DEFINE([DISABLED_LEGACY_ENGINE], [], [Disable the legacy OCR engine])
175+
fi
176+
AM_CONDITIONAL([DISABLED_LEGACY_ENGINE], test "$enable_legacy" = "no")
177+
164178
# check whether to build embedded version
165179
AC_MSG_CHECKING([--enable-embedded argument])
166180
AC_ARG_ENABLE([embedded],

doc/Makefile.am

+15-10
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,32 @@ if ASCIIDOC
44

55
asciidoc=asciidoc -d manpage
66

7+
78
man_MANS = \
8-
ambiguous_words.1 \
9-
classifier_tester.1 \
10-
cntraining.1 \
11-
combine_lang_model.1 \
9+
combine_lang_model.1 \
1210
combine_tessdata.1 \
1311
dawg2wordlist.1 \
1412
lstmeval.1 \
1513
lstmtraining.1 \
1614
merge_unicharsets.1 \
17-
mftraining.1 \
1815
set_unicharset_properties.1 \
19-
shapeclustering.1 \
2016
tesseract.1 \
2117
text2image.1 \
2218
unicharambigs.5 \
23-
unicharset.5 \
24-
unicharset_extractor.1 \
19+
unicharset_extractor.1 \
2520
wordlist2dawg.1
26-
27-
EXTRA_DIST = $(man_MANS) Doxyfile
21+
22+
if !DISABLED_LEGACY_ENGINE
23+
man_MANS += \
24+
ambiguous_words.1 \
25+
classifier_tester.1 \
26+
cntraining.1 \
27+
mftraining.1 \
28+
shapeclustering.1 \
29+
unicharset.5
30+
endif
31+
32+
EXTRA_DIST = $(man_MANS) Doxyfile
2833

2934
%: %.asc
3035
$(asciidoc) -o $@ $<

0 commit comments

Comments
 (0)