comparison mupdf-source/thirdparty/tesseract/configure.ac @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 # -*-Shell-script-*-
2 #
3 # Copyright (c) Luc Vincent
4
5 # ----------------------------------------
6 # Initialization
7 # ----------------------------------------
8 AC_PREREQ([2.69])
9 AC_INIT([tesseract],
10 [m4_esyscmd_s([test -d .git && git describe --abbrev=4 2>/dev/null || cat VERSION])],
11 [https://github.com/tesseract-ocr/tesseract/issues],,
12 [https://github.com/tesseract-ocr/tesseract/])
13
14 # Store command like options for CXXFLAGS
15 OLD_CXXFLAGS=$CXXFLAGS
16 AC_PROG_CXX([g++ clang++])
17 # reset compiler flags to initial flags
18 AC_LANG([C++])
19 AC_LANG_COMPILER_REQUIRE
20 CXXFLAGS=${CXXFLAGS:-""}
21 AC_CONFIG_MACRO_DIR([m4])
22 AC_CONFIG_AUX_DIR([config])
23 AC_CONFIG_SRCDIR([src/tesseract.cpp])
24 AC_PREFIX_DEFAULT([/usr/local])
25
26 # Automake configuration. Do not require README file (we use README.md).
27 AM_INIT_AUTOMAKE([foreign subdir-objects nostdinc])
28
29 # Define date of package, etc. Could be useful in auto-generated
30 # documentation.
31 PACKAGE_YEAR=2024
32 PACKAGE_DATE="11/10"
33
34 abs_top_srcdir=`AS_DIRNAME([$0])`
35
36 AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["${PACKAGE_NAME}"], [Name of package])
37 AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["${PACKAGE_VERSION}"], [Version number])
38 AC_DEFINE_UNQUOTED([PACKAGE_YEAR], ["$PACKAGE_YEAR"], [Official year for this release])
39 AC_DEFINE_UNQUOTED([PACKAGE_DATE], ["$PACKAGE_DATE"], [Official date of release])
40
41 AC_SUBST([PACKAGE_NAME])
42 AC_SUBST([PACKAGE_VERSION])
43 AC_SUBST([PACKAGE_YEAR])
44 AC_SUBST([PACKAGE_DATE])
45
46 GENERIC_LIBRARY_NAME=tesseract
47
48 # Release versioning. Get versions from PACKAGE_VERSION.
49 AX_SPLIT_VERSION
50 GENERIC_MAJOR_VERSION=$(echo "$AX_MAJOR_VERSION" | $SED 's/^[[^0-9]]*//')
51 GENERIC_MINOR_VERSION=$AX_MINOR_VERSION
52 GENERIC_MICRO_VERSION=`echo "$AX_POINT_VERSION" | $SED 's/^\([[0-9]][[0-9]]*\).*/\1/'`
53
54 # API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
55 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
56 GENERIC_LIBRARY_VERSION=$GENERIC_MAJOR_VERSION:$GENERIC_MINOR_VERSION
57 AC_SUBST([GENERIC_API_VERSION])
58 AC_SUBST([GENERIC_MAJOR_VERSION])
59 AC_SUBST([GENERIC_MINOR_VERSION])
60 AC_SUBST([GENERIC_MICRO_VERSION])
61
62 AC_SUBST([GENERIC_LIBRARY_VERSION])
63 PACKAGE=$GENERIC_LIBRARY_NAME
64 AC_SUBST([GENERIC_LIBRARY_NAME])
65
66 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
67 GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
68 AC_SUBST([GENERIC_RELEASE])
69 AC_SUBST([GENERIC_VERSION])
70
71 AC_CONFIG_HEADERS([include/config_auto.h:config/config.h.in])
72
73 # default conditional
74 AM_CONDITIONAL([T_WIN], false)
75 AM_CONDITIONAL([MINGW], false)
76 AM_CONDITIONAL([GRAPHICS_DISABLED], false)
77 AC_SUBST([AM_CPPFLAGS])
78
79 # Be less noisy by default.
80 # Can be overridden with `configure --disable-silent-rules` or with `make V=1`.
81 AM_SILENT_RULES([yes])
82
83 #############################
84 #
85 # Platform specific setup
86 #
87 #############################
88 AC_CANONICAL_HOST
89 case "${host_os}" in
90 mingw*)
91 AC_DEFINE_UNQUOTED([MINGW], 1, [This is a MinGW system])
92 AM_CONDITIONAL([T_WIN], true)
93 AM_CONDITIONAL([MINGW], true)
94 AM_CONDITIONAL([ADD_RT], false)
95 AC_SUBST([AM_LDFLAGS], ['-no-undefined'])
96 ;;
97 cygwin*)
98 AM_CONDITIONAL([ADD_RT], false)
99 AC_SUBST([NOUNDEFINED], ['-no-undefined'])
100 ;;
101 solaris*)
102 LIBS="$LIBS -lsocket -lnsl -lrt -lxnet"
103 AM_CONDITIONAL([ADD_RT], true)
104 ;;
105 *darwin*)
106 AM_CONDITIONAL([ADD_RT], false)
107 ;;
108 *android*|openbsd*)
109 AM_CONDITIONAL([ADD_RT], false)
110 ;;
111 powerpc-*-darwin*)
112 ;;
113 *)
114 # default
115 AM_CONDITIONAL([ADD_RT], true)
116 ;;
117 esac
118
119 WERROR=-Werror
120 # The test code used by AX_CHECK_COMPILE_FLAG uses an empty statement
121 # and unused macros which must not raise a compiler error, but it must
122 # be an error if flags like -avx are ignored on ARM and other
123 # architectures because they are unsupported.
124 AX_CHECK_COMPILE_FLAG([-Werror=unused-command-line-argument], [WERROR=-Werror=unused-command-line-argument])
125
126 ## Checks for supported compiler options.
127
128 AM_CONDITIONAL([HAVE_AVX], false)
129 AM_CONDITIONAL([HAVE_AVX2], false)
130 AM_CONDITIONAL([HAVE_AVX512F], false)
131 AM_CONDITIONAL([HAVE_FMA], false)
132 AM_CONDITIONAL([HAVE_SSE4_1], false)
133 AM_CONDITIONAL([HAVE_NEON], false)
134 AM_CONDITIONAL([HAVE_RVV], false)
135
136 case "${host_cpu}" in
137
138 amd64|*86*)
139
140 AX_CHECK_COMPILE_FLAG([-mavx], [avx=true], [avx=false], [$WERROR])
141 AM_CONDITIONAL([HAVE_AVX], ${avx})
142 if $avx; then
143 AC_DEFINE([HAVE_AVX], [1], [Enable AVX instructions])
144 fi
145
146 AX_CHECK_COMPILE_FLAG([-mavx2], [avx2=true], [avx2=false], [$WERROR])
147 AM_CONDITIONAL([HAVE_AVX2], $avx2)
148 if $avx2; then
149 AC_DEFINE([HAVE_AVX2], [1], [Enable AVX2 instructions])
150 fi
151
152 AX_CHECK_COMPILE_FLAG([-mavx512f], [avx512f=true], [avx512f=false], [$WERROR])
153 AM_CONDITIONAL([HAVE_AVX512F], $avx512f)
154 if $avx512f; then
155 AC_DEFINE([HAVE_AVX512F], [1], [Enable AVX512F instructions])
156 fi
157
158 AX_CHECK_COMPILE_FLAG([-mfma], [fma=true], [fma=false], [$WERROR])
159 AM_CONDITIONAL([HAVE_FMA], $fma)
160 if $fma; then
161 AC_DEFINE([HAVE_FMA], [1], [Enable FMA instructions])
162 fi
163
164 AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false], [$WERROR])
165 AM_CONDITIONAL([HAVE_SSE4_1], $sse41)
166 if $sse41; then
167 AC_DEFINE([HAVE_SSE4_1], [1], [Enable SSE 4.1 instructions])
168 fi
169
170 ;;
171
172 aarch64*|arm64)
173
174 # ARMv8 always has NEON and does not need special compiler flags.
175 AM_CONDITIONAL([HAVE_NEON], true)
176 AC_DEFINE([HAVE_NEON], [1], [Enable NEON instructions])
177 ;;
178
179 arm*)
180
181 AX_CHECK_COMPILE_FLAG([-mfpu=neon], [neon=true], [neon=false], [$WERROR])
182 AM_CONDITIONAL([HAVE_NEON], $neon)
183 if $neon; then
184 AC_DEFINE([HAVE_NEON], [1], [Enable NEON instructions])
185 NEON_CXXFLAGS="-mfpu=neon"
186 AC_SUBST([NEON_CXXFLAGS])
187 check_for_neon=1
188 fi
189
190 ;;
191
192 riscv*)
193
194 AX_CHECK_COMPILE_FLAG([-march=rv64gcv], [rvv=true], [rvv=false], [$WERROR])
195 AM_CONDITIONAL([HAVE_RVV], [$rvv])
196 if $rvv; then
197 AC_DEFINE([HAVE_RVV], [1], [Enable RVV instructions])
198 check_for_rvv=1
199 fi
200 ;;
201
202 *)
203
204 AC_MSG_WARN([No compiler options for $host_cpu])
205
206 esac
207
208 # check whether feenableexcept is supported. some C libraries (e.g. uclibc) don't.
209 AC_CHECK_FUNCS([feenableexcept])
210
211 # additional checks for NEON targets
212 if test x$check_for_neon = x1; then
213 AC_MSG_NOTICE([checking how to detect NEON availability])
214 AC_CHECK_FUNCS([getauxval elf_aux_info android_getCpuFamily])
215
216 if test $ac_cv_func_getauxval = no && test $ac_cv_func_elf_aux_info = no && test $ac_cv_func_android_getCpuFamily = no; then
217 AC_MSG_WARN([NEON is available, but we don't know how to check for it. Will not be able to use NEON.])
218 fi
219 fi
220
221 # additional checks for RVV targets
222 if test x$check_for_rvv = x1; then
223 AC_MSG_NOTICE([checking how to detect RVV availability])
224 AC_CHECK_FUNCS([getauxval])
225
226 if test $ac_cv_func_getauxval = no; then
227 AC_MSG_WARN([RVV is available, but we don't know how to check for it. Will not be able to use RVV.])
228 fi
229 fi
230
231 AX_CHECK_COMPILE_FLAG([-fopenmp-simd], [openmp_simd=true], [openmp_simd=false], [$WERROR])
232 AM_CONDITIONAL([OPENMP_SIMD], $openmp_simd)
233
234 AC_ARG_WITH([extra-includes],
235 [AS_HELP_STRING([--with-extra-includes=DIR],
236 [Define an additional directory for include files])],
237 [if test -d "$withval" ; then
238 CFLAGS="$CFLAGS -I$withval"
239 else
240 AC_MSG_ERROR([Cannot stat directory $withval])
241 fi])
242
243 AC_ARG_WITH([extra-libraries],
244 [AS_HELP_STRING([--with-extra-libraries=DIR],
245 [Define an additional directory for library files])],
246 [if test -d "$withval" ; then
247 LDFLAGS="$LDFLAGS -L$withval"
248 else
249 AC_MSG_ERROR([Cannot stat directory $withval])
250 fi])
251
252 AC_MSG_CHECKING([--enable-float32 argument])
253 AC_ARG_ENABLE([float32],
254 AS_HELP_STRING([--disable-float32], [disable float and enable double for LSTM]))
255 AC_MSG_RESULT([$enable_float32])
256 if test "$enable_float32" != "no"; then
257 AC_DEFINE([FAST_FLOAT], [1], [Enable float for LSTM])
258 fi
259
260 AC_MSG_CHECKING([--enable-graphics argument])
261 AC_ARG_ENABLE([graphics],
262 AS_HELP_STRING([--disable-graphics], [disable graphics (ScrollView)]))
263 AC_MSG_RESULT([$enable_graphics])
264 if test "$enable_graphics" = "no"; then
265 AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics])
266 AM_CONDITIONAL([GRAPHICS_DISABLED], true)
267 fi
268
269 AC_MSG_CHECKING([--enable-legacy argument])
270 AC_ARG_ENABLE([legacy],
271 AS_HELP_STRING([--disable-legacy], [disable the legacy OCR engine]))
272 AC_MSG_RESULT([$enable_legacy])
273 AM_CONDITIONAL([DISABLED_LEGACY_ENGINE], test "$enable_legacy" = "no")
274 if test "$enable_legacy" = "no"; then
275 AC_DEFINE([DISABLED_LEGACY_ENGINE], [1], [Disable legacy OCR engine])
276 fi
277
278 # check whether to build OpenMP support
279 AC_OPENMP
280
281 have_tiff=false
282 # Note that the first usage of AC_CHECK_HEADERS must be unconditional.
283 AC_CHECK_HEADERS([tiffio.h], [have_tiff=true], [have_tiff=false])
284
285 # Configure arguments which allow disabling some optional libraries.
286 AC_ARG_WITH([archive],
287 AS_HELP_STRING([--with-archive],
288 [Build with libarchive which supports compressed model files @<:@default=check@:>@]),
289 [], [with_archive=check])
290 AC_ARG_WITH([curl],
291 AS_HELP_STRING([--with-curl],
292 [Build with libcurl which supports processing an image URL @<:@default=check@:>@]),
293 [], [with_curl=check])
294
295 # https://lists.apple.com/archives/unix-porting/2009/Jan/msg00026.html
296 m4_define([MY_CHECK_FRAMEWORK],
297 [AC_CACHE_CHECK([if -framework $1 works],[my_cv_framework_$1],
298 [save_LIBS="$LIBS"
299 LIBS="$LIBS -framework $1"
300 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
301 [my_cv_framework_$1=yes],
302 [my_cv_framework_$1=no])
303 LIBS="$save_LIBS"
304 ])
305 if test "$my_cv_framework_$1"="yes"; then
306 AC_DEFINE(AS_TR_CPP([HAVE_FRAMEWORK_$1]), 1,
307 [Define if you have the $1 framework])
308 AS_TR_CPP([FRAMEWORK_$1])="-framework $1"
309 AC_SUBST(AS_TR_CPP([FRAMEWORK_$1]))
310 fi]
311 )
312
313 case "${host_os}" in
314 *darwin* | *-macos10*)
315 MY_CHECK_FRAMEWORK([Accelerate])
316 if test $my_cv_framework_Accelerate = yes; then
317 AM_CPPFLAGS="-DHAVE_FRAMEWORK_ACCELERATE $AM_CPPFLAGS"
318 AM_LDFLAGS="$AM_LDFLAGS -framework Accelerate"
319 fi
320 ;;
321 *)
322 # default
323 ;;
324 esac
325
326 # check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
327 # http://gcc.gnu.org/wiki/Visibility
328 # https://groups.google.com/g/tesseract-dev/c/l2ZFrpgYkSc/m/_cdYSRDSXuUJ
329 AC_MSG_CHECKING([--enable-visibility argument])
330 AC_ARG_ENABLE([visibility],
331 AS_HELP_STRING([--enable-visibility],
332 [enable experimental build with -fvisibility [default=no]]))
333 AC_MSG_RESULT([$enable_visibility])
334 AM_CONDITIONAL([VISIBILITY], [test "$enable_visibility" = "yes"])
335
336 # Check if tessdata-prefix is disabled
337 AC_MSG_CHECKING([whether to use tessdata-prefix])
338 AC_ARG_ENABLE([tessdata-prefix],
339 [AS_HELP_STRING([--disable-tessdata-prefix],
340 [don't set TESSDATA-PREFIX during compile])],
341 [tessdata_prefix="no"], [tessdata_prefix="yes"])
342 AC_MSG_RESULT([$tessdata_prefix])
343 AM_CONDITIONAL([NO_TESSDATA_PREFIX], [test "$tessdata_prefix" = "no"])
344
345
346 # Detect Clang compiler
347 AC_MSG_CHECKING([if compiling with clang])
348 AC_COMPILE_IFELSE(
349 [AC_LANG_PROGRAM([], [[
350 #ifndef __clang__
351 not clang
352 #endif
353 ]])],
354 [CLANG=yes], [CLANG=no])
355 AC_MSG_RESULT([$CLANG])
356
357 # Check whether to enable debugging
358 AC_MSG_CHECKING([whether to enable debugging])
359 AC_ARG_ENABLE([debug],
360 AS_HELP_STRING([--enable-debug], [turn on debugging [default=no]]))
361 AC_MSG_RESULT([$enable_debug])
362 if test x"$enable_debug" = x"yes"; then
363 CXXFLAGS=${CXXFLAGS:-"-O2"}
364 AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -DDEBUG -pedantic"
365 AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -DDEBUG -pedantic"
366 if test "x$CLANG" = "xyes"; then
367 # https://clang.llvm.org/docs/CommandGuide/clang.html
368 # clang treats -Og as -O1
369 AM_CPPFLAGS="$AM_CPPFLAGS -O0"
370 AM_CXXFLAGS="$AM_CXXFLAGS -O0"
371 else
372 AM_CPPFLAGS="$AM_CPPFLAGS -Og"
373 AM_CXXFLAGS="$AM_CXXFLAGS -Og"
374 fi
375 else
376 AM_CXXFLAGS="$AM_CXXFLAGS -O2 -DNDEBUG"
377 AM_CPPFLAGS="$AM_CPPFLAGS -O2 -DNDEBUG"
378 fi
379
380 # ----------------------------------------
381 # Init libtool
382 # ----------------------------------------
383
384 LT_INIT
385
386
387 # ----------------------------------------
388 # C++ related options
389 # ----------------------------------------
390 dnl **********************
391 dnl Turn on C++17 or newer
392 dnl **********************
393
394 CPLUSPLUS=
395 AX_CHECK_COMPILE_FLAG([-std=c++17], [CPLUSPLUS=17], [], [$WERROR])
396 AX_CHECK_COMPILE_FLAG([-std=c++20], [CPLUSPLUS=20], [], [$WERROR])
397
398 if test -z "$CPLUSPLUS"; then
399 AC_MSG_ERROR([Your compiler does not have the necessary C++17 support! Cannot proceed.])
400 fi
401
402 # Set C++17 or newer support based on platform/compiler
403 case "${host_os}" in
404 cygwin*)
405 CXXFLAGS="$CXXFLAGS -std=gnu++$CPLUSPLUS"
406 ;;
407 *-darwin* | *-macos10*)
408 CXXFLAGS="$CXXFLAGS -std=c++$CPLUSPLUS"
409 if test "x$CLANG" = "xyes"; then
410 LDFLAGS="$LDFLAGS -stdlib=libc++"
411 fi
412 ;;
413 *)
414 # default
415 CXXFLAGS="$CXXFLAGS -std=c++$CPLUSPLUS"
416 ;;
417 esac
418
419
420 # ----------------------------------------
421 # Check for libraries
422 # ----------------------------------------
423
424 AC_SEARCH_LIBS([pthread_create], [pthread])
425
426 # Set PKG_CONFIG_PATH for macOS with Homebrew unless it is already set.
427 AC_CHECK_PROG([have_brew], brew, true, false)
428 if $have_brew; then
429 brew_prefix=$(brew --prefix)
430 if test -z "$PKG_CONFIG_PATH"; then
431 PKG_CONFIG_PATH=$brew_prefix/opt/icu4c/lib/pkgconfig:$brew_prefix/opt/libarchive/lib/pkgconfig
432 export PKG_CONFIG_PATH
433 fi
434 fi
435
436 # ----------------------------------------
437 # Check for programs needed to build documentation.
438 # ----------------------------------------
439
440 AM_CONDITIONAL([ASCIIDOC], false)
441 AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], false)
442 AC_ARG_ENABLE([doc],
443 AS_HELP_STRING([--disable-doc], [disable build of documentation])
444 [],
445 [: m4_divert_text([DEFAULTS], [enable_doc=check])])
446 AS_IF([test "$enable_doc" != "no"], [
447 AC_CHECK_PROG([have_asciidoc], asciidoc, true, false)
448 AC_CHECK_PROG([have_xsltproc], xsltproc, true, false)
449 # macOS with Homebrew requires the environment variable
450 # XML_CATALOG_FILES for xsltproc.
451 if $have_asciidoc && $have_xsltproc; then
452 AM_CONDITIONAL([ASCIIDOC], true)
453 XML_CATALOG_FILES=
454 if $have_brew; then
455 catalog_file=$brew_prefix/etc/xml/catalog
456 if test -f $catalog_file; then
457 AM_CONDITIONAL([HAVE_XML_CATALOG_FILES], true)
458 XML_CATALOG_FILES=file:$catalog_file
459 else
460 AC_MSG_WARN([Missing file $catalog_file.])
461 fi
462 fi
463 AC_SUBST([XML_CATALOG_FILES])
464 else
465 AS_IF([test "x$enable_doc" != xcheck], [
466 AC_MSG_FAILURE(
467 [--enable-doc was given, but test for asciidoc and xsltproc failed])
468 ])
469 fi
470 ])
471
472 # ----------------------------------------
473 # Checks for typedefs, structures, and compiler characteristics.
474 # ----------------------------------------
475
476 AC_CHECK_TYPES([wchar_t],,, [#include "wchar.h"])
477 AC_CHECK_TYPES([long long int])
478
479 # ----------------------------------------
480 # Test auxiliary packages
481 # ----------------------------------------
482
483 AM_CONDITIONAL([HAVE_LIBCURL], false)
484 AS_IF([test "x$with_curl" != xno], [
485 PKG_CHECK_MODULES([libcurl], [libcurl], [have_libcurl=true], [have_libcurl=false])
486 AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl)
487 if $have_libcurl; then
488 AC_DEFINE([HAVE_LIBCURL], [1], [Enable libcurl])
489 else
490 AS_IF([test "x$with_curl" != xcheck], [
491 AC_MSG_FAILURE(
492 [--with-curl was given, but test for libcurl failed])
493 ])
494 fi
495 ])
496
497 PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false])
498 if $have_lept; then
499 CPPFLAGS="$CPPFLAGS $LEPTONICA_CFLAGS"
500 else
501 AC_MSG_ERROR([Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.])
502 fi
503
504 AM_CONDITIONAL([HAVE_LIBARCHIVE], false)
505 AS_IF([test "x$with_archive" != xno], [
506 PKG_CHECK_MODULES([libarchive], [libarchive], [have_libarchive=true], [have_libarchive=false])
507 AM_CONDITIONAL([HAVE_LIBARCHIVE], [$have_libarchive])
508 if $have_libarchive; then
509 AC_DEFINE([HAVE_LIBARCHIVE], [1], [Enable libarchive])
510 CPPFLAGS="$CPPFLAGS $libarchive_CFLAGS"
511 else
512 AS_IF([test "x$with_archive" != xcheck], [
513 AC_MSG_FAILURE(
514 [--with-archive was given, but test for libarchive failed])
515 ])
516 fi
517 ])
518
519 AM_CONDITIONAL([ENABLE_TRAINING], true)
520
521 # Check availability of ICU packages.
522 PKG_CHECK_MODULES([ICU_UC], [icu-uc >= 52.1], [have_icu_uc=true], [have_icu_uc=false])
523 PKG_CHECK_MODULES([ICU_I18N], [icu-i18n >= 52.1], [have_icu_i18n=true], [have_icu_i18n=false])
524 if !($have_icu_uc && $have_icu_i18n); then
525 AC_MSG_WARN([icu 52.1 or higher is required, but was not found.])
526 AC_MSG_WARN([Training tools WILL NOT be built.])
527 AC_MSG_WARN([Try to install libicu-dev package.])
528 AM_CONDITIONAL([ENABLE_TRAINING], false)
529 fi
530
531 # Check location of pango headers
532 PKG_CHECK_MODULES([pango], [pango >= 1.38.0], [have_pango=true], [have_pango=false])
533 if !($have_pango); then
534 AC_MSG_WARN([pango 1.38.0 or higher is required, but was not found.])
535 AC_MSG_WARN([Training tools WILL NOT be built.])
536 AC_MSG_WARN([Try to install libpango1.0-dev package.])
537 AM_CONDITIONAL([ENABLE_TRAINING], false)
538 fi
539
540 # Check location of cairo headers
541 PKG_CHECK_MODULES([cairo], [cairo], [have_cairo=true], [have_cairo=false])
542 if !($have_cairo); then
543 AC_MSG_WARN([Training tools WILL NOT be built because of missing cairo library.])
544 AC_MSG_WARN([Try to install libcairo-dev?? package.])
545 AM_CONDITIONAL([ENABLE_TRAINING], false)
546 fi
547
548 PKG_CHECK_MODULES([pangocairo], [pangocairo], [], [false])
549 PKG_CHECK_MODULES([pangoft2], [pangoft2], [], [false])
550
551 # ----------------------------------------
552 # Final Tasks and Output
553 # ----------------------------------------
554
555 # Output files
556 AC_CONFIG_FILES([include/tesseract/version.h])
557 AC_CONFIG_FILES([Makefile tesseract.pc])
558 AC_CONFIG_FILES([tessdata/Makefile])
559 AC_CONFIG_FILES([tessdata/configs/Makefile])
560 AC_CONFIG_FILES([tessdata/tessconfigs/Makefile])
561 AC_CONFIG_FILES([java/Makefile])
562 AC_CONFIG_FILES([java/com/Makefile])
563 AC_CONFIG_FILES([java/com/google/Makefile])
564 AC_CONFIG_FILES([java/com/google/scrollview/Makefile])
565 AC_CONFIG_FILES([java/com/google/scrollview/events/Makefile])
566 AC_CONFIG_FILES([java/com/google/scrollview/ui/Makefile])
567 AC_CONFIG_FILES([nsis/Makefile])
568 AC_OUTPUT
569
570 # Final message
571 echo ""
572 echo "Configuration is done."
573 echo "You can now build and install $PACKAGE_NAME by running:"
574 echo ""
575 echo "$ make"
576 echo "$ sudo make install"
577 echo "$ sudo ldconfig"
578 echo ""
579
580 AM_COND_IF([ASCIIDOC], [
581 echo "This will also build the documentation."
582 ], [
583 AS_IF([test "$enable_doc" = "no"], [
584 echo "Documentation will not be built because it was disabled."
585 ], [
586 echo "Documentation will not be built because asciidoc or xsltproc is missing."
587 ])
588 ])
589
590 # echo "$ sudo make install LANGS=\"eng ara deu\""
591 # echo " Or:"
592 # echo "$ sudo make install-langs"
593 echo ""
594
595 AM_COND_IF([ENABLE_TRAINING],
596 [
597 echo "Training tools can be built and installed with:"
598 echo ""
599 echo "$ make training"
600 echo "$ sudo make training-install"
601 echo ""],
602 [
603 echo "You cannot build training tools because of missing dependency."
604 echo "Check configure output for details."
605 echo ""]
606 )
607
608 # ----------------------------------------
609 # CONFIG Template
610 # ----------------------------------------
611
612 # Fence added in configuration file
613 AH_TOP([
614 #ifndef CONFIG_AUTO_H
615 #define CONFIG_AUTO_H
616 /* config_auto.h: begin */
617 ])
618
619 # Stuff added at bottom of file
620 AH_BOTTOM([
621
622 /* Miscellaneous defines */
623 #define AUTOCONF 1
624
625 /* Not used yet
626 #ifndef NO_GETTEXT
627 #define USING_GETTEXT
628 #endif
629 */
630
631 /* config_auto.h: end */
632 #endif
633 ])