From cca609a09785e7d95bf385e2cd1fed4874c3411a Mon Sep 17 00:00:00 2001 From: joregan Date: Fri, 28 May 2010 12:21:22 +0000 Subject: [PATCH] add a configure option to disable graphics git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@385 d0cd1f9f-072b-0410-8dd7-cf729c803f20 --- config/config.h.in | 3 +++ configure | 59 ++++++++++++++++++++++++++++++---------------- configure.ac | 10 ++++++++ 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/config/config.h.in b/config/config.h.in index 71af527293..be2c25dffa 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -9,6 +9,9 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD +/* Disable graphics */ +#undef DISABLE_GRAPHICS + /* Define to 1 if you have the `acos' function. */ #undef HAVE_ACOS diff --git a/configure b/configure index e98f1b457e..5d7eb4d4d1 100755 --- a/configure +++ b/configure @@ -884,6 +884,7 @@ ac_user_opts=' enable_option_checking with_extra_includes with_extra_libraries +enable_graphics enable_shared enable_static with_pic @@ -1529,6 +1530,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-graphics Enable graphics (default). --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -2847,6 +2849,23 @@ if test "${with_extra_libraries+set}" = set; then : fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-graphics argument" >&5 +$as_echo_n "checking --enable-graphics argument... " >&6; } +# Check whether --enable-graphics was given. +if test "${enable_graphics+set}" = set; then : + enableval=$enable_graphics; enable_graphics=$enableval +else + enable_graphics="yes" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_graphics" >&5 +$as_echo "$enable_graphics" >&6; } +if test "$enable_graphics" = "no"; then + +$as_echo "#define DISABLE_GRAPHICS /**/" >>confdefs.h + +fi + # Always look into a "gnu" directory. curwd=`pwd` if test -d $curwd/gnu/include ; then @@ -4536,13 +4555,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4539: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4558: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4542: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4561: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4545: output\"" >&5) + (eval echo "\"\$as_me:4564: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5748,7 +5767,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5751 "configure"' > conftest.$ac_ext + echo '#line 5770 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7674,11 +7693,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7677: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7696: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7681: \$? = $ac_status" >&5 + echo "$as_me:7700: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8013,11 +8032,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8016: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8035: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8020: \$? = $ac_status" >&5 + echo "$as_me:8039: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8118,11 +8137,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8121: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8140: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8125: \$? = $ac_status" >&5 + echo "$as_me:8144: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8173,11 +8192,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8176: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8195: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8180: \$? = $ac_status" >&5 + echo "$as_me:8199: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10557,7 +10576,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10560 "configure" +#line 10579 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10653,7 +10672,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10656 "configure" +#line 10675 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12609,11 +12628,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12612: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12631: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12616: \$? = $ac_status" >&5 + echo "$as_me:12635: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12708,11 +12727,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12711: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12730: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12715: \$? = $ac_status" >&5 + echo "$as_me:12734: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12760,11 +12779,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12763: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12782: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12767: \$? = $ac_status" >&5 + echo "$as_me:12786: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized diff --git a/configure.ac b/configure.ac index 54eac80290..1bde8b76e1 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,16 @@ AC_ARG_WITH(extra-libraries, AC_MSG_ERROR([Cannot stat directory $withval]) fi ] ) +AC_MSG_CHECKING(--enable-graphics argument) +AC_ARG_ENABLE(graphics, + [ --enable-graphics Enable graphics (default).], + [enable_graphics=$enableval], + [enable_graphics="yes"]) +AC_MSG_RESULT($enable_graphics) +if test "$enable_graphics" = "no"; then + AC_DEFINE([DISABLE_GRAPHICS], [], [Disable graphics]) +fi + # Always look into a "gnu" directory. curwd=`pwd` if test -d $curwd/gnu/include ; then