Skip to content

Commit

Permalink
visibility - autotools part (./configure --enable-visibility)
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@690 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
zdenop@gmail.com committed Mar 2, 2012
1 parent a776e0b commit 30a7014
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 19 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ray Smith (lead developer) <theraysmith@users.sourceforge.net>
Ray Smith (lead developer) <theraysmith@gmail.com>
Phil Cheatle
Simon Crouch
Dan Johnson
Expand Down
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = ccutil viewer cutil image ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . training java tessdata testing doc
SUBDIRS = ccutil viewer cutil image ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . java tessdata testing doc
# training subdir can not be build with -fvisibility at the moment
if !VISIBILITY
SUBDIRS += training
endif

#if USING_GETTEXT
#SUBDIRS += po
#AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
Expand Down
15 changes: 13 additions & 2 deletions api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"\
-I$(top_srcdir)/textord -I$(top_srcdir)/dict \
-I$(top_srcdir)/classify -I$(top_srcdir)/ccmain \
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil

if VISIBILITY
AM_CPPFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
apitypes.h baseapi.h tesseractmain.h
Expand All @@ -28,10 +32,14 @@ libtesseract_api_la_LIBADD = \
$(top_srcdir)/viewer/libtesseract_viewer.la \
$(top_srcdir)/ccutil/libtesseract_ccutil.la
endif
libtesseract_api_la_CPPFLAGS = $(AM_CPPFLAGS)
if VISIBILITY
libtesseract_api_la_CPPFLAGS += -DTESS_EXPORTS
endif
libtesseract_api_la_SOURCES = baseapi.cpp

lib_LTLIBRARIES += libtesseract.la
libtesseract_la_LDFLAGS =
libtesseract_la_LDFLAGS =
libtesseract_la_SOURCES =
# Dummy C++ source to cause C++ linking.
# see http://www.gnu.org/s/hello/manual/automake/Libtool-Convenience-Libraries.html#Libtool-Convenience-Libraries
Expand All @@ -52,8 +60,11 @@ libtesseract_la_LIBADD = \
$(top_srcdir)/ccutil/libtesseract_ccutil.la

libtesseract_la_LDFLAGS += -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_la_LDFLAGS += -L./ -L../ -L../api -L../ccutil -L../viewer -L../cutil -L../image -L../ccstruct -L../dict -L../classify -L../wordrec -L../neural_networks/runtime -L../textord -L../cube -L../ccmain

bin_PROGRAMS = tesseract
tesseract_SOURCES = $(top_srcdir)/api/tesseractmain.cpp
tesseract_LDADD = libtesseract.la
tesseract_CPPFLAGS = $(AM_CPPFLAGS)
if VISIBILITY
tesseract_CPPFLAGS += -DTESS_IMPORTS
endif
6 changes: 5 additions & 1 deletion ccmain/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
SUBDIRS =
AM_CPPFLAGS = \
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
Expand All @@ -7,6 +6,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/wordrec -I$(top_srcdir)/cutil \
-I$(top_srcdir)/neural_networks/runtime -I$(top_srcdir)/cube \
-I$(top_srcdir)/textord

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
control.h cube_reco_context.h cubeclassifier.h \
Expand Down
6 changes: 5 additions & 1 deletion ccstruct/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
SUBDIRS =
AM_CPPFLAGS = \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
blckerr.h blobbox.h blobs.h blread.h boxread.h boxword.h ccstruct.h coutln.h crakedge.h \
Expand Down
5 changes: 5 additions & 0 deletions ccutil/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
SUBDIRS =
AM_CXXFLAGS = -DTESSDATA_PREFIX=@datadir@/

if VISIBILITY
AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
AM_CPPFLAGS += -DTESS_EXPORTS
endif

EXTRA_DIST = mfcpch.cpp

include_HEADERS = \
Expand Down
6 changes: 5 additions & 1 deletion classify/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
SUBDIRS =
AM_CPPFLAGS = \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
adaptive.h baseline.h blobclass.h chartoname.h \
Expand Down
13 changes: 12 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ----------------------------------------

AC_PREREQ(2.50)
AC_INIT([tesseract], [3.02], [theraysmith@gmail.com])
AC_INIT([tesseract], [3.02], [http://code.google.com/p/tesseract-ocr/issues/list])
AC_CONFIG_MACRO_DIR([m4])
AC_REVISION($Id: configure.ac,v 1.4 2007/02/02 22:38:17 theraysmith Exp $)
AC_CONFIG_AUX_DIR(config)
Expand Down Expand Up @@ -98,6 +98,17 @@ if test "$enable_embedded" = "yes"; then
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
fi

# check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
# http://gcc.gnu.org/wiki/Visibility
# http://groups.google.com/group/tesseract-dev/browse_thread/thread/976645ae98189127
AC_MSG_CHECKING(--enable-visibility argument)
AC_ARG_ENABLE([visibility],
[AC_HELP_STRING([--enable-visibility],[enable experimental build with fvisibility (default=no)])],
[enable_visibility=$enableval],
[enable_visibility="no"])
AC_MSG_RESULT($enable_visibility)
AM_CONDITIONAL([VISIBILITY], [test "$enable_visibility" = "yes"])

# check whether to build multiple libraries
AC_MSG_CHECKING(--enable-multiple-libraries argument)
AC_ARG_ENABLE([multiple-libraries],
Expand Down
6 changes: 5 additions & 1 deletion cube/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
SUBDIRS =
AM_CPPFLAGS = \
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
Expand All @@ -7,6 +6,11 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/textord -I$(top_srcdir)/wordrec \
-I$(top_srcdir)/neural_networks/runtime \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
altlist.h beam_search.h bmp_8.h cached_file.h \
Expand Down
6 changes: 5 additions & 1 deletion cutil/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
SUBDIRS =
AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
bitvec.h callcpp.h const.h cutil.h cutil_class.h danerror.h efio.h \
emalloc.h freelist.h globals.h listio.h \
Expand Down
6 changes: 5 additions & 1 deletion dict/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
SUBDIRS =
AM_CPPFLAGS = -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/viewer -I$(top_srcdir)/image

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
dawg.h dict.h matchdefs.h \
Expand Down
6 changes: 5 additions & 1 deletion image/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
SUBDIRS =
AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
image.h img.h imgerrs.h imgs.h \
Expand Down
6 changes: 5 additions & 1 deletion neural_networks/runtime/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
SUBDIRS =
AM_CPPFLAGS = \
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
input_file_buffer.h neural_net.h neuron.h

Expand Down
7 changes: 6 additions & 1 deletion textord/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
SUBDIRS =
AM_CPPFLAGS = \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify -I$(top_srcdir)/dict

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif


include_HEADERS = \
alignedblob.h bbgrid.h blkocc.h blobgrid.h \
Expand Down
8 changes: 4 additions & 4 deletions viewer/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SUBDIRS =
AM_CPPFLAGS =
if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
scrollview.h svmnode.h svutil.h
Expand All @@ -13,5 +15,3 @@ endif

libtesseract_viewer_la_SOURCES = \
scrollview.cpp svmnode.cpp svutil.cpp svpaint.cpp


6 changes: 5 additions & 1 deletion wordrec/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
SUBDIRS =
AM_CPPFLAGS = \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify \
-I$(top_srcdir)/image -I$(top_srcdir)/dict \
-I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
-fvisibility=hidden -fvisibility-inlines-hidden
endif

include_HEADERS = \
associate.h bestfirst.h chop.h \
chopper.h closed.h drawfx.h findseam.h gradechop.h \
Expand Down

0 comments on commit 30a7014

Please sign in to comment.