提交 d4d4b8aa 编写于 作者: Z zdenop@gmail.com

improve autools system (mingw+msys fix); implementation of --disable-tessdata-prefix

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@708 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 c0cd2cd6
## run autogen.sh to create Makefile.in from this file ## run autogen.sh to create Makefile.in from this file
ACLOCAL_AMFLAGS = -I m4 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 #if USING_GETTEXT
#SUBDIRS += po #SUBDIRS += po
#AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" #AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"
#endif #endif
EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \ EXTRA_DIST = eurotext.tif phototest.tif ReleaseNotes \
......
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"\ AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \
-I$(top_srcdir)/textord -I$(top_srcdir)/dict \ -I$(top_srcdir)/textord -I$(top_srcdir)/dict \
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#include "osdetect.h" #include "osdetect.h"
#include "params.h" #include "params.h"
#ifdef _WIN32 #if defined(_WIN32) && !defined(VERSION)
#include "version.h" #include "version.h"
#endif #endif
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \ -DUSE_STD_NAMESPACE \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer -I$(top_srcdir)/image -I$(top_srcdir)/viewer
...@@ -24,10 +24,10 @@ else ...@@ -24,10 +24,10 @@ else
lib_LTLIBRARIES = libtesseract_ccstruct.la lib_LTLIBRARIES = libtesseract_ccstruct.la
libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_ccstruct_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_ccstruct_la_LIBADD = \ libtesseract_ccstruct_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
endif endif
libtesseract_ccstruct_la_SOURCES = \ libtesseract_ccstruct_la_SOURCES = \
......
SUBDIRS = SUBDIRS =
AM_CXXFLAGS = -DTESSDATA_PREFIX=@datadir@/ AM_CXXFLAGS =
if !NO_TESSDATA_PREFIX
AM_CXXFLAGS += -DTESSDATA_PREFIX=@datadir@/
endif
if VISIBILITY if VISIBILITY
AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden AM_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
...@@ -42,3 +46,8 @@ if EMBEDDED ...@@ -42,3 +46,8 @@ if EMBEDDED
include_HEADERS += scanutils.h include_HEADERS += scanutils.h
libtesseract_ccutil_la_SOURCES += scanutils.cpp libtesseract_ccutil_la_SOURCES += scanutils.cpp
endif 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
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer -I$(top_srcdir)/image -I$(top_srcdir)/viewer
...@@ -27,12 +27,12 @@ else ...@@ -27,12 +27,12 @@ else
lib_LTLIBRARIES = libtesseract_classify.la lib_LTLIBRARIES = libtesseract_classify.la
libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_classify_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_classify_la_LIBADD = \ libtesseract_classify_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../ccstruct/libtesseract_ccstruct.la \ ../ccstruct/libtesseract_ccstruct.la \
../dict/libtesseract_dict.la \ ../dict/libtesseract_dict.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
endif endif
libtesseract_classify_la_SOURCES = \ libtesseract_classify_la_SOURCES = \
......
...@@ -13,7 +13,6 @@ AC_REVISION($Id: configure.ac,v 1.4 2007/02/02 22:38:17 theraysmith Exp $) ...@@ -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_AUX_DIR(config)
AC_CONFIG_SRCDIR(api/tesseractmain.cpp) AC_CONFIG_SRCDIR(api/tesseractmain.cpp)
AC_PREFIX_DEFAULT(/usr/local) AC_PREFIX_DEFAULT(/usr/local)
AC_CANONICAL_HOST
# Define date of package, etc. Could be useful in auto-generated # Define date of package, etc. Could be useful in auto-generated
# documentation. # documentation.
...@@ -53,6 +52,30 @@ GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION ...@@ -53,6 +52,30 @@ GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
AC_SUBST(GENERIC_RELEASE) AC_SUBST(GENERIC_RELEASE)
AC_SUBST(GENERIC_VERSION) 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" includedir="${includedir}/tesseract"
AC_ARG_WITH(extra-includes, AC_ARG_WITH(extra-includes,
...@@ -81,7 +104,8 @@ AC_HELP_STRING([--disable-graphics],[disable graphics (ScrollView)])], ...@@ -81,7 +104,8 @@ AC_HELP_STRING([--disable-graphics],[disable graphics (ScrollView)])],
[enable_graphics="yes"]) [enable_graphics="yes"])
AC_MSG_RESULT($enable_graphics) AC_MSG_RESULT($enable_graphics)
if test "$enable_graphics" = "no"; then if test "$enable_graphics" = "no"; then
AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics]) AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics])
AM_CONDITIONAL(GRAPHICS_DISABLED, true)
fi fi
# check whether to build embedded version # check whether to build embedded version
...@@ -93,8 +117,6 @@ AC_ARG_ENABLE([embedded], ...@@ -93,8 +117,6 @@ AC_ARG_ENABLE([embedded],
AC_MSG_RESULT($enable_embedded) AC_MSG_RESULT($enable_embedded)
AM_CONDITIONAL([EMBEDDED], [test "$enable_embedded" = "yes"]) AM_CONDITIONAL([EMBEDDED], [test "$enable_embedded" = "yes"])
if test "$enable_embedded" = "yes"; then if test "$enable_embedded" = "yes"; then
#AC_DEFINE([EMBEDDED], [], [Embedded Mode])
AC_SUBST([AM_CXXFLAGS], [-DEMBEDDED])
AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED]) AC_SUBST([AM_CPPFLAGS], [-DEMBEDDED])
fi fi
...@@ -118,6 +140,14 @@ AC_ARG_ENABLE([multiple-libraries], ...@@ -118,6 +140,14 @@ AC_ARG_ENABLE([multiple-libraries],
AC_MSG_RESULT($enable_mlibs) AC_MSG_RESULT($enable_mlibs)
AM_CONDITIONAL([USING_MULTIPLELIBS], [test "$enable_mlibs" = "yes"]) 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' #localedir='${prefix}/share/locale'
...@@ -459,4 +489,3 @@ AH_BOTTOM([ ...@@ -459,4 +489,3 @@ AH_BOTTOM([
/* config_auto.h: end */ /* config_auto.h: end */
#endif #endif
]) ])
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \ -DUSE_STD_NAMESPACE \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
...@@ -31,15 +31,15 @@ else ...@@ -31,15 +31,15 @@ else
lib_LTLIBRARIES = libtesseract_cube.la lib_LTLIBRARIES = libtesseract_cube.la
libtesseract_cube_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_cube_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_cube_la_LIBADD = \ libtesseract_cube_la_LIBADD = \
../ccstruct/libtesseract_ccstruct.la \ ../ccstruct/libtesseract_ccstruct.la \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../neural_networks/runtime/libtesseract_neural.la \ ../neural_networks/runtime/libtesseract_neural.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la \ ../viewer/libtesseract_viewer.la \
../wordrec/libtesseract_wordrec.la \ ../wordrec/libtesseract_wordrec.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../classify/libtesseract_classify.la \ ../classify/libtesseract_classify.la \
../dict/libtesseract_dict.la ../dict/libtesseract_dict.la
endif endif
libtesseract_cube_la_SOURCES = \ libtesseract_cube_la_SOURCES = \
......
AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer
if VISIBILITY if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \ AM_CPPFLAGS += -DTESS_EXPORTS \
......
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 -I$(top_srcdir)/ccstruct -I$(top_srcdir)/viewer -I$(top_srcdir)/image
if VISIBILITY if VISIBILITY
...@@ -16,11 +16,11 @@ else ...@@ -16,11 +16,11 @@ else
lib_LTLIBRARIES = libtesseract_dict.la lib_LTLIBRARIES = libtesseract_dict.la
libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_dict_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_dict_la_LIBADD = \ libtesseract_dict_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../ccstruct/libtesseract_ccstruct.la \ ../ccstruct/libtesseract_ccstruct.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
endif endif
libtesseract_dict_la_SOURCES = \ libtesseract_dict_la_SOURCES = \
......
AM_CPPFLAGS = -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer
if VISIBILITY if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \ AM_CPPFLAGS += -DTESS_EXPORTS \
...@@ -15,8 +15,8 @@ else ...@@ -15,8 +15,8 @@ else
lib_LTLIBRARIES = libtesseract_image.la lib_LTLIBRARIES = libtesseract_image.la
libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_image_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_image_la_LIBADD = \ libtesseract_image_la_LIBADD = \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
endif endif
libtesseract_image_la_SOURCES = \ libtesseract_image_la_SOURCES = \
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \ -DUSE_STD_NAMESPACE \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/image -I$(top_srcdir)/viewer \ -I$(top_srcdir)/image -I$(top_srcdir)/viewer \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \ -I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \
...@@ -29,14 +29,14 @@ else ...@@ -29,14 +29,14 @@ else
lib_LTLIBRARIES = libtesseract_textord.la lib_LTLIBRARIES = libtesseract_textord.la
libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_textord_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_textord_la_LIBADD = \ libtesseract_textord_la_LIBADD = \
../ccstruct/libtesseract_ccstruct.la \ ../ccstruct/libtesseract_ccstruct.la \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../viewer/libtesseract_viewer.la \ ../viewer/libtesseract_viewer.la \
../wordrec/libtesseract_wordrec.la \ ../wordrec/libtesseract_wordrec.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../classify/libtesseract_classify.la \ ../classify/libtesseract_classify.la \
../dict/libtesseract_dict.la ../dict/libtesseract_dict.la
endif endif
libtesseract_textord_la_SOURCES = \ libtesseract_textord_la_SOURCES = \
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \ -DUSE_STD_NAMESPACE \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/api \ -I$(top_srcdir)/ccmain -I$(top_srcdir)/api \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \ -I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
...@@ -10,7 +10,7 @@ AM_CPPFLAGS = \ ...@@ -10,7 +10,7 @@ AM_CPPFLAGS = \
# TODO: training programs can not be linked to shared library created # TODO: training programs can not be linked to shared library created
# with -fvisibility # with -fvisibility
if VISIBILITY if VISIBILITY
AM_LDFLAGS = -all-static AM_LDFLAGS += -all-static
endif endif
noinst_HEADERS = \ noinst_HEADERS = \
......
AM_CPPFLAGS = \ AM_CPPFLAGS += \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \ -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify \ -I$(top_srcdir)/cutil -I$(top_srcdir)/classify \
-I$(top_srcdir)/image -I$(top_srcdir)/dict \ -I$(top_srcdir)/image -I$(top_srcdir)/dict \
...@@ -23,13 +23,13 @@ else ...@@ -23,13 +23,13 @@ else
lib_LTLIBRARIES = libtesseract_wordrec.la lib_LTLIBRARIES = libtesseract_wordrec.la
libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION) libtesseract_wordrec_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
libtesseract_wordrec_la_LIBADD = \ libtesseract_wordrec_la_LIBADD = \
../ccstruct/libtesseract_ccstruct.la \ ../ccstruct/libtesseract_ccstruct.la \
../ccutil/libtesseract_ccutil.la \ ../ccutil/libtesseract_ccutil.la \
../cutil/libtesseract_cutil.la \ ../cutil/libtesseract_cutil.la \
../classify/libtesseract_classify.la \ ../classify/libtesseract_classify.la \
../image/libtesseract_image.la \ ../image/libtesseract_image.la \
../dict/libtesseract_dict.la \ ../dict/libtesseract_dict.la \
../viewer/libtesseract_viewer.la ../viewer/libtesseract_viewer.la
endif endif
libtesseract_wordrec_la_SOURCES = \ libtesseract_wordrec_la_SOURCES = \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册