configure.ac 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. # -*-Shell-script-*-
  2. #
  3. # Copyright (c) Luc Vincent
  4. # ----------------------------------------
  5. # Initialization
  6. # ----------------------------------------
  7. AC_PREREQ([2.63])
  8. AC_INIT([tesseract],
  9. [m4_esyscmd_s([test -d .git && git describe --abbrev=4 || cat VERSION])],
  10. [https://github.com/tesseract-ocr/tesseract/issues],,
  11. [https://github.com/tesseract-ocr/tesseract/])
  12. # Store command like options for CXXFLAGS
  13. OLD_CXXFLAGS=$CXXFLAGS
  14. AC_PROG_CXX([g++ clang++])
  15. # reset compiler flags to initial flags
  16. AC_LANG([C++])
  17. AC_LANG_COMPILER_REQUIRE
  18. CXXFLAGS=${CXXFLAGS:-""}
  19. AC_CONFIG_MACRO_DIR([m4])
  20. AC_CONFIG_AUX_DIR([config])
  21. AC_CONFIG_SRCDIR([src/api/tesseractmain.cpp])
  22. AC_PREFIX_DEFAULT([/usr/local])
  23. # Automake configuration. Do not require README file (we use README.md).
  24. AM_INIT_AUTOMAKE([foreign subdir-objects])
  25. # Define date of package, etc. Could be useful in auto-generated
  26. # documentation.
  27. PACKAGE_YEAR=2018
  28. PACKAGE_DATE="10/29"
  29. abs_top_srcdir=`AS_DIRNAME([$0])`
  30. AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["${PACKAGE_NAME}"], [Name of package])
  31. AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["${PACKAGE_VERSION}"], [Version number])
  32. AC_DEFINE_UNQUOTED([PACKAGE_YEAR], ["$PACKAGE_YEAR"], [Official year for this release])
  33. AC_DEFINE_UNQUOTED([PACKAGE_DATE], ["$PACKAGE_DATE"], [Official date of release])
  34. AC_SUBST([PACKAGE_NAME])
  35. AC_SUBST([PACKAGE_VERSION])
  36. AC_SUBST([PACKAGE_YEAR])
  37. AC_SUBST([PACKAGE_DATE])
  38. GENERIC_LIBRARY_NAME=tesseract
  39. # Release versioning. Get versions from PACKAGE_VERSION.
  40. AX_SPLIT_VERSION
  41. GENERIC_MAJOR_VERSION=$(echo "$AX_MAJOR_VERSION" | $SED 's/^[[^0-9]]*//')
  42. GENERIC_MINOR_VERSION=$AX_MINOR_VERSION
  43. GENERIC_MICRO_VERSION=`echo "$AX_POINT_VERSION" | $SED 's/^\([[0-9]][[0-9]]*\).*/\1/'`
  44. # API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
  45. GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
  46. GENERIC_LIBRARY_VERSION=$GENERIC_MAJOR_VERSION:$GENERIC_MINOR_VERSION
  47. AC_SUBST([GENERIC_API_VERSION])
  48. AC_SUBST([GENERIC_MAJOR_VERSION])
  49. AC_SUBST([GENERIC_MINOR_VERSION])
  50. AC_SUBST([GENERIC_MICRO_VERSION])
  51. AC_SUBST([GENERIC_LIBRARY_VERSION])
  52. PACKAGE=$GENERIC_LIBRARY_NAME
  53. AC_SUBST([GENERIC_LIBRARY_NAME])
  54. GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
  55. GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
  56. AC_SUBST([GENERIC_RELEASE])
  57. AC_SUBST([GENERIC_VERSION])
  58. AC_CONFIG_HEADERS([config_auto.h:config/config.h.in])
  59. # default conditional
  60. AM_CONDITIONAL([T_WIN], false)
  61. AM_CONDITIONAL([OSX], false)
  62. AM_CONDITIONAL([GRAPHICS_DISABLED], false)
  63. AC_SUBST([AM_CPPFLAGS])
  64. OPENCL_INC="/opt/AMDAPP/include"
  65. OPENCL_LIBS="-lOpenCL"
  66. #############################
  67. #
  68. # Platform specific setup
  69. #
  70. #############################
  71. AC_CANONICAL_HOST
  72. case "${host_os}" in
  73. mingw*)
  74. AM_CONDITIONAL([T_WIN], true)
  75. AM_CONDITIONAL([ADD_RT], false)
  76. AC_SUBST([AM_LDFLAGS], ['-Wl,-no-undefined -Wl,--as-needed'])
  77. ;;
  78. cygwin*)
  79. AM_CONDITIONAL([ADD_RT], false)
  80. AC_SUBST([NOUNDEFINED], ['-no-undefined'])
  81. ;;
  82. solaris*)
  83. LIBS="$LIBS -lsocket -lnsl -lrt -lxnet"
  84. AM_CONDITIONAL([ADD_RT], true)
  85. ;;
  86. *darwin*)
  87. OPENCL_LIBS=""
  88. OPENCL_INC=""
  89. AM_CONDITIONAL([ADD_RT], false)
  90. ;;
  91. *android*|openbsd*)
  92. AM_CONDITIONAL([ADD_RT], false)
  93. ;;
  94. powerpc-*-darwin*)
  95. OPENCL_LIBS=""
  96. ;;
  97. *)
  98. # default
  99. AM_CONDITIONAL([ADD_RT], true)
  100. ;;
  101. esac
  102. WERROR=-Werror
  103. # The test code used by AX_CHECK_COMPILE_FLAG uses an empty statement
  104. # and unused macros which must not raise a compiler error, but it must
  105. # be an error if flags like -avx are ignored on ARM and other
  106. # architectures because they are unsupported.
  107. AX_CHECK_COMPILE_FLAG([-Werror=unused-command-line-argument], [WERROR=-Werror=unused-command-line-argument])
  108. ## Checks for supported compiler options.
  109. AX_CHECK_COMPILE_FLAG([-mavx], [avx=true], [avx=false], [$WERROR])
  110. AM_CONDITIONAL([HAVE_AVX], ${avx})
  111. if $avx; then
  112. AC_DEFINE([HAVE_AVX], [1], [Enable AVX instructions])
  113. fi
  114. AX_CHECK_COMPILE_FLAG([-mavx2], [avx2=true], [avx2=false], [$WERROR])
  115. AM_CONDITIONAL([HAVE_AVX2], $avx2)
  116. if $avx2; then
  117. AC_DEFINE([HAVE_AVX2], [1], [Enable AVX2 instructions])
  118. fi
  119. AX_CHECK_COMPILE_FLAG([-mfma], [fma=true], [fma=false], [$WERROR])
  120. AM_CONDITIONAL([HAVE_FMA], $fma)
  121. if $fma; then
  122. AC_DEFINE([HAVE_FMA], [1], [Enable FMA instructions])
  123. fi
  124. AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=true], [sse41=false], [$WERROR])
  125. AM_CONDITIONAL([HAVE_SSE4_1], $sse41)
  126. if $sse41; then
  127. AC_DEFINE([HAVE_SSE4_1], [1], [Enable SSE 4.1 instructions])
  128. fi
  129. AX_CHECK_COMPILE_FLAG([-march=native], [arch_native=true], [arch_native=false], [$WERROR])
  130. AM_CONDITIONAL([MARCH_NATIVE_OPT], $arch_native)
  131. AC_ARG_WITH([extra-includes],
  132. [AS_HELP_STRING([--with-extra-includes=DIR],
  133. [Define an additional directory for include files])],
  134. [if test -d "$withval" ; then
  135. CFLAGS="$CFLAGS -I$withval"
  136. else
  137. AC_MSG_ERROR([Cannot stat directory $withval])
  138. fi])
  139. AC_ARG_WITH([extra-libraries],
  140. [AS_HELP_STRING([--with-extra-libraries=DIR],
  141. [Define an additional directory for library files])],
  142. [if test -d "$withval" ; then
  143. LDFLAGS="$LDFLAGS -L$withval"
  144. else
  145. AC_MSG_ERROR([Cannot stat directory $withval])
  146. fi])
  147. AC_MSG_CHECKING([--enable-graphics argument])
  148. AC_ARG_ENABLE([graphics],
  149. AS_HELP_STRING([--disable-graphics], [disable graphics (ScrollView)]))
  150. AC_MSG_RESULT([$enable_graphics])
  151. if test "$enable_graphics" = "no"; then
  152. AC_DEFINE([GRAPHICS_DISABLED], [], [Disable graphics])
  153. AM_CONDITIONAL([GRAPHICS_DISABLED], true)
  154. fi
  155. AC_MSG_CHECKING([--enable-legacy argument])
  156. AC_ARG_ENABLE([legacy],
  157. AS_HELP_STRING([--disable-legacy], [disable the legacy OCR engine]))
  158. AC_MSG_RESULT([$enable_legacy])
  159. AM_CONDITIONAL([DISABLED_LEGACY_ENGINE], test "$enable_legacy" = "no")
  160. if test "$enable_legacy" = "no"; then
  161. AC_DEFINE([DISABLED_LEGACY_ENGINE], [1], [Disable legacy OCR engine])
  162. fi
  163. # check whether to build OpenMP support
  164. AC_OPENMP
  165. have_tiff=false
  166. # Note that the first usage of AC_CHECK_HEADERS must be unconditional.
  167. AC_CHECK_HEADERS([tiffio.h], [have_tiff=true], [have_tiff=false])
  168. # check whether to build opencl version
  169. AC_MSG_CHECKING([--enable-opencl argument])
  170. AC_ARG_ENABLE([opencl],
  171. AS_HELP_STRING([--enable-opencl], [enable opencl build [default=no]]))
  172. AC_MSG_RESULT([$enable_opencl])
  173. # check for opencl header
  174. have_opencl=false
  175. if test "$enable_opencl" = "yes"; then
  176. AC_CHECK_HEADERS([CL/cl.h], [have_opencl=true], [
  177. AC_CHECK_HEADERS(OpenCL/cl.h, [have_opencl=true], [have_opencl=false])
  178. ])
  179. fi
  180. # Check whether to build with support for TensorFlow.
  181. AC_ARG_WITH([tensorflow],
  182. AS_HELP_STRING([--with-tensorflow],
  183. [support TensorFlow @<:@default=check@:>@]),
  184. [], [with_tensorflow=check])
  185. AM_CONDITIONAL([TENSORFLOW], false)
  186. TENSORFLOW_LIBS=
  187. AS_IF([test "x$with_tensorflow" != xno],
  188. [AC_CHECK_HEADERS(["tensorflow/core/framework/graph.pb.h"],
  189. [AC_SUBST([TENSORFLOW_LIBS], ["-lprotobuf -ltensorflow_cc"])
  190. AM_CONDITIONAL([TENSORFLOW], true)
  191. ],
  192. [if test "x$with_tensorflow" != xcheck; then
  193. AC_MSG_FAILURE(
  194. [--with-tensorflow was given, but test for libtensorflow-dev failed])
  195. fi
  196. ])
  197. ])
  198. # https://lists.apple.com/archives/unix-porting/2009/Jan/msg00026.html
  199. m4_define([MY_CHECK_FRAMEWORK],
  200. [AC_CACHE_CHECK([if -framework $1 works],[my_cv_framework_$1],
  201. [save_LIBS="$LIBS"
  202. LIBS="$LIBS -framework $1"
  203. AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
  204. [my_cv_framework_$1=yes],
  205. [my_cv_framework_$1=no])
  206. LIBS="$save_LIBS"
  207. ])
  208. if test "$my_cv_framework_$1"="yes"; then
  209. AC_DEFINE(AS_TR_CPP([HAVE_FRAMEWORK_$1]), 1,
  210. [Define if you have the $1 framework])
  211. AS_TR_CPP([FRAMEWORK_$1])="-framework $1"
  212. AC_SUBST(AS_TR_CPP([FRAMEWORK_$1]))
  213. fi]
  214. )
  215. have_opencl_lib=false
  216. OPENCL_CPPFLAGS=''
  217. OPENCL_LDFLAGS=''
  218. case "${host_os}" in
  219. *darwin* | *-macos10*)
  220. echo "checking for OpenCL framework"
  221. MY_CHECK_FRAMEWORK([OpenCL])
  222. if test $my_cv_framework_OpenCL = yes; then
  223. have_opencl_lib=true
  224. fi
  225. if test "$enable_opencl" = "yes"; then
  226. if !($have_opencl_lib); then
  227. AC_MSG_ERROR([Required OpenCL library not found!])
  228. fi
  229. AM_CPPFLAGS="-DUSE_OPENCL $AM_CPPFLAGS"
  230. OPENCL_CPPFLAGS=""
  231. OPENCL_LDFLAGS="-framework OpenCL"
  232. fi
  233. ;;
  234. *)
  235. # default
  236. if test "$enable_opencl" = "yes"; then
  237. AC_CHECK_LIB([OpenCL], [clGetPlatformIDs],
  238. [have_opencl_lib=true], [have_opencl_lib=false])
  239. if !($have_opencl); then
  240. AC_MSG_ERROR([Required OpenCL headers not found!])
  241. fi
  242. if !($have_opencl_lib); then
  243. AC_MSG_ERROR([Required OpenCL library not found!])
  244. fi
  245. AM_CPPFLAGS="-DUSE_OPENCL $AM_CPPFLAGS"
  246. OPENCL_CPPFLAGS="-I${OPENCL_INC}"
  247. OPENCL_LDFLAGS="${OPENCL_LIBS}"
  248. fi
  249. ;;
  250. esac
  251. AM_CONDITIONAL([USE_OPENCL], [test "$enable_opencl" = "yes"])
  252. AC_SUBST([OPENCL_CPPFLAGS])
  253. AC_SUBST([OPENCL_LDFLAGS])
  254. # check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
  255. # http://gcc.gnu.org/wiki/Visibility
  256. # http://groups.google.com/group/tesseract-dev/browse_thread/thread/976645ae98189127
  257. AC_MSG_CHECKING([--enable-visibility argument])
  258. AC_ARG_ENABLE([visibility],
  259. AS_HELP_STRING([--enable-visibility],
  260. [enable experimental build with -fvisibility [default=no]]))
  261. AC_MSG_RESULT([$enable_visibility])
  262. AM_CONDITIONAL([VISIBILITY], [test "$enable_visibility" = "yes"])
  263. # Check if tessdata-prefix is disabled
  264. AC_MSG_CHECKING([whether to use tessdata-prefix])
  265. AC_ARG_ENABLE([tessdata-prefix],
  266. [AS_HELP_STRING([--disable-tessdata-prefix],
  267. [don't set TESSDATA-PREFIX during compile])],
  268. [tessdata_prefix="no"], [tessdata_prefix="yes"])
  269. AC_MSG_RESULT([$tessdata_prefix])
  270. AM_CONDITIONAL([NO_TESSDATA_PREFIX], [test "$tessdata_prefix" = "no"])
  271. # Detect Clang compiler
  272. AC_MSG_CHECKING([if compiling with clang])
  273. AC_COMPILE_IFELSE(
  274. [AC_LANG_PROGRAM([], [[
  275. #ifndef __clang__
  276. not clang
  277. #endif
  278. ]])],
  279. [CLANG=yes], [CLANG=no])
  280. AC_MSG_RESULT([$CLANG])
  281. # Check whether to enable debugging
  282. AC_MSG_CHECKING([whether to enable debugging])
  283. AC_ARG_ENABLE([debug],
  284. AS_HELP_STRING([--enable-debug], [turn on debugging [default=no]]))
  285. AC_MSG_RESULT([$enable_debug])
  286. if test x"$enable_debug" = x"yes"; then
  287. CXXFLAGS=${CXXFLAGS:-"-O2"}
  288. AM_CPPFLAGS="$AM_CPPFLAGS -g -Wall -DDEBUG -pedantic"
  289. AM_CXXFLAGS="$AM_CXXFLAGS -g -Wall -DDEBUG -pedantic"
  290. if test "x$CLANG" = "xyes"; then
  291. # https://clang.llvm.org/docs/CommandGuide/clang.html
  292. # clang treats -Og as -O1
  293. AM_CPPFLAGS="$AM_CPPFLAGS -O0"
  294. AM_CXXFLAGS="$AM_CXXFLAGS -O0"
  295. else
  296. AM_CPPFLAGS="$AM_CPPFLAGS -Og"
  297. AM_CXXFLAGS="$AM_CXXFLAGS -Og"
  298. fi
  299. else
  300. AM_CXXFLAGS="$AM_CXXFLAGS -O2 -DNDEBUG"
  301. AM_CPPFLAGS="$AM_CPPFLAGS -O2 -DNDEBUG"
  302. fi
  303. # Always look into a "gnu" directory.
  304. curwd=`pwd`
  305. if test -d $curwd/gnu/include ; then
  306. CPPFLAGS="$CPPFLAGS -I$curwd/gnu/include"
  307. fi
  308. if test -d $curwd/gnu/lib ; then
  309. LDFLAGS="$LDFLAGS -L$curwd/gnu/lib"
  310. fi
  311. # ----------------------------------------
  312. # Additional checking of compiler characteristics
  313. # ----------------------------------------
  314. # Check Endianness. If Big Endian, this will define WORDS_BIGENDIAN
  315. AC_C_BIGENDIAN
  316. # ----------------------------------------
  317. # Init libtool
  318. # ----------------------------------------
  319. LT_INIT
  320. # ----------------------------------------
  321. # C++ related options
  322. # ----------------------------------------
  323. dnl **********************
  324. dnl Turn on C++11 or newer
  325. dnl **********************
  326. CPLUSPLUS=
  327. AX_CHECK_COMPILE_FLAG([-std=c++11], [CPLUSPLUS=11], [], [$WERROR])
  328. AX_CHECK_COMPILE_FLAG([-std=c++14], [CPLUSPLUS=14], [], [$WERROR])
  329. AX_CHECK_COMPILE_FLAG([-std=c++17], [CPLUSPLUS=17], [], [$WERROR])
  330. #AX_CHECK_COMPILE_FLAG([-std=c++20], [CPLUSPLUS=20], [], [$WERROR])
  331. if test -z "$CPLUSPLUS"; then
  332. AC_MSG_ERROR([Your compiler does not have the necessary C++11 support! Cannot proceed.])
  333. fi
  334. # Set C++11, C++14 or C++17 support based on platform/compiler
  335. case "${host_os}" in
  336. cygwin*)
  337. CXXFLAGS="$CXXFLAGS -std=gnu++$CPLUSPLUS"
  338. ;;
  339. *-darwin* | *-macos10*)
  340. CXXFLAGS="$CXXFLAGS -std=c++$CPLUSPLUS"
  341. if test "x$CLANG" = "xyes"; then
  342. LDFLAGS="$LDFLAGS -stdlib=libc++"
  343. fi
  344. ;;
  345. *)
  346. # default
  347. CXXFLAGS="$CXXFLAGS -std=c++$CPLUSPLUS"
  348. ;;
  349. esac
  350. # ----------------------------------------
  351. # Check for libraries
  352. # ----------------------------------------
  353. AC_SEARCH_LIBS([pthread_create], [pthread])
  354. # ----------------------------------------
  355. # Checks for header files.
  356. # ----------------------------------------
  357. AC_HEADER_STDC
  358. AC_HEADER_TIME
  359. AC_HEADER_SYS_WAIT
  360. AC_CHECK_HEADERS([sys/ipc.h sys/shm.h])
  361. AC_CHECK_HEADERS([limits.h malloc.h])
  362. # Enable use of system-defined bool type if available:
  363. AC_HEADER_STDBOOL
  364. # ----------------------------------------
  365. # Check for programs needed to build documentation.
  366. # ----------------------------------------
  367. AC_CHECK_PROG([have_asciidoc], asciidoc, true, false)
  368. AC_CHECK_PROG([have_xsltproc], xsltproc, true, false)
  369. if $have_asciidoc && $have_xsltproc; then
  370. AM_CONDITIONAL([ASCIIDOC], true)
  371. else
  372. AM_CONDITIONAL([ASCIIDOC], false)
  373. fi
  374. # ----------------------------------------
  375. # Checks for typedefs, structures, and compiler characteristics.
  376. # ----------------------------------------
  377. AC_CHECK_TYPES([wchar_t],,, [#include "wchar.h"])
  378. AC_CHECK_TYPES([long long int])
  379. AC_CHECK_TYPES([off_t],,, [#include "sys/types.h"])
  380. AC_CHECK_TYPES([mbstate_t],,, [#include "wchar.h"])
  381. # ----------------------------------------
  382. # Test auxiliary packages
  383. # ----------------------------------------
  384. PKG_CHECK_MODULES([libcurl], [libcurl], [have_libcurl=true], [have_libcurl=false])
  385. AM_CONDITIONAL([HAVE_LIBCURL], $have_libcurl)
  386. if $have_libcurl; then
  387. AC_DEFINE([HAVE_LIBCURL], [1], [Enable libcurl])
  388. fi
  389. PKG_CHECK_MODULES([LEPTONICA], [lept >= 1.74], [have_lept=true], [have_lept=false])
  390. if $have_lept; then
  391. CPPFLAGS="$CPPFLAGS $LEPTONICA_CFLAGS"
  392. else
  393. AC_MSG_ERROR([Leptonica 1.74 or higher is required. Try to install libleptonica-dev package.])
  394. fi
  395. PKG_CHECK_MODULES([libarchive], [libarchive], [have_libarchive=true], [have_libarchive=false])
  396. AM_CONDITIONAL([HAVE_LIBARCHIVE], [$have_libarchive])
  397. if $have_libarchive; then
  398. AC_DEFINE([HAVE_LIBARCHIVE], [1], [Enable libarchive])
  399. CPPFLAGS="$CPPFLAGS $libarchive_CFLAGS"
  400. fi
  401. AM_CONDITIONAL([ENABLE_TRAINING], true)
  402. # Check availability of ICU packages.
  403. PKG_CHECK_MODULES([ICU_UC], [icu-uc >= 52.1], [have_icu_uc=true], [have_icu_uc=false])
  404. PKG_CHECK_MODULES([ICU_I18N], [icu-i18n >= 52.1], [have_icu_i18n=true], [have_icu_i18n=false])
  405. if !($have_icu_uc && $have_icu_i18n); then
  406. AC_MSG_WARN([icu 52.1 or higher is required, but was not found.])
  407. AC_MSG_WARN([Training tools WILL NOT be built.])
  408. AC_MSG_WARN([Try to install libicu-devel package.])
  409. AM_CONDITIONAL([ENABLE_TRAINING], false)
  410. fi
  411. # Check location of pango headers
  412. PKG_CHECK_MODULES([pango], [pango >= 1.22.0], [have_pango=true], [have_pango=false])
  413. if !($have_pango); then
  414. AC_MSG_WARN([pango 1.22.0 or higher is required, but was not found.])
  415. AC_MSG_WARN([Training tools WILL NOT be built.])
  416. AC_MSG_WARN([Try to install libpango1.0-dev package.])
  417. AM_CONDITIONAL([ENABLE_TRAINING], false)
  418. fi
  419. # Check location of cairo headers
  420. PKG_CHECK_MODULES([cairo], [cairo], [have_cairo=true], [have_cairo=false])
  421. if !($have_cairo); then
  422. AC_MSG_WARN([Training tools WILL NOT be built because of missing cairo library.])
  423. AC_MSG_WARN([Try to install libcairo-dev?? package.])
  424. AM_CONDITIONAL([ENABLE_TRAINING], false)
  425. fi
  426. PKG_CHECK_MODULES([pangocairo], [pangocairo], [], [false])
  427. PKG_CHECK_MODULES([pangoft2], [pangoft2], [], [false])
  428. # ----------------------------------------
  429. # Final Tasks and Output
  430. # ----------------------------------------
  431. # Output files
  432. AC_CONFIG_FILES([include/tesseract/version.h])
  433. AC_CONFIG_FILES([Makefile tesseract.pc])
  434. AC_CONFIG_FILES([tessdata/Makefile])
  435. AC_CONFIG_FILES([tessdata/configs/Makefile])
  436. AC_CONFIG_FILES([tessdata/tessconfigs/Makefile])
  437. AC_CONFIG_FILES([unittest/Makefile])
  438. AC_CONFIG_FILES([java/Makefile])
  439. AC_CONFIG_FILES([java/com/Makefile])
  440. AC_CONFIG_FILES([java/com/google/Makefile])
  441. AC_CONFIG_FILES([java/com/google/scrollview/Makefile])
  442. AC_CONFIG_FILES([java/com/google/scrollview/events/Makefile])
  443. AC_CONFIG_FILES([java/com/google/scrollview/ui/Makefile])
  444. AC_CONFIG_FILES([doc/Makefile])
  445. AM_COND_IF([ENABLE_TRAINING], [AC_CONFIG_FILES(src/training/Makefile)])
  446. AC_OUTPUT
  447. # Final message
  448. echo ""
  449. echo "Configuration is done."
  450. echo "You can now build and install $PACKAGE_NAME by running:"
  451. echo ""
  452. echo "$ make"
  453. echo "$ sudo make install"
  454. echo "$ sudo ldconfig"
  455. echo ""
  456. AM_COND_IF([ASCIIDOC],
  457. [
  458. echo "This will also build the documentation."
  459. ], [
  460. echo "Documentation will not be built because asciidoc or xsltproc is missing."
  461. ]
  462. )
  463. # echo "$ sudo make install LANGS=\"eng ara deu\""
  464. # echo " Or:"
  465. # echo "$ sudo make install-langs"
  466. echo ""
  467. AM_COND_IF([ENABLE_TRAINING],
  468. [
  469. echo "Training tools can be built and installed with:"
  470. echo ""
  471. echo "$ make training"
  472. echo "$ sudo make training-install"
  473. echo ""],
  474. [
  475. echo "You can not build training tools because of missing dependency."
  476. echo "Check configure output for details."
  477. echo ""]
  478. )
  479. # ----------------------------------------
  480. # CONFIG Template
  481. # ----------------------------------------
  482. # Fence added in configuration file
  483. AH_TOP([
  484. #ifndef CONFIG_AUTO_H
  485. #define CONFIG_AUTO_H
  486. /* config_auto.h: begin */
  487. ])
  488. # Stuff added at bottom of file
  489. AH_BOTTOM([
  490. /* Miscellaneous defines */
  491. #define AUTOCONF 1
  492. /* Not used yet
  493. #ifndef NO_GETTEXT
  494. #define USING_GETTEXT
  495. #endif
  496. */
  497. /* config_auto.h: end */
  498. #endif
  499. ])
Tip!

Press p or to see the previous file or, n or to see the next file