Skip to content

Commit

Permalink
add a configure option to disable graphics
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@385 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
joregan committed May 28, 2010
1 parent 5c8ad7e commit cca609a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 20 deletions.
3 changes: 3 additions & 0 deletions config/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
59 changes: 39 additions & 20 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ ac_user_opts='
enable_option_checking
with_extra_includes
with_extra_libraries
enable_graphics
enable_shared
enable_static
with_pic
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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=$?
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cca609a

Please sign in to comment.