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

fix for mingw32/g++ 4.8.1

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@998 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 adfac414
......@@ -73,14 +73,16 @@ tesseract_CPPFLAGS += -DTESS_IMPORTS
endif
tesseract_LDADD = libtesseract.la
if !OSX
tesseract_LDADD += -lrt
endif
if USE_OPENCL
tesseract_LDADD += $(OPENCL_LIB)
endif
if MINGW
tesseract_LDADD += -lws2_32
libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32
libtesseract_la_LDFLAGS += -no-undefined -Wl,--as-needed -lws2_32
endif
if ADD_RT
tesseract_LDADD += -lrt
endif
......@@ -26,6 +26,25 @@
#include <signal.h>
#endif
#if defined(_WIN32)
#ifdef _MSC_VER
#include "mathfix.h"
#elif MINGW
// workaround for stdlib.h with -std=c++11 for _splitpath and _MAX_FNAME
#undef __STRICT_ANSI__
#endif // _MSC_VER
#include <stdlib.h>
#include <windows.h>
#else
#include <dirent.h>
#include <libgen.h>
#include <string.h>
#endif // _WIN32
#if !defined(VERSION)
#include "version.h"
#endif
#include "allheaders.h"
#include "baseapi.h"
......@@ -54,22 +73,6 @@
#include "strngs.h"
#include "openclwrapper.h"
#ifdef _WIN32
#include <windows.h>
#include <stdlib.h>
#ifdef _MSC_VER
#include "mathfix.h"
#endif // _MSC_VER
#else
#include <dirent.h>
#include <libgen.h>
#include <string.h>
#endif // _WIN32
#if !defined(VERSION)
#include "version.h"
#endif
namespace tesseract {
/** Minimum sensible image size to be worth running tesseract. */
......@@ -370,7 +373,7 @@ void TessBaseAPI::GetAvailableLanguagesAsVector(
}
FindClose(handle);
}
#else
#else // _WIN32
DIR *dir;
struct dirent *dirent;
char *dot;
......
......@@ -20,10 +20,13 @@
#ifdef _WIN32
#ifndef __GNUC__
#include <windows.h>
#endif /* __GNUC__ */
#endif // __GNUC__
#ifndef unlink
#include <io.h>
#endif
#else
#include <unistd.h>
#endif
#endif // _WIN32
#ifdef _MSC_VER
#pragma warning(disable:4244) // Conversion warnings
#endif
......
......@@ -195,7 +195,7 @@ void PDBLK::plot( //draw outline
// tprintf("Block %d bottom left is (%d,%d)\n",
// serial,startpt.x(),startpt.y());
char temp_buff[34];
#ifdef __UNIX__
#if defined(__UNIX__) || defined(MINGW)
sprintf(temp_buff, INT32FORMAT, serial);
#else
ultoa (serial, temp_buff, 10);
......
......@@ -252,7 +252,7 @@ void POLY_BLOCK::plot(ScrollView* window, inT32 num) {
if (num > 0) {
window->TextAttributes("Times", 80, false, false, false);
char temp_buff[34];
#ifdef __UNIX__
#if defined(__UNIX__) || defined(MINGW)
sprintf(temp_buff, INT32FORMAT, num);
#else
ltoa (num, temp_buff, 10);
......
......@@ -8,7 +8,7 @@
AC_PREREQ(2.50)
AC_INIT([tesseract], [3.03], [http://code.google.com/p/tesseract-ocr/issues/list])
CXXFLAGS=""
CXXFLAGS=${CXXFLAGS:-""}
AC_CONFIG_MACRO_DIR([m4])
AC_REVISION([$Revision$])
AC_CONFIG_AUX_DIR(config)
......@@ -78,21 +78,24 @@ case "${host_os}" in
mingw32*)
AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
AM_CONDITIONAL(MINGW, true)
AM_CONDITIONAL(ADD_RT, false)
AC_SUBST([AM_LDFLAGS], ['-Wl,-no-undefined -Wl,--as-needed'])
;;
solaris*)
LIBS="-lsocket -lnsl -lrt -lxnet"
AM_CONDITIONAL(ADD_RT, true)
;;
*-*-darwin*)
OPENCL_LIBS="-framework OpenCL"
OPENCL_INC=""
AM_CONDITIONAL(OSX, true)
AM_CONDITIONAL(ADD_RT, false)
;;
powerpc-*-darwin*)
OPENCL_LIBS=""
;;
*)
*)
# default
AM_CONDITIONAL(ADD_RT, true)
;;
esac
......
#ifdef WIN32
#ifdef _WIN32
#include <Windows.h>
#include <io.h>
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册