diff --git a/AUTHORS b/AUTHORS index a0a208f0..9f0bc71e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -Ray Smith (lead developer) +Ray Smith (lead developer) Phil Cheatle Simon Crouch Dan Johnson diff --git a/Makefile.am b/Makefile.am index d8fba7a8..ba08556b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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)\" diff --git a/api/Makefile.am b/api/Makefile.am index b8c74660..cc758717 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -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 @@ -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 @@ -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 diff --git a/ccmain/Makefile.am b/ccmain/Makefile.am index 8fdebedb..e1e7f7a7 100644 --- a/ccmain/Makefile.am +++ b/ccmain/Makefile.am @@ -1,4 +1,3 @@ -SUBDIRS = AM_CPPFLAGS = \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ @@ -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 \ diff --git a/ccstruct/Makefile.am b/ccstruct/Makefile.am index 54c19f96..c273c38a 100644 --- a/ccstruct/Makefile.am +++ b/ccstruct/Makefile.am @@ -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 \ diff --git a/ccutil/Makefile.am b/ccutil/Makefile.am index 69d5fd9e..87db8cb8 100644 --- a/ccutil/Makefile.am +++ b/ccutil/Makefile.am @@ -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 = \ diff --git a/classify/Makefile.am b/classify/Makefile.am index 2083eb2e..5b1e5201 100644 --- a/classify/Makefile.am +++ b/classify/Makefile.am @@ -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 \ diff --git a/configure.ac b/configure.ac index 5ff8b4b8..a8d3e647 100644 --- a/configure.ac +++ b/configure.ac @@ -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) @@ -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], diff --git a/cube/Makefile.am b/cube/Makefile.am index 522d848e..fe60c6bd 100644 --- a/cube/Makefile.am +++ b/cube/Makefile.am @@ -1,4 +1,3 @@ -SUBDIRS = AM_CPPFLAGS = \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ @@ -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 \ diff --git a/cutil/Makefile.am b/cutil/Makefile.am index fc28be37..30861e55 100644 --- a/cutil/Makefile.am +++ b/cutil/Makefile.am @@ -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 \ diff --git a/dict/Makefile.am b/dict/Makefile.am index 8fef2d37..cfc584b5 100644 --- a/dict/Makefile.am +++ b/dict/Makefile.am @@ -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 \ diff --git a/image/Makefile.am b/image/Makefile.am index a22d8c60..d26d0247 100644 --- a/image/Makefile.am +++ b/image/Makefile.am @@ -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 \ diff --git a/neural_networks/runtime/Makefile.am b/neural_networks/runtime/Makefile.am index fad3d05a..fb098c57 100644 --- a/neural_networks/runtime/Makefile.am +++ b/neural_networks/runtime/Makefile.am @@ -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 diff --git a/textord/Makefile.am b/textord/Makefile.am index b189d221..774c0f94 100644 --- a/textord/Makefile.am +++ b/textord/Makefile.am @@ -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 \ diff --git a/viewer/Makefile.am b/viewer/Makefile.am index 448499a5..8e8fcd2a 100644 --- a/viewer/Makefile.am +++ b/viewer/Makefile.am @@ -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 @@ -13,5 +15,3 @@ endif libtesseract_viewer_la_SOURCES = \ scrollview.cpp svmnode.cpp svutil.cpp svpaint.cpp - - diff --git a/wordrec/Makefile.am b/wordrec/Makefile.am index fb542b58..a3acada5 100644 --- a/wordrec/Makefile.am +++ b/wordrec/Makefile.am @@ -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 \