added compilation option TESSDATA_PREFIX to put the data files in an absolute location

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@14 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
tmbdev 2007-03-30 19:43:30 +00:00
parent 9a1c5a9be2
commit 37b9f1244c
3 changed files with 13 additions and 4 deletions

View File

@ -64,12 +64,21 @@ void main_setup( /*main demo program */
STRING varfile; /*name of file */
imagebasename = basename; /*name of image */
#ifdef TESSDATA_PREFIX
#define _STR(a) #a
#define _XSTR(a) _STR(a)
datadir = _XSTR(TESSDATA_PREFIX);
#undef _XSTR
#undef _STR
#else
if (getpath (argv0, datadir) < 0)
#ifdef __UNIX__
CANTOPENFILE.error ("main", ABORT, "%s to get path", argv[0]);
#else
NO_PATH.error ("main", DBG, NULL);
#endif
#endif
for (arg = 0; arg < argc; arg++) {
if (argv[arg][0] == '+' || argv[arg][0] == '-') {
@ -99,6 +108,7 @@ void main_setup( /*main demo program */
if (m_print_variables)
print_variables(stdout); /*print them all */
datadir += m_data_sub_dir; /*data directory */
#ifdef __UNIX__

5
configure vendored
View File

@ -1359,7 +1359,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
tesseract
ac_aux_dir=
for ac_dir in config $srcdir/config; do
@ -4215,7 +4214,7 @@ fi;
OPTS="$OPTS $VCOPTS_COMMON /Ow /O2"
else
opt="-O3"
opt="-O2"
echo "$as_me:$LINENO: checking if $CXX accepts $opt" >&5
echo $ECHO_N "checking if $CXX accepts $opt... $ECHO_C" >&6
echo 'void f(){}' > conftest.cc
@ -4223,7 +4222,7 @@ echo $ECHO_N "checking if $CXX accepts $opt... $ECHO_C" >&6
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
rm conftest.*
OPTS="$OPTS -O3"
OPTS="$OPTS -O2"
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

View File

@ -270,7 +270,7 @@ void print_dawg_node(EDGE_ARRAY dawg, NODE_REF node) {
void read_squished_dawg(char *filename, EDGE_ARRAY dawg, INT32 max_num_edges) {
FILE *file;
EDGE_REF edge;
INT32 num_edges;
INT32 num_edges = 0;
INT32 node_count = 0;
if (debug) print_string ("read_debug");