Skip to content

Commit

Permalink
Use more compiler and linker flags from pkg-config
Browse files Browse the repository at this point in the history
This fixes some build issues with Homebrew on MacOS.

Signed-off-by: Stefan Weil <stefan@Sabines-Mac-mini.fritz.box>
  • Loading branch information
stweil committed Jun 2, 2021
1 parent 6dc4b18 commit dbc79b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ else
CPPFLAGS="$CPPFLAGS $cairo_CFLAGS"
fi
PKG_CHECK_MODULES([pangocairo], [pangocairo], [], [false])
PKG_CHECK_MODULES([pangoft2], [pangoft2], [], [false])
# ----------------------------------------
# Final Tasks and Output
Expand Down
4 changes: 2 additions & 2 deletions src/training/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ text2image_LDADD = \
$(ICU_I18N_LIBS) $(ICU_UC_LIBS)
text2image_LDADD += \
../api/libtesseract.la
text2image_LDADD += $(ICU_UC_LIBS) -lpango-1.0 -lpangocairo-1.0
text2image_LDADD += -lgobject-2.0 -lglib-2.0 -lcairo -lpangoft2-1.0 -lfontconfig
text2image_LDADD += $(ICU_UC_LIBS) $(cairo_LIBS)
text2image_LDADD += $(pango_LIBS) $(pangocairo_LIBS) $(pangoft2_LIBS)

unicharset_extractor_SOURCES = unicharset_extractor.cpp
#unicharset_extractor_LDFLAGS = -static
Expand Down
7 changes: 4 additions & 3 deletions unittest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lstm
AM_CPPFLAGS += -I$(top_srcdir)/src/textord
AM_CPPFLAGS += -I$(top_srcdir)/unittest/base
AM_CPPFLAGS += -I$(top_srcdir)/unittest/util
AM_CPPFLAGS += $(LEPTONICA_CFLAGS)
if ENABLE_TRAINING
AM_CPPFLAGS += -I$(top_srcdir)/src/training
endif # ENABLE_TRAINING
Expand Down Expand Up @@ -287,8 +288,8 @@ layout_test_LDADD = $(TRAINING_LIBS) $(LEPTONICA_LIBS)

ligature_table_test_SOURCES = ligature_table_test.cc
ligature_table_test_LDADD = $(TRAINING_LIBS)
ligature_table_test_LDADD += $(ICU_I18N_LIBS) $(ICU_UC_LIBS) -lfontconfig
ligature_table_test_LDADD += -lpangocairo-1.0 -lpangoft2-1.0
ligature_table_test_LDADD += $(ICU_I18N_LIBS) $(ICU_UC_LIBS)
ligature_table_test_LDADD += $(pangocairo_LIBS) $(pangoft2_LIBS)
ligature_table_test_LDADD += $(cairo_LIBS) $(pango_LIBS)

linlsq_test_SOURCES = linlsq_test.cc
Expand Down Expand Up @@ -385,7 +386,7 @@ endif # TENSORFLOW
stringrenderer_test_SOURCES = stringrenderer_test.cc
stringrenderer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)
stringrenderer_test_LDADD += $(ICU_I18N_LIBS) $(ICU_UC_LIBS)
stringrenderer_test_LDADD += -lfontconfig -lpangocairo-1.0 -lpangoft2-1.0
stringrenderer_test_LDADD += $(pangocairo_LIBS) $(pangoft2_LIBS)
stringrenderer_test_LDADD += $(cairo_LIBS) $(pango_LIBS)

tablefind_test_SOURCES = tablefind_test.cc
Expand Down

0 comments on commit dbc79b0

Please sign in to comment.