Skip to content

Commit

Permalink
Fix build with legacy engine disabled
Browse files Browse the repository at this point in the history
Instead of defining the DISABLED_LEGACY_ENGINE macro in config_auto.h
(which is not included by all source files), define it as a preprocessor
option for those parts of the code which require it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jul 4, 2018
1 parent 20e53b1 commit 081793f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ AC_ARG_ENABLE([legacy],
[enable_legacy=$enableval],
[enable_legacy="yes"])
AC_MSG_RESULT([$enable_legacy])
if test "$enable_legacy" = "no"; then
AC_DEFINE([DISABLED_LEGACY_ENGINE], [], [Disable the legacy OCR engine])
fi
AM_CONDITIONAL([DISABLED_LEGACY_ENGINE], test "$enable_legacy" = "no")

# check whether to build embedded version
Expand Down
4 changes: 4 additions & 0 deletions src/api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" \

AM_CPPFLAGS += $(OPENCL_CPPFLAGS)

if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif

if VISIBILITY
AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
endif
Expand Down
4 changes: 4 additions & 0 deletions src/ccmain/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ AM_CPPFLAGS += \
AM_CPPFLAGS += $(OPENCL_CPPFLAGS)
AM_CPPFLAGS += $(OPENMP_CXXFLAGS)

if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
Expand Down
4 changes: 4 additions & 0 deletions src/classify/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/src/dict \
-I$(top_srcdir)/src/viewer

if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
Expand Down
4 changes: 4 additions & 0 deletions src/training/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ AM_CPPFLAGS += \

EXTRA_DIST = language-specific.sh tesstrain.sh tesstrain_utils.sh

if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif

# TODO: training programs can not be linked to shared library created
# with -fvisibility
if VISIBILITY
Expand Down
4 changes: 4 additions & 0 deletions src/wordrec/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/src/dict \
-I$(top_srcdir)/src/viewer

if DISABLED_LEGACY_ENGINE
AM_CPPFLAGS += -DDISABLED_LEGACY_ENGINE
endif

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
Expand Down

0 comments on commit 081793f

Please sign in to comment.