diff --git a/Makefile.am b/Makefile.am index 0715931c6e77cb294856e39a3c5095c4c860d36f..b756d8a0a46efd34dfc8fb95953e46852ffb6d73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,14 @@ ## run autogen.sh to create Makefile.in from this file ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = ccutil viewer cutil image ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . java tessdata testing doc training +SUBDIRS = ccutil viewer cutil image ccstruct dict classify wordrec neural_networks/runtime textord cube ccmain api . tessdata testing doc training + +if !GRAPHICS_DISABLED +SUBDIRS += java +endif #if USING_GETTEXT #SUBDIRS += po -#AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" +#AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" #endif EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \ diff --git a/api/Makefile.am b/api/Makefile.am index 7dc11c6af88c2a5ecf62f66afa029ea5158d9dd0..95def3562c9363a6faf89a4b53ca2527f1c4010a 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"\ +AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \ -I$(top_srcdir)/textord -I$(top_srcdir)/dict \ diff --git a/api/baseapi.cpp b/api/baseapi.cpp index b570cd455e50503bfee6dbbd858daf615fac6d0e..838ee81acccf7843f98740c0b5328bd989f81198 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -57,7 +57,7 @@ #include "osdetect.h" #include "params.h" -#ifdef _WIN32 +#if defined(_WIN32) && !defined(VERSION) #include "version.h" #endif diff --git a/ccmain/Makefile.am b/ccmain/Makefile.am index bd23c26a52318cdf70832df2e685cc990db41a9e..f6c6f05ef74c8b7ad700b8aff2508d87ba09a767 100644 --- a/ccmain/Makefile.am +++ b/ccmain/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \ diff --git a/ccstruct/Makefile.am b/ccstruct/Makefile.am index cde2b37620de003f805f6ee718035ee468d058a0..ee906fa4f9c8109ea7620382481d25729785d14c 100644 --- a/ccstruct/Makefile.am +++ b/ccstruct/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer @@ -24,10 +24,10 @@ else lib_LTLIBRARIES = libtesseract_ccstruct.la libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_ccstruct_la_LIBADD = \ - ../ccutil/libtesseract_ccutil.la \ - ../cutil/libtesseract_cutil.la \ - ../image/libtesseract_image.la \ - ../viewer/libtesseract_viewer.la + ../ccutil/libtesseract_ccutil.la \ + ../cutil/libtesseract_cutil.la \ + ../image/libtesseract_image.la \ + ../viewer/libtesseract_viewer.la endif libtesseract_ccstruct_la_SOURCES = \ diff --git a/ccutil/Makefile.am b/ccutil/Makefile.am index 403a41d4f961a4c226e1678c1d6067c9f8da7f2b..78cc38450fb0efaad81d4421d55cb8bbd2e1cf43 100644 --- a/ccutil/Makefile.am +++ b/ccutil/Makefile.am @@ -1,5 +1,9 @@ SUBDIRS = -AM_CXXFLAGS = -DTESSDATA_PREFIX=@datadir@/ +AM_CXXFLAGS = + +if !NO_TESSDATA_PREFIX +AM_CXXFLAGS += -DTESSDATA_PREFIX=@datadir@/ +endif if VISIBILITY AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden @@ -42,3 +46,8 @@ if EMBEDDED include_HEADERS += scanutils.h libtesseract_ccutil_la_SOURCES += scanutils.cpp endif + +if MINGW +AM_CPPFLAGS += -I$(top_srcdir)/vs2008/port -DWINDLLNAME=\"lib@GENERIC_LIBRARY_NAME@\" +libtesseract_ccutil_la_SOURCES += ../vs2008/port/strtok_r.cpp +endif \ No newline at end of file diff --git a/classify/Makefile.am b/classify/Makefile.am index 729bc3c3d3e03acdd0229ba69e686fc8e15df129..8b352a99f2988d476985335748590d475f91e9c0 100644 --- a/classify/Makefile.am +++ b/classify/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +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 @@ -27,12 +27,12 @@ else lib_LTLIBRARIES = libtesseract_classify.la libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_classify_la_LIBADD = \ - ../ccutil/libtesseract_ccutil.la \ - ../cutil/libtesseract_cutil.la \ - ../ccstruct/libtesseract_ccstruct.la \ - ../dict/libtesseract_dict.la \ - ../image/libtesseract_image.la \ - ../viewer/libtesseract_viewer.la + ../ccutil/libtesseract_ccutil.la \ + ../cutil/libtesseract_cutil.la \ + ../ccstruct/libtesseract_ccstruct.la \ + ../dict/libtesseract_dict.la \ + ../image/libtesseract_image.la \ + ../viewer/libtesseract_viewer.la endif libtesseract_classify_la_SOURCES = \ diff --git a/configure.ac b/configure.ac index a8d3e6476cfac440b0e44bf9a2dca3f1e86efa2d..d0163db4033bd6f28e2e4bd3ab1a5496418c3bdf 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,6 @@ AC_REVISION($Id: configure.ac,v 1.4 2007/02/02 22:38:17 theraysmith Exp $) AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR(api/tesseractmain.cpp) AC_PREFIX_DEFAULT(/usr/local) -AC_CANONICAL_HOST # Define date of package, etc. Could be useful in auto-generated # documentation. @@ -53,6 +52,30 @@ GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION AC_SUBST(GENERIC_RELEASE) AC_SUBST(GENERIC_VERSION) +# default conditional +AM_CONDITIONAL(MINGW, false) +AM_CONDITIONAL(GRAPHICS_DISABLED, false) + +# +# Platform specific setup +# +############################# +AC_CANONICAL_HOST +case $host_os in + mingw32*) + AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) + AM_CONDITIONAL(MINGW, true) + #AC_SUBST([AM_CPPFLAGS], ["-DWINDLLNAME=\"lib$GENERIC_LIBRARY_NAME\""]) + #AC_SUBST([AM_CPPFLAGS], ["-D__BLOB_T_DEFINED -DWINDLLNAME=\"lib$GENERIC_LIBRARY_NAME\""]) + AC_SUBST([AM_CPPFLAGS], ["-D__BLOB_T_DEFINED"]) + AC_SUBST([AM_LDFLAGS], ['-Wl,-no-undefined -Wl,--as-needed']) + #AM_LDFLAGS='-Wl,-no-undefined -Wl,--as-needed' + ;; + *) + # default + ;; +esac + includedir="${includedir}/tesseract" AC_ARG_WITH(extra-includes, @@ -81,7 +104,8 @@ AC_HELP_STRING([--disable-graphics],[disable graphics (ScrollView)])], [enable_graphics="yes"]) AC_MSG_RESULT($enable_graphics) if test "$enable_graphics" = "no"; then - AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics]) + AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics]) + AM_CONDITIONAL(GRAPHICS_DISABLED, true) fi # check whether to build embedded version @@ -93,8 +117,6 @@ AC_ARG_ENABLE([embedded], AC_MSG_RESULT($enable_embedded) AM_CONDITIONAL([EMBEDDED], [test "$enable_embedded" = "yes"]) if test "$enable_embedded" = "yes"; then - #AC_DEFINE([EMBEDDED], [], [Embedded Mode]) - AC_SUBST([AM_CXXFLAGS], [-DEMBEDDED]) AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED]) fi @@ -118,6 +140,14 @@ AC_ARG_ENABLE([multiple-libraries], AC_MSG_RESULT($enable_mlibs) AM_CONDITIONAL([USING_MULTIPLELIBS], [test "$enable_mlibs" = "yes"]) +# Check if tessdata-prefix is disabled +AC_MSG_CHECKING(whether to use tessdata-prefix) +AC_ARG_ENABLE(tessdata-prefix, + [AC_HELP_STRING([--disable-tessdata-prefix], + [dont set TESSDATA-PREFIX during compile])], + [tessdata_prefix="no"], [tessdata_prefix="yes"]) +AC_MSG_RESULT($tessdata_prefix) +AM_CONDITIONAL([NO_TESSDATA_PREFIX], [test "$tessdata_prefix" = "no"]) #localedir='${prefix}/share/locale' @@ -459,4 +489,3 @@ AH_BOTTOM([ /* config_auto.h: end */ #endif ]) - diff --git a/cube/Makefile.am b/cube/Makefile.am index cf48be8a08087b09143d7a8399f749ef776c7dbc..9c8774c3e6d51f145596066476e6437add15ed62 100644 --- a/cube/Makefile.am +++ b/cube/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \ @@ -31,15 +31,15 @@ else lib_LTLIBRARIES = libtesseract_cube.la libtesseract_cube_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_cube_la_LIBADD = \ - ../ccstruct/libtesseract_ccstruct.la \ - ../ccutil/libtesseract_ccutil.la \ - ../neural_networks/runtime/libtesseract_neural.la \ - ../image/libtesseract_image.la \ - ../viewer/libtesseract_viewer.la \ - ../wordrec/libtesseract_wordrec.la \ - ../cutil/libtesseract_cutil.la \ - ../classify/libtesseract_classify.la \ - ../dict/libtesseract_dict.la + ../ccstruct/libtesseract_ccstruct.la \ + ../ccutil/libtesseract_ccutil.la \ + ../neural_networks/runtime/libtesseract_neural.la \ + ../image/libtesseract_image.la \ + ../viewer/libtesseract_viewer.la \ + ../wordrec/libtesseract_wordrec.la \ + ../cutil/libtesseract_cutil.la \ + ../classify/libtesseract_classify.la \ + ../dict/libtesseract_dict.la endif libtesseract_cube_la_SOURCES = \ diff --git a/cutil/Makefile.am b/cutil/Makefile.am index 2c861d97ec73664b01acd2810cf262ba02080361..1028d9488304a3201471bd01ef38b1baab542dab 100644 --- a/cutil/Makefile.am +++ b/cutil/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer +AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer if VISIBILITY AM_CPPFLAGS += -DTESS_EXPORTS \ diff --git a/dict/Makefile.am b/dict/Makefile.am index 288d41fd9930375df383fa532284ea606fe8ac91..44e41a5100f81e5035a474eb0af83e824e91bb3b 100644 --- a/dict/Makefile.am +++ b/dict/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ +AM_CPPFLAGS += -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/viewer -I$(top_srcdir)/image if VISIBILITY @@ -16,11 +16,11 @@ else lib_LTLIBRARIES = libtesseract_dict.la libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_dict_la_LIBADD = \ - ../ccutil/libtesseract_ccutil.la \ - ../cutil/libtesseract_cutil.la \ - ../ccstruct/libtesseract_ccstruct.la \ - ../image/libtesseract_image.la \ - ../viewer/libtesseract_viewer.la + ../ccutil/libtesseract_ccutil.la \ + ../cutil/libtesseract_cutil.la \ + ../ccstruct/libtesseract_ccstruct.la \ + ../image/libtesseract_image.la \ + ../viewer/libtesseract_viewer.la endif libtesseract_dict_la_SOURCES = \ diff --git a/image/Makefile.am b/image/Makefile.am index 9722c5494b78de9d33b4da006e9d9c5f7ea08b87..cdc171f6f30ac56aae593ccc00307d5262912065 100644 --- a/image/Makefile.am +++ b/image/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer +AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer if VISIBILITY AM_CPPFLAGS += -DTESS_EXPORTS \ @@ -15,8 +15,8 @@ else lib_LTLIBRARIES = libtesseract_image.la libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_image_la_LIBADD = \ - ../ccutil/libtesseract_ccutil.la \ - ../viewer/libtesseract_viewer.la + ../ccutil/libtesseract_ccutil.la \ + ../viewer/libtesseract_viewer.la endif libtesseract_image_la_SOURCES = \ diff --git a/neural_networks/runtime/Makefile.am b/neural_networks/runtime/Makefile.am index 856bcf2a6bccbd3a27963bfcea24f1bac884db17..de43768f54c8dcf7fa5ee20c6d4ce3e69f0ffa14 100644 --- a/neural_networks/runtime/Makefile.am +++ b/neural_networks/runtime/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \ diff --git a/textord/Makefile.am b/textord/Makefile.am index 17cf729f858cf53d3ecbd4e6f26ec361a8ceed9b..52230cc55ad609b609cb47959aba3018a1640422 100644 --- a/textord/Makefile.am +++ b/textord/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +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 \ @@ -29,14 +29,14 @@ else lib_LTLIBRARIES = libtesseract_textord.la libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_textord_la_LIBADD = \ - ../ccstruct/libtesseract_ccstruct.la \ - ../ccutil/libtesseract_ccutil.la \ - ../image/libtesseract_image.la \ - ../viewer/libtesseract_viewer.la \ - ../wordrec/libtesseract_wordrec.la \ - ../cutil/libtesseract_cutil.la \ - ../classify/libtesseract_classify.la \ - ../dict/libtesseract_dict.la + ../ccstruct/libtesseract_ccstruct.la \ + ../ccutil/libtesseract_ccutil.la \ + ../image/libtesseract_image.la \ + ../viewer/libtesseract_viewer.la \ + ../wordrec/libtesseract_wordrec.la \ + ../cutil/libtesseract_cutil.la \ + ../classify/libtesseract_classify.la \ + ../dict/libtesseract_dict.la endif libtesseract_textord_la_SOURCES = \ diff --git a/training/Makefile.am b/training/Makefile.am index a523f3f78efaf9e3baedb774f142c6adbd125eab..f72e76e186fc4ded2d48ba4e58ff2dca4f94d536 100644 --- a/training/Makefile.am +++ b/training/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +AM_CPPFLAGS += \ -DUSE_STD_NAMESPACE \ -I$(top_srcdir)/ccmain -I$(top_srcdir)/api \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ @@ -10,7 +10,7 @@ AM_CPPFLAGS = \ # TODO: training programs can not be linked to shared library created # with -fvisibility if VISIBILITY -AM_LDFLAGS = -all-static +AM_LDFLAGS += -all-static endif noinst_HEADERS = \ diff --git a/wordrec/Makefile.am b/wordrec/Makefile.am index bcddcb24edac6af13c04f7eec7d0c6a5e7789e69..34b4b49480e1f243fc0177d8158b100e9df4568c 100644 --- a/wordrec/Makefile.am +++ b/wordrec/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = \ +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 \ @@ -23,13 +23,13 @@ else lib_LTLIBRARIES = libtesseract_wordrec.la libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_wordrec_la_LIBADD = \ - ../ccstruct/libtesseract_ccstruct.la \ - ../ccutil/libtesseract_ccutil.la \ - ../cutil/libtesseract_cutil.la \ - ../classify/libtesseract_classify.la \ - ../image/libtesseract_image.la \ - ../dict/libtesseract_dict.la \ - ../viewer/libtesseract_viewer.la + ../ccstruct/libtesseract_ccstruct.la \ + ../ccutil/libtesseract_ccutil.la \ + ../cutil/libtesseract_cutil.la \ + ../classify/libtesseract_classify.la \ + ../image/libtesseract_image.la \ + ../dict/libtesseract_dict.la \ + ../viewer/libtesseract_viewer.la endif libtesseract_wordrec_la_SOURCES = \