Permalink
Browse files

Fix build with legacy engine disabled

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 081793ff4869365e18bfd8546ac02870c96c573a
Showing with 20 additions and 3 deletions.
  1. +0 −3 configure.ac
  2. +4 −0 src/api/Makefile.am
  3. +4 −0 src/ccmain/Makefile.am
  4. +4 −0 src/classify/Makefile.am
  5. +4 −0 src/training/Makefile.am
  6. +4 −0 src/wordrec/Makefile.am
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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

0 comments on commit 081793f

Please sign in to comment.