Skip to content

Commit

Permalink
improve autools system (mingw+msys fix); implementation of --disable-…
Browse files Browse the repository at this point in the history
…tessdata-prefix

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@708 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
zdenop@gmail.com committed Mar 22, 2012
1 parent c0cd2cd commit d4d4b8a
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 63 deletions.
8 changes: 6 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion api/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#include "osdetect.h"
#include "params.h"

#ifdef _WIN32
#if defined(_WIN32) && !defined(VERSION)
#include "version.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion ccmain/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions ccstruct/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CPPFLAGS = \
AM_CPPFLAGS += \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer

Expand All @@ -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 = \
Expand Down
11 changes: 10 additions & 1 deletion ccutil/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
14 changes: 7 additions & 7 deletions classify/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = \
Expand Down
39 changes: 34 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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'

Expand Down Expand Up @@ -459,4 +489,3 @@ AH_BOTTOM([
/* config_auto.h: end */
#endif
])

20 changes: 10 additions & 10 deletions cube/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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 = \
Expand Down
2 changes: 1 addition & 1 deletion cutil/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
12 changes: 6 additions & 6 deletions dict/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = \
Expand Down
6 changes: 3 additions & 3 deletions image/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 = \
Expand Down
2 changes: 1 addition & 1 deletion neural_networks/runtime/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
18 changes: 9 additions & 9 deletions textord/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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 = \
Expand Down
4 changes: 2 additions & 2 deletions training/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 = \
Expand Down
16 changes: 8 additions & 8 deletions wordrec/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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 = \
Expand Down

0 comments on commit d4d4b8a

Please sign in to comment.