mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-06 09:17:49 +08:00
Use pkg-config for icu compiler and linker flags
The old settings are used as fallback if there is no configuration. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
aec39d629d
commit
b66ff1f455
11
configure.ac
11
configure.ac
@ -421,12 +421,17 @@ fi
|
|||||||
AM_CONDITIONAL([ENABLE_TRAINING], true)
|
AM_CONDITIONAL([ENABLE_TRAINING], true)
|
||||||
|
|
||||||
# Check location of icu headers
|
# Check location of icu headers
|
||||||
have_icu=false
|
PKG_CHECK_MODULES([ICU_UC], [icu-uc], [have_icu_uc=true], [have_icu_uc=false])
|
||||||
AC_CHECK_HEADERS([unicode/uchar.h], [have_icu=true], [have_icu=false])
|
PKG_CHECK_MODULES([ICU_I18N], [icu-i18n], [have_icu_i18n=true], [have_icu_i18n=false])
|
||||||
if !($have_icu); then
|
if !($have_icu_uc && $have_icu_i18n); then
|
||||||
|
AC_CHECK_HEADERS([unicode/uchar.h], [have_icu=true], [have_icu=false])
|
||||||
|
if !($have_icu); then
|
||||||
AC_MSG_WARN([Training tools WILL NOT be built because of missing icu library.])
|
AC_MSG_WARN([Training tools WILL NOT be built because of missing icu library.])
|
||||||
AC_MSG_WARN([Try to install libicu-devel package.])
|
AC_MSG_WARN([Try to install libicu-devel package.])
|
||||||
AM_CONDITIONAL([ENABLE_TRAINING], false)
|
AM_CONDITIONAL([ENABLE_TRAINING], false)
|
||||||
|
else
|
||||||
|
ICU_UC_LIBS="-licui18n -licuuc"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check location of pango headers
|
# Check location of pango headers
|
||||||
|
@ -10,9 +10,8 @@ AM_CPPFLAGS += \
|
|||||||
|
|
||||||
EXTRA_DIST = language-specific.sh tesstrain.sh tesstrain_utils.sh
|
EXTRA_DIST = language-specific.sh tesstrain.sh tesstrain_utils.sh
|
||||||
|
|
||||||
libicu=-licui18n -licuuc
|
# TODO: training programs can not be linked to shared library created
|
||||||
# TODO: training programs can not be linked to shared library created
|
# with -fvisibility
|
||||||
# with -fvisibility
|
|
||||||
if VISIBILITY
|
if VISIBILITY
|
||||||
AM_LDFLAGS += -all-static
|
AM_LDFLAGS += -all-static
|
||||||
endif
|
endif
|
||||||
@ -26,9 +25,9 @@ noinst_HEADERS = \
|
|||||||
noinst_LTLIBRARIES = libtesseract_training.la libtesseract_tessopt.la
|
noinst_LTLIBRARIES = libtesseract_training.la libtesseract_tessopt.la
|
||||||
|
|
||||||
libtesseract_training_la_LIBADD = \
|
libtesseract_training_la_LIBADD = \
|
||||||
../cutil/libtesseract_cutil.la
|
../cutil/libtesseract_cutil.la
|
||||||
# ../api/libtesseract.la
|
# ../api/libtesseract.la
|
||||||
|
|
||||||
libtesseract_training_la_SOURCES = \
|
libtesseract_training_la_SOURCES = \
|
||||||
boxchar.cpp commandlineflags.cpp commontraining.cpp degradeimage.cpp \
|
boxchar.cpp commandlineflags.cpp commontraining.cpp degradeimage.cpp \
|
||||||
fileio.cpp ligature_table.cpp normstrngs.cpp pango_font_info.cpp \
|
fileio.cpp ligature_table.cpp normstrngs.cpp pango_font_info.cpp \
|
||||||
@ -171,7 +170,7 @@ set_unicharset_properties_SOURCES = set_unicharset_properties.cpp
|
|||||||
set_unicharset_properties_LDADD = \
|
set_unicharset_properties_LDADD = \
|
||||||
libtesseract_training.la \
|
libtesseract_training.la \
|
||||||
libtesseract_tessopt.la \
|
libtesseract_tessopt.la \
|
||||||
$(libicu)
|
$(ICU_I18N_LIBS) $(ICU_UC_LIBS)
|
||||||
if USING_MULTIPLELIBS
|
if USING_MULTIPLELIBS
|
||||||
set_unicharset_properties_LDADD += \
|
set_unicharset_properties_LDADD += \
|
||||||
../textord/libtesseract_textord.la \
|
../textord/libtesseract_textord.la \
|
||||||
@ -217,7 +216,8 @@ text2image_SOURCES = text2image.cpp
|
|||||||
#text2image_LDFLAGS = -static
|
#text2image_LDFLAGS = -static
|
||||||
text2image_LDADD = \
|
text2image_LDADD = \
|
||||||
libtesseract_training.la \
|
libtesseract_training.la \
|
||||||
libtesseract_tessopt.la
|
libtesseract_tessopt.la \
|
||||||
|
$(ICU_I18N_LIBS) $(ICU_UC_LIBS)
|
||||||
if USING_MULTIPLELIBS
|
if USING_MULTIPLELIBS
|
||||||
text2image_LDADD += \
|
text2image_LDADD += \
|
||||||
../textord/libtesseract_textord.la \
|
../textord/libtesseract_textord.la \
|
||||||
@ -235,7 +235,7 @@ else
|
|||||||
text2image_LDADD += \
|
text2image_LDADD += \
|
||||||
../api/libtesseract.la
|
../api/libtesseract.la
|
||||||
endif
|
endif
|
||||||
text2image_LDADD += $(libicu) -lpango-1.0 -lpangocairo-1.0 \
|
text2image_LDADD += $(ICU_UC_LIBS) -lpango-1.0 -lpangocairo-1.0 \
|
||||||
-lgobject-2.0 -lglib-2.0 -lcairo -lpangoft2-1.0 -lfontconfig
|
-lgobject-2.0 -lglib-2.0 -lcairo -lpangoft2-1.0 -lfontconfig
|
||||||
|
|
||||||
unicharset_extractor_SOURCES = unicharset_extractor.cpp
|
unicharset_extractor_SOURCES = unicharset_extractor.cpp
|
||||||
|
Loading…
Reference in New Issue
Block a user