#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in
  *posix*) set -o posix ;;
esac

fi




# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi

# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
as_nl='
'
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
case $0 in
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  { (exit 1); exit 1; }
fi

# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
for as_var in \
  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  LC_TELEPHONE LC_TIME
do
  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
    eval $as_var=C; export $as_var
  else
    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi


# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# CDPATH.
$as_unset CDPATH


if test "x$CONFIG_SHELL" = x; then
  if (eval ":") 2>/dev/null; then
  as_have_required=yes
else
  as_have_required=no
fi

  if test $as_have_required = yes && 	 (eval ":
(as_func_return () {
  (exit \$1)
}
as_func_success () {
  as_func_return 0
}
as_func_failure () {
  as_func_return 1
}
as_func_ret_success () {
  return 0
}
as_func_ret_failure () {
  return 1
}

exitcode=0
if as_func_success; then
  :
else
  exitcode=1
  echo as_func_success failed.
fi

if as_func_failure; then
  exitcode=1
  echo as_func_failure succeeded.
fi

if as_func_ret_success; then
  :
else
  exitcode=1
  echo as_func_ret_success failed.
fi

if as_func_ret_failure; then
  exitcode=1
  echo as_func_ret_failure succeeded.
fi

if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
  :
else
  exitcode=1
  echo positional parameters were not saved.
fi

test \$exitcode = 0) || { (exit 1); exit 1; }

(
  as_lineno_1=\$LINENO
  as_lineno_2=\$LINENO
  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
") 2> /dev/null; then
  :
else
  as_candidate_shells=
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  case $as_dir in
	 /*)
	   for as_base in sh bash ksh sh5; do
	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
	   done;;
       esac
done
IFS=$as_save_IFS


      for as_shell in $as_candidate_shells $SHELL; do
	 # Try only shells that exist, to save several forks.
	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
		{ ("$as_shell") 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in
  *posix*) set -o posix ;;
esac

fi


:
_ASEOF
}; then
  CONFIG_SHELL=$as_shell
	       as_have_required=yes
	       if { "$as_shell" 2> /dev/null <<\_ASEOF
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in
  *posix*) set -o posix ;;
esac

fi


:
(as_func_return () {
  (exit $1)
}
as_func_success () {
  as_func_return 0
}
as_func_failure () {
  as_func_return 1
}
as_func_ret_success () {
  return 0
}
as_func_ret_failure () {
  return 1
}

exitcode=0
if as_func_success; then
  :
else
  exitcode=1
  echo as_func_success failed.
fi

if as_func_failure; then
  exitcode=1
  echo as_func_failure succeeded.
fi

if as_func_ret_success; then
  :
else
  exitcode=1
  echo as_func_ret_success failed.
fi

if as_func_ret_failure; then
  exitcode=1
  echo as_func_ret_failure succeeded.
fi

if ( set x; as_func_ret_success y && test x = "$1" ); then
  :
else
  exitcode=1
  echo positional parameters were not saved.
fi

test $exitcode = 0) || { (exit 1); exit 1; }

(
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }

_ASEOF
}; then
  break
fi

fi

      done

      if test "x$CONFIG_SHELL" != x; then
  for as_var in BASH_ENV ENV
        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
        done
        export CONFIG_SHELL
        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi


    if test $as_have_required = no; then
  echo This script requires a shell more modern than all the
      echo shells that I found on your system.  Please install a
      echo modern shell, or manually run the script under such a
      echo shell if you do have one.
      { (exit 1); exit 1; }
fi


fi

fi



(eval "as_func_return () {
  (exit \$1)
}
as_func_success () {
  as_func_return 0
}
as_func_failure () {
  as_func_return 1
}
as_func_ret_success () {
  return 0
}
as_func_ret_failure () {
  return 1
}

exitcode=0
if as_func_success; then
  :
else
  exitcode=1
  echo as_func_success failed.
fi

if as_func_failure; then
  exitcode=1
  echo as_func_failure succeeded.
fi

if as_func_ret_success; then
  :
else
  exitcode=1
  echo as_func_ret_success failed.
fi

if as_func_ret_failure; then
  exitcode=1
  echo as_func_ret_failure succeeded.
fi

if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
  :
else
  exitcode=1
  echo positional parameters were not saved.
fi

test \$exitcode = 0") || {
  echo No shell found that supports shell functions.
  echo Please tell autoconf@gnu.org about your system,
  echo including any error possibly output before this
  echo message
}



  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line after each line using $LINENO; the second 'sed'
  # does the real work.  The second script uses 'N' to pair each
  # line-number line with the line containing $LINENO, and appends
  # trailing '-' during substitution so that $LINENO is not a special
  # case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # scripts with optimization help from Paolo Bonzini.  Blame Lee
  # E. McMahon (1931-1989) for sed's syntax.  :-)
  sed -n '
    p
    /[$]LINENO/=
  ' <$as_myself |
    sed '
      s/[$]LINENO.*/&-/
      t lineno
      b
      :lineno
      N
      :loop
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
      t loop
      s/-\n.*//
    ' >$as_me.lineno &&
  chmod +x "$as_me.lineno" ||
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensitive to this).
  . "./$as_me.lineno"
  # Exit status is that of the last command.
  exit
}


if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
  case `echo 'x\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  *)   ECHO_C='\c';;
  esac;;
*)
  ECHO_N='-n';;
esac

if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir
fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  as_ln_s='ln -s'
  # ... but there are two gotchas:
  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
  # In both cases, we have to default to `cp -p'.
  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null

if mkdir -p . 2>/dev/null; then
  as_mkdir_p=:
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

if test -x / >/dev/null 2>&1; then
  as_test_x='test -x'
else
  if ls -dL / >/dev/null 2>&1; then
    as_ls_L_option=L
  else
    as_ls_L_option=
  fi
  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
        test -d "$1/.";
      else
	case $1 in
        -*)set "./$1";;
	esac;
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
	???[sx]*):;;*)false;;esac;fi
    '\'' sh
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"



exec 7<&0 </dev/null 6>&1

# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`

#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}

# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=

ac_unique_file="Makefile.in"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"

ac_subst_vars='SHELL
PATH_SEPARATOR
PACKAGE_NAME
PACKAGE_TARNAME
PACKAGE_VERSION
PACKAGE_STRING
PACKAGE_BUGREPORT
exec_prefix
prefix
program_transform_name
bindir
sbindir
libexecdir
datarootdir
datadir
sysconfdir
sharedstatedir
localstatedir
includedir
oldincludedir
docdir
infodir
htmldir
dvidir
pdfdir
psdir
libdir
localedir
mandir
DEFS
ECHO_C
ECHO_N
ECHO_T
LIBS
build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
CPPFLAGS
ac_ct_CC
EXEEXT
OBJEXT
CXX
CXXFLAGS
ac_ct_CXX
RANLIB
LEX
LEX_OUTPUT_ROOT
LEXLIB
YACC
YFLAGS
XTRALIBS
CPP
GREP
EGREP
C_PIC
STRINGS
MS_VERSION
PKG_CONFIG
FT_BIN
ZLIB_ENABLED
ZLIB_INC
ZLIB_LIB
JPEG_ENABLED
JPEG_INC
JPEG_LIB
ICONV_ENABLED
ICONV_INC
ICONV_LIB
GD_DEF
GD_INC
GD_LIB
GD_STATIC
MAKE_GD
MAKE_GD_CLEAN
PDF_ENABLED
PDF_INC
PDF_LIB
FTGL_ENABLED
FTGL_INC
FTGL_LIB
OGL_ENABLED
OGL_INC
OGL_LIB
AGG_ENABLED
AGG_INC
AGG_OBJ
RGBA_PNG_ENABLED
PNG_INC
PNG_LIB
EPPL_ENABLED
EPPL_OBJ
PROJ_ENABLED
PROJ_INC
PROJ_LIBS
THREAD_FLAG
THREAD_LIB
SDE_ENABLED
SDE_INC
SDE_LIB
GEOS_CONFIG
GEOS_ENABLED
GEOS_INC
GEOS_LIB
GDAL_CONFIG
GDAL_ENABLED
OGR_ENABLED
GDAL_INC
GDAL_LIB
TIFF_ENABLED
TIFF_INC
TIFF_LIB
PG_CONFIG
POSTGIS_ENABLED
POSTGIS_INC
POSTGIS_LIB
MY_CONFIG
MYGIS_ENABLED
MYGIS_INC
MYGIS_LIB
ORACLESPATIAL_ENABLED
ORACLESPATIAL_INC
ORACLESPATIAL_LIB
MING_ENABLED
MING_INC
MING_LIB
WMS_SVR_ENABLED
WFS_SVR_ENABLED
WCS_SVR_ENABLED
LIBCURL_CONFIG
CURL_INC
CURL_LIB
LIBXML2_CONFIG
XML2_INC
XML2_LIB
WMS_LYR_ENABLED
WFS_LYR_ENABLED
SOS_SVR_ENABLED
FRIBIDI_CONFIG
FRIBIDI_ENABLED
FRIBIDI_INC
FRIBIDI_LIB
CAIRO_ENABLED
CAIRO_INC
CAIRO_LIB
FASTCGI_ENABLED
FASTCGI_INC
FASTCGI_LIB
HTTPD
MS_INC
MS_LIB
IGNORE_MISSING_DATA
USE_POINT_Z_M
USE_NINT
DEBUG_FLAGS
LD_SHARED
SO_EXT
SO_COMMAND_NAME
PHP_LD_SHARED
PHP_VERSION_FLAG
PHP_SRC_DIR
PHP_CC
PHP_LD
PHP_REGEX_INC
PHP_REGEX_OBJ
USE_PHP_REGEX
MAKE_PHPMS
MAKE_PHPMS_CLEAN
APACHE_INC
OS_INCLUDE_DIR
ALL_ENABLED
ALL_INC
ALL_LIB
ALL_STATIC_LIB
RPATHS
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
      ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CXX
CXXFLAGS
CCC
YACC
YFLAGS
CPP'


# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'

ac_prev=
ac_dashdash=
for ac_option
do
  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval $ac_prev=\$ac_option
    ac_prev=
    continue
  fi

  case $ac_option in
  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
  *)	ac_optarg=yes ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case $ac_dashdash$ac_option in
  --)
    ac_dashdash=yes ;;

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir=$ac_optarg ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build_alias ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build_alias=$ac_optarg ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file=$ac_optarg ;;

  --config-cache | -C)
    cache_file=config.cache ;;

  -datadir | --datadir | --datadi | --datad)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=*)
    datadir=$ac_optarg ;;

  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
  | --dataroo | --dataro | --datar)
    ac_prev=datarootdir ;;
  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
    datarootdir=$ac_optarg ;;

  -disable-* | --disable-*)
    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   { (exit 1); exit 1; }; }
    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
    eval enable_$ac_feature=no ;;

  -docdir | --docdir | --docdi | --doc | --do)
    ac_prev=docdir ;;
  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
    docdir=$ac_optarg ;;

  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
    ac_prev=dvidir ;;
  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
    dvidir=$ac_optarg ;;

  -enable-* | --enable-*)
    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   { (exit 1); exit 1; }; }
    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
    eval enable_$ac_feature=\$ac_optarg ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix=$ac_optarg ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he | -h)
    ac_init_help=long ;;
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
    ac_init_help=recursive ;;
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
    ac_init_help=short ;;

  -host | --host | --hos | --ho)
    ac_prev=host_alias ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host_alias=$ac_optarg ;;

  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
    ac_prev=htmldir ;;
  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
  | --ht=*)
    htmldir=$ac_optarg ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir=$ac_optarg ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir=$ac_optarg ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir=$ac_optarg ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir=$ac_optarg ;;

  -localedir | --localedir | --localedi | --localed | --locale)
    ac_prev=localedir ;;
  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
    localedir=$ac_optarg ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst | --locals)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
    localstatedir=$ac_optarg ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir=$ac_optarg ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c | -n)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir=$ac_optarg ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix=$ac_optarg ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix=$ac_optarg ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix=$ac_optarg ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name=$ac_optarg ;;

  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
    ac_prev=pdfdir ;;
  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
    pdfdir=$ac_optarg ;;

  -psdir | --psdir | --psdi | --psd | --ps)
    ac_prev=psdir ;;
  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
    psdir=$ac_optarg ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir=$ac_optarg ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir=$ac_optarg ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site=$ac_optarg ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir=$ac_optarg ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir=$ac_optarg ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target_alias ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target_alias=$ac_optarg ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers | -V)
    ac_init_version=: ;;

  -with-* | --with-*)
    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid package name: $ac_package" >&2
   { (exit 1); exit 1; }; }
    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
    eval with_$ac_package=\$ac_optarg ;;

  -without-* | --without-*)
    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid package name: $ac_package" >&2
   { (exit 1); exit 1; }; }
    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
    eval with_$ac_package=no ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes=$ac_optarg ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries=$ac_optarg ;;

  -*) { echo "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
   { (exit 1); exit 1; }; }
    ;;

  *=*)
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    # Reject names that are not valid shell variable names.
    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
   { (exit 1); exit 1; }; }
    eval $ac_envvar=\$ac_optarg
    export $ac_envvar ;;

  *)
    # FIXME: should be removed in autoconf 3.0.
    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
    ;;

  esac
done

if test -n "$ac_prev"; then
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  { echo "$as_me: error: missing argument to $ac_option" >&2
   { (exit 1); exit 1; }; }
fi

# Be sure to have absolute directory names.
for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
		datadir sysconfdir sharedstatedir localstatedir includedir \
		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
		libdir localedir mandir
do
  eval ac_val=\$$ac_var
  case $ac_val in
    [\\/$]* | ?:[\\/]* )  continue;;
    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
  esac
  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; }
done

# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used." >&2
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-

test "$silent" = yes && exec 6>/dev/null


ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  { echo "$as_me: error: Working directory cannot be determined" >&2
   { (exit 1); exit 1; }; }
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  { echo "$as_me: error: pwd does not report name of working directory" >&2
   { (exit 1); exit 1; }; }


# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then the parent directory.
  ac_confdir=`$as_dirname -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$0" : 'X\(//\)[^/]' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  srcdir=$ac_confdir
  if test ! -r "$srcdir/$ac_unique_file"; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
   { (exit 1); exit 1; }; }
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
   { (exit 1); exit 1; }; }
	pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
  srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_env_${ac_var}_value=\$${ac_var}
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
done

#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # Omit some internal or obsolete options to make the list less imposing.
  # This message is too long to be a string in the A/UX 3.1 sh.
  cat <<_ACEOF
\`configure' configures this package to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print \`checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for \`--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
			  [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
			  [PREFIX]

By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR          info documentation [DATAROOTDIR/info]
  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR           man documentation [DATAROOTDIR/man]
  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
  --htmldir=DIR          html documentation [DOCDIR]
  --dvidir=DIR           dvi documentation [DOCDIR]
  --pdfdir=DIR           pdf documentation [DOCDIR]
  --psdir=DIR            ps documentation [DOCDIR]
_ACEOF

  cat <<\_ACEOF
_ACEOF
fi

if test -n "$ac_init_help"; then

  cat <<\_ACEOF

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-ignore-missing-data
                          Ignore missing data file errors at runtime
  --disable-ignore-missing-data
                          Report all missing data files (enabled by default).
  --enable-point-z-m      Use point Z and M parameters (disabled by default).
  --disable-point-z-m     Disable support for point Z and M parameters.
  --disable-fast-nint     Use safe MS_NINT with reliable rounding
  --enable-debug          Include "-g" in CFLAGS for debugging.
  --disable-debug         Do not include "-g" in CFLAGS (the default).
  --enable-gcov           Enable source code coverage testing using gcov
  --enable-perlv-ld-detect
                          (applies to --with-php only)
                          Use perl -V output to figure the command to use to
                          link php_mapscript.so.  Try this only if the default
                          internal macro didn't work.
  --enable-runpath        Include runtime library path flags (-Wl,-R) in link.
                          Required on *BSD systems.
  --disable-runpath       Do not link with runtime lib path (the default).

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pkg-config[=PATH]
                          Include pkg-config support (PATH is path to pkg-config)
  --with-freetype=DIR     GD: Specify where FreeType 2.x is installed (DIR is
                              path to freetype-config program or install dir).
  --with-zlib=DIR         GD,SVG: Specify where zlib is installed (DIR is path
                              to zlib install dir).
  --with-png=DIR          GD: Specify where PNG is installed (DIR is path to
                              PNG install dir).
  --with-jpeg[=DIR]       Include JPEG support (DIR is LibJPEG's install dir).
  --with-xpm=DIR          GD: Specify where libXpm is installed (DIR it the
                              libXpm install prefix).
  --with-libiconv=DIR     Specify where libiconv is installed (DIR is path
                          to libiconv install dir (prefix)).
  --with-gd[=[static,]DIR]
                          Specify which version of GD to use (DIR is GD's
                          install dir).
  --without-pdf           Disable PDF support.
  --with-pdf[=DIR]        Include PDF support (DIR is PDFlib's install dir).
  --with-ftgl[=DIR]       Include OpenGl support (DIR is OpenGL's install dir).
  --with-opengl[=DIR]     Include OpenGl support (DIR is OpenGL's install dir).
  --with-agg[=DIR]        Include AGG support (DIR is AGG's install dir).
  --with-experimental-png Include experimental palette support for rgba png.
  --without-eppl          Disable EPPL7 support.
  --with-eppl             Include EPPL7 support.
  --with-proj[=DIR]       Include PROJ.4 support (DIR is PROJ.4's install dir).
  --with-threads[=linkopt]Include thread safe support
  --with-sde[=DIR]        Include ESRI SDE support (DIR is SDE's install dir).
  --with-sde-version[=VERSION NUMBER]
                          Set ESRI SDE version number (Default is 91).
  --with-geos[=PATH]      Include GEOS support (PATH is path to geos-config)
  --with-ogr[=PATH]       Include OGR support (PATH is path to gdal-config).
  --with-gdal[=PATH]      Include GDAL support (PATH is path to gdal-config)
  --without-tiff          Disable TIFF support.
  --with-tiff[=DIR]       Include TIFF support (DIR is LibTIFF's install dir).
  --with-postgis[=ARG]    Include PostGIS Support (ARG=yes/path to pg_config)
  --with-mygis[=ARG]      Include MyGIS Support (ARG=yes/path to mysql_config)
  --with-oraclespatial[=ARG]
                          Include OracleSpatial Support (ARG=yes/path to
                          Oracle home)
  --with-ming[=DIR]       Include MING/Flash Support (DIR=path to Ming
                          directory)
  --without-wms           Disable OGC WMS Compatibility (enabled by default).
  --with-wfs              Enable OGC WFS Server Support (OGR+PROJ4 required).
  --with-wcs              Enable OGC WCS Server Support (GDAL+PROJ4 required).
  --with-wmsclient        Enable OGC WMS Client Connections (PROJ4 and libcurl
                          required).
  --with-wfsclient        Enable OGC WFS Client Connections (PROJ4, libcurl and
                          OGR required).
  --with-sos              Enable OGC SOS Server Support (libxml2 and PROJ4 and
                          OGR required).
  --with-curl-config=PATH Specify path to curl-config.
  --with-xml2-config=PATH Specify path to xml2-config.
  --with-fribidi-config[=ARG]
                          Include FriBidi Support (ARG=yes/path to
                          fribidi-config or fribidi.pc)
  --with-cairo[=ARG]      Include Cairo Support (ARG=yes/path to cairo.pc)
  --with-fastcgi=path     Enable FastCGI, point to installed tree.
  --with-httpd            Specify path to 'httpd' executable.
  --with-warnings[=flags] Enable strict warnings (or user defined warnings)
  --with-php=DIR          Specify directory where PHP4's include files are
                          installed (or a pointer to the full source tree)
                          Required in order to compile the PHP/MapScript
                          module.
  --with-ld-shared=CMD    Specify link command to use to build shared libs
  --without-ld-shared     Disable shared library support
  --with-apxs[=FILE]      (CURRENTLY DISABLED)
                          Use this option only if building the PHP MapScript
                          on a system where PHP was built as a shared Apache
                          module.  FILE is the optional pathname to the
                          Apache apxs tool; defaults to apxs.
  --with-apache=DIR       (CURRENTLY DISABLED)
                          Use this option only if building the PHP MapScript
                          on a system where PHP was built as an Apache
                          module statically linked into the httpd executable.
                          DIR is the path to the apache include files.
  --with-java-include-os-name=dirname
                          (AUTODETECTED)
                          Use this option only if building of Java Mapscript
                          fails because os-dependent headers are not found.
                          dirname is the name of subdirectory of the Java
                          installation where os-dependent include files are
                          found (for instance linux or solaris).
                          Only used by Java mapscript.

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
              the first program found out of: `bison -y', `byacc', `yacc'.
  YFLAGS      The list of arguments that will be passed by default to $YACC.
              This script will default YFLAGS to the empty string to avoid a
              default value of `-d' given by some make applications.
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

_ACEOF
ac_status=$?
fi

if test "$ac_init_help" = "recursive"; then
  # If there are subdirs, report their specific --help.
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
    test -d "$ac_dir" || continue
    ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix

    cd "$ac_dir" || { ac_status=$?; continue; }
    # Check for guested configure.
    if test -f "$ac_srcdir/configure.gnu"; then
      echo &&
      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
    elif test -f "$ac_srcdir/configure"; then
      echo &&
      $SHELL "$ac_srcdir/configure" --help=recursive
    else
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    fi || ac_status=$?
    cd "$ac_pwd" || { ac_status=$?; break; }
  done
fi

test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
  cat <<\_ACEOF
configure
generated by GNU Autoconf 2.61

Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit
fi
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by $as_me, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ $0 $@

_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  echo "PATH: $as_dir"
done
IFS=$as_save_IFS

} >&5

cat >&5 <<_ACEOF


## ----------- ##
## Core tests. ##
## ----------- ##

_ACEOF


# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
  for ac_arg
  do
    case $ac_arg in
    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
    | -silent | --silent | --silen | --sile | --sil)
      continue ;;
    *\'*)
      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
    esac
    case $ac_pass in
    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
    2)
      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
      if test $ac_must_keep_next = true; then
	ac_must_keep_next=false # Got value, back to normal.
      else
	case $ac_arg in
	  *=* | --config-cache | -C | -disable-* | --disable-* \
	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
	  | -with-* | --with-* | -without-* | --without-* | --x)
	    case "$ac_configure_args0 " in
	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
	    esac
	    ;;
	  -* ) ac_must_keep_next=true ;;
	esac
      fi
      ac_configure_args="$ac_configure_args '$ac_arg'"
      ;;
    esac
  done
done
$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo

    cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
    echo
    # The following way of writing the cache mishandles newlines in values,
(
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      *) $as_unset $ac_var ;;
      esac ;;
    esac
  done
  (set) 2>&1 |
    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      sed -n \
	"s/'\''/'\''\\\\'\'''\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
      ;; #(
    *)
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
)
    echo

    cat <<\_ASBOX
## ----------------- ##
## Output variables. ##
## ----------------- ##
_ASBOX
    echo
    for ac_var in $ac_subst_vars
    do
      eval ac_val=\$$ac_var
      case $ac_val in
      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
      esac
      echo "$ac_var='\''$ac_val'\''"
    done | sort
    echo

    if test -n "$ac_subst_files"; then
      cat <<\_ASBOX
## ------------------- ##
## File substitutions. ##
## ------------------- ##
_ASBOX
      echo
      for ac_var in $ac_subst_files
      do
	eval ac_val=\$$ac_var
	case $ac_val in
	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
	esac
	echo "$ac_var='\''$ac_val'\''"
      done | sort
      echo
    fi

    if test -s confdefs.h; then
      cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
      echo
      cat confdefs.h
      echo
    fi
    test "$ac_signal" != 0 &&
      echo "$as_me: caught signal $ac_signal"
    echo "$as_me: exit $exit_status"
  } >&5
  rm -f core *.core core.conftest.* &&
    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
    exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h

# Predefined preprocessor variables.

cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF


# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
  set x "$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
  set x "$prefix/share/config.site" "$prefix/etc/config.site"
else
  set x "$ac_default_prefix/share/config.site" \
	"$ac_default_prefix/etc/config.site"
fi
shift
for ac_site_file
do
  if test -r "$ac_site_file"; then
    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
    sed 's/^/| /' "$ac_site_file" >&5
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  # Some versions of bash will fail to source /dev/null (special
  # files actually), so we avoid doing that.
  if test -f "$cache_file"; then
    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
    case $cache_file in
      [\\/]* | ?:[\\/]* ) . "$cache_file";;
      *)                      . "./$cache_file";;
    esac
  fi
else
  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
echo "$as_me: creating cache $cache_file" >&6;}
  >$cache_file
fi

# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  eval ac_new_set=\$ac_env_${ac_var}_set
  eval ac_old_val=\$ac_cv_env_${ac_var}_value
  eval ac_new_val=\$ac_env_${ac_var}_value
  case $ac_old_set,$ac_new_set in
    set,)
      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,set)
      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,);;
    *)
      if test "x$ac_old_val" != "x$ac_new_val"; then
	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
echo "$as_me:   former value:  $ac_old_val" >&2;}
	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
echo "$as_me:   current value: $ac_new_val" >&2;}
	ac_cache_corrupted=:
      fi;;
  esac
  # Pass precious variables to config.status.
  if test "$ac_new_set" = set; then
    case $ac_new_val in
    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
    *) ac_arg=$ac_var=$ac_new_val ;;
    esac
    case " $ac_configure_args " in
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
    esac
  fi
done
if $ac_cache_corrupted; then
  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
   { (exit 1); exit 1; }; }
fi

















ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu



ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
  { echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


fi
if test -z "$ac_cv_prog_CC"; then
  ac_ct_CC=$CC
  # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_ac_ct_CC="gcc"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
else
  CC="$ac_cv_prog_CC"
fi

if test -z "$CC"; then
          if test -n "$ac_tool_prefix"; then
    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_CC="${ac_tool_prefix}cc"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
  { echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  fi
fi
if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
       ac_prog_rejected=yes
       continue
     fi
    ac_cv_prog_CC="cc"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# != 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
  fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
  { echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


fi
if test -z "$CC"; then
  if test -n "$ac_tool_prefix"; then
  for ac_prog in cl.exe
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
  { echo "$as_me:$LINENO: result: $CC" >&5
echo "${ECHO_T}$CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


    test -n "$CC" && break
  done
fi
if test -z "$CC"; then
  ac_ct_CC=$CC
  for ac_prog in cl.exe
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CC"; then
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_ac_ct_CC="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  test -n "$ac_ct_CC" && break
done

  if test "x$ac_ct_CC" = x; then
    CC=""
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
    CC=$ac_ct_CC
  fi
fi

fi


test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&5
echo "$as_me: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }

# Provide some information about the compiler.
echo "$as_me:$LINENO: checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler --version >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler -v >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler -V >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
#
# List of possible output files, starting from the most likely.
# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
# only as a last resort.  b.out is created by i960 compilers.
ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
#
# The IRIX 6 linker writes into existing files which may not be
# executable, retaining their permissions.  Remove them first so a
# subsequent execution test works.
ac_rmfiles=
for ac_file in $ac_files
do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
  esac
done
rm -f $ac_rmfiles

if { (ac_try="$ac_link_default"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link_default") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile.  We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
	;;
    [ab].out )
	# We found the default executable, but exeext='' is most
	# certainly right.
	break;;
    *.* )
        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
	then :; else
	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	fi
	# We set ac_cv_exeext here because the later test for it is not
	# safe: cross compilers may not add the suffix if given an `-o'
	# argument, so we may need to know it at that point already.
	# Even if this section looks crufty: it has the advantage of
	# actually working.
	break;;
    * )
	break;;
  esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=

else
  ac_file=''
fi

{ echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6; }
if test -z "$ac_file"; then
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
   { (exit 77); exit 77; }; }
fi

ac_exeext=$ac_cv_exeext

# Check that the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
  if { ac_try='./$ac_file'
  { (case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
    cross_compiling=no
  else
    if test "$cross_compiling" = maybe; then
	cross_compiling=yes
    else
	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi
fi
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
# Check that the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6; }

{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	  break;;
    * ) break;;
  esac
done
else
  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi

rm -f conftest$ac_cv_exeext
{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6; }

rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
if test "${ac_cv_objext+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  for ac_file in conftest.o conftest.obj conftest.*; do
  test -f "$ac_file" || continue;
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
       break;;
  esac
done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi

rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_compiler_gnu=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_compiler_gnu=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu

fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_save_c_werror_flag=$ac_c_werror_flag
   ac_c_werror_flag=yes
   ac_cv_prog_cc_g=no
   CFLAGS="-g"
   cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_prog_cc_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	CFLAGS=""
      cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_c_werror_flag=$ac_save_c_werror_flag
	 CFLAGS="-g"
	 cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_prog_cc_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
  CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi
{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_c89+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
     char **p;
     int i;
{
  return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
  char *s;
  va_list v;
  va_start (v,p);
  s = g (p, va_arg (v,int));
  va_end (v);
  return s;
}

/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
   function prototypes and stuff, but not '\xHH' hex character constants.
   These don't provoke an error unfortunately, instead are silently treated
   as 'x'.  The following induces an error, until -std is added to get
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
   array size at least.  It's necessary to write '\x00'==0 to get something
   that's true only with -std.  */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];

/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
   inside strings and character constants.  */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_prog_cc_c89=$ac_arg
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


fi

rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { echo "$as_me:$LINENO: result: none needed" >&5
echo "${ECHO_T}none needed" >&6; } ;;
  xno)
    { echo "$as_me:$LINENO: result: unsupported" >&5
echo "${ECHO_T}unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
esac


ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -z "$CXX"; then
  if test -n "$CCC"; then
    CXX=$CCC
  else
    if test -n "$ac_tool_prefix"; then
  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
  { echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


    test -n "$CXX" && break
  done
fi
if test -z "$CXX"; then
  ac_ct_CXX=$CXX
  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CXX"; then
  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_ac_ct_CXX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
echo "${ECHO_T}$ac_ct_CXX" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  test -n "$ac_ct_CXX" && break
done

  if test "x$ac_ct_CXX" = x; then
    CXX="g++"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
    CXX=$ac_ct_CXX
  fi
fi

  fi
fi
# Provide some information about the compiler.
echo "$as_me:$LINENO: checking for C++ compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (ac_try="$ac_compiler --version >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler --version >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (ac_try="$ac_compiler -v >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler -v >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (ac_try="$ac_compiler -V >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compiler -V >&5") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_compiler_gnu=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_compiler_gnu=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu

fi
{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
GXX=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cxx_g+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
   ac_cxx_werror_flag=yes
   ac_cv_prog_cxx_g=no
   CXXFLAGS="-g"
   cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	CXXFLAGS=""
      cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
	 CXXFLAGS="-g"
	 cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_cxx_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  { echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_ac_ct_RANLIB="ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi

  if test "x$ac_ct_RANLIB" = x; then
    RANLIB=":"
  else
    case $cross_compiling:$ac_tool_warned in
yes:)
{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&5
echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org." >&2;}
ac_tool_warned=yes ;;
esac
    RANLIB=$ac_ct_RANLIB
  fi
else
  RANLIB="$ac_cv_prog_RANLIB"
fi


for ac_prog in flex lex
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_LEX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_LEX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
LEX=$ac_cv_prog_LEX
if test -n "$LEX"; then
  { echo "$as_me:$LINENO: result: $LEX" >&5
echo "${ECHO_T}$LEX" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  test -n "$LEX" && break
done
test -n "$LEX" || LEX=":"

if test "x$LEX" != "x:"; then
  cat >conftest.l <<_ACEOF
%%
a { ECHO; }
b { REJECT; }
c { yymore (); }
d { yyless (1); }
e { yyless (input () != 0); }
f { unput (yytext[0]); }
. { BEGIN INITIAL; }
%%
#ifdef YYTEXT_POINTER
extern char *yytext;
#endif
int
main (void)
{
  return ! yylex () + ! yywrap ();
}
_ACEOF
{ (ac_try="$LEX conftest.l"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$LEX conftest.l") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ echo "$as_me:$LINENO: checking lex output file root" >&5
echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; }
if test "${ac_cv_prog_lex_root+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

if test -f lex.yy.c; then
  ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
  ac_cv_prog_lex_root=lexyy
else
  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
   { (exit 1); exit 1; }; }
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; }
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root

if test -z "${LEXLIB+set}"; then
  { echo "$as_me:$LINENO: checking lex library" >&5
echo $ECHO_N "checking lex library... $ECHO_C" >&6; }
if test "${ac_cv_lib_lex+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

    ac_save_LIBS=$LIBS
    ac_cv_lib_lex='none needed'
    for ac_lib in '' -lfl -ll; do
      LIBS="$ac_lib $ac_save_LIBS"
      cat >conftest.$ac_ext <<_ACEOF
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_lex=$ac_lib
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
      test "$ac_cv_lib_lex" != 'none needed' && break
    done
    LIBS=$ac_save_LIBS

fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
echo "${ECHO_T}$ac_cv_lib_lex" >&6; }
  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
fi


{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; }
if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent.  Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
ac_save_LIBS=$LIBS
LIBS="$LEXLIB $ac_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
#define YYTEXT_POINTER 1
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_prog_lex_yytext_pointer=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_save_LIBS

fi
{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; }
if test $ac_cv_prog_lex_yytext_pointer = yes; then

cat >>confdefs.h <<\_ACEOF
#define YYTEXT_POINTER 1
_ACEOF

fi
rm -f conftest.l $LEX_OUTPUT_ROOT.c

fi
for ac_prog in 'bison -y' byacc
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_YACC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_prog_YACC="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

fi
fi
YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
  { echo "$as_me:$LINENO: result: $YACC" >&5
echo "${ECHO_T}$YACC" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"


  { echo "$as_me:$LINENO: checking if compiler supports -R" >&5
echo $ECHO_N "checking if compiler supports -R... $ECHO_C" >&6; }
  if test "${php_cv_cc_dashr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

	SAVE_LIBS="${LIBS}"
	LIBS="-R /usr/lib ${LIBS}"
	cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  php_cv_cc_dashr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	php_cv_cc_dashr=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
	LIBS="${SAVE_LIBS}"
fi

  { echo "$as_me:$LINENO: result: $php_cv_cc_dashr" >&5
echo "${ECHO_T}$php_cv_cc_dashr" >&6; }
  if test $php_cv_cc_dashr = "yes"; then
	ld_runpath_switch="-R"
	apxs_runpath_switch="-Wl,-R'"
  fi
  if test -z "$ld_runpath_switch" ; then
	{ echo "$as_me:$LINENO: checking if compiler supports -Wl,-rpath," >&5
echo $ECHO_N "checking if compiler supports -Wl,-rpath,... $ECHO_C" >&6; }
	if test "${php_cv_cc_rpath+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

		SAVE_LIBS="${LIBS}"
		LIBS="-Wl,-rpath,/usr/lib ${LIBS}"
		cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  php_cv_cc_rpath=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	php_cv_cc_rpath=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
		LIBS="${SAVE_LIBS}"
fi

	{ echo "$as_me:$LINENO: result: $php_cv_cc_rpath" >&5
echo "${ECHO_T}$php_cv_cc_rpath" >&6; }
	if test $php_cv_cc_rpath = "yes"; then
		ld_runpath_switch="-Wl,-rpath,"
		apxs_runpath_switch="-Wl,'-rpath "
	fi
  fi
  if test -z "$ld_runpath_switch" ; then
	{ echo "$as_me:$LINENO: checking if compiler supports -Wl,-R" >&5
echo $ECHO_N "checking if compiler supports -Wl,-R... $ECHO_C" >&6; }
	if test "${php_cv_cc_dashwlr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

		SAVE_LIBS="${LIBS}"
		LIBS="-Wl,-R/usr/lib ${LIBS}"
		cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  php_cv_cc_dashwlr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	php_cv_cc_dashwlr=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
		LIBS="${SAVE_LIBS}"
fi

	{ echo "$as_me:$LINENO: result: $php_cv_cc_dashwlr" >&5
echo "${ECHO_T}$php_cv_cc_dashwlr" >&6; }
	if test $php_cv_cc_rpath = "yes"; then
		ld_runpath_switch="-Wl,-R"
		apxs_runpath_switch="-Wl,-R'"
	fi
  fi
  if test -z "$ld_runpath_switch" ; then
		ld_runpath_switch="-L"
	apxs_runpath_switch="-L'"
  fi



{ echo "$as_me:$LINENO: checking for exp in -lm" >&5
echo $ECHO_N "checking for exp in -lm... $ECHO_C" >&6; }
if test "${ac_cv_lib_m_exp+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char exp ();
int
main ()
{
return exp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_m_exp=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_m_exp=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_exp" >&5
echo "${ECHO_T}$ac_cv_lib_m_exp" >&6; }
if test $ac_cv_lib_m_exp = yes; then
  XTRALIBS="$XTRALIBS -lm"
fi

XTRALIBS=$XTRALIBS


{ echo "$as_me:$LINENO: checking for __gxx_personality_v0 in -lstdc++" >&5
echo $ECHO_N "checking for __gxx_personality_v0 in -lstdc++... $ECHO_C" >&6; }
if test "${ac_cv_lib_stdcpp___gxx_personality_v0+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lstdc++  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char __gxx_personality_v0 ();
int
main ()
{
return __gxx_personality_v0 ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_stdcpp___gxx_personality_v0=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_stdcpp___gxx_personality_v0=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_stdcpp___gxx_personality_v0" >&5
echo "${ECHO_T}$ac_cv_lib_stdcpp___gxx_personality_v0" >&6; }
if test $ac_cv_lib_stdcpp___gxx_personality_v0 = yes; then
  XTRALIBS="$XTRALIBS -lstdc++"
fi

XTRALIBS=$XTRALIBS


LIBS="$XTRALIBS $LIBS"

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
  if test "${ac_cv_prog_CPP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      # Double quotes because CPP needs to be expanded
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi

rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi

rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  break
fi

    done
    ac_cv_prog_CPP=$CPP

fi
  CPP=$ac_cv_prog_CPP
else
  ac_cv_prog_CPP=$CPP
fi
{ echo "$as_me:$LINENO: result: $CPP" >&5
echo "${ECHO_T}$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi

rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether nonexistent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi

rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  :
else
  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
if test "${ac_cv_path_GREP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # Extract the first word of "grep ggrep" to use in msg output
if test -z "$GREP"; then
set dummy grep ggrep; ac_prog_name=$2
if test "${ac_cv_path_GREP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_prog in grep ggrep; do
  for ac_exec_ext in '' $ac_executable_extensions; do
    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
    # Check for GNU ac_path_GREP and select it if it is found.
  # Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
  ac_count=0
  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    echo 'GREP' >> "conftest.nl"
    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    ac_count=`expr $ac_count + 1`
    if test $ac_count -gt ${ac_path_GREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_GREP="$ac_path_GREP"
      ac_path_GREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac


    $ac_path_GREP_found && break 3
  done
done

done
IFS=$as_save_IFS


fi

GREP="$ac_cv_path_GREP"
if test -z "$GREP"; then
  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
   { (exit 1); exit 1; }; }
fi

else
  ac_cv_path_GREP=$GREP
fi


fi
{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
 GREP="$ac_cv_path_GREP"


{ echo "$as_me:$LINENO: checking for egrep" >&5
echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
if test "${ac_cv_path_EGREP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
   then ac_cv_path_EGREP="$GREP -E"
   else
     # Extract the first word of "egrep" to use in msg output
if test -z "$EGREP"; then
set dummy egrep; ac_prog_name=$2
if test "${ac_cv_path_EGREP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_prog in egrep; do
  for ac_exec_ext in '' $ac_executable_extensions; do
    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
    # Check for GNU ac_path_EGREP and select it if it is found.
  # Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
  ac_count=0
  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
  while :
  do
    cat "conftest.in" "conftest.in" >"conftest.tmp"
    mv "conftest.tmp" "conftest.in"
    cp "conftest.in" "conftest.nl"
    echo 'EGREP' >> "conftest.nl"
    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
    ac_count=`expr $ac_count + 1`
    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
      # Best one so far, save it but keep looking for a better one
      ac_cv_path_EGREP="$ac_path_EGREP"
      ac_path_EGREP_max=$ac_count
    fi
    # 10*(2^10) chars as input seems more than enough
    test $ac_count -gt 10 && break
  done
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac


    $ac_path_EGREP_found && break 3
  done
done

done
IFS=$as_save_IFS


fi

EGREP="$ac_cv_path_EGREP"
if test -z "$EGREP"; then
  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
   { (exit 1); exit 1; }; }
fi

else
  ac_cv_path_EGREP=$EGREP
fi


   fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
 EGREP="$ac_cv_path_EGREP"


{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_cv_header_stdc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_header_stdc=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <string.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then
  :
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      return 2;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_try") 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi


fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then

cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF

fi



	echo 'void f(){}' > conftest.c
	if test -z "`${CC} -fPIC -c conftest.c 2>&1`"; then
	  C_PIC=-fPIC
	else
	  C_PIC=
	fi
	rm -f conftest*

	C_PIC=$C_PIC


CFLAGS="$CFLAGS $C_PIC"
CXXFLAGS="$CXXFLAGS $C_PIC"

{ echo "$as_me:$LINENO: checking for strcasecmp" >&5
echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6; }
if test "${ac_cv_func_strcasecmp+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strcasecmp to an innocuous variant, in case <limits.h> declares strcasecmp.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strcasecmp innocuous_strcasecmp

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strcasecmp (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strcasecmp

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strcasecmp ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strcasecmp || defined __stub___strcasecmp
choke me
#endif

int
main ()
{
return strcasecmp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strcasecmp=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strcasecmp=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5
echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6; }
if test $ac_cv_func_strcasecmp = yes; then
  :
else
  STRINGS="-DNEED_STRCASECMP $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for strncasecmp" >&5
echo $ECHO_N "checking for strncasecmp... $ECHO_C" >&6; }
if test "${ac_cv_func_strncasecmp+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strncasecmp to an innocuous variant, in case <limits.h> declares strncasecmp.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strncasecmp innocuous_strncasecmp

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strncasecmp (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strncasecmp

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strncasecmp ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strncasecmp || defined __stub___strncasecmp
choke me
#endif

int
main ()
{
return strncasecmp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strncasecmp=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strncasecmp=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strncasecmp" >&5
echo "${ECHO_T}$ac_cv_func_strncasecmp" >&6; }
if test $ac_cv_func_strncasecmp = yes; then
  :
else
  STRINGS="-DNEED_STRNCASECMP $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for strdup" >&5
echo $ECHO_N "checking for strdup... $ECHO_C" >&6; }
if test "${ac_cv_func_strdup+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strdup to an innocuous variant, in case <limits.h> declares strdup.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strdup innocuous_strdup

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strdup (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strdup

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strdup ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strdup || defined __stub___strdup
choke me
#endif

int
main ()
{
return strdup ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strdup=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strdup=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strdup" >&5
echo "${ECHO_T}$ac_cv_func_strdup" >&6; }
if test $ac_cv_func_strdup = yes; then
  :
else
  STRINGS="-DNEED_STRDUP $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for strrstr" >&5
echo $ECHO_N "checking for strrstr... $ECHO_C" >&6; }
if test "${ac_cv_func_strrstr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strrstr to an innocuous variant, in case <limits.h> declares strrstr.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strrstr innocuous_strrstr

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strrstr (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strrstr

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strrstr ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strrstr || defined __stub___strrstr
choke me
#endif

int
main ()
{
return strrstr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strrstr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strrstr=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strrstr" >&5
echo "${ECHO_T}$ac_cv_func_strrstr" >&6; }
if test $ac_cv_func_strrstr = yes; then
  :
else
  STRINGS="-DNEED_STRRSTR $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for strcasestr" >&5
echo $ECHO_N "checking for strcasestr... $ECHO_C" >&6; }
if test "${ac_cv_func_strcasestr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strcasestr to an innocuous variant, in case <limits.h> declares strcasestr.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strcasestr innocuous_strcasestr

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strcasestr (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strcasestr

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strcasestr ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strcasestr || defined __stub___strcasestr
choke me
#endif

int
main ()
{
return strcasestr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strcasestr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strcasestr=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strcasestr" >&5
echo "${ECHO_T}$ac_cv_func_strcasestr" >&6; }
if test $ac_cv_func_strcasestr = yes; then
  :
else
  STRINGS="-DNEED_STRCASESTR $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for strlcat" >&5
echo $ECHO_N "checking for strlcat... $ECHO_C" >&6; }
if test "${ac_cv_func_strlcat+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define strlcat to an innocuous variant, in case <limits.h> declares strlcat.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strlcat innocuous_strlcat

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strlcat (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef strlcat

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char strlcat ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_strlcat || defined __stub___strlcat
choke me
#endif

int
main ()
{
return strlcat ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_strlcat=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_strlcat=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_strlcat" >&5
echo "${ECHO_T}$ac_cv_func_strlcat" >&6; }
if test $ac_cv_func_strlcat = yes; then
  :
else
  STRINGS="-DNEED_STRLCAT $STRINGS"
fi

{ echo "$as_me:$LINENO: checking for vsnprintf" >&5
echo $ECHO_N "checking for vsnprintf... $ECHO_C" >&6; }
if test "${ac_cv_func_vsnprintf+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define vsnprintf to an innocuous variant, in case <limits.h> declares vsnprintf.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define vsnprintf innocuous_vsnprintf

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char vsnprintf (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef vsnprintf

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char vsnprintf ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined __stub_vsnprintf || defined __stub___vsnprintf
choke me
#endif

int
main ()
{
return vsnprintf ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_func_vsnprintf=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_func_vsnprintf=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $ac_cv_func_vsnprintf" >&5
echo "${ECHO_T}$ac_cv_func_vsnprintf" >&6; }
if test $ac_cv_func_vsnprintf = yes; then
  STRINGS="-DHAVE_VSNPRINTF $STRINGS"
fi

STRINGS=$STRINGS


MS_VERSION=`grep 'MS_VERSION ' mapserver.h | grep '#define' | cut -d\" -f2`
{ echo "$as_me:$LINENO: result: MapServer Version from mapserver.h: '$MS_VERSION'" >&5
echo "${ECHO_T}MapServer Version from mapserver.h: '$MS_VERSION'" >&6; }
MS_VERSION="$MS_VERSION"



{ echo "$as_me:$LINENO: checking if pkg-config path is provided" >&5
echo $ECHO_N "checking if pkg-config path is provided... $ECHO_C" >&6; }


# Check whether --with-pkg-config was given.
if test "${with_pkg_config+set}" = set; then
  withval=$with_pkg_config;
fi


if test -n "$with_pkg_config" -a "$with_pkg_config" != "no" ; then

  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

  PKG_CONFIG=$with_pkg_config
else
  PKG_CONFIG="yes"
fi

if test "$PKG_CONFIG" = "yes" ; then

   # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi



   if test "$PKG_CONFIG" = "no" ; then
      { echo "$as_me:$LINENO: result: couldn't find pkg-config in default path. Please specify full path to pkg-config if needed" >&5
echo "${ECHO_T}couldn't find pkg-config in default path. Please specify full path to pkg-config if needed" >&6; }
   fi

elif test -f "$PKG_CONFIG" -a -x "$PKG_CONFIG" ; then
     { echo "$as_me:$LINENO: result: user supplied pkg-config ($PKG_CONFIG)" >&5
echo "${ECHO_T}user supplied pkg-config ($PKG_CONFIG)" >&6; }
else
     { { echo "$as_me:$LINENO: error: '$PKG_CONFIG' is not an executable.  Make sure you use --with-pkg-config=/path/to/pkg-config" >&5
echo "$as_me: error: '$PKG_CONFIG' is not an executable.  Make sure you use --with-pkg-config=/path/to/pkg-config" >&2;}
   { (exit 1); exit 1; }; }
fi



unset ac_cv_lib_freetype_FT_Init_FreeType
unset ac_cv_lib_ttf_TT_Init_FreeType


# Check whether --with-freetype was given.
if test "${with_freetype+set}" = set; then
  withval=$with_freetype; FT_DIR=$withval
else
  FT_DIR=''
fi



  if test -z "$FT_DIR" || echo "$FT_DIR" | grep '^/' >/dev/null ; then
    FT_DIR="$FT_DIR"
  else
    FT_DIR="`pwd`/$FT_DIR"
  fi

{ echo "$as_me:$LINENO: checking where FreeType 2.x is installed..." >&5
echo "$as_me: checking where FreeType 2.x is installed..." >&6;}
FT_LIB=''
FT_BIN=''
FT_TYPE=''

test -x "$FT_DIR" -a "freetype-config" = "`basename $FT_DIR ''`" && FT_BIN="$FT_DIR"
test -x "$FT_DIR/freetype-config" && FT_BIN="$FT_DIR/freetype-config"
test -x "$FT_DIR/bin/freetype-config" && FT_BIN="$FT_DIR/bin/freetype-config"

if test "$with_freetype" = "yes" ; then
 # Extract the first word of "freetype-config", so it can be a program name with args.
set dummy freetype-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_FT_BIN+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $FT_BIN in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_FT_BIN="$FT_BIN" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_FT_BIN="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_FT_BIN" && ac_cv_path_FT_BIN="no"
  ;;
esac
fi
FT_BIN=$ac_cv_path_FT_BIN
if test -n "$FT_BIN"; then
  { echo "$as_me:$LINENO: result: $FT_BIN" >&5
echo "${ECHO_T}$FT_BIN" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


fi

if test -n "$FT_BIN" ; then
    FT_LIB=`$FT_BIN --libs`
  FT_LIBDIR="`$FT_BIN --exec-prefix`/lib"
  { echo "$as_me:$LINENO: result:         using libfreetype from $FT_LIB" >&5
echo "${ECHO_T}        using libfreetype from $FT_LIB" >&6; }

  if test ""$FT_LIBDIR"" != "/usr/lib"; then

  if test -z ""$FT_LIBDIR"" || echo ""$FT_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$FT_LIBDIR""
  else
    ai_p="`pwd`/"$FT_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


else
    test -f $FT_DIR/lib/libfreetype.a -o -f $FT_DIR/lib/libfreetype.so -o -f $FT_DIR/lib/libfreetype.sl -o -f $FT_DIR/lib/libfreetype.dylib && FT_LIBDIR="$FT_DIR/lib"
  test -f $FT_DIR/lib64/libfreetype.a -o -f $FT_DIR/lib64/libfreetype.so -o -f $FT_DIR/lib64/libfreetype.sl && FT_LIBDIR="$FT_DIR/lib64"
  test -f $FT_DIR/libfreetype.a -o -f $FT_DIR/libfreetype.so -o -f $FT_DIR/libfreetype.sl -o -f $FT_DIR/libfreetype.dylib && FT_LIBDIR="$FT_DIR"

  if test -n "$FT_LIBDIR" ; then
     FT_TYPE="-lfreetype"
  fi
fi

if test -n "$FT_LIBDIR" -a -z "$FT_BIN" ; then
  FT_LIB="-L$FT_LIBDIR $FT_TYPE"
  { echo "$as_me:$LINENO: result:         using libfreetype from $FT_LIB" >&5
echo "${ECHO_T}        using libfreetype from $FT_LIB" >&6; }

  if test ""$FT_LIB"" != "/usr/lib"; then

  if test -z ""$FT_LIB"" || echo ""$FT_LIB"" | grep '^/' >/dev/null ; then
    ai_p=""$FT_LIB""
  else
    ai_p="`pwd`/"$FT_LIB""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

elif test -z "$FT_LIBDIR" -a -z "$FT_BIN" ; then     { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lfreetype  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char FT_Init_FreeType ();
int
main ()
{
return FT_Init_FreeType ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_freetype_FT_Init_FreeType=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_freetype_FT_Init_FreeType=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
  FT_LIB="-lfreetype"
fi


  if test -n "$FT_LIB" ; then
    { echo "$as_me:$LINENO: result:         using libfreetype $FT_LIB from system libs." >&5
echo "${ECHO_T}        using libfreetype $FT_LIB from system libs." >&6; }
  else
    { echo "$as_me:$LINENO: result:         freetype-config or libfreetype cannot be found, possibly needed for GD" >&5
echo "${ECHO_T}        freetype-config or libfreetype cannot be found, possibly needed for GD" >&6; }
  fi
fi



unset ac_cv_lib_z_zlibVersion


# Check whether --with-zlib was given.
if test "${with_zlib+set}" = set; then
  withval=$with_zlib; ZLIB_DIR=$withval
else
  ZLIB_DIR=''
fi



  if test -z "$ZLIB_DIR" || echo "$ZLIB_DIR" | grep '^/' >/dev/null ; then
    ZLIB_DIR="$ZLIB_DIR"
  else
    ZLIB_DIR="`pwd`/$ZLIB_DIR"
  fi

{ echo "$as_me:$LINENO: checking where Zlib is installed..." >&5
echo "$as_me: checking where Zlib is installed..." >&6;}
ZLIB_LIB=''

test -f $ZLIB_DIR/include/zlib.h && ZLIB_INCDIR="$ZLIB_DIR/include"

test -f $ZLIB_DIR/lib/libz.a -o -f $ZLIB_DIR/lib/libz.so -o -f $ZLIB_DIR/lib/libz.sl -o -f $ZLIB_DIR/lib/libz.dylib && ZLIB_LIBDIR="$ZLIB_DIR/lib"
test -f $ZLIB_DIR/lib64/libz.a -o -f $ZLIB_DIR/lib64/libz.so -o -f $ZLIB_DIR/lib64/libz.sl && ZLIB_LIBDIR="$ZLIB_DIR/lib64"
test -f $ZLIB_DIR/libz.a -o -f $ZLIB_DIR/libz.so -o -f $ZLIB_DIR/libz.sl && ZLIB_LIBDIR="$ZLIB_DIR"


if test -n "$ZLIB_LIBDIR" -a -n "$ZLIB_INCDIR" ; then

        ZLIB_ENABLED="-DUSE_ZLIB"
  ZLIB_INC="-I$ZLIB_INCDIR"
  ZLIB_LIB="-L$ZLIB_LIBDIR -lz"
  { echo "$as_me:$LINENO: result:         using libz from $ZLIB_LIB ($ZLIB_ENABLED)" >&5
echo "${ECHO_T}        using libz from $ZLIB_LIB ($ZLIB_ENABLED)" >&6; }

  if test ""$ZLIB_DIR"" != "/usr/lib"; then

  if test -z ""$ZLIB_DIR"" || echo ""$ZLIB_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$ZLIB_DIR""
  else
    ai_p="`pwd`/"$ZLIB_DIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


elif test -n "$ZLIB_LIBDIR" ; then

        ZLIB_LIB="-L$ZLIB_LIBDIR -lz"
  { echo "$as_me:$LINENO: result:         using runtime libz from $ZLIB_LIB" >&5
echo "${ECHO_T}        using runtime libz from $ZLIB_LIB" >&6; }

  if test ""$ZLIB_DIR"" != "/usr/lib"; then

  if test -z ""$ZLIB_DIR"" || echo ""$ZLIB_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$ZLIB_DIR""
  else
    ai_p="`pwd`/"$ZLIB_DIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


else


  { echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5
echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6; }
if test "${ac_cv_lib_z_zlibVersion+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lz  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion ();
int
main ()
{
return zlibVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_z_zlibVersion=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_z_zlibVersion=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5
echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6; }
if test $ac_cv_lib_z_zlibVersion = yes; then
  ZLIB_LIB="-lz"
fi


  if test -n "$ZLIB_LIB" ; then
    ZLIB_ENABLED="-DUSE_ZLIB"
    { echo "$as_me:$LINENO: result:         using libz from system libs ($ZLIB_ENABLED)." >&5
echo "${ECHO_T}        using libz from system libs ($ZLIB_ENABLED)." >&6; }
  else
    { echo "$as_me:$LINENO: result:         Zlib (libz) library cannot be found, possibly needed for GD" >&5
echo "${ECHO_T}        Zlib (libz) library cannot be found, possibly needed for GD" >&6; }
  fi

fi


ZLIB_ENABLED=$ZLIB_ENABLED

ZLIB_INC=$ZLIB_INC

ZLIB_LIB=$ZLIB_LIB


ALL_ENABLED="$ZLIB_ENABLED $ALL_ENABLED"
ALL_INC="$ZLIB_INC $ALL_INC"
ALL_LIB="$ZLIB_LIB $ALL_LIB"


unset ac_cv_lib_png_png_init_io


# Check whether --with-png was given.
if test "${with_png+set}" = set; then
  withval=$with_png; PNG_DIR=$withval
else
  PNG_DIR=''
fi



  if test -z "$PNG_DIR" || echo "$PNG_DIR" | grep '^/' >/dev/null ; then
    PNG_DIR="$PNG_DIR"
  else
    PNG_DIR="`pwd`/$PNG_DIR"
  fi

{ echo "$as_me:$LINENO: checking where PNG is installed..." >&5
echo "$as_me: checking where PNG is installed..." >&6;}
PNG_LIB=''

test -f $PNG_DIR/lib/libpng.a -o -f $PNG_DIR/lib/libpng.so -o -f $PNG_DIR/lib/libpng.sl -o -f $PNG_DIR/lib/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib"
test -f $PNG_DIR/lib64/libpng.a -o -f $PNG_DIR/lib64/libpng.so -o -f $PNG_DIR/lib64/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR/lib64"
test -f $PNG_DIR/libpng.a -o -f $PNG_DIR/libpng.so -o -f $PNG_DIR/libpng.sl -o -f $PNG_DIR/libpng.dylib && PNG_LIBDIR="$PNG_DIR"

if test -n "$PNG_LIBDIR" ; then

  PNG_LIB="-L$PNG_LIBDIR -lpng"
  { echo "$as_me:$LINENO: result:         using libpng from $PNG_LIB" >&5
echo "${ECHO_T}        using libpng from $PNG_LIB" >&6; }

  if test ""$PNG_LIBDIR"" != "/usr/lib"; then

  if test -z ""$PNG_LIBDIR"" || echo ""$PNG_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$PNG_LIBDIR""
  else
    ai_p="`pwd`/"$PNG_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


else


  { echo "$as_me:$LINENO: checking for png_init_io in -lpng" >&5
echo $ECHO_N "checking for png_init_io in -lpng... $ECHO_C" >&6; }
if test "${ac_cv_lib_png_png_init_io+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng $ZLIB_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char png_init_io ();
int
main ()
{
return png_init_io ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_png_png_init_io=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_png_png_init_io=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_init_io" >&5
echo "${ECHO_T}$ac_cv_lib_png_png_init_io" >&6; }
if test $ac_cv_lib_png_png_init_io = yes; then
  PNG_LIB="-lpng"
fi


  if test -n "$PNG_LIB" ; then
    { echo "$as_me:$LINENO: result:         using libpng from system libs." >&5
echo "${ECHO_T}        using libpng from system libs." >&6; }
  else
    { echo "$as_me:$LINENO: result:         PNG (libpng) library cannot be found, possibly needed for GD" >&5
echo "${ECHO_T}        PNG (libpng) library cannot be found, possibly needed for GD" >&6; }
  fi

fi


unset ac_cv_lib_jpeg_jpeg_read_header

{ echo "$as_me:$LINENO: checking whether we should include JPEG support..." >&5
echo "$as_me: checking whether we should include JPEG support..." >&6;}

# Check whether --with-jpeg was given.
if test "${with_jpeg+set}" = set; then
  withval=$with_jpeg;
fi


if test -n "$with_jpeg" -a "$with_jpeg" != "yes" ; then


  if test -z "$with_jpeg" || echo "$with_jpeg" | grep '^/' >/dev/null ; then
    JPEG_DIR="$with_jpeg"
  else
    JPEG_DIR="`pwd`/$with_jpeg"
  fi

  test -f $JPEG_DIR/include/jpeg/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include/jpeg"
  test -f $JPEG_DIR/include/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/include"
  test -f $JPEG_DIR/lib/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR/lib"
  test -f $JPEG_DIR/jpeglib.h && JPEG_INCLUDE="$JPEG_DIR"

  test -f $JPEG_DIR/lib/libjpeg.a && JPEG_LIBDIR="$JPEG_DIR/lib"
  test -f $JPEG_DIR/lib64/libjpeg.a && JPEG_LIBDIR="$JPEG_DIR/lib64"
  test -f $JPEG_DIR/libjpeg.a && JPEG_LIBDIR="$JPEG_DIR"

  test -f $JPEG_DIR/lib/libjpeg.so -o -f $JPEG_DIR/lib/libjpeg.sl -o -f $JPEG_DIR/lib/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR/lib"
  test -f $JPEG_DIR/lib64/libjpeg.so -o -f $JPEG_DIR/lib64/libjpeg.sl && JPEG_LIBDIR="$JPEG_DIR/lib64"
  test -f $JPEG_DIR/libjpeg.so -o -f $JPEG_DIR/libjpeg.sl -o -f $JPEG_DIR/libjpeg.dylib && JPEG_LIBDIR="$JPEG_DIR"

  if test -n "$JPEG_INCLUDE" -a -n "$JPEG_LIBDIR" ; then
      JPEG_ENABLED="-DUSE_JPEG"
      JPEG_INC=-I$JPEG_INCLUDE
      JPEG_LIB="-L$JPEG_LIBDIR -ljpeg"

  if test ""$JPEG_LIBDIR"" != "/usr/lib"; then

  if test -z ""$JPEG_LIBDIR"" || echo ""$JPEG_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$JPEG_LIBDIR""
  else
    ai_p="`pwd`/"$JPEG_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      if test "$with_jpeg" != "no" ; then
        { echo "$as_me:$LINENO: result: \"Could not find jpeglib.h or libjpeg.a/libjpeg.so/libjpeg.dylib in $JPEG_DIR.\"" >&5
echo "${ECHO_T}\"Could not find jpeglib.h or libjpeg.a/libjpeg.so/libjpeg.dylib in $JPEG_DIR.\"" >&6; }
      fi
  fi


  if test "$with_jpeg" = "no" ; then
    { echo "$as_me:$LINENO: result:         disabled by --without-jpeg" >&5
echo "${ECHO_T}        disabled by --without-jpeg" >&6; }
  else
    JPEG_ENABLED="-DUSE_JPEG"
  fi

  if test -z "$JPEG_LIB" ; then

    { echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6; }
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char jpeg_read_header ();
int
main ()
{
return jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_jpeg_jpeg_read_header=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6; }
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then
  JPEG_LIB="-ljpeg"
fi


    if test -n "$JPEG_LIB" ; then
        JPEG_LIB="-ljpeg"
        { echo "$as_me:$LINENO: result:         using libjpeg from system libs." >&5
echo "${ECHO_T}        using libjpeg from system libs." >&6; }
    else
        { echo "$as_me:$LINENO: result:         libjpeg not found. JPEG support not included, possibly needed for GD." >&5
echo "${ECHO_T}        libjpeg not found. JPEG support not included, possibly needed for GD." >&6; }
    fi
  else
     { echo "$as_me:$LINENO: result:         using libjpeg from system $JPEG_LIB" >&5
echo "${ECHO_T}        using libjpeg from system $JPEG_LIB" >&6; }
  fi

else

  { echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6; }
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char jpeg_read_header ();
int
main ()
{
return jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_jpeg_jpeg_read_header=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6; }
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then
  JPEG_ENABLED=-DUSE_JPEG
fi


  if test -n "$JPEG_ENABLED" ; then
      JPEG_LIB="-ljpeg"
      { echo "$as_me:$LINENO: result:         using libjpeg from system libs." >&5
echo "${ECHO_T}        using libjpeg from system libs." >&6; }
  else
      { echo "$as_me:$LINENO: result:         libjpeg not found. JPEG support not included, possibly needed for GD." >&5
echo "${ECHO_T}        libjpeg not found. JPEG support not included, possibly needed for GD." >&6; }
  fi

fi

JPEG_ENABLED=$JPEG_ENABLED

JPEG_INC=$JPEG_INC

JPEG_LIB=$JPEG_LIB



unset ac_cv_lib_Xpm_XpmFreeXpmImage


# Check whether --with-xpm was given.
if test "${with_xpm+set}" = set; then
  withval=$with_xpm; XPM_DIR=$withval
else
  XPM_DIR=''
fi


if test "$with_xpm" != "no" ; then


  if test -z "$XPM_DIR" || echo "$XPM_DIR" | grep '^/' >/dev/null ; then
    XPM_DIR="$XPM_DIR"
  else
    XPM_DIR="`pwd`/$XPM_DIR"
  fi

  { echo "$as_me:$LINENO: checking where libXpm is installed..." >&5
echo "$as_me: checking where libXpm is installed..." >&6;}
  XPM_LIB=''

  test -f $XPM_DIR/lib/libXpm.a -o -f $XPM_DIR/lib/libXpm.so -o -f $XPM_DIR/lib/libXpm.sl -o -f $XPM_DIR/lib/libXpm.dylib && XPM_LIBDIR="$XPM_DIR/lib"
  test -f $XPM_DIR/lib64/libXpm.a -o -f $XPM_DIR/lib64/libXpm.so -o -f $XPM_DIR/lib64/libXpm.sl && XPM_LIBDIR="$XPM_DIR/lib64"
  test -f $XPM_DIR/libXpm.a -o -f $XPM_DIR/libXpm.so -o -f $XPM_DIR/libXpm.sl -o -f $XPM_DIR/libXpm.dylib && XPM_LIBDIR="$XPM_DIR"

  if test -n "$XPM_LIBDIR" ; then

    XPM_LIB="-L$XPM_LIBDIR -lXpm -lX11"
    { echo "$as_me:$LINENO: result:         using libXpm from $XPM_LIB" >&5
echo "${ECHO_T}        using libXpm from $XPM_LIB" >&6; }

  if test ""$XPM_LIBDIR"" != "/usr/lib"; then

  if test -z ""$XPM_LIBDIR"" || echo ""$XPM_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$XPM_LIBDIR""
  else
    ai_p="`pwd`/"$XPM_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


  else


    { echo "$as_me:$LINENO: checking for XpmFreeXpmImage in -lXpm" >&5
echo $ECHO_N "checking for XpmFreeXpmImage in -lXpm... $ECHO_C" >&6; }
if test "${ac_cv_lib_Xpm_XpmFreeXpmImage+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lXpm -lX11 $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char XpmFreeXpmImage ();
int
main ()
{
return XpmFreeXpmImage ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_Xpm_XpmFreeXpmImage=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_Xpm_XpmFreeXpmImage=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmFreeXpmImage" >&5
echo "${ECHO_T}$ac_cv_lib_Xpm_XpmFreeXpmImage" >&6; }
if test $ac_cv_lib_Xpm_XpmFreeXpmImage = yes; then
  XPM_LIB="-lXpm -lX11"
fi


    if test -n "$XPM_LIB" ; then
      { echo "$as_me:$LINENO: result:         using libXpm from system libs." >&5
echo "${ECHO_T}        using libXpm from system libs." >&6; }
    else
      { echo "$as_me:$LINENO: result:         XPM (libXpm) library cannot be found, possibly needed for GD" >&5
echo "${ECHO_T}        XPM (libXpm) library cannot be found, possibly needed for GD" >&6; }
    fi
  fi

fi


GD_XTRA_LIBS="$JPEG_LIB $FT_LIB $PNG_LIB $ZLIB_LIB $XPM_LIB"



unset ac_cv_lib_iconv_libiconv_open
unset ac_cv_lib_iconv_iconv_open
unset ac_cv_lib_c_iconv_open


# Check whether --with-libiconv was given.
if test "${with_libiconv+set}" = set; then
  withval=$with_libiconv; ICONV_DIR=$withval
else
  ICONV_DIR=''
fi


{ echo "$as_me:$LINENO: checking where libiconv is installed..." >&5
echo "$as_me: checking where libiconv is installed..." >&6;}

ICONV_LIB=''

if test -n "$ICONV_DIR" ; then


  if test -z "$ICONV_DIR" || echo "$ICONV_DIR" | grep '^/' >/dev/null ; then
    ICONV_DIR="$ICONV_DIR"
  else
    ICONV_DIR="`pwd`/$ICONV_DIR"
  fi


  test -f $ICONV_DIR/include/iconv.h && ICONV_LIBDIR="$ICONV_DIR/lib" && ICONV_INCDIR="$ICONV_DIR/include"
  test -f $ICONV_DIR/lib/libiconv.a -o -f $ICONV_DIR/lib/libiconv.so -o -f $ICONV_DIR/lib/libiconv.sl -o -f $ICONV_DIR/lib/libiconv.dylib && ICONV_LIBDIR="$ICONV_DIR/lib" && ICONV_INCDIR="$ICONV_DIR/include"
  test -f $ICONV_DIR/lib64/libiconv.a -o -f $ICONV_DIR/lib64/libiconv.so -o -f $ICONV_DIR/lib64/libiconv.sl && ICONV_LIBDIR="$ICONV_DIR/lib64" && ICONV_INCDIR="$ICONV_DIR/include"

            { echo "$as_me:$LINENO: checking for iconv_open in -lc" >&5
echo $ECHO_N "checking for iconv_open in -lc... $ECHO_C" >&6; }
if test "${ac_cv_lib_c_iconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc "-L$ICONV_LIBDIR" $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char iconv_open ();
int
main ()
{
return iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_c_iconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_c_iconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_iconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_c_iconv_open" >&6; }
if test $ac_cv_lib_c_iconv_open = yes; then
  ICONV_LIB="-L$ICONV_LIBDIR -lc"
fi

  { echo "$as_me:$LINENO: checking for libiconv_open in -liconv" >&5
echo $ECHO_N "checking for libiconv_open in -liconv... $ECHO_C" >&6; }
if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv "-L$ICONV_LIBDIR" $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char libiconv_open ();
int
main ()
{
return libiconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_iconv_libiconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_iconv_libiconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_iconv_libiconv_open" >&6; }
if test $ac_cv_lib_iconv_libiconv_open = yes; then
  ICONV_LIB="-L$ICONV_LIBDIR -liconv"
fi

  { echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5
echo $ECHO_N "checking for iconv_open in -liconv... $ECHO_C" >&6; }
if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv "-L$ICONV_LIBDIR" $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char iconv_open ();
int
main ()
{
return iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_iconv_iconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_iconv_iconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6; }
if test $ac_cv_lib_iconv_iconv_open = yes; then
  ICONV_LIB="-L$ICONV_LIBDIR -liconv"
fi


fi

if test -n "$ICONV_LIB" ; then
  if test -n "$ICONV_INCDIR"; then
     ICONV_INC="-I$ICONV_INCDIR"
  fi
  { echo "$as_me:$LINENO: result:         using libiconv from $ICONV_LIB" >&5
echo "${ECHO_T}        using libiconv from $ICONV_LIB" >&6; }

  if test ""$ICONV_DIR"" != "/usr/lib"; then

  if test -z ""$ICONV_DIR"" || echo ""$ICONV_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$ICONV_DIR""
  else
    ai_p="`pwd`/"$ICONV_DIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


else


  unset ac_cv_lib_iconv_libiconv_open
  unset ac_cv_lib_c_iconv_open
  { echo "$as_me:$LINENO: checking for iconv_open in -lc" >&5
echo $ECHO_N "checking for iconv_open in -lc... $ECHO_C" >&6; }
if test "${ac_cv_lib_c_iconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char iconv_open ();
int
main ()
{
return iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_c_iconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_c_iconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_iconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_c_iconv_open" >&6; }
if test $ac_cv_lib_c_iconv_open = yes; then
  ICONV_LIB="-lc"
fi

  { echo "$as_me:$LINENO: checking for libiconv_open in -liconv" >&5
echo $ECHO_N "checking for libiconv_open in -liconv... $ECHO_C" >&6; }
if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char libiconv_open ();
int
main ()
{
return libiconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_iconv_libiconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_iconv_libiconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_iconv_libiconv_open" >&6; }
if test $ac_cv_lib_iconv_libiconv_open = yes; then
  ICONV_LIB="-liconv"
fi

  { echo "$as_me:$LINENO: checking for iconv_open in -liconv" >&5
echo $ECHO_N "checking for iconv_open in -liconv... $ECHO_C" >&6; }
if test "${ac_cv_lib_iconv_iconv_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char iconv_open ();
int
main ()
{
return iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_iconv_iconv_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_iconv_iconv_open=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_iconv_open" >&5
echo "${ECHO_T}$ac_cv_lib_iconv_iconv_open" >&6; }
if test $ac_cv_lib_iconv_iconv_open = yes; then
  ICONV_LIB="-liconv"
fi


  if test -n "$ICONV_LIB" ; then
    { echo "$as_me:$LINENO: result:         using libiconv from system libs." >&5
echo "${ECHO_T}        using libiconv from system libs." >&6; }
  else
    { echo "$as_me:$LINENO: result:         libiconv library cannot be found, possibly needed for GD" >&5
echo "${ECHO_T}        libiconv library cannot be found, possibly needed for GD" >&6; }
  fi

fi

if test -n "$ICONV_LIB" ; then
  ICONV_ENABLED="-DUSE_ICONV"
  { echo "$as_me:$LINENO: result:         libiconv found. Enabling internationalization ($ICONV_ENABLED)" >&5
echo "${ECHO_T}        libiconv found. Enabling internationalization ($ICONV_ENABLED)" >&6; }
fi


ICONV_ENABLED=$ICONV_ENABLED

ICONV_INC=$ICONV_INC

ICONV_LIB=$ICONV_LIB


ALL_ENABLED="$ICONV_ENABLED $ALL_ENABLED"
ALL_INC="$ICONV_INC $ALL_INC"
ALL_LIB="$ICONV_LIB $ALL_LIB"




ms_saved_LIBS="$LIBS"
IS_GD2="false";

unset ac_cv_lib_gd_gdImageCreate
unset ac_cv_lib_gd_gdImageString16
unset ac_cv_lib_gd_gdImageGif
unset ac_cv_lib_gd_gdImagePng
unset ac_cv_lib_gd_gdImageJpeg
unset ac_cv_lib_gd_gdImageWBMP
unset ac_cv_lib_gd_gdImageStringFT
unset ac_cv_lib_gd_gdImageGifPtr
unset ac_cv_lib_gd_gdFontGetTiny
unset ac_cv_lib_c_gdImageCreate
unset ac_cv_lib_c_gdImageString16
unset ac_cv_lib_c_gdImageGif
unset ac_cv_lib_c_gdImagePng
unset ac_cv_lib_c_gdImageJpeg
unset ac_cv_lib_c_gdImageWBMP
unset ac_cv_lib_c_gdImageStringFT
unset ac_cv_lib_c_gdImageGifPtr
unset ac_cv_lib_c_gdFontGetTiny
unset ac_cv_lib_gd_gdFontCacheSetup

{ echo "$as_me:$LINENO: checking for GD 2.0.16 or higher..." >&5
echo "$as_me: checking for GD 2.0.16 or higher..." >&6;}

# Check whether --with-gd was given.
if test "${with_gd+set}" = set; then
  withval=$with_gd;
fi


if test "$with_gd" = "no" ; then
  { { echo "$as_me:$LINENO: error: GD library cannot be disabled" >&5
echo "$as_me: error: GD library cannot be disabled" >&2;}
   { (exit 1); exit 1; }; }
elif test -n "$with_gd" -a "$with_gd" != "yes" ; then

  if echo "$with_gd" | grep '^static,' >/dev/null ; then
    GD_DIR=`echo "$with_gd" | sed "s/^static,//"`
    GD_STATIC=yes
  else
    GD_DIR=$with_gd
    GD_STATIC=no
  fi


  if test -z "$GD_DIR" || echo "$GD_DIR" | grep '^/' >/dev/null ; then
    GD_DIR="$GD_DIR"
  else
    GD_DIR="`pwd`/$GD_DIR"
  fi

  test -f $GD_DIR/include/gd.h && GD_INCLUDE="$GD_DIR/include"
  test -f $GD_DIR/include/gd/gd.h && GD_INCLUDE="$GD_DIR/include/gd"
  test -f $GD_DIR/gd.h && GD_INCLUDE="$GD_DIR"

  test -f $GD_DIR/lib/libgd.a && GD_LIBDIR="$GD_DIR/lib"
  test -f $GD_DIR/lib64/libgd.a && GD_LIBDIR="$GD_DIR/lib64"
  test -f $GD_DIR/.libs/libgd.a && GD_LIBDIR="$GD_DIR/.libs"
  test -f $GD_DIR/_libs/libgd.a && GD_LIBDIR="$GD_DIR/_libs"
  test -f $GD_DIR/libgd.a && GD_LIBDIR="$GD_DIR"

  test -f $GD_DIR/lib/libgd.so -o -f $GD_DIR/lib/libgd.sl -o -f $GD_DIR/lib/libgd.dylib && GD_LIBDIR="$GD_DIR/lib"
  test -f $GD_DIR/lib64/libgd.so -o -f $GD_DIR/lib/libgd.sl && GD_LIBDIR="$GD_DIR/lib64"
  test -f $GD_DIR/.libs/libgd.so -o -f $GD_DIR/.libs/libgd.sl -o -f $GD_DIR/.libs/libgd.dylib && GD_LIBDIR="$GD_DIR/.libs"
  test -f $GD_DIR/_libs/libgd.so -o -f $GD_DIR/_libs/libgd.sl -o -f $GD_DIR/_libs/libgd.dylib && GD_LIBDIR="$GD_DIR/_libs"
  test -f $GD_DIR/libgd.so -o -f $GD_DIR/libgd.sl -o -f $GD_DIR/libgd.dylib && GD_LIBDIR="$GD_DIR"

    { echo "$as_me:$LINENO: checking for gdFontCacheSetup in -lgd" >&5
echo $ECHO_N "checking for gdFontCacheSetup in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdFontCacheSetup+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_XTRA_LIBS -L$GD_LIBDIR $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontCacheSetup ();
int
main ()
{
return gdFontCacheSetup ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdFontCacheSetup=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdFontCacheSetup=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontCacheSetup" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontCacheSetup" >&6; }
if test $ac_cv_lib_gd_gdFontCacheSetup = yes; then
  IS_GD2="true"
fi


  if test "$IS_GD2" = "false" -a -n "$ICONV_LIB"; then
        unset ac_cv_lib_gd_gdFontCacheSetup
    { echo "$as_me:$LINENO: checking whether GD needs libiconv..." >&5
echo "$as_me: checking whether GD needs libiconv..." >&6;}
    { echo "$as_me:$LINENO: checking for gdFontCacheSetup in -lgd" >&5
echo $ECHO_N "checking for gdFontCacheSetup in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdFontCacheSetup+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_XTRA_LIBS -L$GD_LIBDIR $ICONV_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontCacheSetup ();
int
main ()
{
return gdFontCacheSetup ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdFontCacheSetup=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdFontCacheSetup=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontCacheSetup" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontCacheSetup" >&6; }
if test $ac_cv_lib_gd_gdFontCacheSetup = yes; then
  IS_GD2="true"
fi

    GD_NEED_ICONV_LIB="$ICONV_LIB"
  fi

  if test -n "$GD_INCLUDE" -a -n "$GD_LIBDIR" -a "$IS_GD2" = "true"; then
      GD_INC=-I$GD_INCLUDE
      GD_LIB="-L$GD_LIBDIR -lgd"
      GD_XTRA_LIBS="$GD_XTRA_LIBS $GD_NEED_ICONV_LIB"
      { echo "$as_me:$LINENO: result:         using libgd 2.0.16 (or higher) from $GD_LIB $GD_XTRA_LIBS" >&5
echo "${ECHO_T}        using libgd 2.0.16 (or higher) from $GD_LIB $GD_XTRA_LIBS" >&6; }

  if test ""$GD_LIBDIR"" != "/usr/lib"; then

  if test -z ""$GD_LIBDIR"" || echo ""$GD_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$GD_LIBDIR""
  else
    ai_p="`pwd`/"$GD_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      { { echo "$as_me:$LINENO: error: Could not find gd.h or libgd.a/libgd.so in $GD_DIR.  Make sure GD 2.0.16 or higher is compiled before calling configure. You may also get this error if you didn't specify the appropriate location for one of GD's dependencies (freetype, libpng, libjpeg or libiconv)." >&5
echo "$as_me: error: Could not find gd.h or libgd.a/libgd.so in $GD_DIR.  Make sure GD 2.0.16 or higher is compiled before calling configure. You may also get this error if you didn't specify the appropriate location for one of GD's dependencies (freetype, libpng, libjpeg or libiconv)." >&2;}
   { (exit 1); exit 1; }; }
  fi
else
    FOUND_GD="false"
  for GD_DIR in /usr /usr/local
  do
    test -f $GD_DIR/include/gd.h && GD_INCLUDE="$GD_DIR/include"
    test -f $GD_DIR/lib/libgd.a && GD_LIBDIR="$GD_DIR/lib"
    test -f $GD_DIR/lib64/libgd.a && GD_LIBDIR="$GD_DIR/lib64"
    test -f $GD_DIR/lib/libgd.so -o -f $GD_DIR/lib/libgd.sl -o -f $GD_DIR/lib/libgd.dylib && GD_LIBDIR="$GD_DIR/lib"
    test -f $GD_DIR/lib64/libgd.so -o -f $GD_DIR/lib/libgd.sl && GD_LIBDIR="$GD_DIR/lib64"

        { echo "$as_me:$LINENO: checking for gdFontCacheSetup in -lgd" >&5
echo $ECHO_N "checking for gdFontCacheSetup in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdFontCacheSetup+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontCacheSetup ();
int
main ()
{
return gdFontCacheSetup ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdFontCacheSetup=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdFontCacheSetup=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontCacheSetup" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontCacheSetup" >&6; }
if test $ac_cv_lib_gd_gdFontCacheSetup = yes; then
  IS_GD2="true"
fi


    if test "$IS_GD2" = "false" -a -n "$ICONV_LIB"; then
            { echo "$as_me:$LINENO: checking whether GD needs libiconv..." >&5
echo "$as_me: checking whether GD needs libiconv..." >&6;}
      unset ac_cv_lib_gd_gdFontCacheSetup
      { echo "$as_me:$LINENO: checking for gdFontCacheSetup in -lgd" >&5
echo $ECHO_N "checking for gdFontCacheSetup in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdFontCacheSetup+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_XTRA_LIBS $ICONV_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontCacheSetup ();
int
main ()
{
return gdFontCacheSetup ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdFontCacheSetup=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdFontCacheSetup=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontCacheSetup" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontCacheSetup" >&6; }
if test $ac_cv_lib_gd_gdFontCacheSetup = yes; then
  IS_GD2="true"
fi

      GD_NEED_ICONV_LIB="$ICONV_LIB"
    fi

    if test -n "$GD_INCLUDE" -a -n "$GD_LIBDIR" -a "$IS_GD2" = "true"; then
      GD_INC=-I$GD_INCLUDE
      GD_LIB="-L$GD_LIBDIR -lgd"
      GD_XTRA_LIBS="$GD_XTRA_LIBS $GD_NEED_ICONV_LIB"
      { echo "$as_me:$LINENO: result:         using libgd 2.0.16 (or higher) from system libs ($GD_LIB $GD_XTRA_LIBS)." >&5
echo "${ECHO_T}        using libgd 2.0.16 (or higher) from system libs ($GD_LIB $GD_XTRA_LIBS)." >&6; }

  if test ""$GD_LIBDIR"" != "/usr/lib"; then

  if test -z ""$GD_LIBDIR"" || echo ""$GD_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$GD_LIBDIR""
  else
    ai_p="`pwd`/"$GD_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

      FOUND_GD="true"
      break;
    fi
  done

  if test "$FOUND_GD" = "false" ; then
    { { echo "$as_me:$LINENO: error: Could not find gd.h or libgd.a/libgd.so in $GD_DIR.  Make sure GD 2.0.16 or higher is compiled before calling configure. You may also get this error if you didn't specify the appropriate location for one of GD's dependencies (freetype, libpng, libjpeg or libiconv)." >&5
echo "$as_me: error: Could not find gd.h or libgd.a/libgd.so in $GD_DIR.  Make sure GD 2.0.16 or higher is compiled before calling configure. You may also get this error if you didn't specify the appropriate location for one of GD's dependencies (freetype, libpng, libjpeg or libiconv)." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi


if test -n "$with_gd" -a "$with_gd" != "yes" ; then


  if test "$GD_STATIC" = "yes" ; then
            GD_CHECKLIB=c
    GD_LIB=$GD_LIBDIR/libgd.a
    GD_STATIC=$GD_LIBDIR/libgd.a
    { echo "$as_me:$LINENO: result: static linkage of $GD_STATIC requested... testing supported formats..." >&5
echo "${ECHO_T}static linkage of $GD_STATIC requested... testing supported formats..." >&6; }
  else
    GD_CHECKLIB=c
    # GD_LIB was already set above
    GD_STATIC=""
  fi

  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageGif" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageGif in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageGif in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageGif ();
int
main ()
{
return gdImageGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_GIF"
fi

  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImagePng" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImagePng in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImagePng in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImagePng ();
int
main ()
{
return gdImagePng ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_PNG"
fi

  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageJpeg" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageJpeg in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageJpeg in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageJpeg ();
int
main ()
{
return gdImageJpeg ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_JPEG"
fi

  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageWBMP" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageWBMP in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageWBMP in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageWBMP ();
int
main ()
{
return gdImageWBMP ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_WBMP"
fi


    GD_FT_SUPPORT=no
  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageStringFT" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageStringFT in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageStringFT in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageStringFT ();
int
main ()
{
return gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_FT_SUPPORT=yes
fi


    if test -n "$GD_STATIC" ; then
     GD_LIB="$GD_LIB -lfontconfig"
     unset ac_cv_lib_c___gdImageStringFT
     as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageStringFT" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageStringFT in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageStringFT in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageStringFT ();
int
main ()
{
return gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_FT_SUPPORT=yes
fi

  fi

  if test "$GD_FT_SUPPORT" = "yes"; then
     GD_DEF="$GD_DEF -DUSE_GD_FT"
  fi

    GD_RESOLUTION_SUPPORT=no
  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageSetResolution" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageSetResolution in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageSetResolution in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageSetResolution ();
int
main ()
{
return gdImageSetResolution ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_RESOLUTION_SUPPORT=yes
fi


  if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
     GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
  fi

    as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageOpenPolygon" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageOpenPolygon in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageOpenPolygon in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageOpenPolygon ();
int
main ()
{
return gdImageOpenPolygon ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_FTEX_XSHOW"
fi


    as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageGifPtr" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageGifPtr in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageGifPtr in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageGifPtr ();
int
main ()
{
return gdImageGifPtr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GDIMAGEGIFPTR"
fi


      as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdFontGetTiny" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdFontGetTiny in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdFontGetTiny in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontGetTiny ();
int
main ()
{
return gdFontGetTiny ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GETBITMAPFONTS"
fi


  { echo "$as_me:$LINENO: result:         using GD ($GD_DEF) from $GD_DIR." >&5
echo "${ECHO_T}        using GD ($GD_DEF) from $GD_DIR." >&6; }

else


    { echo "$as_me:$LINENO: checking for gdImageCreate in -lgd" >&5
echo $ECHO_N "checking for gdImageCreate in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageCreate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageCreate ();
int
main ()
{
return gdImageCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageCreate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageCreate=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreate" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreate" >&6; }
if test $ac_cv_lib_gd_gdImageCreate = yes; then
  GD_FOUND=yes
fi

  if test -z "$GD_FOUND" ; then
      { { echo "$as_me:$LINENO: error: GD is required but was not found... use --with-gd=DIR to specify its location." >&5
echo "$as_me: error: GD is required but was not found... use --with-gd=DIR to specify its location." >&2;}
   { (exit 1); exit 1; }; }
  fi

    { echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5
echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageGif+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageGif ();
int
main ()
{
return gdImageGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageGif=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageGif=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGif" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageGif" >&6; }
if test $ac_cv_lib_gd_gdImageGif = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_GIF"
fi

  { echo "$as_me:$LINENO: checking for gdImagePng in -lgd" >&5
echo $ECHO_N "checking for gdImagePng in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImagePng+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImagePng ();
int
main ()
{
return gdImagePng ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImagePng=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImagePng=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePng" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImagePng" >&6; }
if test $ac_cv_lib_gd_gdImagePng = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_PNG"
fi

  { echo "$as_me:$LINENO: checking for gdImageJpeg in -lgd" >&5
echo $ECHO_N "checking for gdImageJpeg in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageJpeg+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageJpeg ();
int
main ()
{
return gdImageJpeg ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageJpeg=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageJpeg=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageJpeg" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageJpeg" >&6; }
if test $ac_cv_lib_gd_gdImageJpeg = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_JPEG"
fi

  { echo "$as_me:$LINENO: checking for gdImageWBMP in -lgd" >&5
echo $ECHO_N "checking for gdImageWBMP in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageWBMP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageWBMP ();
int
main ()
{
return gdImageWBMP ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageWBMP=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageWBMP=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageWBMP" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageWBMP" >&6; }
if test $ac_cv_lib_gd_gdImageWBMP = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_WBMP"
fi


    { echo "$as_me:$LINENO: checking for gdImageStringFT in -lgd" >&5
echo $ECHO_N "checking for gdImageStringFT in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageStringFT+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageStringFT ();
int
main ()
{
return gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageStringFT=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageStringFT=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageStringFT" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageStringFT" >&6; }
if test $ac_cv_lib_gd_gdImageStringFT = yes; then
  GD_DEF="$GD_DEF -DUSE_GD_FT"
fi


    { echo "$as_me:$LINENO: checking for gdImageOpenPolygon in -lgd" >&5
echo $ECHO_N "checking for gdImageOpenPolygon in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageOpenPolygon+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageOpenPolygon ();
int
main ()
{
return gdImageOpenPolygon ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageOpenPolygon=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageOpenPolygon=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageOpenPolygon" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageOpenPolygon" >&6; }
if test $ac_cv_lib_gd_gdImageOpenPolygon = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_FTEX_XSHOW"
fi


    { echo "$as_me:$LINENO: checking for gdImageGifPtr in -lgd" >&5
echo $ECHO_N "checking for gdImageGifPtr in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdImageGifPtr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageGifPtr ();
int
main ()
{
return gdImageGifPtr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdImageGifPtr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdImageGifPtr=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGifPtr" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageGifPtr" >&6; }
if test $ac_cv_lib_gd_gdImageGifPtr = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GDIMAGEGIFPTR"
fi


      { echo "$as_me:$LINENO: checking for gdFontGetTiny in -lgd" >&5
echo $ECHO_N "checking for gdFontGetTiny in -lgd... $ECHO_C" >&6; }
if test "${ac_cv_lib_gd_gdFontGetTiny+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdFontGetTiny ();
int
main ()
{
return gdFontGetTiny ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_gd_gdFontGetTiny=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_gd_gdFontGetTiny=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontGetTiny" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontGetTiny" >&6; }
if test $ac_cv_lib_gd_gdFontGetTiny = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GETBITMAPFONTS"
fi


    GD_RESOLUTION_SUPPORT=no
  as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageSetResolution" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for gdImageSetResolution in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageSetResolution in -l$GD_CHECKLIB... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GD_CHECKLIB $GD_STATIC $GD_LIB $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char gdImageSetResolution ();
int
main ()
{
return gdImageSetResolution ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_RESOLUTION_SUPPORT=yes
fi


  if test "$GD_RESOLUTION_SUPPORT" = "yes"; then
     GD_DEF="$GD_DEF -DUSE_GD_RESOLUTION"
  fi

  if test -n "$GD_DEF" ; then
      GD_LIB="-lgd $GD_LIB"
      { echo "$as_me:$LINENO: result:         using GD ($GD_DEF) from system libs." >&5
echo "${ECHO_T}        using GD ($GD_DEF) from system libs." >&6; }
  fi
fi

GD_LIB="$GD_LIB $GD_XTRA_LIBS"

GD_DEF=$GD_DEF

GD_INC=$GD_INC

GD_LIB=$GD_LIB

GD_STATIC=$GD_STATIC

MAKE_GD=$MAKE_GD

MAKE_GD_CLEAN=$MAKE_GD_CLEAN


ALL_ENABLED="$GD_DEF $ALL_ENABLED"
ALL_INC="$GD_INC $ALL_INC"
ALL_LIB="$GD_LIB $ALL_LIB"
ALL_STATIC_LIB="$GD_STATIC $ALL_STATIC_LIB"

LIBS="$ms_saved_LIBS"



ms_saved_LIBS="$LIBS"

unset ac_cv_lib_pdf_PDF_setlinewidth
unset ac_cv_lib_pdf_PDF_setrgbcolor
unset ac_cv_lib_pdf_PDF_moveto
unset ac_cv_lib_pdf_PDF_curveto
unset ac_cv_lib_pdf_PDF_show_xy
unset ac_cv_lib_pdf_PDF_load_font

{ echo "$as_me:$LINENO: checking whether we should include PDF support..." >&5
echo "$as_me: checking whether we should include PDF support..." >&6;}

# Check whether --with-pdf was given.
if test "${with_pdf+set}" = set; then
  withval=$with_pdf;
fi

if test "$with_pdf" = "no" ; then
  { echo "$as_me:$LINENO: result:         disabled by --without-pdf" >&5
echo "${ECHO_T}        disabled by --without-pdf" >&6; }
elif test -n "$with_pdf" -a "$with_pdf" != "yes" ; then


  if test -z "$with_pdf" || echo "$with_pdf" | grep '^/' >/dev/null ; then
    PDF_DIR="$with_pdf"
  else
    PDF_DIR="`pwd`/$with_pdf"
  fi

  test -f $PDF_DIR/include/pdflib.h && PDF_INCLUDE="$PDF_DIR/include"
  test -f $PDF_DIR/libpdf/pdflib.h && PDF_INCLUDE="$PDF_DIR/libpdf"
  test -f $PDF_DIR/include/libpdf/pdflib.h && PDF_INCLUDE="$PDF_DIR/include/libpdf"
  test -f $PDF_DIR/pdflib.h && PDF_INCLUDE="$PDF_DIR"

  test -f $PDF_DIR/lib/libpdf.a && PDF_LIBDIR="$PDF_DIR/lib"
  test -f $PDF_DIR/lib64/libpdf.a && PDF_LIBDIR="$PDF_DIR/lib64"
  test -f $PDF_DIR/libpdf/libpdf.a && PDF_LIBDIR="$PDF_DIR/libpdf"
  test -f $PDF_DIR/libpdf.a && PDF_LIBDIR="$PDF_DIR"

  test -f $PDF_DIR/lib/libpdf.so -o -f $PDF_DIR/lib/libpdf.sl -o -f $PDF_DIR/lib/libpdf.dylib && PDF_LIBDIR="$PDF_DIR/lib"
  test -f $PDF_DIR/lib64/libpdf.so -o -f $PDF_DIR/lib64/libpdf.sl && PDF_LIBDIR="$PDF_DIR/lib64"
  test -f $PDF_DIR/libpdf/libpdf.so -o -f $PDF_DIR/libpdf/libpdf.sl -o -f $PDF_DIR/libpdf/libpdf.dylib && PDF_LIBDIR="$PDF_DIR/libpdf"
  test -f $PDF_DIR/libpdf.so -o -f $PDF_DIR/libpdf.sl -o -f $PDF_DIR/libpdf.dylib && PDF_LIBDIR="$PDF_DIR"

  if test -n "$PDF_INCLUDE" -a -n "$PDF_LIBDIR" ; then

      PDF_LIB="-L$PDF_LIBDIR -lpdf"
      PDF_INC=-I$PDF_INCLUDE

  if test ""$PDF_LIBDIR"" != "/usr/lib"; then

  if test -z ""$PDF_LIBDIR"" || echo ""$PDF_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$PDF_LIBDIR""
  else
    ai_p="`pwd`/"$PDF_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      { { echo "$as_me:$LINENO: error: \"Could not find pdflib.h or libpdf.a/libpdf.so in $PDF_DIR.\"" >&5
echo "$as_me: error: \"Could not find pdflib.h or libpdf.a/libpdf.so in $PDF_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  PDF_VERSION_CHECK="pass"

{ echo "$as_me:$LINENO: checking for PDF_setlinewidth in -lpdf" >&5
echo $ECHO_N "checking for PDF_setlinewidth in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_setlinewidth+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_setlinewidth ();
int
main ()
{
return PDF_setlinewidth ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_setlinewidth=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_setlinewidth=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_setlinewidth" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_setlinewidth" >&6; }
if test $ac_cv_lib_pdf_PDF_setlinewidth = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


{ echo "$as_me:$LINENO: checking for PDF_setrgbcolor in -lpdf" >&5
echo $ECHO_N "checking for PDF_setrgbcolor in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_setrgbcolor+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_setrgbcolor ();
int
main ()
{
return PDF_setrgbcolor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_setrgbcolor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_setrgbcolor=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_setrgbcolor" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_setrgbcolor" >&6; }
if test $ac_cv_lib_pdf_PDF_setrgbcolor = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


{ echo "$as_me:$LINENO: checking for PDF_moveto in -lpdf" >&5
echo $ECHO_N "checking for PDF_moveto in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_moveto+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_moveto ();
int
main ()
{
return PDF_moveto ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_moveto=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_moveto=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_moveto" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_moveto" >&6; }
if test $ac_cv_lib_pdf_PDF_moveto = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


{ echo "$as_me:$LINENO: checking for PDF_curveto in -lpdf" >&5
echo $ECHO_N "checking for PDF_curveto in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_curveto+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_curveto ();
int
main ()
{
return PDF_curveto ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_curveto=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_curveto=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_curveto" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_curveto" >&6; }
if test $ac_cv_lib_pdf_PDF_curveto = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


{ echo "$as_me:$LINENO: checking for PDF_show_xy in -lpdf" >&5
echo $ECHO_N "checking for PDF_show_xy in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_show_xy+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_show_xy ();
int
main ()
{
return PDF_show_xy ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_show_xy=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_show_xy=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_show_xy" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_show_xy" >&6; }
if test $ac_cv_lib_pdf_PDF_show_xy = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


{ echo "$as_me:$LINENO: checking for PDF_load_font in -lpdf" >&5
echo $ECHO_N "checking for PDF_load_font in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_load_font+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf $PDF_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_load_font ();
int
main ()
{
return PDF_load_font ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_load_font=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_load_font=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_load_font" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_load_font" >&6; }
if test $ac_cv_lib_pdf_PDF_load_font = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPDF 1
_ACEOF

  LIBS="-lpdf $LIBS"

else
  PDF_VERSION_CHECK="fail"
fi


  if test "$PDF_VERSION_CHECK" = "fail" ; then
      { { echo "$as_me:$LINENO: error: libpdf in $PDF_DIR missing some required functions. Please upgrade to a more recent version of libpdf." >&5
echo "$as_me: error: libpdf in $PDF_DIR missing some required functions. Please upgrade to a more recent version of libpdf." >&2;}
   { (exit 1); exit 1; }; }
  fi

  PDF_ENABLED="-DUSE_PDF"
  { echo "$as_me:$LINENO: result:         using libpdf from $PDF_LIB." >&5
echo "${ECHO_T}        using libpdf from $PDF_LIB." >&6; }

else

  { echo "$as_me:$LINENO: checking for PDF_setlinewidth in -lpdf" >&5
echo $ECHO_N "checking for PDF_setlinewidth in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_setlinewidth+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_setlinewidth ();
int
main ()
{
return PDF_setlinewidth ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_setlinewidth=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_setlinewidth=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_setlinewidth" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_setlinewidth" >&6; }
if test $ac_cv_lib_pdf_PDF_setlinewidth = yes; then
  PDF_LIB="-lpdf"
fi

  { echo "$as_me:$LINENO: checking for PDF_setrgbcolor in -lpdf" >&5
echo $ECHO_N "checking for PDF_setrgbcolor in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_setrgbcolor+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_setrgbcolor ();
int
main ()
{
return PDF_setrgbcolor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_setrgbcolor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_setrgbcolor=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_setrgbcolor" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_setrgbcolor" >&6; }
if test $ac_cv_lib_pdf_PDF_setrgbcolor = yes; then
  PDF_LIB="-lpdf"
fi

  { echo "$as_me:$LINENO: checking for PDF_moveto in -lpdf" >&5
echo $ECHO_N "checking for PDF_moveto in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_moveto+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_moveto ();
int
main ()
{
return PDF_moveto ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_moveto=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_moveto=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_moveto" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_moveto" >&6; }
if test $ac_cv_lib_pdf_PDF_moveto = yes; then
  PDF_LIB="-lpdf"
fi

  { echo "$as_me:$LINENO: checking for PDF_curveto in -lpdf" >&5
echo $ECHO_N "checking for PDF_curveto in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_curveto+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_curveto ();
int
main ()
{
return PDF_curveto ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_curveto=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_curveto=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_curveto" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_curveto" >&6; }
if test $ac_cv_lib_pdf_PDF_curveto = yes; then
  PDF_LIB="-lpdf"
fi

  { echo "$as_me:$LINENO: checking for PDF_show_xy in -lpdf" >&5
echo $ECHO_N "checking for PDF_show_xy in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_show_xy+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_show_xy ();
int
main ()
{
return PDF_show_xy ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_show_xy=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_show_xy=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_show_xy" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_show_xy" >&6; }
if test $ac_cv_lib_pdf_PDF_show_xy = yes; then
  PDF_LIB="-lpdf"
fi

  { echo "$as_me:$LINENO: checking for PDF_load_font in -lpdf" >&5
echo $ECHO_N "checking for PDF_load_font in -lpdf... $ECHO_C" >&6; }
if test "${ac_cv_lib_pdf_PDF_load_font+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char PDF_load_font ();
int
main ()
{
return PDF_load_font ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pdf_PDF_load_font=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pdf_PDF_load_font=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_load_font" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_load_font" >&6; }
if test $ac_cv_lib_pdf_PDF_load_font = yes; then
  PDF_LIB="-lpdf"
fi

  if test -n "$PDF_LIB" ; then
      PDF_ENABLED=-DUSE_PDF
      { echo "$as_me:$LINENO: result:         using libpdf from system libs." >&5
echo "${ECHO_T}        using libpdf from system libs." >&6; }
  else
      { echo "$as_me:$LINENO: result:         libpdf not found or too old... PDF support not included." >&5
echo "${ECHO_T}        libpdf not found or too old... PDF support not included." >&6; }
  fi

fi

PDF_LIB="$PDF_LIB"

PDF_ENABLED=$PDF_ENABLED

PDF_INC=$PDF_INC

PDF_LIB=$PDF_LIB


ALL_ENABLED="$PDF_ENABLED $ALL_ENABLED"
ALL_INC="$PDF_INC $ALL_INC"
ALL_LIB="$PDF_LIB $ALL_LIB"

LIBS="$ms_saved_LIBS"


{ echo "$as_me:$LINENO: checking if FTGL support requested" >&5
echo $ECHO_N "checking if FTGL support requested... $ECHO_C" >&6; }

# Check whether --with-ftgl was given.
if test "${with_ftgl+set}" = set; then
  withval=$with_ftgl;
fi


if test "$with_ftgl" = "yes" ; then
  with_ftgl="/usr"
  { echo "$as_me:$LINENO: result: looking for ftgl libs in /usr" >&5
echo "${ECHO_T}looking for ftgl libs in /usr" >&6; }
fi
if test -n "$with_ftgl" -a "$with_ftgl" != "no" ; then


  if test -z "$with_ftgl" || echo "$with_ftgl" | grep '^/' >/dev/null ; then
    FTGL_DIR="$with_ftgl"
  else
    FTGL_DIR="`pwd`/$with_ftgl"
  fi


  test -f $FTGL_DIR/include/FTGL/ftgl.h -a -f $FTGL_DIR/include/FTGL/FTGLTextureFont.h && FTGL_INCLUDE="-I$FTGL_DIR/include/FTGL/"

  if test -z "$FTGL_INCLUDE" ; then
      { { echo "$as_me:$LINENO: error: \"could not find ftgl.h in $FTGL_DIR/include/FTGL.\"" >&5
echo "$as_me: error: \"could not find ftgl.h in $FTGL_DIR/include/FTGL.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  test -f $FTGL_DIR/lib/libftgl.so && FTGL_LIBDIR="$FTGL_DIR/lib"
  test -f $FTGL_DIR/lib64/libftgl.so && FTGL_LIBDIR="$FTGL_DIR/lib64"

  if test -z "$FTGL_LIBDIR" ; then
      { { echo "$as_me:$LINENO: error: \"could not find libftgl in $FTGL_DIR.\"" >&5
echo "$as_me: error: \"could not find libftgl in $FTGL_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi



    FTGL_ENABLED="-DUSE_FTGL"
  FTGL_INC="$FTGL_INCLUDE"
  FTGL_LIB="-L$FTGL_LIBDIR -lftgl"

  if test ""$FTGL_LIBDIR"" != "/usr/lib"; then

  if test -z ""$FTGL_LIBDIR"" || echo ""$FTGL_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$FTGL_LIBDIR""
  else
    ai_p="`pwd`/"$FTGL_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


  { echo "$as_me:$LINENO: result: using ftgl from $FTGL_DIR" >&5
echo "${ECHO_T}using ftgl from $FTGL_DIR" >&6; }

else

  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }

fi

FTGL_ENABLED=$FTGL_ENABLED

FTGL_INC=$FTGL_INC

FTGL_LIB=$FTGL_LIB



ALL_ENABLED="$FTGL_ENABLED $ALL_ENABLED"
ALL_INC="$FTGL_INC $ALL_INC"
ALL_LIB="$FTGL_LIB $ALL_LIB"



{ echo "$as_me:$LINENO: checking if OGL support requested" >&5
echo $ECHO_N "checking if OGL support requested... $ECHO_C" >&6; }

# Check whether --with-ogl was given.
if test "${with_ogl+set}" = set; then
  withval=$with_ogl;
fi


if test "$with_opengl" = "yes" ; then

  with_opengl="/usr"
  { echo "$as_me:$LINENO: result: looking for opengl libs in /usr" >&5
echo "${ECHO_T}looking for opengl libs in /usr" >&6; }
fi
if test -n "$with_opengl" -a "$with_opengl" != "no" ; then

  if test -n "$FTGL_LIB" ; then
     FT_INC=`$FTGL_LIB --cflags`
  else
     { { echo "$as_me:$LINENO: error: FTGL required for opengl support - please configure --with-ftgl." >&5
echo "$as_me: error: FTGL required for opengl support - please configure --with-ftgl." >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test -z "$with_opengl" || echo "$with_opengl" | grep '^/' >/dev/null ; then
    OGL_DIR="$with_opengl"
  else
    OGL_DIR="`pwd`/$with_opengl"
  fi


  test -f $OGL_DIR/include/GL/gl.h -a -f $OGL_DIR/include/GL/glx.h -a -f $OGL_DIR/include/GL/glu.h && OGL_INCLUDE="-I$OGL_DIR/include"

  if test -z "$OGL_INCLUDE" ; then
      { { echo "$as_me:$LINENO: error: \"could not find gl.h in $OGL_DIR/include/.\"" >&5
echo "$as_me: error: \"could not find gl.h in $OGL_DIR/include/.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  test -f $OGL_DIR/lib/libGL.so -a -f $OGL_DIR/lib/libGLU.so && OGL_LIBDIR="$OGL_DIR/lib"

  if test -z "$OGL_LIBDIR" ; then
      { { echo "$as_me:$LINENO: error: \"could not find libGL or libGLU in $OGL_DIR/lib/.\"" >&5
echo "$as_me: error: \"could not find libGL or libGLU in $OGL_DIR/lib/.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi



    OGL_ENABLED="-DUSE_OGL"
  OGL_INC="$OGL_INCLUDE"
  OGL_LIB="-L$OGL_LIBDIR -lGL -lGLU"

  if test ""$OGL_LIBDIR"" != "/usr/lib"; then

  if test -z ""$OGL_LIBDIR"" || echo ""$OGL_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$OGL_LIBDIR""
  else
    ai_p="`pwd`/"$OGL_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi


  { echo "$as_me:$LINENO: result: using opengl from $OGL_DIR" >&5
echo "${ECHO_T}using opengl from $OGL_DIR" >&6; }

else

  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }

fi

OGL_ENABLED=$OGL_ENABLED

OGL_INC=$OGL_INC

OGL_LIB=$OGL_LIB



ALL_ENABLED="$OGL_ENABLED $ALL_ENABLED"
ALL_INC="$OGL_INC $ALL_INC"
ALL_LIB="$OGL_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if AGG support requested" >&5
echo $ECHO_N "checking if AGG support requested... $ECHO_C" >&6; }

# Check whether --with-agg was given.
if test "${with_agg+set}" = set; then
  withval=$with_agg;
fi


if test "$with_agg" != "no" ; then

  if test -z "$FT_BIN" ; then
    # Extract the first word of "freetype-config", so it can be a program name with args.
set dummy freetype-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_FT_BIN+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $FT_BIN in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_FT_BIN="$FT_BIN" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_FT_BIN="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_FT_BIN" && ac_cv_path_FT_BIN="no"
  ;;
esac
fi
FT_BIN=$ac_cv_path_FT_BIN
if test -n "$FT_BIN"; then
  { echo "$as_me:$LINENO: result: $FT_BIN" >&5
echo "${ECHO_T}$FT_BIN" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


    if test "$FT_BIN" == "no" ; then
      { { echo "$as_me:$LINENO: error: the freetype-config executable could not be found and is required for agg support
        to fix this, you should either:
        * install the freetype development headers
        * rerun configure with --with-freetype=/path/to/freetype-config
        * disable agg support with --with-agg=no " >&5
echo "$as_me: error: the freetype-config executable could not be found and is required for agg support
        to fix this, you should either:
        * install the freetype development headers
        * rerun configure with --with-freetype=/path/to/freetype-config
        * disable agg support with --with-agg=no " >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi

  FT_INC=`$FT_BIN --cflags`


    AGG_ENABLED="-DUSE_AGG"
  AGG_INC="$FT_INC"
 # AGG_OBJ="renderers/agg/src/agg_arc.o renderers/agg/src/agg_arrowhead.o renderers/agg/src/agg_bezier_arc.o renderers/agg/src/agg_bspline.o renderers/agg/src/agg_curves.o renderers/agg/src/agg_vcgen_contour.o renderers/agg/src/agg_vcgen_dash.o renderers/agg/src/agg_vcgen_markers_term.o renderers/agg/src/agg_vcgen_smooth_poly1.o renderers/agg/src/agg_vcgen_stroke.o renderers/agg/src/agg_vcgen_bspline.o renderers/agg/src/agg_gsv_text.o renderers/agg/src/agg_image_filters.o renderers/agg/src/agg_line_aa_basics.o renderers/agg/src/agg_line_profile_aa.o renderers/agg/src/agg_rounded_rect.o renderers/agg/src/agg_sqrt_tables.o renderers/agg/src/agg_embedded_raster_fonts.o renderers/agg/src/agg_trans_affine.o renderers/agg/src/agg_trans_warp_magnifier.o renderers/agg/src/agg_trans_single_path.o renderers/agg/src/agg_trans_double_path.o renderers/agg/src/agg_vpgen_clip_polygon.o renderers/agg/src/agg_vpgen_clip_polyline.o renderers/agg/src/agg_vpgen_segmentator.o renderers/agg/src/agg_font_freetype.o"
  AGG_OBJ="renderers/agg/src/agg_arc.o renderers/agg/src/agg_curves.o renderers/agg/src/agg_vcgen_contour.o renderers/agg/src/agg_vcgen_dash.o renderers/agg/src/agg_vcgen_stroke.o renderers/agg/src/agg_image_filters.o renderers/agg/src/agg_line_aa_basics.o renderers/agg/src/agg_line_profile_aa.o renderers/agg/src/agg_sqrt_tables.o renderers/agg/src/agg_embedded_raster_fonts.o renderers/agg/src/agg_trans_affine.o renderers/agg/src/agg_vpgen_clip_polygon.o renderers/agg/src/agg_vpgen_clip_polyline.o renderers/agg/src/agg_font_freetype.o"
else

  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }

fi

AGG_ENABLED=$AGG_ENABLED

AGG_INC=$AGG_INC

AGG_OBJ=$AGG_OBJ


ALL_ENABLED="$AGG_ENABLED $ALL_ENABLED"
ALL_INC="$AGG_INC $ALL_INC"



{ echo "$as_me:$LINENO: checking if RGBA palette png support requested" >&5
echo $ECHO_N "checking if RGBA palette png support requested... $ECHO_C" >&6; }

# Check whether --with-experimental-png was given.
if test "${with_experimental_png+set}" = set; then
  withval=$with_experimental_png;
fi


if test -z "$with_experimental_png" -o "$with_experimental_png" = "no" ; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
else
  if test -z "$PNG_LIB" ; then
     { { echo "$as_me:$LINENO: error: libpng required - please reconfigure --with-png." >&5
echo "$as_me: error: libpng required - please reconfigure --with-png." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -n "$PNG_DIR" ; then
    test -f $PNG_DIR/include/png.h && PNG_INCLUDE="$PNG_DIR/include"
    test -f $PNG_DIR/lib/png.h && PNG_INCLUDE="$PNG_DIR/lib"
    test -f $PNG_DIR/png.h && PNG_INCLUDE="$PNG_DIR"
    if test -n "$PNG_INCLUDE" ; then
            old_cflags="$CFLAGS"
      CFLAGS="$ZLIB_INC $CFLAGS"
      # On IRIX 5.3, sys/types and inttypes.h are conflicting.









for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
		  inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default

#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  eval "$as_ac_Header=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Header=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


as_ac_Header=`echo "ac_cv_header_$PNG_INCLUDE/png.h" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
  { echo "$as_me:$LINENO: checking for $PNG_INCLUDE/png.h" >&5
echo $ECHO_N "checking for $PNG_INCLUDE/png.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
else
  # Is the header compilable?
{ echo "$as_me:$LINENO: checking $PNG_INCLUDE/png.h usability" >&5
echo $ECHO_N "checking $PNG_INCLUDE/png.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$PNG_INCLUDE/png.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_header_compiler=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }

# Is the header present?
{ echo "$as_me:$LINENO: checking $PNG_INCLUDE/png.h presence" >&5
echo $ECHO_N "checking $PNG_INCLUDE/png.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$PNG_INCLUDE/png.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi

rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $PNG_INCLUDE/png.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $PNG_INCLUDE/png.h: in the future, the compiler will take precedence" >&2;}

    ;;
esac
{ echo "$as_me:$LINENO: checking for $PNG_INCLUDE/png.h" >&5
echo $ECHO_N "checking for $PNG_INCLUDE/png.h... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  :
else
  { { echo "$as_me:$LINENO: error: cannot find png headers" >&5
echo "$as_me: error: cannot find png headers" >&2;}
   { (exit 1); exit 1; }; }
fi


      CFLAGS="$old_cflags"
    else
        { { echo "$as_me:$LINENO: error: cannot find png headers in $PNG_DIR" >&5
echo "$as_me: error: cannot find png headers in $PNG_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    if test "${ac_cv_header_png_h+set}" = set; then
  { echo "$as_me:$LINENO: checking for png.h" >&5
echo $ECHO_N "checking for png.h... $ECHO_C" >&6; }
if test "${ac_cv_header_png_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5
echo "${ECHO_T}$ac_cv_header_png_h" >&6; }
else
  # Is the header compilable?
{ echo "$as_me:$LINENO: checking png.h usability" >&5
echo $ECHO_N "checking png.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <png.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_header_compiler=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }

# Is the header present?
{ echo "$as_me:$LINENO: checking png.h presence" >&5
echo $ECHO_N "checking png.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <png.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi

rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: png.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: png.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: png.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: png.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: png.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: png.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: png.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: png.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: png.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: png.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: png.h: in the future, the compiler will take precedence" >&2;}

    ;;
esac
{ echo "$as_me:$LINENO: checking for png.h" >&5
echo $ECHO_N "checking for png.h... $ECHO_C" >&6; }
if test "${ac_cv_header_png_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_png_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5
echo "${ECHO_T}$ac_cv_header_png_h" >&6; }

fi
if test $ac_cv_header_png_h = yes; then
  :
else
  { { echo "$as_me:$LINENO: error: cannot find png headers in system path" >&5
echo "$as_me: error: cannot find png headers in system path" >&2;}
   { (exit 1); exit 1; }; }
fi


  fi
  if test -n "$PNG_DIR" ; then
    PNG_INC=-I$PNG_INCLUDE
    { echo "$as_me:$LINENO: result:  using libpng from $PNG_DIR." >&5
echo "${ECHO_T} using libpng from $PNG_DIR." >&6; }
  else
    { echo "$as_me:$LINENO: result:  using libpng from system libs." >&5
echo "${ECHO_T} using libpng from system libs." >&6; }
  fi
  if test "${ac_cv_header_setjmp_h+set}" = set; then
  { echo "$as_me:$LINENO: checking for setjmp.h" >&5
echo $ECHO_N "checking for setjmp.h... $ECHO_C" >&6; }
if test "${ac_cv_header_setjmp_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_setjmp_h" >&5
echo "${ECHO_T}$ac_cv_header_setjmp_h" >&6; }
else
  # Is the header compilable?
{ echo "$as_me:$LINENO: checking setjmp.h usability" >&5
echo $ECHO_N "checking setjmp.h usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <setjmp.h>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_compile") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest.$ac_objext; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_header_compiler=no
fi

rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }

# Is the header present?
{ echo "$as_me:$LINENO: checking setjmp.h presence" >&5
echo $ECHO_N "checking setjmp.h presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <setjmp.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null && {
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
	 test ! -s conftest.err
       }; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi

rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: setjmp.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: setjmp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: setjmp.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: setjmp.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: setjmp.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: setjmp.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: setjmp.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: setjmp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: setjmp.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: setjmp.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: setjmp.h: in the future, the compiler will take precedence" >&2;}

    ;;
esac
{ echo "$as_me:$LINENO: checking for setjmp.h" >&5
echo $ECHO_N "checking for setjmp.h... $ECHO_C" >&6; }
if test "${ac_cv_header_setjmp_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_setjmp_h=$ac_header_preproc
fi
{ echo "$as_me:$LINENO: result: $ac_cv_header_setjmp_h" >&5
echo "${ECHO_T}$ac_cv_header_setjmp_h" >&6; }

fi
if test $ac_cv_header_setjmp_h = yes; then
  :
else
  { { echo "$as_me:$LINENO: error: setjmp.h is required with libpng" >&5
echo "$as_me: error: setjmp.h is required with libpng" >&2;}
   { (exit 1); exit 1; }; }
fi


  RGBA_PNG_ENABLED=-DUSE_RGBA_PNG
fi

RGBA_PNG_ENABLED=$RGBA_PNG_ENABLED

PNG_INC=$PNG_INC

PNG_LIB=$PNG_LIB


ALL_ENABLED="$RGBA_PNG_ENABLED $ALL_ENABLED"
ALL_INC="$PNG_INC $ALL_INC"


{ echo "$as_me:$LINENO: checking whether we should include EPPL7 support..." >&5
echo "$as_me: checking whether we should include EPPL7 support..." >&6;}

# Check whether --with-eppl was given.
if test "${with_eppl+set}" = set; then
  withval=$with_eppl;
fi

if test "$with_eppl" = "no" ; then
  { echo "$as_me:$LINENO: result:         disabled by --without-eppl" >&5
echo "${ECHO_T}        disabled by --without-eppl" >&6; }
else

  EPPL_OBJ="epplib.o"
  EPPL_ENABLED="-DUSE_EPPL"

  { echo "$as_me:$LINENO: result:         including EPPL7 support." >&5
echo "${ECHO_T}        including EPPL7 support." >&6; }

fi

EPPL_ENABLED=$EPPL_ENABLED

EPPL_OBJ=$EPPL_OBJ


ALL_ENABLED="$EPPL_ENABLED $ALL_ENABLED"


unset ac_cv_lib_proj_pj_init
unset ac_cv_lib_proj_pj_transform
unset ac_cv_lib_proj_pj_latlong_from_proj

{ echo "$as_me:$LINENO: checking whether we should include PROJ.4 support..." >&5
echo "$as_me: checking whether we should include PROJ.4 support..." >&6;}

# Check whether --with-proj was given.
if test "${with_proj+set}" = set; then
  withval=$with_proj;
fi


if test "$with_proj" = "yes" ; then

  { echo "$as_me:$LINENO: checking for pj_init in -lproj" >&5
echo $ECHO_N "checking for pj_init in -lproj... $ECHO_C" >&6; }
if test "${ac_cv_lib_proj_pj_init+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lproj  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pj_init ();
int
main ()
{
return pj_init ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_proj_pj_init=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_proj_pj_init=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_init" >&5
echo "${ECHO_T}$ac_cv_lib_proj_pj_init" >&6; }
if test $ac_cv_lib_proj_pj_init = yes; then
  PROJ_ENABLED=-DUSE_PROJ
fi

  { echo "$as_me:$LINENO: checking for pj_transform in -lproj" >&5
echo $ECHO_N "checking for pj_transform in -lproj... $ECHO_C" >&6; }
if test "${ac_cv_lib_proj_pj_transform+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lproj  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pj_transform ();
int
main ()
{
return pj_transform ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_proj_pj_transform=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_proj_pj_transform=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_transform" >&5
echo "${ECHO_T}$ac_cv_lib_proj_pj_transform" >&6; }
if test $ac_cv_lib_proj_pj_transform = yes; then
  PJ_TRANSFORM=yes
else
  PJ_TRANSFORM=no
fi


  if test -n "$PROJ_ENABLED" -a "$PJ_TRANSFORM" = "no"; then
      { { echo "$as_me:$LINENO: error: This version of PROJ is too old.  PROJ4.4.2 or later is required." >&5
echo "$as_me: error: This version of PROJ is too old.  PROJ4.4.2 or later is required." >&2;}
   { (exit 1); exit 1; }; }
  elif test -n "$PROJ_ENABLED" -a "$PJ_TRANSFORM" = "yes"; then
      PROJ_LIBS="-lproj"
      { echo "$as_me:$LINENO: result:         using PROJ.4 from system libs." >&5
echo "${ECHO_T}        using PROJ.4 from system libs." >&6; }
  else
      { echo "$as_me:$LINENO: WARNING:         PROJ.4 not found in system libs... use --with-proj=DIR." >&5
echo "$as_me: WARNING:         PROJ.4 not found in system libs... use --with-proj=DIR." >&2;}
  fi

elif test -n "$with_proj" -a "$with_proj" != "no" ; then


  if test -z "$with_proj" || echo "$with_proj" | grep '^/' >/dev/null ; then
    PROJ_DIR="$with_proj"
  else
    PROJ_DIR="`pwd`/$with_proj"
  fi

  test -f $PROJ_DIR/include/proj_api.h && PROJ_INCLUDE="$PROJ_DIR/include"
  test -f $PROJ_DIR/include/proj/proj_api.h && PROJ_INCLUDE="$PROJ_DIR/include/proj"
  test -f $PROJ_DIR/src/proj_api.h && PROJ_INCLUDE="$PROJ_DIR/src"
  test -f $PROJ_DIR/proj_api.h && PROJ_INCLUDE="$PROJ_DIR"

  test -f $PROJ_DIR/src/.libs/libproj.a && PROJ_LIBDIR="$PROJ_DIR/src/.libs"
  test -f $PROJ_DIR/lib/libproj.a && PROJ_LIBDIR="$PROJ_DIR/lib"
  test -f $PROJ_DIR/lib64/libproj.a && PROJ_LIBDIR="$PROJ_DIR/lib64"
  test -f $PROJ_DIR/libproj.a && PROJ_LIBDIR="$PROJ_DIR"

  test -f $PROJ_DIR/src/.libs/libproj.so -o -f $PROJ_DIR/src/.libs/libproj.sl -o -f $PROJ_DIR/src/.libs/libproj.dylib && PROJ_LIBDIR="$PROJ_DIR/src/.libs"
  test -f $PROJ_DIR/lib/libproj.so -o -f $PROJ_DIR/lib/libproj.sl -o -f $PROJ_DIR/lib/libproj.dylib && PROJ_LIBDIR="$PROJ_DIR/lib"
  test -f $PROJ_DIR/lib64/libproj.so -o -f $PROJ_DIR/lib64/libproj.sl && PROJ_LIBDIR="$PROJ_DIR/lib64"
  test -f $PROJ_DIR/libproj.so -o -f $PROJ_DIR/libproj.sl -o -f $PROJ_DIR/libproj.dylib && PROJ_LIBDIR="$PROJ_DIR"

  if test -n "$PROJ_INCLUDE" -a -n "$PROJ_LIBDIR" ; then
      PROJ_INC=-I$PROJ_INCLUDE
      PROJ_LIBS="-L$PROJ_LIBDIR -lproj"

  if test ""$PROJ_LIBDIR"" != "/usr/lib"; then

  if test -z ""$PROJ_LIBDIR"" || echo ""$PROJ_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$PROJ_LIBDIR""
  else
    ai_p="`pwd`/"$PROJ_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      { { echo "$as_me:$LINENO: error: \"Could not find proj_api.h or libproj.a/libproj.so in $PROJ_DIR.\"" >&5
echo "$as_me: error: \"Could not find proj_api.h or libproj.a/libproj.so in $PROJ_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  { echo "$as_me:$LINENO: checking for pj_transform in -lproj" >&5
echo $ECHO_N "checking for pj_transform in -lproj... $ECHO_C" >&6; }
if test "${ac_cv_lib_proj_pj_transform+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lproj $PROJ_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pj_transform ();
int
main ()
{
return pj_transform ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_proj_pj_transform=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_proj_pj_transform=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_proj_pj_transform" >&5
echo "${ECHO_T}$ac_cv_lib_proj_pj_transform" >&6; }
if test $ac_cv_lib_proj_pj_transform = yes; then
  PJ_TRANSFORM=yes
else
  PJ_TRANSFORM=no
fi

  if test "$PJ_TRANSFORM" = "no"; then
      { { echo "$as_me:$LINENO: error: This version of PROJ is too old.  PROJ4.4.2 or later is required." >&5
echo "$as_me: error: This version of PROJ is too old.  PROJ4.4.2 or later is required." >&2;}
   { (exit 1); exit 1; }; }
  fi

  PROJ_ENABLED=-DUSE_PROJ
  { echo "$as_me:$LINENO: result:         using PROJ.4 from $PROJ_DIR." >&5
echo "${ECHO_T}        using PROJ.4 from $PROJ_DIR." >&6; }

else

  { echo "$as_me:$LINENO: result:         PROJ.4 support not requested." >&5
echo "${ECHO_T}        PROJ.4 support not requested." >&6; }
fi

PROJ_ENABLED=$PROJ_ENABLED

PROJ_INC=$PROJ_INC

PROJ_LIBS=$PROJ_LIBS


ALL_ENABLED="$PROJ_ENABLED $ALL_ENABLED"
ALL_INC="$PROJ_INC $ALL_INC"
ALL_LIB="$PROJ_LIBS $ALL_LIB"


THREAD_LIB=""
THREAD_FLAG=""

{ echo "$as_me:$LINENO: checking whether we should include thread safe support..." >&5
echo "$as_me: checking whether we should include thread safe support..." >&6;}

# Check whether --with-threads was given.
if test "${with_threads+set}" = set; then
  withval=$with_threads;
fi


if test "$with_threads" = "yes" ; then

  { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char pthread_create ();
int
main ()
{
return pthread_create ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pthread_pthread_create=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pthread_pthread_create=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
if test $ac_cv_lib_pthread_pthread_create = yes; then
  THREAD_FLAG=-DUSE_THREAD
fi


  if test -n "$THREAD_FLAG" ; then
      THREAD_LIB="-lpthread"
      { echo "$as_me:$LINENO: result:         using -lpthread from system libs." >&5
echo "${ECHO_T}        using -lpthread from system libs." >&6; }
  else
      { { echo "$as_me:$LINENO: error:         -lpthread not found, use --with-thread=<pthread link options>" >&5
echo "$as_me: error:         -lpthread not found, use --with-thread=<pthread link options>" >&2;}
   { (exit 1); exit 1; }; }
  fi

elif test -n "$with_threads" -a "$with_threads" != "no" ; then

  THREAD_FLAG=-DUSE_THREAD
  THREAD_LIB="$with_threads"

  { echo "$as_me:$LINENO: result:         using threads with link options \"$THREAD_LIB\"." >&5
echo "${ECHO_T}        using threads with link options \"$THREAD_LIB\"." >&6; }

else
  { echo "$as_me:$LINENO: result:         thread safe support disabled." >&5
echo "${ECHO_T}        thread safe support disabled." >&6; }
fi

THREAD_FLAG=$THREAD_FLAG

THREAD_LIB=$THREAD_LIB


ALL_ENABLED="$THREAD_FLAG $ALL_ENABLED"
ALL_LIB="$THREAD_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking whether we should include ESRI SDE support..." >&5
echo "$as_me: checking whether we should include ESRI SDE support..." >&6;}

# Check whether --with-sde was given.
if test "${with_sde+set}" = set; then
  withval=$with_sde;
fi



# Check whether --with-sde-version was given.
if test "${with_sde_version+set}" = set; then
  withval=$with_sde_version; SDE_VERSION=$with_sde_version
else
  SDE_VERSION=91
fi


if test -z "$SDE_VERSION" -o `expr "$SDE_VERSION" \>\= 92` = 1; then
SDE_VERSION=""
fi
if test "$with_sde" = "yes" ; then

  as_ac_Lib=`echo "ac_cv_lib_sde$SDE_VERSION''_SE_connection_create" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for SE_connection_create in -lsde$SDE_VERSION" >&5
echo $ECHO_N "checking for SE_connection_create in -lsde$SDE_VERSION... $ECHO_C" >&6; }
if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsde$SDE_VERSION  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char SE_connection_create ();
int
main ()
{
return SE_connection_create ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	eval "$as_ac_Lib=no"
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
ac_res=`eval echo '${'$as_ac_Lib'}'`
	       { echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  SDE_ENABLED=-DUSE_SDE
fi


  if test -n "$SDE_ENABLED" ; then
      SDE_LIB="-lsde$SDE_VERSION -lpe$SDE_VERSION -lsg$SDE_VERSION"
      { echo "$as_me:$LINENO: checking for main in -lpthread" >&5
echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pthread_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pthread_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
if test $ac_cv_lib_pthread_main = yes; then
  SDE_LIB="$SDE_LIB -lpthread"
fi

      { echo "$as_me:$LINENO: checking for main in -lsocket" >&5
echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
if test "${ac_cv_lib_socket_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_socket_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_socket_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
if test $ac_cv_lib_socket_main = yes; then
  SDE_LIB="$SDE_LIB -lsocket"
fi

      { echo "$as_me:$LINENO: checking for main in -ldl" >&5
echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6; }
if test "${ac_cv_lib_dl_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_dl_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_dl_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
echo "${ECHO_T}$ac_cv_lib_dl_main" >&6; }
if test $ac_cv_lib_dl_main = yes; then
  SDE_LIB="$SDE_LIB -ldl"
fi

      { echo "$as_me:$LINENO: result:         using ESRI SDE from system libs." >&5
echo "${ECHO_T}        using ESRI SDE from system libs." >&6; }
  else
      { echo "$as_me:$LINENO: WARNING:         ESRI SDE not found in system libs... use --with-sde=DIR." >&5
echo "$as_me: WARNING:         ESRI SDE not found in system libs... use --with-sde=DIR." >&2;}
  fi

elif test -n "$with_sde" -a "$with_sde" != "no" ; then


  if test -z "$with_sde" || echo "$with_sde" | grep '^/' >/dev/null ; then
    SDE_DIR="$with_sde"
  else
    SDE_DIR="`pwd`/$with_sde"
  fi


  test -f $SDE_DIR/arcsde/coverages/include/sdetype.h && SDE_INCDIR="$SDE_DIR/arcsde/coverages/include"
  test -f $SDE_DIR/include/sdetype.h && SDE_INCDIR="$SDE_DIR/include"
  test -f $SDE_DIR/sdetype.h && SDE_INCDIR="$SDE_DIR"

  test -f $SDE_DIR/lib/libsde$SDE_VERSION.a && SDE_LIBDIR="$SDE_DIR/lib"
  test -f $SDE_DIR/lib64/libsde$SDE_VERSION.a && SDE_LIBDIR="$SDE_DIR/lib64"
  test -f $SDE_DIR/libsde$SDE_VERSION.a && SDE_LIBDIR="$SDE_DIR"

  test -f $SDE_DIR/lib/libsde$SDE_VERSION.so -o -f $SDE_DIR/lib/libsde$SDE_VERSION.sl && SDE_LIBDIR="$SDE_DIR/lib"
  test -f $SDE_DIR/lib64/libsde$SDE_VERSION.so -o -f $SDE_DIR/lib64/libsde$SDE_VERSION.sl && SDE_LIBDIR="$SDE_DIR/lib64"
  test -f $SDE_DIR/libsde$SDE_VERSION.so -o -f $SDE_DIR/libsde$SDE_VERSION.sl && SDE_LIBDIR="$SDE_DIR"

  if test -n "$SDE_INCDIR" -a -n "$SDE_LIBDIR" ; then
      SDE_INC=-I$SDE_INCDIR
      SDE_LIB="-L$SDE_LIBDIR -lsde$SDE_VERSION -lpe$SDE_VERSION -lsg$SDE_VERSION"
      { echo "$as_me:$LINENO: checking for main in -lpthread" >&5
echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
if test "${ac_cv_lib_pthread_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_pthread_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_pthread_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
if test $ac_cv_lib_pthread_main = yes; then
  SDE_LIB="$SDE_LIB -lpthread"
fi

      { echo "$as_me:$LINENO: checking for main in -lsocket" >&5
echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; }
if test "${ac_cv_lib_socket_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_socket_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_socket_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; }
if test $ac_cv_lib_socket_main = yes; then
  SDE_LIB="$SDE_LIB -lsocket"
fi

      { echo "$as_me:$LINENO: checking for main in -ldl" >&5
echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6; }
if test "${ac_cv_lib_dl_main+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */


int
main ()
{
return main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_dl_main=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_dl_main=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
echo "${ECHO_T}$ac_cv_lib_dl_main" >&6; }
if test $ac_cv_lib_dl_main = yes; then
  SDE_LIB="$SDE_LIB -ldl"
fi


  if test ""$SDE_LIBDIR"" != "/usr/lib"; then

  if test -z ""$SDE_LIBDIR"" || echo ""$SDE_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$SDE_LIBDIR""
  else
    ai_p="`pwd`/"$SDE_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      { { echo "$as_me:$LINENO: error: \"Could not find sdetype.h or libsde$SDE_VERSION.a/libsde$SDE_VERSION.so in $SDE_DIR.\"" >&5
echo "$as_me: error: \"Could not find sdetype.h or libsde$SDE_VERSION.a/libsde$SDE_VERSION.so in $SDE_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  SDE_ENABLED=-DUSE_SDE
  { echo "$as_me:$LINENO: result:         using ESRI SDE from $SDE_DIR." >&5
echo "${ECHO_T}        using ESRI SDE from $SDE_DIR." >&6; }

else

  { echo "$as_me:$LINENO: result:         ESRI SDE support not requested." >&5
echo "${ECHO_T}        ESRI SDE support not requested." >&6; }
fi

SDE_ENABLED=$SDE_ENABLED

SDE_INC=$SDE_INC

SDE_LIB=$SDE_LIB


ALL_ENABLED="$SDE_ENABLED $ALL_ENABLED"
ALL_INC="$SDE_INC $ALL_INC"
ALL_LIB="$SDE_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if GEOS support requested" >&5
echo $ECHO_N "checking if GEOS support requested... $ECHO_C" >&6; }


# Check whether --with-geos was given.
if test "${with_geos+set}" = set; then
  withval=$with_geos;
fi


if test -n "$with_geos" -a "$with_geos" != "no" ; then

  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

  GEOS_CONFIG=$with_geos

  if test "$GEOS_CONFIG" = "yes" ; then

    # Extract the first word of "geos-config", so it can be a program name with args.
set dummy geos-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_GEOS_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $GEOS_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_GEOS_CONFIG="$GEOS_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_GEOS_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_GEOS_CONFIG" && ac_cv_path_GEOS_CONFIG="no"
  ;;
esac
fi
GEOS_CONFIG=$ac_cv_path_GEOS_CONFIG
if test -n "$GEOS_CONFIG"; then
  { echo "$as_me:$LINENO: result: $GEOS_CONFIG" >&5
echo "${ECHO_T}$GEOS_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi



    if test "$GEOS_CONFIG" = "no" ; then
      { { echo "$as_me:$LINENO: error: couldn't find geos-config in default path. Please specify full path to geos-config" >&5
echo "$as_me: error: couldn't find geos-config in default path. Please specify full path to geos-config" >&2;}
   { (exit 1); exit 1; }; }
    fi

  elif test -f "$GEOS_CONFIG" -a -x "$GEOS_CONFIG" ; then
    { echo "$as_me:$LINENO: result: user supplied geos-config ($GEOS_CONFIG)" >&5
echo "${ECHO_T}user supplied geos-config ($GEOS_CONFIG)" >&6; }
  else
    { { echo "$as_me:$LINENO: error: '$GEOS_CONFIG' is not an executable.  Make sure you use --with-geos=/path/to/geos-config" >&5
echo "$as_me: error: '$GEOS_CONFIG' is not an executable.  Make sure you use --with-geos=/path/to/geos-config" >&2;}
   { (exit 1); exit 1; }; }
  fi


  min_geos_version=2.2.2

  { echo "$as_me:$LINENO: checking for GEOS version >= $min_geos_version" >&5
echo $ECHO_N "checking for GEOS version >= $min_geos_version... $ECHO_C" >&6; }

  geos_major_version=`$GEOS_CONFIG --version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
  geos_minor_version=`$GEOS_CONFIG --version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
  geos_micro_version=`$GEOS_CONFIG --version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`

  req_major=`echo $min_geos_version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
  req_minor=`echo $min_geos_version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
  req_micro=`echo $min_geos_version | \
       sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`

  ac_req_version=`expr $req_major \* 100000 \+  $req_minor \* 100 \+ $req_micro`
  ac_geos_version=`expr $geos_major_version \* 100000 \+  $geos_minor_version \* 100 \+ $geos_micro_version`

  if test $ac_req_version -le $ac_geos_version; then
     { echo "$as_me:$LINENO: result: yes. Found version ${geos_major_version}.${geos_minor_version}.${geos_micro_version}" >&5
echo "${ECHO_T}yes. Found version ${geos_major_version}.${geos_minor_version}.${geos_micro_version}" >&6; }
  else
     { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
     { { echo "$as_me:$LINENO: error: geos-config reports version ${geos_major_version}.${geos_minor_version}.${geos_micro_version}, need at least $min_geos_version or configure --without-geos" >&5
echo "$as_me: error: geos-config reports version ${geos_major_version}.${geos_minor_version}.${geos_micro_version}, need at least $min_geos_version or configure --without-geos" >&2;}
   { (exit 1); exit 1; }; }
  fi



  GEOS_ENABLED=-DUSE_GEOS

  GEOS_INCDIR=`$GEOS_CONFIG --includes`
  GEOS_INC="-I$GEOS_INCDIR"
  GEOS_LIB="`$GEOS_CONFIG --libs`_c"

  GEOS_ENABLED=$GEOS_ENABLED

  GEOS_INC=$GEOS_INC

  GEOS_LIB=$GEOS_LIB


  ALL_ENABLED="$GEOS_ENABLED $ALL_ENABLED"
  ALL_INC="$GEOS_INC $ALL_INC"
  ALL_LIB="$GEOS_LIB $ALL_LIB"

else

  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }

fi


{ echo "$as_me:$LINENO: checking whether we should include OGR support..." >&5
echo "$as_me: checking whether we should include OGR support..." >&6;}

# Check whether --with-ogr was given.
if test "${with_ogr+set}" = set; then
  withval=$with_ogr;
fi


if test "`basename xx/$with_ogr`" = "gdal-config" ; then
  GDAL_CONFIG="$with_ogr"
fi

if test "$with_ogr" = "yes" ; then
 # Extract the first word of "gdal-config", so it can be a program name with args.
set dummy gdal-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $GDAL_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_GDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_GDAL_CONFIG" && ac_cv_path_GDAL_CONFIG="no"
  ;;
esac
fi
GDAL_CONFIG=$ac_cv_path_GDAL_CONFIG
if test -n "$GDAL_CONFIG"; then
  { echo "$as_me:$LINENO: result: $GDAL_CONFIG" >&5
echo "${ECHO_T}$GDAL_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi



  if test "$GDAL_CONFIG" = "no" ; then
    { { echo "$as_me:$LINENO: error: couldn't find gdal-config" >&5
echo "$as_me: error: couldn't find gdal-config" >&2;}
   { (exit 1); exit 1; }; }
  fi
fi

if test -n "$GDAL_CONFIG" -a "$with_ogr" != "no" ; then


  if test x`$GDAL_CONFIG --ogr-enabled` = "xyes" ; then
      OGR_ENABLED=-DUSE_OGR
      { echo "$as_me:$LINENO: result:         OGR enabled ($OGR_ENABLED)." >&5
echo "${ECHO_T}        OGR enabled ($OGR_ENABLED)." >&6; }
  else
      { echo "$as_me:$LINENO: WARNING:         OGR not available." >&5
echo "$as_me: WARNING:         OGR not available." >&2;}
  fi

else

  { echo "$as_me:$LINENO: result:         OGR support not requested." >&5
echo "${ECHO_T}        OGR support not requested." >&6; }
fi


{ echo "$as_me:$LINENO: checking if GDAL support requested" >&5
echo $ECHO_N "checking if GDAL support requested... $ECHO_C" >&6; }


# Check whether --with-gdal was given.
if test "${with_gdal+set}" = set; then
  withval=$with_gdal;
fi


if test "$with_gdal" = "yes" ; then

  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

  if test "`basename xx/$with_gdal`" = "gdal-config" ; then
    GDAL_CONFIG="$with_gdal"
  fi

  if test -z "$GDAL_CONFIG" ; then
    # Extract the first word of "gdal-config", so it can be a program name with args.
set dummy gdal-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $GDAL_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_GDAL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_GDAL_CONFIG" && ac_cv_path_GDAL_CONFIG="no"
  ;;
esac
fi
GDAL_CONFIG=$ac_cv_path_GDAL_CONFIG
if test -n "$GDAL_CONFIG"; then
  { echo "$as_me:$LINENO: result: $GDAL_CONFIG" >&5
echo "${ECHO_T}$GDAL_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  fi

  if test "$GDAL_CONFIG" = "no" ; then
    { { echo "$as_me:$LINENO: error: couldn't find gdal-config" >&5
echo "$as_me: error: couldn't find gdal-config" >&2;}
   { (exit 1); exit 1; }; }
  fi

  GDAL_ENABLED=-DUSE_GDAL

elif test -n "$with_gdal" -a "$with_gdal" != "no" ; then

  GDAL_CONFIG=$with_gdal

  if test -f "$GDAL_CONFIG" -a -x "$GDAL_CONFIG" ; then
    { echo "$as_me:$LINENO: result: yes, user supplied gdal-config ($GDAL_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied gdal-config ($GDAL_CONFIG)" >&6; }
  else
    { { echo "$as_me:$LINENO: error: '$GDAL_CONFIG' is not an executable.  Make sure you use --with-gdal=/path/to/gdal-config" >&5
echo "$as_me: error: '$GDAL_CONFIG' is not an executable.  Make sure you use --with-gdal=/path/to/gdal-config" >&2;}
   { (exit 1); exit 1; }; }
  fi

  GDAL_ENABLED=-DUSE_GDAL

else

  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }

fi


if test -n "$GDAL_ENABLED" -o "$OGR_ENABLED"; then

  GDAL_LIB=`$GDAL_CONFIG --libs`' '`$GDAL_CONFIG --dep-libs`
  GDAL_INC=`$GDAL_CONFIG --cflags`

fi

GDAL_ENABLED=$GDAL_ENABLED

OGR_ENABLED=$OGR_ENABLED

GDAL_INC=$GDAL_INC

GDAL_LIB=$GDAL_LIB


ALL_ENABLED="$GDAL_ENABLED $OGR_ENABLED $ALL_ENABLED"
ALL_INC="$GDAL_INC $ALL_INC"
ALL_LIB="$GDAL_LIB $ALL_LIB"


if test -n "$JPEG_ENABLED" ; then
  { echo "$as_me:$LINENO: checking checking ms JPEG output" >&5
echo $ECHO_N "checking checking ms JPEG output... $ECHO_C" >&6; }
  if test -n "$GDAL_ENABLED" ; then
    JPEG_ENABLED=
    { echo "$as_me:$LINENO: result: no we, have GDAL available." >&5
echo "${ECHO_T}no we, have GDAL available." >&6; }
  else
    ALL_ENABLED="$JPEG_ENABLED $ALL_ENABLED"
    ALL_INC="$JPEG_INC $ALL_INC"
    ALL_LIB="$JPEG_LIB $ALL_LIB"
    { echo "$as_me:$LINENO: result: yes, GDAL is not available but libjpeg is." >&5
echo "${ECHO_T}yes, GDAL is not available but libjpeg is." >&6; }
  fi
fi


unset ac_cv_lib_tiff_TIFFOpen

{ echo "$as_me:$LINENO: checking whether we should include TIFF support..." >&5
echo "$as_me: checking whether we should include TIFF support..." >&6;}

# Check whether --with-tiff was given.
if test "${with_tiff+set}" = set; then
  withval=$with_tiff;
fi

if test -z "$with_tiff" -a -n "$GDAL_ENABLED" ; then
  { echo "$as_me:$LINENO: result:         disabled since gdal is in use" >&5
echo "${ECHO_T}        disabled since gdal is in use" >&6; }

elif test "$with_tiff" = "no" ; then
  { echo "$as_me:$LINENO: result:         disabled by --without-tiff" >&5
echo "${ECHO_T}        disabled by --without-tiff" >&6; }

elif test -n "$with_tiff" -a "$with_tiff" != "yes" ; then


  if test -z "$with_tiff" || echo "$with_tiff" | grep '^/' >/dev/null ; then
    TIFF_DIR="$with_tiff"
  else
    TIFF_DIR="`pwd`/$with_tiff"
  fi

  test -f $TIFF_DIR/include/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/include"
  test -f $TIFF_DIR/libtiff/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/libtiff"
  test -f $TIFF_DIR/include/libtiff/tiffio.h && TIFF_INCLUDE="$TIFF_DIR/include/libtiff"
  test -f $TIFF_DIR/tiffio.h && TIFF_INCLUDE="$TIFF_DIR"

  test -f $TIFF_DIR/lib/libtiff.a && TIFF_LIBDIR="$TIFF_DIR/lib"
  test -f $TIFF_DIR/lib64/libtiff.a && TIFF_LIBDIR="$TIFF_DIR/lib64"
  test -f $TIFF_DIR/libtiff/libtiff.a && TIFF_LIBDIR="$TIFF_DIR/libtiff"
  test -f $TIFF_DIR/libtiff.a && TIFF_LIBDIR="$TIFF_DIR"

  test -f $TIFF_DIR/lib/libtiff.so -o $TIFF_DIR/lib/libtiff.sl -o -f $TIFF_DIR/lib/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/lib"
  test -f $TIFF_DIR/lib64/libtiff.so -o $TIFF_DIR/lib64/libtiff.sl && TIFF_LIBDIR="$TIFF_DIR/lib64"
  test -f $TIFF_DIR/libtiff/libtiff.so -o -f $TIFF_DIR/libtiff/libtiff.sl -o -f $TIFF_DIR/libtiff/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR/libtiff"
  test -f $TIFF_DIR/libtiff.so -o -f $TIFF_DIR/libtiff.sl -o -f $TIFF_DIR/libtiff.dylib && TIFF_LIBDIR="$TIFF_DIR"

  if test -n "$TIFF_INCLUDE" -a -n "$TIFF_LIBDIR" ; then

      TIFF_LIB="-L$TIFF_LIBDIR -ltiff"
      TIFF_INC=-I$TIFF_INCLUDE

  if test ""$TIFF_LIBDIR"" != "/usr/lib"; then

  if test -z ""$TIFF_LIBDIR"" || echo ""$TIFF_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$TIFF_LIBDIR""
  else
    ai_p="`pwd`/"$TIFF_LIBDIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

  else
      { { echo "$as_me:$LINENO: error: \"Could not find tiffio.h or libtiff.a/libtiff.so in $TIFF_DIR.\"" >&5
echo "$as_me: error: \"Could not find tiffio.h or libtiff.a/libtiff.so in $TIFF_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi

  TIFF_ENABLED="-DUSE_TIFF"
  { echo "$as_me:$LINENO: result:         using libtiff from $TIFF_LIB." >&5
echo "${ECHO_T}        using libtiff from $TIFF_LIB." >&6; }

else

  { echo "$as_me:$LINENO: checking for TIFFOpen in -ltiff" >&5
echo $ECHO_N "checking for TIFFOpen in -ltiff... $ECHO_C" >&6; }
if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltiff $GD_XTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char TIFFOpen ();
int
main ()
{
return TIFFOpen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_tiff_TIFFOpen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_tiff_TIFFOpen=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFOpen" >&5
echo "${ECHO_T}$ac_cv_lib_tiff_TIFFOpen" >&6; }
if test $ac_cv_lib_tiff_TIFFOpen = yes; then
  TIFF_LIB="-ltiff"
fi

  if test -n "$TIFF_LIB" ; then
      TIFF_ENABLED=-DUSE_TIFF
      { echo "$as_me:$LINENO: result:         using libtiff from system libs." >&5
echo "${ECHO_T}        using libtiff from system libs." >&6; }
  else
      { echo "$as_me:$LINENO: result:         libtiff not found... TIFF support not included." >&5
echo "${ECHO_T}        libtiff not found... TIFF support not included." >&6; }
  fi

fi

TIFF_LIB="$TIFF_LIB $GD_XTRA_LIBS"

TIFF_ENABLED=$TIFF_ENABLED

TIFF_INC=$TIFF_INC

TIFF_LIB=$TIFF_LIB


ALL_ENABLED="$TIFF_ENABLED $ALL_ENABLED"
ALL_INC="$TIFF_INC $ALL_INC"
ALL_LIB="$TIFF_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if PostGIS support requested" >&5
echo $ECHO_N "checking if PostGIS support requested... $ECHO_C" >&6; }


# Check whether --with-postgis was given.
if test "${with_postgis+set}" = set; then
  withval=$with_postgis;
fi


if test "$with_postgis" = "no" -o "$with_postgis" = "" ; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  PG_CONFIG="no"
elif test "$with_postgis" = "yes" ; then
  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
  # Extract the first word of "pg_config", so it can be a program name with args.
set dummy pg_config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_PG_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $PG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_PG_CONFIG" && ac_cv_path_PG_CONFIG="no"
  ;;
esac
fi
PG_CONFIG=$ac_cv_path_PG_CONFIG
if test -n "$PG_CONFIG"; then
  { echo "$as_me:$LINENO: result: $PG_CONFIG" >&5
echo "${ECHO_T}$PG_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


else
  PG_CONFIG=$with_postgis
fi

if test "$PG_CONFIG" = "no" ; then
  POSTGIS_ENABLED=
  POSTGIS_INC=
  POSTGIS_LIB=
else
  if test -f "$PG_CONFIG" -a -x "$PG_CONFIG" ; then
    { echo "$as_me:$LINENO: result: yes, user supplied pg_config ($PG_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied pg_config ($PG_CONFIG)" >&6; }
  else
    { { echo "$as_me:$LINENO: error: '$PG_CONFIG' is not an executable.  Make sure you use --with-postgis=/path/to/pg_config" >&5
echo "$as_me: error: '$PG_CONFIG' is not an executable.  Make sure you use --with-postgis=/path/to/pg_config" >&2;}
   { (exit 1); exit 1; }; }
  fi

  POSTGIS_ENABLED=-DUSE_POSTGIS
  POSTGIS_EXTRALIBS=`$PG_CONFIG --libs`
    if test $? -eq 0 ; then
      POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq $POSTGIS_EXTRALIBS"
  else
      POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq"
  fi
  POSTGIS_INC="-I`$PG_CONFIG --includedir`"
fi

POSTGIS_ENABLED=$POSTGIS_ENABLED

POSTGIS_INC=$POSTGIS_INC

POSTGIS_LIB=$POSTGIS_LIB


ALL_ENABLED="$POSTGIS_ENABLED $ALL_ENABLED"
ALL_INC="$POSTGIS_INC $ALL_INC"
ALL_LIB="$POSTGIS_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if MyGIS support requested" >&5
echo $ECHO_N "checking if MyGIS support requested... $ECHO_C" >&6; }


# Check whether --with-mygis was given.
if test "${with_mygis+set}" = set; then
  withval=$with_mygis;
fi


if test "$with_mygis" = "no" -o "$with_mygis" = "" ; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  MY_CONFIG="no"
elif test "$with_mygis" = "yes" ; then
  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
  # Extract the first word of "mysql_config", so it can be a program name with args.
set dummy mysql_config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_MY_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $MY_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_MY_CONFIG="$MY_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_MY_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_MY_CONFIG" && ac_cv_path_MY_CONFIG="no"
  ;;
esac
fi
MY_CONFIG=$ac_cv_path_MY_CONFIG
if test -n "$MY_CONFIG"; then
  { echo "$as_me:$LINENO: result: $MY_CONFIG" >&5
echo "${ECHO_T}$MY_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


else
  MY_CONFIG=$with_mygis
fi

if test "$MY_CONFIG" = "no" ; then
  MYGIS_ENABLED=
  MYGIS_INC=
  MYGIS_LIB=
else
  if test -f "$MY_CONFIG" -a -x "$MY_CONFIG" ; then
    { echo "$as_me:$LINENO: result: yes, user supplied mysql_config ($MY_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied mysql_config ($MY_CONFIG)" >&6; }
  else
    { { echo "$as_me:$LINENO: error: '$MY_CONFIG' is not an executable.  Make sure you use --with-mygis=/path/to/mysql_config" >&5
echo "$as_me: error: '$MY_CONFIG' is not an executable.  Make sure you use --with-mygis=/path/to/mysql_config" >&2;}
   { (exit 1); exit 1; }; }
  fi

  MYGIS_ENABLED=-DUSE_MYGIS
  MYGIS_LIB="`$MY_CONFIG --libs` -lmysqlclient"
#  MYGIS_LIB="-L/usr/lib/mysql -lmysqlclient"
  MYGIS_INC="`$MY_CONFIG --cflags`"
#  MYGIS_INC="-I/usr/include/mysql"
fi

MYGIS_ENABLED=$MYGIS_ENABLED

MYGIS_INC=$MYGIS_INC

MYGIS_LIB=$MYGIS_LIB


ALL_ENABLED="$MYGIS_ENABLED $ALL_ENABLED"
ALL_INC="$MYGIS_INC $ALL_INC"
ALL_LIB="$MYGIS_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if OracleSpatial support requested" >&5
echo $ECHO_N "checking if OracleSpatial support requested... $ECHO_C" >&6; }

# Check whether --with-oraclespatial was given.
if test "${with_oraclespatial+set}" = set; then
  withval=$with_oraclespatial;
fi


if test "$with_oraclespatial" = "no" -o "$with_oraclespatial" = ""; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  ORA_HOME="no"
elif test "$with_oraclespatial" = "yes"; then
  if test -d "$ORACLE_HOME"; then
    { echo "$as_me:$LINENO: result: yes, set from ORACLE_HOME environment variable" >&5
echo "${ECHO_T}yes, set from ORACLE_HOME environment variable" >&6; }
    ORA_HOME="$ORACLE_HOME"
  else
    ORA_HOME="no"
    { { echo "$as_me:$LINENO: error: ORACLE_HOME variable is not properly set" >&5
echo "$as_me: error: ORACLE_HOME variable is not properly set" >&2;}
   { (exit 1); exit 1; }; }
  fi
else
  { echo "$as_me:$LINENO: result: yes, user supplied ORACLE_HOME" >&5
echo "${ECHO_T}yes, user supplied ORACLE_HOME" >&6; }
  ORA_HOME=$with_oraclespatial
fi

if test "$ORA_HOME" = "no" ; then
  ORACLESPATIAL_ENABLED=
  ORACLESPATIAL_INC=
  ORACLESPATIAL_LIB=
else

    test -f $ORA_HOME/lib/libclntsh.so -o -f $ORA_HOME/lib/libclntsh.dylib && ORA_LIBDIR="$ORA_HOME/lib"
  test -f $ORA_HOME/libclntsh.so -o -f $ORA_HOME/libclntsh.dylib && ORA_LIBDIR="$ORA_HOME"
  test -f $ORA_HOME/lib/oracle/10*/client/lib/libclntsh.so && ORA_LIBDIR=`dirname $ORA_HOME/lib/oracle/10*/client/lib/libclntsh.so`
  test -f $ORA_HOME/lib/oracle/10*/client/lib/libclntsh.dylib && ORA_LIBDIR=`dirname $ORA_HOME/lib/oracle/10*/client/lib/libclntsh.dylib`

  if test -z "$ORA_LIBDIR" ; then
    { { echo "$as_me:$LINENO: error: Oracle Spatial: libclntsh.so not found." >&5
echo "$as_me: error: Oracle Spatial: libclntsh.so not found." >&2;}
   { (exit 1); exit 1; }; }
  fi

    test -f $ORA_HOME/sdk/include/oci.h && ORA_INCDIR="$ORA_HOME/sdk/include"
  test -f $ORA_HOME/rdbms/public/oci.h && ORA_INCDIR="$ORA_HOME/rdbms/public"
  test -f $ORA_HOME/rdbms/demo/oci.h && ORA_INCDIR="$ORA_HOME/rdbms/public"
  test -f $ORA_HOME/include/oracle/10*/client/oci.h && ORA_INCDIR=`dirname $ORA_HOME/include/oracle/10*/client/oci.h`

  if test -z "$ORA_INCDIR" ; then
    { { echo "$as_me:$LINENO: error: Oracle Spatial: oci.h not found." >&5
echo "$as_me: error: Oracle Spatial: oci.h not found." >&2;}
   { (exit 1); exit 1; }; }
  fi

  ORACLESPATIAL_ENABLED=-DUSE_ORACLESPATIAL
  ORACLESPATIAL_LIB="-L$ORA_LIBDIR -lclntsh"
  ORACLESPATIAL_INC="-I$ORA_INCDIR -I$ORA_HOME/rdbms/demo -I$ORA_HOME/rdbms/public"

  { echo "$as_me:$LINENO: result:         Oracle Spatial found in $ORA_HOME." >&5
echo "${ECHO_T}        Oracle Spatial found in $ORA_HOME." >&6; }

fi

ORACLESPATIAL_ENABLED=$ORACLESPATIAL_ENABLED

ORACLESPATIAL_INC=$ORACLESPATIAL_INC

ORACLESPATIAL_LIB=$ORACLESPATIAL_LIB


ALL_ENABLED="$ORACLESPATIAL_ENABLED $ALL_ENABLED"
ALL_INC="$ORACLESPATIAL_INC $ALL_INC"
ALL_LIB="$ORACLESPATIAL_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking if MING/Flash support requested" >&5
echo $ECHO_N "checking if MING/Flash support requested... $ECHO_C" >&6; }

# Check whether --with-ming was given.
if test "${with_ming+set}" = set; then
  withval=$with_ming;
fi


if test "$with_ming" = "no" -o "$with_ming" = ""; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  MING_ENABLED=
  MING_LIB=
  MING_INC=
elif test "$with_ming" = "yes"; then
  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
  MING_ENABLED=-DUSE_MING_FLASH
  MING_LIB="-lming"
  MING_INC=
else
  { echo "$as_me:$LINENO: result: yes, user supplied MING directory" >&5
echo "${ECHO_T}yes, user supplied MING directory" >&6; }
  MING_ENABLED=-DUSE_MING_FLASH
  MING_LIB="-L$with_ming/lib -lming"
  MING_INC="-I$with_ming/include"
fi

MING_ENABLED=$MING_ENABLED

MING_INC=$MING_INC

MING_LIB=$MING_LIB


ALL_ENABLED="$MING_ENABLED $ALL_ENABLED"
ALL_INC="$MING_INC $ALL_INC"
ALL_LIB="$MING_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking whether we should include WMS Server support..." >&5
echo "$as_me: checking whether we should include WMS Server support..." >&6;}

# Check whether --with-wms was given.
if test "${with_wms+set}" = set; then
  withval=$with_wms;
fi


if test "$with_wms" = "no" ; then

  { echo "$as_me:$LINENO: result:         OGC WMS Compatibility disabled by --without-wms." >&5
echo "${ECHO_T}        OGC WMS Compatibility disabled by --without-wms." >&6; }

elif test -z "$PROJ_ENABLED" ; then

  { echo "$as_me:$LINENO: result:         OGC WMS Compatibility not enabled (PROJ.4 is required for WMS)." >&5
echo "${ECHO_T}        OGC WMS Compatibility not enabled (PROJ.4 is required for WMS)." >&6; }

else

  WMS_SVR_ENABLED="-DUSE_WMS_SVR"
  { echo "$as_me:$LINENO: result:         OGC WMS compatibility enabled ($WMS_SVR_ENABLED)." >&5
echo "${ECHO_T}        OGC WMS compatibility enabled ($WMS_SVR_ENABLED)." >&6; }

fi

WMS_SVR_ENABLED=$WMS_SVR_ENABLED


ALL_ENABLED="$WMS_SVR_ENABLED $ALL_ENABLED"



{ echo "$as_me:$LINENO: checking whether we should include WFS Server support..." >&5
echo "$as_me: checking whether we should include WFS Server support..." >&6;}

# Check whether --with-wfs was given.
if test "${with_wfs+set}" = set; then
  withval=$with_wfs;
fi


if test "$with_wfs" != "yes" ; then

  { echo "$as_me:$LINENO: result:         OGC WFS Server support not requested." >&5
echo "${ECHO_T}        OGC WFS Server support not requested." >&6; }

elif test -z "$OGR_ENABLED" ; then

  { { echo "$as_me:$LINENO: error: OGC WFS Server support cannot be enabled: missing OGR which is required)." >&5
echo "$as_me: error: OGC WFS Server support cannot be enabled: missing OGR which is required)." >&2;}
   { (exit 1); exit 1; }; }

elif test -z "$PROJ_ENABLED" ; then

  { { echo "$as_me:$LINENO: error: OGC WFS Server support cannot be enabled: missing PROJ4 which is required)." >&5
echo "$as_me: error: OGC WFS Server support cannot be enabled: missing PROJ4 which is required)." >&2;}
   { (exit 1); exit 1; }; }

elif test "$with_wfs" = "yes" ; then

  WFS_SVR_ENABLED="-DUSE_WFS_SVR"
  { echo "$as_me:$LINENO: result:         OGC WFS Server support enabled ($WFS_SVR_ENABLED)." >&5
echo "${ECHO_T}        OGC WFS Server support enabled ($WFS_SVR_ENABLED)." >&6; }

fi

WFS_SVR_ENABLED=$WFS_SVR_ENABLED


ALL_ENABLED="$WFS_SVR_ENABLED $ALL_ENABLED"



{ echo "$as_me:$LINENO: checking whether we should include WCS Server support..." >&5
echo "$as_me: checking whether we should include WCS Server support..." >&6;}

# Check whether --with-wcs was given.
if test "${with_wcs+set}" = set; then
  withval=$with_wcs;
fi


if test "$with_wcs" != "yes" ; then
  { echo "$as_me:$LINENO: result:         OGC WCS Server support not requested." >&5
echo "${ECHO_T}        OGC WCS Server support not requested." >&6; }
elif test -z "$GDAL_ENABLED" ; then
  { { echo "$as_me:$LINENO: error: OGC WCS Server support cannot be enabled: missing GDAL which is required)." >&5
echo "$as_me: error: OGC WCS Server support cannot be enabled: missing GDAL which is required)." >&2;}
   { (exit 1); exit 1; }; }
elif test -z "$PROJ_ENABLED" ; then
  { { echo "$as_me:$LINENO: error: OGC WCS Server support cannot be enabled: missing PROJ4 which is required)." >&5
echo "$as_me: error: OGC WCS Server support cannot be enabled: missing PROJ4 which is required)." >&2;}
   { (exit 1); exit 1; }; }
elif test "$with_wcs" = "yes" ; then
  WCS_SVR_ENABLED="-DUSE_WCS_SVR"
  { echo "$as_me:$LINENO: result:         OGC WCS Server support enabled ($WCS_SVR_ENABLED)." >&5
echo "${ECHO_T}        OGC WCS Server support enabled ($WCS_SVR_ENABLED)." >&6; }
fi

WCS_SVR_ENABLED=$WCS_SVR_ENABLED

ALL_ENABLED="$WCS_SVR_ENABLED $ALL_ENABLED"



{ echo "$as_me:$LINENO: checking whether we should include WMS Client Connections support..." >&5
echo "$as_me: checking whether we should include WMS Client Connections support..." >&6;}

# Check whether --with-wmsclient was given.
if test "${with_wmsclient+set}" = set; then
  withval=$with_wmsclient;
fi


if test "$with_wmsclient" = "no" ; then

  { echo "$as_me:$LINENO: result:         OGC WMS Client Layers disabled by --without-wmsclient." >&5
echo "${ECHO_T}        OGC WMS Client Layers disabled by --without-wmsclient." >&6; }

elif test -z "$PROJ_ENABLED" ; then

  { echo "$as_me:$LINENO: result:         OGC WMS Client Connections not enabled (PROJ.4 and libcurl required)." >&5
echo "${ECHO_T}        OGC WMS Client Connections not enabled (PROJ.4 and libcurl required)." >&6; }

elif test "$with_wmsclient" = "yes" ; then

    WMS_REQUESTED="yes"

fi


{ echo "$as_me:$LINENO: checking whether we should include WFS Client Connections support..." >&5
echo "$as_me: checking whether we should include WFS Client Connections support..." >&6;}

# Check whether --with-wfsclient was given.
if test "${with_wfsclient+set}" = set; then
  withval=$with_wfsclient;
fi


if test "$with_wfsclient" = "no" ; then

  { echo "$as_me:$LINENO: result:         OGC WFS Client Layers disabled by --without-wfsclient." >&5
echo "${ECHO_T}        OGC WFS Client Layers disabled by --without-wfsclient." >&6; }

elif test -z "$PROJ_ENABLED" -o -z "$OGR_ENABLED"; then

  { echo "$as_me:$LINENO: result:         OGC WFS Client Connections not enabled (PROJ.4, libcurl and OGR required)." >&5
echo "${ECHO_T}        OGC WFS Client Connections not enabled (PROJ.4, libcurl and OGR required)." >&6; }

elif test "$with_wfsclient" = "yes" ; then

    WFS_REQUESTED="yes"

fi


{ echo "$as_me:$LINENO: checking whether we should include OGC SOS Server support..." >&5
echo "$as_me: checking whether we should include OGC SOS Server support..." >&6;}

# Check whether --with-sos was given.
if test "${with_sos+set}" = set; then
  withval=$with_sos;
fi


if test "x$with_sos" != "xyes" ; then

  { echo "$as_me:$LINENO: result:         OGC SOS Server support not requested." >&5
echo "${ECHO_T}        OGC SOS Server support not requested." >&6; }

else

  if test -z "$PROJ_ENABLED" ; then
    { { echo "$as_me:$LINENO: error:         OGC SOS Support requested, but PROJ.4 required and missing." >&5
echo "$as_me: error:         OGC SOS Support requested, but PROJ.4 required and missing." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$OGR_ENABLED" ; then
    { { echo "$as_me:$LINENO: error:         OGC SOS Support requested, but OGR required and missing." >&5
echo "$as_me: error:         OGC SOS Support requested, but OGR required and missing." >&2;}
   { (exit 1); exit 1; }; }
  fi

    SOS_REQUESTED="yes"
  { echo "$as_me:$LINENO: result:         OGC SOS Server support requested." >&5
echo "${ECHO_T}        OGC SOS Server support requested." >&6; }

fi


{ echo "$as_me:$LINENO: checking for curl-config" >&5
echo $ECHO_N "checking for curl-config... $ECHO_C" >&6; }

# Check whether --with-curl-config was given.
if test "${with_curl_config+set}" = set; then
  withval=$with_curl_config;
fi


unset ac_cv_path_LIBCURL_CONFIG

if test "$WMS_REQUESTED" = "yes" -o "$WFS_REQUESTED" = "yes" ; then

  if test "`basename xx/$with_curl_config`" = "curl-config" ; then
    LIBCURL_CONFIG="$with_curl_config"
    if test -f "$LIBCURL_CONFIG" -a -x "$LIBCURL_CONFIG" ; then
      { echo "$as_me:$LINENO: result: yes, user supplied curl-config ($LIBCURL_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied curl-config ($LIBCURL_CONFIG)" >&6; }
    else
      { { echo "$as_me:$LINENO: error: '$LIBCURL_CONFIG' is not an executable.  Make sure you use --with-curl-config=/path/to/curl-config" >&5
echo "$as_me: error: '$LIBCURL_CONFIG' is not an executable.  Make sure you use --with-curl-config=/path/to/curl-config" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    # Extract the first word of "curl-config", so it can be a program name with args.
set dummy curl-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_LIBCURL_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $LIBCURL_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_LIBCURL_CONFIG="$LIBCURL_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_LIBCURL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_LIBCURL_CONFIG" && ac_cv_path_LIBCURL_CONFIG="no"
  ;;
esac
fi
LIBCURL_CONFIG=$ac_cv_path_LIBCURL_CONFIG
if test -n "$LIBCURL_CONFIG"; then
  { echo "$as_me:$LINENO: result: $LIBCURL_CONFIG" >&5
echo "${ECHO_T}$LIBCURL_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  fi

  if test "$LIBCURL_CONFIG" = "no" ; then
    { { echo "$as_me:$LINENO: error: couldn't find curl-config, try using --with-curl-config=PATH" >&5
echo "$as_me: error: couldn't find curl-config, try using --with-curl-config=PATH" >&2;}
   { (exit 1); exit 1; }; }
  fi

  CURL_VERNUM=`$LIBCURL_CONFIG --vernum`
  CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'`

  { echo "$as_me:$LINENO: result:         found libcurl version $CURL_VER" >&5
echo "${ECHO_T}        found libcurl version $CURL_VER" >&6; }

    if test -z "$CURL_VERNUM" -o `expr "0x$CURL_VERNUM" \< "0x070a01"` = 1; then
    { { echo "$as_me:$LINENO: error: libcurl version 7.10.1 or more recent is required." >&5
echo "$as_me: error: libcurl version 7.10.1 or more recent is required." >&2;}
   { (exit 1); exit 1; }; }
  fi

      if test "$WMS_REQUESTED" = "yes" ; then
    WMS_LYR_ENABLED="-DUSE_WMS_LYR"
    { echo "$as_me:$LINENO: result:         OGC WMS Client Connections enabled ($WMS_LYR_ENABLED)." >&5
echo "${ECHO_T}        OGC WMS Client Connections enabled ($WMS_LYR_ENABLED)." >&6; }
  fi

  if test "$WFS_REQUESTED" = "yes" ; then
    WFS_LYR_ENABLED="-DUSE_WFS_LYR"
    { echo "$as_me:$LINENO: result:         OGC WFS Client Connections enabled ($WFS_LYR_ENABLED)." >&5
echo "${ECHO_T}        OGC WFS Client Connections enabled ($WFS_LYR_ENABLED)." >&6; }
  fi

  CURL_INC=`$LIBCURL_CONFIG --cflags`
  CURL_LIB=`$LIBCURL_CONFIG --libs`
  CURL_ENABLED=-DUSE_CURL

fi

CURL_INC=$CURL_INC

CURL_LIB=$CURL_LIB


ALL_INC="$CURL_INC $ALL_INC"
ALL_LIB="$CURL_LIB $ALL_LIB"



{ echo "$as_me:$LINENO: checking for libxml2" >&5
echo $ECHO_N "checking for libxml2... $ECHO_C" >&6; }


# Check whether --with-xml2-config was given.
if test "${with_xml2_config+set}" = set; then
  withval=$with_xml2_config;
fi


unset ac_cv_path_LIBXML2_CONFIG


if test -z "$with_xml2_config" ; then
  if test "x$SOS_REQUESTED" = "xyes" ; then
    with_xml2_config=yes
    { echo "$as_me:$LINENO: result: libxml2 required." >&5
echo "${ECHO_T}libxml2 required." >&6; }
  elif test "x$WCS_SVR_ENABLED" != "x" ; then
    with_xml2_config=yes
    { echo "$as_me:$LINENO: result: libxml2 requested for WCS Server." >&5
echo "${ECHO_T}libxml2 requested for WCS Server." >&6; }
    { echo "$as_me:$LINENO: result:       If unavailable disable using --without-xml2-config," >&5
echo "${ECHO_T}      If unavailable disable using --without-xml2-config," >&6; }
    { echo "$as_me:$LINENO: result:       but WCS 1.1 support will be disabled." >&5
echo "${ECHO_T}      but WCS 1.1 support will be disabled." >&6; }
  else
    with_xml2_config=no
    { echo "$as_me:$LINENO: result: libxml2 not required." >&5
echo "${ECHO_T}libxml2 not required." >&6; }
  fi
fi

if test "$with_xml2_config" != "no" ; then

  if test "`basename xx/$with_xml2_config`" = "xml2-config" ; then
    LIBXML2_CONFIG="$with_xml2_config"
    if test -f "$LIBXML2_CONFIG" -a -x "$LIBXML2_CONFIG" ; then
      { echo "$as_me:$LINENO: result: yes, user supplied xml2-config ($LIBXML2_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied xml2-config ($LIBXML2_CONFIG)" >&6; }
    else
      { { echo "$as_me:$LINENO: error: '$LIBXML2_CONFIG' is not an executable.  Make sure you use --with-xml2-config=/path/to/xml2-config" >&5
echo "$as_me: error: '$LIBXML2_CONFIG' is not an executable.  Make sure you use --with-xml2-config=/path/to/xml2-config" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    # Extract the first word of "xml2-config", so it can be a program name with args.
set dummy xml2-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_LIBXML2_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $LIBXML2_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_LIBXML2_CONFIG="$LIBXML2_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_LIBXML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_LIBXML2_CONFIG" && ac_cv_path_LIBXML2_CONFIG="no"
  ;;
esac
fi
LIBXML2_CONFIG=$ac_cv_path_LIBXML2_CONFIG
if test -n "$LIBXML2_CONFIG"; then
  { echo "$as_me:$LINENO: result: $LIBXML2_CONFIG" >&5
echo "${ECHO_T}$LIBXML2_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  fi

  if test "$LIBXML2_CONFIG" = "no" ; then
   { { echo "$as_me:$LINENO: error: couldn't find xml2-config, try using --with-xml2-config=PATH" >&5
echo "$as_me: error: couldn't find xml2-config, try using --with-xml2-config=PATH" >&2;}
   { (exit 1); exit 1; }; }
  fi

  XML2_VER=`$LIBXML2_CONFIG --version`

  { echo "$as_me:$LINENO: result:         found libxml2 version $XML2_VER" >&5
echo "${ECHO_T}        found libxml2 version $XML2_VER" >&6; }

  XML2_INC=`$LIBXML2_CONFIG --cflags`
  XML2_LIB=`$LIBXML2_CONFIG --libs`
  XML2_ENABLED=-DUSE_LIBXML2

  if test "$SOS_REQUESTED" = "yes" ; then
    SOS_SVR_ENABLED="-DUSE_SOS_SVR"
  fi
fi

XML2_INC=$XML2_INC

XML2_LIB=$XML2_LIB


ALL_INC="$XML2_INC $ALL_INC"
ALL_LIB="$XML2_LIB $ALL_LIB"


WMS_LYR_ENABLED=$WMS_LYR_ENABLED

WFS_LYR_ENABLED=$WFS_LYR_ENABLED

SOS_SVR_ENABLED=$SOS_SVR_ENABLED


ALL_ENABLED="$WMS_LYR_ENABLED $WFS_LYR_ENABLED $SOS_SVR_ENABLED $XML2_ENABLED $CURL_ENABLED $ALL_ENABLED"



{ echo "$as_me:$LINENO: checking if FriBidi support requested" >&5
echo $ECHO_N "checking if FriBidi support requested... $ECHO_C" >&6; }


# Check whether --with-fribidi-config was given.
if test "${with_fribidi_config+set}" = set; then
  withval=$with_fribidi_config;
fi


if test "$with_fribidi_config" = "no" -o "$with_fribidi_config" = "" ; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  FRIBIDI_CONFIG="no"

elif test "$with_fribidi_config" = "yes" ; then
  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
  # Extract the first word of "fribidi-config", so it can be a program name with args.
set dummy fribidi-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_FRIBIDI_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $FRIBIDI_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_FRIBIDI_CONFIG="$FRIBIDI_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_FRIBIDI_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_FRIBIDI_CONFIG" && ac_cv_path_FRIBIDI_CONFIG="no"
  ;;
esac
fi
FRIBIDI_CONFIG=$ac_cv_path_FRIBIDI_CONFIG
if test -n "$FRIBIDI_CONFIG"; then
  { echo "$as_me:$LINENO: result: $FRIBIDI_CONFIG" >&5
echo "${ECHO_T}$FRIBIDI_CONFIG" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  FRIBIDI_PKG_CONFIG="no"
  if test "$FRIBIDI_CONFIG" = "no" -a "$PKG_CONFIG" != "no" ; then
     { echo "$as_me:$LINENO: checking for fribidi pkg-config path" >&5
echo $ECHO_N "checking for fribidi pkg-config path... $ECHO_C" >&6; }
     `$PKG_CONFIG --silence-errors --libs fribidi >> /dev/null`
     if test $? -eq 0 ; then
        { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
        FRIBIDI_PKG_CONFIG="yes"
        FRIBIDI_CONFIG="fribidi"
     else
       { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
     fi
  fi
else
  FRIBIDI_CONFIG=$with_fribidi_config
fi

if test "$FRIBIDI_CONFIG" = "no" ; then
  FRIBIDI_ENABLED=
  FRIBIDI_INC=
  FRIBIDI_LIB=
else
  if test "$FRIBIDI_PKG_CONFIG" = "yes" -o ${FRIBIDI_CONFIG: -3} = ".pc" ; then
     { echo "$as_me:$LINENO: result: yes, user supplied path to fribidi.pc" >&5
echo "${ECHO_T}yes, user supplied path to fribidi.pc" >&6; }
     FRIBIDI_ENABLED="-DUSE_FRIBIDI -DUSE_FRIBIDI2"
     FRIBIDI_LIB=`$PKG_CONFIG --libs $FRIBIDI_CONFIG`
     FRIBIDI_INC=`$PKG_CONFIG --cflags $FRIBIDI_CONFIG`
  else
     if test -f "$FRIBIDI_CONFIG" -a -x "$FRIBIDI_CONFIG" ; then
       { echo "$as_me:$LINENO: result: yes, user supplied fribidi-config ($FRIBIDI_CONFIG)" >&5
echo "${ECHO_T}yes, user supplied fribidi-config ($FRIBIDI_CONFIG)" >&6; }
     else
       { { echo "$as_me:$LINENO: error: '$FRIBIDI_CONFIG' is not an executable.  Make sure you use --with-fribidi-config=/path/to/fribidi-config or fribidi.pc" >&5
echo "$as_me: error: '$FRIBIDI_CONFIG' is not an executable.  Make sure you use --with-fribidi-config=/path/to/fribidi-config or fribidi.pc" >&2;}
   { (exit 1); exit 1; }; }
     fi
     FRIBIDI_ENABLED=-DUSE_FRIBIDI
     FRIBIDI_LIB=`$FRIBIDI_CONFIG --libs`
     FRIBIDI_INC=`$FRIBIDI_CONFIG --cflags`
  fi
fi

FRIBIDI_ENABLED=$FRIBIDI_ENABLED

FRIBIDI_INC=$FRIBIDI_INC

FRIBIDI_LIB=$FRIBIDI_LIB


ALL_ENABLED="$FRIBIDI_ENABLED $ALL_ENABLED"
ALL_INC="$FRIBIDI_INC $ALL_INC"
ALL_LIB="$FRIBIDI_LIB $ALL_LIB"



{ echo "$as_me:$LINENO: checking if Cairo support requested" >&5
echo $ECHO_N "checking if Cairo support requested... $ECHO_C" >&6; }


# Check whether --with-cairo was given.
if test "${with_cairo+set}" = set; then
  withval=$with_cairo;
fi


if test "$with_cairo" = "no" -o "$with_cairo" = "" ; then
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  CAIRO_CONFIG="no"

elif test "$with_cairo" = "yes" ; then
  { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
  if test "$PKG_CONFIG" != "no" ; then
     { echo "$as_me:$LINENO: checking for cairo pkg-config path" >&5
echo $ECHO_N "checking for cairo pkg-config path... $ECHO_C" >&6; }
     `$PKG_CONFIG --silence-errors -- cairo cairo-ft cairo-svg cairo-pdf cairo-png >> /dev/null`
     if test $? -eq 0 ; then
        { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
        CAIRO_CONFIG="cairo cairo-ft cairo-svg cairo-pdf cairo-png"
     else
       { { echo "$as_me:$LINENO: error: cairo support requested, but not found.Try installing the cairo development headers" >&5
echo "$as_me: error: cairo support requested, but not found.Try installing the cairo development headers" >&2;}
   { (exit 1); exit 1; }; }
     fi
  else
    { { echo "$as_me:$LINENO: error: pkg-config required for cairo support, try using --with-pkg-config=PATH" >&5
echo "$as_me: error: pkg-config required for cairo support, try using --with-pkg-config=PATH" >&2;}
   { (exit 1); exit 1; }; }
  fi
else
  CAIRO_CONFIG=$with_cairo_config
fi

if test "$CAIRO_CONFIG" = "no" ; then
  CAIRO_ENABLED=
  CAIRO_INC=
  CAIRO_LIB=
else
  { echo "$as_me:$LINENO: result: yes, pkg-config defaults, or user supplied path to cairo.pc" >&5
echo "${ECHO_T}yes, pkg-config defaults, or user supplied path to cairo.pc" >&6; }
  CAIRO_ENABLED="-DUSE_CAIRO"
  CAIRO_LIB=`$PKG_CONFIG --libs $CAIRO_CONFIG`
  CAIRO_INC=`$PKG_CONFIG --cflags $CAIRO_CONFIG`
fi

CAIRO_ENABLED=$CAIRO_ENABLED

CAIRO_INC=$CAIRO_INC

CAIRO_LIB=$CAIRO_LIB


ALL_ENABLED="$CAIRO_ENABLED $ALL_ENABLED"
ALL_INC="$CAIRO_INC $ALL_INC"
ALL_LIB="$CAIRO_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking FastCGI support" >&5
echo $ECHO_N "checking FastCGI support... $ECHO_C" >&6; }

# Check whether --with-fastcgi was given.
if test "${with_fastcgi+set}" = set; then
  withval=$with_fastcgi;
fi


if test "$with_fastcgi" = "no" -o "$with_fastcgi" = "" ; then

  { echo "$as_me:$LINENO: result: not requested." >&5
echo "${ECHO_T}not requested." >&6; }

else

  { echo "$as_me:$LINENO: result: requested." >&5
echo "${ECHO_T}requested." >&6; }

  if test "$with_fastcgi" = "yes" ; then
    FASTCGI_INC=""
    FASTCGI_LIB="-lfcgi"
  else
    FASTCGI_INC="-I$with_fastcgi/include"
    FASTCGI_LIB="-L$with_fastcgi/lib -lfcgi"
  fi

  { echo "$as_me:$LINENO: checking for FCGI_Accept in -lfcgi" >&5
echo $ECHO_N "checking for FCGI_Accept in -lfcgi... $ECHO_C" >&6; }
if test "${ac_cv_lib_fcgi_FCGI_Accept+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lfcgi $FASTCGI_LIB $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char FCGI_Accept ();
int
main ()
{
return FCGI_Accept ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  (eval "$ac_link") 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && {
	 test -z "$ac_c_werror_flag" ||
	 test ! -s conftest.err
       } && test -s conftest$ac_exeext &&
       $as_test_x conftest$ac_exeext; then
  ac_cv_lib_fcgi_FCGI_Accept=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

	ac_cv_lib_fcgi_FCGI_Accept=no
fi

rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_fcgi_FCGI_Accept" >&5
echo "${ECHO_T}$ac_cv_lib_fcgi_FCGI_Accept" >&6; }
if test $ac_cv_lib_fcgi_FCGI_Accept = yes; then
  FASTCGI_ENABLED=-DUSE_FASTCGI
fi


  if test "x$FASTCGI_ENABLED" = "x" ; then
    { { echo "$as_me:$LINENO: error: Unable to link against $FASTCGI_LIB" >&5
echo "$as_me: error: Unable to link against $FASTCGI_LIB" >&2;}
   { (exit 1); exit 1; }; }
  fi

fi

FASTCGI_ENABLED=$FASTCGI_ENABLED

FASTCGI_INC=$FASTCGI_INC

FASTCGI_LIB=$FASTCGI_LIB


ALL_ENABLED="$FASTCGI_ENABLED $ALL_ENABLED"
ALL_INC="$FASTCGI_INC $ALL_INC"
ALL_LIB="$FASTCGI_LIB $ALL_LIB"


{ echo "$as_me:$LINENO: checking HTTPD server (Apache) version..." >&5
echo "$as_me: checking HTTPD server (Apache) version..." >&6;}

# Check whether --with-httpd was given.
if test "${with_httpd+set}" = set; then
  withval=$with_httpd;
fi



if test "$with_httpd" = "no" ; then

  { echo "$as_me:$LINENO: result:         HTTPD server (Apache) version detection disabled by --without-httpd." >&5
echo "${ECHO_T}        HTTPD server (Apache) version detection disabled by --without-httpd." >&6; }

elif test "$with_httpd" = "yes" ; then
  { { echo "$as_me:$LINENO: error: full path to httpd executable is required as argument when using --with-httpd" >&5
echo "$as_me: error: full path to httpd executable is required as argument when using --with-httpd" >&2;}
   { (exit 1); exit 1; }; }

else

  if test -n "$with_httpd" ; then
                HTTPD="$with_httpd"

    if test -f "$HTTPD" -a -x "$HTTPD" ; then
      { echo "$as_me:$LINENO: result:         using user-supplied httpd ($HTTPD)" >&5
echo "${ECHO_T}        using user-supplied httpd ($HTTPD)" >&6; }
    else
      { { echo "$as_me:$LINENO: error: $HTTPD is not an executable.  Make sure you use --with-httpd=/path/to/httpd" >&5
echo "$as_me: error: $HTTPD is not an executable.  Make sure you use --with-httpd=/path/to/httpd" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
                # Extract the first word of "httpd", so it can be a program name with args.
set dummy httpd; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_HTTPD+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $HTTPD in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_HTTPD="$HTTPD" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy=""$PATH:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/apache/bin""
for as_dir in $as_dummy
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    ac_cv_path_HTTPD="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done
IFS=$as_save_IFS

  test -z "$ac_cv_path_HTTPD" && ac_cv_path_HTTPD=""""
  ;;
esac
fi
HTTPD=$ac_cv_path_HTTPD
if test -n "$HTTPD"; then
  { echo "$as_me:$LINENO: result: $HTTPD" >&5
echo "${ECHO_T}$HTTPD" >&6; }
else
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi


  fi

  if test -z "$HTTPD" ; then
    { echo "$as_me:$LINENO: result:         'httpd' not found, skipping Apache version detection. You may want to use --with-httpd=/path/to/httpd" >&5
echo "${ECHO_T}        'httpd' not found, skipping Apache version detection. You may want to use --with-httpd=/path/to/httpd" >&6; }
  else
    HTTPD_VERSION_STRING=`$HTTPD -v | grep "Server version" | awk '{print $3}'`
        APACHE_VERSION=`echo "$HTTPD_VERSION_STRING" | grep Apache | awk -F / '{print $2}' | awk -F . '{print $1*1000000 + $2*1000 + $3}'`

    { echo "$as_me:$LINENO: result:         $HTTPD version is $HTTPD_VERSION_STRING ($APACHE_VERSION)." >&5
echo "${ECHO_T}        $HTTPD version is $HTTPD_VERSION_STRING ($APACHE_VERSION)." >&6; }


        if test -n "$APACHE_VERSION" -a `expr "$APACHE_VERSION" \>= "2000000"` = 1 ; then
      { echo "$as_me:$LINENO: result:         Your system is apparently running $HTTPD_VERSION_STRING.  Setting stderr to non-blocking for msDebug() due to Apache 2.x bug (see MapServer bug 458 or Apache bug 22030)." >&5
echo "${ECHO_T}        Your system is apparently running $HTTPD_VERSION_STRING.  Setting stderr to non-blocking for msDebug() due to Apache 2.x bug (see MapServer bug 458 or Apache bug 22030)." >&6; }
      DEBUG_FLAGS="${DEBUG_FLAGS} -DNEED_NONBLOCKING_STDERR"
    fi

  fi

fi



MS_DIR="`pwd`"
MS_INC="-I$MS_DIR"
MS_LIB="-L$MS_DIR -lmapserver"

  if test ""$MS_DIR"" != "/usr/lib"; then

  if test -z ""$MS_DIR"" || echo ""$MS_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$MS_DIR""
  else
    ai_p="`pwd`/"$MS_DIR""
  fi


  unique=`echo $ac_n "$ai_p$ac_c" | tr -c -d a-zA-Z0-9`
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

      EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
        RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"

  fi

  fi

MS_INC=$MS_INC

MS_LIB=$MS_LIB



# Check whether --enable-ignore-missing-data was given.
if test "${enable_ignore_missing_data+set}" = set; then
  enableval=$enable_ignore_missing_data;
fi

if test "$enable_ignore_missing_data" = "yes" ; then

  IGNORE_MISSING_DATA="-DIGNORE_MISSING_DATA"

  { echo "$as_me:$LINENO: result: Compiling with -DIGNORE_MISSING_DATA." >&5
echo "${ECHO_T}Compiling with -DIGNORE_MISSING_DATA." >&6; }
fi
IGNORE_MISSING_DATA=$IGNORE_MISSING_DATA



# Check whether --enable-point-z-m was given.
if test "${enable_point_z_m+set}" = set; then
  enableval=$enable_point_z_m;
fi

if test "$enable_point_z_m" = "yes" ; then

  USE_POINT_Z_M="-DUSE_POINT_Z_M"

  { echo "$as_me:$LINENO: result: Compiling with -DUSE_POINT_Z_M." >&5
echo "${ECHO_T}Compiling with -DUSE_POINT_Z_M." >&6; }
fi
USE_POINT_Z_M=$USE_POINT_Z_M

ALL_ENABLED="$USE_POINT_Z_M $ALL_ENABLED"



# Check whether --enable-point-z-m was given.
if test "${enable_point_z_m+set}" = set; then
  enableval=$enable_point_z_m;
fi


if test "$enable_fast_nint" = "no" ; then

  USE_NINT="-DUSE_GENERIC_MS_NINT"

  { echo "$as_me:$LINENO: result: Compiling with safe MS_NINT" >&5
echo "${ECHO_T}Compiling with safe MS_NINT" >&6; }
else
  USE_NINT=""

  { echo "$as_me:$LINENO: result: Compiling with fast MS_NINT" >&5
echo "${ECHO_T}Compiling with fast MS_NINT" >&6; }
fi
USE_NINT=$USE_NINT

ALL_ENABLED="$USE_NINT $ALL_ENABLED"


{ echo "$as_me:$LINENO: checking compiler warnings" >&5
echo $ECHO_N "checking compiler warnings... $ECHO_C" >&6; }


# Check whether --with-warnings was given.
if test "${with_warnings+set}" = set; then
  withval=$with_warnings;
fi


if test "$with_warnings" = "yes" ; then
  if test "$GCC" = "yes" ; then
    WFLAGS="-W -Wall -Wcast-align -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type"
    C_EXTRA_WFLAGS="-Wmissing-declarations"

    { echo "$as_me:$LINENO: result: strict" >&5
echo "${ECHO_T}strict" >&6; }
  else
    WFLAGS=""
    C_EXTRA_WFLAGS=""
    { echo "$as_me:$LINENO: result: disabled" >&5
echo "${ECHO_T}disabled" >&6; }
  fi

elif test "$with_warnings" = "" ; then
  if test "$GCC" = "yes" ; then
    WFLAGS="-Wall"
    C_EXTRA_WFLAGS=""
    { echo "$as_me:$LINENO: result: basic" >&5
echo "${ECHO_T}basic" >&6; }
  else
    WFLAGS=""
    C_EXTRA_WFLAGS=""
    { echo "$as_me:$LINENO: result: disabled" >&5
echo "${ECHO_T}disabled" >&6; }
  fi

elif test "$with_warnings" = "no" ; then
  WFLAGS=""
  C_EXTRA_WFLAGS=""
  { echo "$as_me:$LINENO: result: disabled" >&5
echo "${ECHO_T}disabled" >&6; }

else
  WFLAGS="$with_warnings"
  C_EXTRA_WFLAGS=""
  { echo "$as_me:$LINENO: result: user defined" >&5
echo "${ECHO_T}user defined" >&6; }
fi

CFLAGS="$CFLAGS $WFLAGS $C_EXTRA_WFLAGS"
CXXFLAGS="$CXXFLAGS $WFLAGS "


{ echo "$as_me:$LINENO: checking whether we should enable debug features..." >&5
echo "$as_me: checking whether we should enable debug features..." >&6;}
# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval=$enable_debug;
fi


if test "$enable_debug" = "yes" ; then
    CXXFLAGS=`echo "$CXXFLAGS " | sed 's/-O[123] / /'`
  CFLAGS=`echo "$CFLAGS " | sed 's/-O[123] / /'`

  REPORT_ENABLE_DEBUG="-g "
  { echo "$as_me:$LINENO: result:         Enabling debug features: -g in CFLAGS." >&5
echo "${ECHO_T}        Enabling debug features: -g in CFLAGS." >&6; }

else
  CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
  CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
fi

DEBUG_FLAGS=$DEBUG_FLAGS

ALL_ENABLED="$DEBUG_FLAGS $ALL_ENABLED"



# Check whether --enable-gcov was given.
if test "${enable_gcov+set}" = set; then
  enableval=$enable_gcov; CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
 PHP_LD_XTRAFLAGS="$PHP_LD_XTRAFLAGS -fprofile-arcs -ftest-coverage"
fi




{ echo "$as_me:$LINENO: checking for PHP/MapScript module options..." >&5
echo "$as_me: checking for PHP/MapScript module options..." >&6;}

# Check whether --with-php was given.
if test "${with_php+set}" = set; then
  withval=$with_php;
fi


# Check whether --enable-internal-ld-detect was given.
if test "${enable_internal_ld_detect+set}" = set; then
  enableval=$enable_internal_ld_detect;
fi


if test -n "$with_php" -a -d "$with_php" ; then

  if test -z "$with_php" || echo "$with_php" | grep '^/' >/dev/null ; then
    PHP_SRC_DIR="$with_php"
  else
    PHP_SRC_DIR="`pwd`/$with_php"
  fi


  if test "$enable_perlv_ld_detect" = "yes" ; then
      { echo "$as_me:$LINENO: result: Using perl -V macro to figure ld command to link php_mapscript.so" >&5
echo "${ECHO_T}Using perl -V macro to figure ld command to link php_mapscript.so" >&6; }

      { echo "$as_me:$LINENO: checking whether 'perl -V' works" >&5
echo $ECHO_N "checking whether 'perl -V' works... $ECHO_C" >&6; }
      if  (perl -V > /dev/null 2>&1)  ; then
        { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

#
# The following is a massive hack.  It tries to steal the
# mechanism for build a dynamic library from Perl's -V output
# If this script fails on this machine, try running 'perl -V'
# manually and pick out the setting for:
#
#    cc, optimize, ccflags, ld, cccdlflags and lddlflags
#
# Replace the below definitions with the output you see.
#

if test ! -r "perl.out"; then
	perl -V > perl.out
fi

# if the greps and cuts don't do the job, set these manually
PERL_CC="`grep ' cc=' perl.out | cut -d, -f1 | cut -d\' -f2 | grep -v undef`"
PERL_OPT="`grep ' optimize=' perl.out | cut -d, -f2 | cut -d\' -f2 | grep -v undef`"
PERL_CCFLAGS="`grep ' ccflags' perl.out | cut -d, -f1 | grep cflags | cut -d\' -f2 | grep -v undef` `grep ' ccflags' perl.out | cut -d, -f2 | grep ccflags | cut -d\' -f2 | grep -v undef`"
PERL_LD="`grep ' ld=' perl.out | cut -d, -f1 | cut -d\' -f2 | grep -v undef`"
PERL_LFLAGS="`grep ' cccdlflags=' perl.out | cut -d, -f1 | cut -d\' -f2 | grep -v undef`"
PERL_CCDLFLAGS="`grep ' ccdlflags=' perl.out | cut -d, -f4 | cut -d\' -f2 | sed 's, ,,' | grep -v undef`"
PERL_LDDLFLAGS=`grep ' lddlflags' perl.out | cut -d, -f2 | cut -d\' -f2 | grep -v undef`
#--------

#if test -n "$PERL_CCDLFLAGS" ; then
#	echo "-------------------------"
#	echo "----- IMPORTANT !!! -----"
#	echo "-------------------------"
#	echo "To use PHP extensions on your OS, you will need to recompile "
#	echo "PHP.                                                         "
#	echo "You need to edit the Makefile in the php3 directory and add  "
#	echo "$PERL_CCDLFLAGS to the start of the LDFLAGS line at the top  "
#	echo "of the Makefile.  Then type: 'make clean; make'              "
#	echo "You can still go ahead and build the extensions now by typing"
#	echo "'make' in this directory.  They just won't work correctly    "
#	echo "until you recompile your PHP.                                "
#        echo "If you are compiling php as a module, you should also add    "
#        echo "$PERL_CCDLFLAGS to the start of the EXTRA_LDFLAGS in Apache  "
#        echo "Configuration file.  Note that if you are using the APACI    "
#        echo "build mechanism you should make this change in the           "
#        echo "Configuration.tmpl file instead.                             "
#	echo "-------------------------"
#	echo "-------------------------"
#	echo "-------------------------"
#fi

PERL_CC="$PERL_CC $PERL_OPT $PERL_CCFLAGS -I. -I.. $PERL_LFLAGS"
PERL_LD="$PERL_LD $PERL_LDDLFLAGS $PERL_CCDLFLAGS"

rm -f perl.out


        PHP_CC="$PERL_CC"
        PHP_LD="$PERL_LD $PHP_LD_XTRAFLAGS"
      else
        { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
        { { echo "$as_me:$LINENO: error: ERROR: Cannot use --enable-perlv-ld-detect since Perl -V does not work on this system." >&5
echo "$as_me: error: ERROR: Cannot use --enable-perlv-ld-detect since Perl -V does not work on this system." >&2;}
   { (exit 1); exit 1; }; }
      fi
  else

	echo 'void f(){}' > conftest.c
	if test -z "`${CC} -fPIC -c conftest.c 2>&1`"; then
	  C_PIC=-fPIC
	else
	  C_PIC=
	fi
	rm -f conftest*

	C_PIC=$C_PIC







  echo 'void g(); int main(){ g(); return 0; }' > conftest1.c

  echo '#include <stdio.h>' > conftest2.c
  echo 'void g(); void g(){printf("");}' >> conftest2.c
  ${CC} ${C_PIC} -c conftest2.c
  SO_EXT="so"
  SO_COMMAND_NAME="-soname"
  export SO_EXT
  export SO_COMMAND_NAME
  LD_SHARED="/bin/true"
  if test ! -z "`uname -a | grep IRIX`" ; then
    IRIX_ALL=-all
  else
    IRIX_ALL=
  fi


# Check whether --with-ld-shared was given.
if test "${with_ld_shared+set}" = set; then
  withval=$with_ld_shared;
fi


      if test "$with_ld_shared" != "" -a "$with_ld_shared" != "yes"; then
    if test "$with_ld_shared" = "no" ; then
      { echo "$as_me:$LINENO: result: user disabled shared library support." >&5
echo "${ECHO_T}user disabled shared library support." >&6; }
    else
      { echo "$as_me:$LINENO: result: using user supplied .so link command ... $with_ld_shared" >&5
echo "${ECHO_T}using user supplied .so link command ... $with_ld_shared" >&6; }
    fi
    LD_SHARED="$with_ld_shared"
  fi

    if test ! -z "`uname -a | grep CYGWIN`" \
        -a "$LD_SHARED" = "/bin/true" ; then
    if test -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
      if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
        LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
        if test -z "$LD_LIBRARY_PATH" ; then
          LD_LIBRARY_PATH="`pwd`"
        else
          LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
        fi
        export LD_LIBRARY_PATH
        if test -z "`./conftest1 2>&1`" ; then
          echo "checking for Cygwin gcc -shared ... yes"
          LD_SHARED="c++ -shared"
          SO_EXT="dll"
        fi
        LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
      fi
    fi
  fi


    if test ! -z "`uname | grep Darwin`" \
          -a "$LD_SHARED" = "/bin/true" ; then
    if test -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
      ${CC} -c conftest1.c
      if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
        DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
        if test -z "$DYLD_LIBRARY_PATH" ; then
          DYLD_LIBRARY_PATH="`pwd`"
        else
          DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
        fi
        export DYLD_LIBRARY_PATH
        if test -z "`./conftest1 2>&1`" ; then
          echo "checking for ${CXX} -dynamiclib ... yes"
          LD_SHARED="${CXX} -dynamiclib -single_module -flat_namespace -undefined suppress"
	  SO_EXT=dylib
          SO_COMMAND_NAME='-dylib_install_name'
        fi
        DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
      fi
      rm -f conftest1.o
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" \
	-a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
      if test -z "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH="`pwd`"
      else
        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
      fi
      export LD_LIBRARY_PATH
      if test -z "`./conftest1 2>&1`" ; then
        echo "checking for ${CXX} -shared ... yes"
        LD_SHARED="${CXX} -shared $IRIX_ALL"
      else
        echo "checking for ${CXX} -shared ... no(3)"
      fi
      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
    else
      echo "checking for ${CXX} -shared ... no(2)"
    fi
  else
    if test "$LD_SHARED" = "/bin/true" ; then
      echo "checking for ${CXX} -shared ... no(1)"
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" \
          -a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
      if test -z "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH="`pwd`"
      else
        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
      fi
      export LD_LIBRARY_PATH
      if test -z "`./conftest1 2>&1`" ; then
        echo "checking for ld -shared ... yes"
        LD_SHARED="ld -shared"
      fi
      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" ; then
    echo "checking for ld -shared ... no"
    if test ! -x /bin/true ; then
      LD_SHARED=/usr/bin/true
    fi
  fi
  if test "$LD_SHARED" = "no" ; then
    if test -x /bin/true ; then
      LD_SHARED=/bin/true
    else
      LD_SHARED=/usr/bin/true
    fi
  fi

  rm -f conftest* libconftest*

  LD_SHARED=$LD_SHARED

  SO_EXT=$SO_EXT

  SO_COMMAND_NAME=$SO_COMMAND_NAME



    if test ! -z "`uname | grep Darwin`" ;then
          PHP_LD_SHARED="${CXX} -bundle -flat_namespace -undefined suppress"
  else
	  PHP_LD_SHARED=$LD_SHARED
  fi

export PHP_LD_SHARED
PHP_LD_SHARED=$PHP_LD_SHARED



    PHP_CC="$CC $C_PIC"
    PHP_LD="$PHP_LD_SHARED $PHP_LD_XTRAFLAGS"
  fi

          { echo "$as_me:$LINENO: checking for location of config.h or php_config.h" >&5
echo $ECHO_N "checking for location of config.h or php_config.h... $ECHO_C" >&6; }
    test -f "$PHP_SRC_DIR/config.h" && PHP_CONFIG_H="$PHP_SRC_DIR/config.h"

    test -f "$PHP_SRC_DIR/php_config.h" && PHP_CONFIG_H="$PHP_SRC_DIR/php_config.h"

    test -f "$PHP_SRC_DIR/main/php_config.h" && PHP_CONFIG_H="$PHP_SRC_DIR/main/php_config.h"

    test -f "$PHP_SRC_DIR/include/php/main/php_config.h" && PHP_SRC_DIR="$PHP_SRC_DIR/include/php/" && PHP_CONFIG_H="$PHP_SRC_DIR/main/php_config.h"

    test -f "$PHP_SRC_DIR/include/php5/main/php_config.h" && PHP_SRC_DIR="$PHP_SRC_DIR/include/php5/" && PHP_CONFIG_H="$PHP_SRC_DIR/main/php_config.h"

  if test -n "$PHP_CONFIG_H" ; then
    { echo "$as_me:$LINENO: result: $PHP_CONFIG_H" >&5
echo "${ECHO_T}$PHP_CONFIG_H" >&6; }
  else
    { { echo "$as_me:$LINENO: error:
!!! Could not find config.h or php_config.h in $PHP_SRC_DIR.          !!!
!!! Has PHP been configured yet?                                      !!!" >&5
echo "$as_me: error:
!!! Could not find config.h or php_config.h in $PHP_SRC_DIR.          !!!
!!! Has PHP been configured yet?                                      !!!" >&2;}
   { (exit 1); exit 1; }; }
  fi

          { echo "$as_me:$LINENO: checking whether we have PHP3 or PHP4" >&5
echo $ECHO_N "checking whether we have PHP3 or PHP4... $ECHO_C" >&6; }
  if test -n "`grep 'ZEND_API' $PHP_CONFIG_H`"  ; then
    PHP_VERSION_FLAG="-DPHP4"
  else
    PHP_VERSION_FLAG="-DPHP3"
    { { echo "$as_me:$LINENO: error:
!!! PHP MapScript now requires PHP 4.1.2 or more recent.              !!!
!!! Support for PHP3 has been dropped after MapServer version 3.5.    !!!" >&5
echo "$as_me: error:
!!! PHP MapScript now requires PHP 4.1.2 or more recent.              !!!
!!! Support for PHP3 has been dropped after MapServer version 3.5.    !!!" >&2;}
   { (exit 1); exit 1; }; }
  fi
  { echo "$as_me:$LINENO: result: $PHP_VERSION_FLAG" >&5
echo "${ECHO_T}$PHP_VERSION_FLAG" >&6; }

          { echo "$as_me:$LINENO: checking whether we should use PHP's regex" >&5
echo $ECHO_N "checking whether we should use PHP's regex... $ECHO_C" >&6; }
  if test -n "`grep 'define REGEX 1' $PHP_CONFIG_H`"  ; then
    { echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }

            test -f "$PHP_SRC_DIR/regex/regex_extra.h" && PHP_NO_SOURCE="1"
        if test -n "$PHP_NO_SOURCE" ; then
                    USE_PHP_REGEX="-DUSE_PHP_REGEX"
          PHP_REGEX_INC="$PHP_SRC_DIR/"
          PHP_REGEX_OBJ=php_regex.o
          { echo "$as_me:$LINENO: result:         found regex_extra.h - building PHP MapScript with PHP's bundled regex " >&5
echo "${ECHO_T}        found regex_extra.h - building PHP MapScript with PHP's bundled regex " >&6; }
        else
                    test -f "$PHP_SRC_DIR/ext/ereg/regex/regex.h" && PHP_NO_SOURCE="1"
          if test -n "$PHP_NO_SOURCE" ; then
                    USE_PHP_REGEX="-DUSE_PHP_REGEX"
          PHP_REGEX_INC="$PHP_SRC_DIR/ext/ereg/"
          PHP_REGEX_OBJ=php_regex.o
          { echo "$as_me:$LINENO: result:         found regex.h - building PHP MapScript with PHP's bundled regex " >&5
echo "${ECHO_T}        found regex.h - building PHP MapScript with PHP's bundled regex " >&6; }
          else
            { { echo "$as_me:$LINENO: error:
!!! PHP uses its bundled regex library but regex/regex_extra.h (PHP <=5.2) or !!!
!!! ext/ereg/regex/regex.h (PHP >=5.3) cannot be found.                                  !!!" >&5
echo "$as_me: error:
!!! PHP uses its bundled regex library but regex/regex_extra.h (PHP <=5.2) or !!!
!!! ext/ereg/regex/regex.h (PHP >=5.3) cannot be found.                                  !!!" >&2;}
   { (exit 1); exit 1; }; }
          fi
	fi

  else
    { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
  fi

  PHPMS_MAKEFILE=mapscript/php3/Makefile
  MAKE_PHPMS=php3_mapscript
  MAKE_PHPMS_CLEAN=php3_mapscript_clean

  PHP_VERSION_FLAG=$PHP_VERSION_FLAG

  PHP_SRC_DIR=$PHP_SRC_DIR

  PHP_CC=$PHP_CC

  PHP_LD=$PHP_LD

  PHP_REGEX_INC=$PHP_REGEX_INC

  PHP_REGEX_OBJ=$PHP_REGEX_OBJ

  USE_PHP_REGEX=$USE_PHP_REGEX


  { echo "$as_me:$LINENO: result:         PHP/MapScript module configured." >&5
echo "${ECHO_T}        PHP/MapScript module configured." >&6; }
elif test -n "$with_php" -a "$with_php" != "no" ; then
  { { echo "$as_me:$LINENO: error: Missing or invalid PHP source directory in --with-php=DIR." >&5
echo "$as_me: error: Missing or invalid PHP source directory in --with-php=DIR." >&2;}
   { (exit 1); exit 1; }; }
else
  { echo "$as_me:$LINENO: result:         PHP/MapScript module not configured." >&5
echo "${ECHO_T}        PHP/MapScript module not configured." >&6; }
fi

MAKE_PHPMS=$MAKE_PHPMS

MAKE_PHPMS_CLEAN=$MAKE_PHPMS_CLEAN



if test "x$LD_SHARED" = "x" ; then

	echo 'void f(){}' > conftest.c
	if test -z "`${CC} -fPIC -c conftest.c 2>&1`"; then
	  C_PIC=-fPIC
	else
	  C_PIC=
	fi
	rm -f conftest*

	C_PIC=$C_PIC




  echo 'void g(); int main(){ g(); return 0; }' > conftest1.c

  echo '#include <stdio.h>' > conftest2.c
  echo 'void g(); void g(){printf("");}' >> conftest2.c
  ${CC} ${C_PIC} -c conftest2.c
  SO_EXT="so"
  SO_COMMAND_NAME="-soname"
  export SO_EXT
  export SO_COMMAND_NAME
  LD_SHARED="/bin/true"
  if test ! -z "`uname -a | grep IRIX`" ; then
    IRIX_ALL=-all
  else
    IRIX_ALL=
  fi


# Check whether --with-ld-shared was given.
if test "${with_ld_shared+set}" = set; then
  withval=$with_ld_shared;
fi


      if test "$with_ld_shared" != "" -a "$with_ld_shared" != "yes"; then
    if test "$with_ld_shared" = "no" ; then
      { echo "$as_me:$LINENO: result: user disabled shared library support." >&5
echo "${ECHO_T}user disabled shared library support." >&6; }
    else
      { echo "$as_me:$LINENO: result: using user supplied .so link command ... $with_ld_shared" >&5
echo "${ECHO_T}using user supplied .so link command ... $with_ld_shared" >&6; }
    fi
    LD_SHARED="$with_ld_shared"
  fi

    if test ! -z "`uname -a | grep CYGWIN`" \
        -a "$LD_SHARED" = "/bin/true" ; then
    if test -z "`gcc -shared conftest2.o -o libconftest.dll`" ; then
      if test -z "`${CC} conftest1.c -L./ -lconftest -o conftest1 2>&1`"; then
        LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
        if test -z "$LD_LIBRARY_PATH" ; then
          LD_LIBRARY_PATH="`pwd`"
        else
          LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
        fi
        export LD_LIBRARY_PATH
        if test -z "`./conftest1 2>&1`" ; then
          echo "checking for Cygwin gcc -shared ... yes"
          LD_SHARED="c++ -shared"
          SO_EXT="dll"
        fi
        LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
      fi
    fi
  fi


    if test ! -z "`uname | grep Darwin`" \
          -a "$LD_SHARED" = "/bin/true" ; then
    if test -z "`${CXX} -dynamiclib conftest2.o -o libconftest.so 2>&1`" ; then
      ${CC} -c conftest1.c
      if test -z "`${CXX} conftest1.o libconftest.so -o conftest1 2>&1`"; then
        DYLD_LIBRARY_PATH_OLD="$DYLD_LIBRARY_PATH"
        if test -z "$DYLD_LIBRARY_PATH" ; then
          DYLD_LIBRARY_PATH="`pwd`"
        else
          DYLD_LIBRARY_PATH="`pwd`:$DYLD_LIBRARY_PATH"
        fi
        export DYLD_LIBRARY_PATH
        if test -z "`./conftest1 2>&1`" ; then
          echo "checking for ${CXX} -dynamiclib ... yes"
          LD_SHARED="${CXX} -dynamiclib -single_module -flat_namespace -undefined suppress"
	  SO_EXT=dylib
          SO_COMMAND_NAME='-dylib_install_name'
        fi
        DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH_OLD"
      fi
      rm -f conftest1.o
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" \
	-a -z "`${CXX} -shared $IRIX_ALL conftest2.o -o libconftest.so 2>&1|grep -v WARNING`" ; then
    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
      if test -z "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH="`pwd`"
      else
        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
      fi
      export LD_LIBRARY_PATH
      if test -z "`./conftest1 2>&1`" ; then
        echo "checking for ${CXX} -shared ... yes"
        LD_SHARED="${CXX} -shared $IRIX_ALL"
      else
        echo "checking for ${CXX} -shared ... no(3)"
      fi
      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
    else
      echo "checking for ${CXX} -shared ... no(2)"
    fi
  else
    if test "$LD_SHARED" = "/bin/true" ; then
      echo "checking for ${CXX} -shared ... no(1)"
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" \
          -a -z "`ld -shared conftest2.o -o libconftest.so 2>&1`" ; then
    if test -z "`${CC} conftest1.c libconftest.so -o conftest1 2>&1`"; then
      LD_LIBRARY_PATH_OLD="$LD_LIBRARY_PATH"
      if test -z "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH="`pwd`"
      else
        LD_LIBRARY_PATH="`pwd`:$LD_LIBRARY_PATH"
      fi
      export LD_LIBRARY_PATH
      if test -z "`./conftest1 2>&1`" ; then
        echo "checking for ld -shared ... yes"
        LD_SHARED="ld -shared"
      fi
      LD_LIBRARY_PATH="$LD_LIBRARY_PATH_OLD"
    fi
  fi

  if test "$LD_SHARED" = "/bin/true" ; then
    echo "checking for ld -shared ... no"
    if test ! -x /bin/true ; then
      LD_SHARED=/usr/bin/true
    fi
  fi
  if test "$LD_SHARED" = "no" ; then
    if test -x /bin/true ; then
      LD_SHARED=/bin/true
    else
      LD_SHARED=/usr/bin/true
    fi
  fi

  rm -f conftest* libconftest*

  LD_SHARED=$LD_SHARED

  SO_EXT=$SO_EXT

  SO_COMMAND_NAME=$SO_COMMAND_NAME


fi



# Check whether --with-apxs was given.
if test "${with_apxs+set}" = set; then
  withval=$with_apxs;
fi


if test -n "$with_apxs" -a "$with_apxs" != "no" ; then

  { { echo "$as_me:$LINENO: error:
!!! The current version of PHP MapScript requires PHP4 configured as  !!!
!!! a CGI and cannot be used with PHP4 configured as an Apache module,!!!
!!! so you cannot use the --with-apxs option.                         !!!
!!! See: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI !!!" >&5
echo "$as_me: error:
!!! The current version of PHP MapScript requires PHP4 configured as  !!!
!!! a CGI and cannot be used with PHP4 configured as an Apache module,!!!
!!! so you cannot use the --with-apxs option.                         !!!
!!! See: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI !!!" >&2;}
   { (exit 1); exit 1; }; }


  { echo "$as_me:$LINENO: checking for location of Apache headers using apxs" >&5
echo $ECHO_N "checking for location of Apache headers using apxs... $ECHO_C" >&6; }
  if test -z "$MAKE_PHPMS" ; then
    { { echo "$as_me:$LINENO: error: --with-apxs applies only if --with-php is used." >&5
echo "$as_me: error: --with-apxs applies only if --with-php is used." >&2;}
   { (exit 1); exit 1; }; }

  elif test "$with_apxs" = "yes" ; then
    APXS=apxs
  else
    APXS="$with_apxs"
  fi

  APACHE_INC=-I`$APXS -q INCLUDEDIR`
  { echo "$as_me:$LINENO: result: $APACHE_INC" >&5
echo "${ECHO_T}$APACHE_INC" >&6; }

    fi




# Check whether --with-apache was given.
if test "${with_apache+set}" = set; then
  withval=$with_apache;
fi


if test -n "$with_apache" -a "$with_apache" != "no" ; then

  { { echo "$as_me:$LINENO: error:
!!! The current version of PHP MapScript requires PHP4 configured as  !!!
!!! a CGI and cannot be used with PHP4 configured as an Apache module,!!!
!!! so you cannot use the --with-apache option.                       !!!
!!! See: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI !!!" >&5
echo "$as_me: error:
!!! The current version of PHP MapScript requires PHP4 configured as  !!!
!!! a CGI and cannot be used with PHP4 configured as an Apache module,!!!
!!! so you cannot use the --with-apache option.                       !!!
!!! See: http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptCGI !!!" >&2;}
   { (exit 1); exit 1; }; }

  { echo "$as_me:$LINENO: checking for location of Apache headers" >&5
echo $ECHO_N "checking for location of Apache headers... $ECHO_C" >&6; }
  if test -z "$MAKE_PHPMS" ; then
    { { echo "$as_me:$LINENO: error: --with-apache applies only if --with-php is used." >&5
echo "$as_me: error: --with-apache applies only if --with-php is used." >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test -z "$with_apache" || echo "$with_apache" | grep '^/' >/dev/null ; then
    APACHE_DIR="$with_apache"
  else
    APACHE_DIR="`pwd`/$with_apache"
  fi

  test -f $APACHE_DIR/httpd.h && APACHE_INC_DIR="$APACHE_DIR"
  test -f $APACHE_DIR/include/httpd.h && APACHE_INC_DIR="$APACHE_DIR/include"
  test -f $APACHE_DIR/src/include/httpd.h && APACHE_INC_DIR="$APACHE_DIR/src/include"
  if test -n "$APACHE_INC_DIR" ; then
    APACHE_INC="-I$APACHE_INC_DIR $APACHE_INC"
    { echo "$as_me:$LINENO: result: \"-I$APACHE_INC_DIR\"" >&5
echo "${ECHO_T}\"-I$APACHE_INC_DIR\"" >&6; }
  else
    { { echo "$as_me:$LINENO: error: \"Could not find httpd.h in $APACHE_DIR.\"" >&5
echo "$as_me: error: \"Could not find httpd.h in $APACHE_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi
fi

APACHE_INC=$APACHE_INC




{ echo "$as_me:$LINENO: checking if --enable-runpath requested" >&5
echo $ECHO_N "checking if --enable-runpath requested... $ECHO_C" >&6; }
# Check whether --enable-runpath was given.
if test "${enable_runpath+set}" = set; then
  enableval=$enable_runpath;
fi


if test "$enable_runpath" != "yes" ; then
  RPATHS=""
  { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
else
  { echo "$as_me:$LINENO: result: yes ($RPATHS)" >&5
echo "${ECHO_T}yes ($RPATHS)" >&6; }
fi


{ echo "$as_me:$LINENO: checking if --with-java-include-os-name specified" >&5
echo $ECHO_N "checking if --with-java-include-os-name specified... $ECHO_C" >&6; }

# Check whether --with-java-include-os-name was given.
if test "${with_java_include_os_name+set}" = set; then
  withval=$with_java_include_os_name;
fi

if test -n "${with_java_include_os_name}" ; then
OS_INCLUDE_DIR="${with_java_include_os_name}"
{ echo "$as_me:$LINENO: result: yes ($OS_INCLUDE_DIR)" >&5
echo "${ECHO_T}yes ($OS_INCLUDE_DIR)" >&6; }
else
OUR_OSNAME=`uname -s`
case "${OUR_OSNAME}" in
[Ll]inux) OS_INCLUDE_DIR="linux" ;;
[sS]olaris*) OS_INCLUDE_DIR="solaris" ;;
[sS]unOS*) OS_INCLUDE_DIR="solaris" ;;
[Ww]in*) OS_INCLUDE_DIR="win32" ;;
*) OS_INCLUDE_DIR="linux" ;;
esac
{ echo "$as_me:$LINENO: result: no, autodetected $OS_INCLUDE_DIR" >&5
echo "${ECHO_T}no, autodetected $OS_INCLUDE_DIR" >&6; }
fi

OS_INCLUDE_DIR=$OS_INCLUDE_DIR



ALL_ENABLED=$ALL_ENABLED

ALL_INC=$ALL_INC

ALL_LIB=$ALL_LIB

ALL_STATIC_LIB=$ALL_STATIC_LIB

RPATHS=$RPATHS


ac_config_files="$ac_config_files Makefile $PHPMS_MAKEFILE mapscript/java/Makefile mapscript/csharp/Makefile"

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
    eval ac_val=\$$ac_var
    case $ac_val in #(
    *${as_nl}*)
      case $ac_var in #(
      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
      esac
      case $ac_var in #(
      _ | IFS | as_nl) ;; #(
      *) $as_unset $ac_var ;;
      esac ;;
    esac
  done

  (set) 2>&1 |
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
    *${as_nl}ac_space=\ *)
      # `set' does not quote correctly, so add quotes (double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \).
      sed -n \
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
      ;; #(
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
      ;;
    esac |
    sort
) |
  sed '
     /^ac_cv_env_/b end
     t clear
     :clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     :end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  if test -w "$cache_file"; then
    test "x$cache_file" != "x/dev/null" &&
      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
echo "$as_me: updating cache $cache_file" >&6;}
    cat confcache >$cache_file
  else
    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
echo "$as_me: not updating unwritable cache $cache_file" >&6;}
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then branch to the quote section.  Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
t clear
:clear
s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
t quote
s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)/-D\1=\2/g
t quote
b any
:quote
s/[	 `~#$^&*(){}\\|;'\''"<>?]/\\&/g
s/\[/\\&/g
s/\]/\\&/g
s/\$/$$/g
H
:any
${
	g
	s/^\n//
	s/\n/ /g
	p
}
'
DEFS=`sed -n "$ac_script" confdefs.h`


ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
  ac_i=`echo "$ac_i" | sed "$ac_script"`
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
  #    will be set to the directory where LIBOBJS objects are built.
  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs

LTLIBOBJS=$ac_ltlibobjs



: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in
  *posix*) set -o posix ;;
esac

fi




# PATH needs CR
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi

# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
as_nl='
'
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
case $0 in
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  { (exit 1); exit 1; }
fi

# Work around bugs in pre-3.0 UWIN ksh.
for as_var in ENV MAIL MAILPATH
do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
for as_var in \
  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  LC_TELEPHONE LC_TIME
do
  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
    eval $as_var=C; export $as_var
  else
    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi


# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

# CDPATH.
$as_unset CDPATH



  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line after each line using $LINENO; the second 'sed'
  # does the real work.  The second script uses 'N' to pair each
  # line-number line with the line containing $LINENO, and appends
  # trailing '-' during substitution so that $LINENO is not a special
  # case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # scripts with optimization help from Paolo Bonzini.  Blame Lee
  # E. McMahon (1931-1989) for sed's syntax.  :-)
  sed -n '
    p
    /[$]LINENO/=
  ' <$as_myself |
    sed '
      s/[$]LINENO.*/&-/
      t lineno
      b
      :lineno
      N
      :loop
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
      t loop
      s/-\n.*//
    ' >$as_me.lineno &&
  chmod +x "$as_me.lineno" ||
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensitive to this).
  . "./$as_me.lineno"
  # Exit status is that of the last command.
  exit
}


if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in
-n*)
  case `echo 'x\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  *)   ECHO_C='\c';;
  esac;;
*)
  ECHO_N='-n';;
esac

if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir
fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  as_ln_s='ln -s'
  # ... but there are two gotchas:
  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
  # In both cases, we have to default to `cp -p'.
  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null

if mkdir -p . 2>/dev/null; then
  as_mkdir_p=:
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

if test -x / >/dev/null 2>&1; then
  as_test_x='test -x'
else
  if ls -dL / >/dev/null 2>&1; then
    as_ls_L_option=L
  else
    as_ls_L_option=
  fi
  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
        test -d "$1/.";
      else
	case $1 in
        -*)set "./$1";;
	esac;
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
	???[sx]*):;;*)false;;esac;fi
    '\'' sh
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


exec 6>&1

# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by $as_me, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

on `(hostname || uname -n) 2>/dev/null | sed 1q`
"

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
config_files="$ac_config_files"

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.

Usage: $0 [OPTIONS] [FILE]...

  -h, --help       print this help, then exit
  -V, --version    print version number and configuration settings, then exit
  -q, --quiet      do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
  --file=FILE[:TEMPLATE]
		   instantiate the configuration file FILE

Configuration files:
$config_files

Report bugs to <bug-autoconf@gnu.org>."

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
configured by $0, generated by GNU Autoconf 2.61,
  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='$ac_pwd'
srcdir='$srcdir'
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
# If no file are specified by the user, then we need to provide default
# value.  By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=*)
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  *)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  esac

  case $ac_option in
  # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    echo "$ac_cs_version"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
    ac_need_defaults=false;;
  --he | --h |  --help | --hel | -h )
    echo "$ac_cs_usage"; exit ;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) { echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2
   { (exit 1); exit 1; }; } ;;

  *) ac_config_targets="$ac_config_targets $1"
     ac_need_defaults=false ;;

  esac
  shift
done

ac_configure_extra_args=

if $ac_cs_silent; then
  exec 6>/dev/null
  ac_configure_extra_args="$ac_configure_extra_args --silent"
fi

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
  CONFIG_SHELL=$SHELL
  export CONFIG_SHELL
  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
  echo "$ac_log"
} >&5

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF

# Handling of arguments.
for ac_config_target in $ac_config_targets
do
  case $ac_config_target in
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
    "$PHPMS_MAKEFILE") CONFIG_FILES="$CONFIG_FILES $PHPMS_MAKEFILE" ;;
    "mapscript/java/Makefile") CONFIG_FILES="$CONFIG_FILES mapscript/java/Makefile" ;;
    "mapscript/csharp/Makefile") CONFIG_FILES="$CONFIG_FILES mapscript/csharp/Makefile" ;;

  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
   { (exit 1); exit 1; }; };;
  esac
done


# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
  tmp=
  trap 'exit_status=$?
  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
' 0
  trap '{ (exit 1); exit 1; }' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.

{
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=./conf$$-$RANDOM
  (umask 077 && mkdir "$tmp")
} ||
{
   echo "$me: cannot create a temporary directory in ." >&2
   { (exit 1); exit 1; }
}

#
# Set up the sed scripts for CONFIG_FILES section.
#

# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
if test -n "$CONFIG_FILES"; then

_ACEOF



ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
  cat >conf$$subs.sed <<_ACEOF
SHELL!$SHELL$ac_delim
PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
PACKAGE_NAME!$PACKAGE_NAME$ac_delim
PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
PACKAGE_STRING!$PACKAGE_STRING$ac_delim
PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
exec_prefix!$exec_prefix$ac_delim
prefix!$prefix$ac_delim
program_transform_name!$program_transform_name$ac_delim
bindir!$bindir$ac_delim
sbindir!$sbindir$ac_delim
libexecdir!$libexecdir$ac_delim
datarootdir!$datarootdir$ac_delim
datadir!$datadir$ac_delim
sysconfdir!$sysconfdir$ac_delim
sharedstatedir!$sharedstatedir$ac_delim
localstatedir!$localstatedir$ac_delim
includedir!$includedir$ac_delim
oldincludedir!$oldincludedir$ac_delim
docdir!$docdir$ac_delim
infodir!$infodir$ac_delim
htmldir!$htmldir$ac_delim
dvidir!$dvidir$ac_delim
pdfdir!$pdfdir$ac_delim
psdir!$psdir$ac_delim
libdir!$libdir$ac_delim
localedir!$localedir$ac_delim
mandir!$mandir$ac_delim
DEFS!$DEFS$ac_delim
ECHO_C!$ECHO_C$ac_delim
ECHO_N!$ECHO_N$ac_delim
ECHO_T!$ECHO_T$ac_delim
LIBS!$LIBS$ac_delim
build_alias!$build_alias$ac_delim
host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
LDFLAGS!$LDFLAGS$ac_delim
CPPFLAGS!$CPPFLAGS$ac_delim
ac_ct_CC!$ac_ct_CC$ac_delim
EXEEXT!$EXEEXT$ac_delim
OBJEXT!$OBJEXT$ac_delim
CXX!$CXX$ac_delim
CXXFLAGS!$CXXFLAGS$ac_delim
ac_ct_CXX!$ac_ct_CXX$ac_delim
RANLIB!$RANLIB$ac_delim
LEX!$LEX$ac_delim
LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim
LEXLIB!$LEXLIB$ac_delim
YACC!$YACC$ac_delim
YFLAGS!$YFLAGS$ac_delim
XTRALIBS!$XTRALIBS$ac_delim
CPP!$CPP$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
C_PIC!$C_PIC$ac_delim
STRINGS!$STRINGS$ac_delim
MS_VERSION!$MS_VERSION$ac_delim
PKG_CONFIG!$PKG_CONFIG$ac_delim
FT_BIN!$FT_BIN$ac_delim
ZLIB_ENABLED!$ZLIB_ENABLED$ac_delim
ZLIB_INC!$ZLIB_INC$ac_delim
ZLIB_LIB!$ZLIB_LIB$ac_delim
JPEG_ENABLED!$JPEG_ENABLED$ac_delim
JPEG_INC!$JPEG_INC$ac_delim
JPEG_LIB!$JPEG_LIB$ac_delim
ICONV_ENABLED!$ICONV_ENABLED$ac_delim
ICONV_INC!$ICONV_INC$ac_delim
ICONV_LIB!$ICONV_LIB$ac_delim
GD_DEF!$GD_DEF$ac_delim
GD_INC!$GD_INC$ac_delim
GD_LIB!$GD_LIB$ac_delim
GD_STATIC!$GD_STATIC$ac_delim
MAKE_GD!$MAKE_GD$ac_delim
MAKE_GD_CLEAN!$MAKE_GD_CLEAN$ac_delim
PDF_ENABLED!$PDF_ENABLED$ac_delim
PDF_INC!$PDF_INC$ac_delim
PDF_LIB!$PDF_LIB$ac_delim
FTGL_ENABLED!$FTGL_ENABLED$ac_delim
FTGL_INC!$FTGL_INC$ac_delim
FTGL_LIB!$FTGL_LIB$ac_delim
OGL_ENABLED!$OGL_ENABLED$ac_delim
OGL_INC!$OGL_INC$ac_delim
OGL_LIB!$OGL_LIB$ac_delim
AGG_ENABLED!$AGG_ENABLED$ac_delim
AGG_INC!$AGG_INC$ac_delim
AGG_OBJ!$AGG_OBJ$ac_delim
RGBA_PNG_ENABLED!$RGBA_PNG_ENABLED$ac_delim
PNG_INC!$PNG_INC$ac_delim
PNG_LIB!$PNG_LIB$ac_delim
EPPL_ENABLED!$EPPL_ENABLED$ac_delim
EPPL_OBJ!$EPPL_OBJ$ac_delim
PROJ_ENABLED!$PROJ_ENABLED$ac_delim
PROJ_INC!$PROJ_INC$ac_delim
PROJ_LIBS!$PROJ_LIBS$ac_delim
_ACEOF

  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
    break
  elif $ac_last_try; then
    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
   { (exit 1); exit 1; }; }
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
  ac_eof=`expr $ac_eof + 1`
fi

cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
s/^/s,@/; s/!/@,|#_!!_#|/
:n
t n
s/'"$ac_delim"'$/,g/; t
s/$/\\/; p
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
CEOF$ac_eof
_ACEOF


ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
  cat >conf$$subs.sed <<_ACEOF
THREAD_FLAG!$THREAD_FLAG$ac_delim
THREAD_LIB!$THREAD_LIB$ac_delim
SDE_ENABLED!$SDE_ENABLED$ac_delim
SDE_INC!$SDE_INC$ac_delim
SDE_LIB!$SDE_LIB$ac_delim
GEOS_CONFIG!$GEOS_CONFIG$ac_delim
GEOS_ENABLED!$GEOS_ENABLED$ac_delim
GEOS_INC!$GEOS_INC$ac_delim
GEOS_LIB!$GEOS_LIB$ac_delim
GDAL_CONFIG!$GDAL_CONFIG$ac_delim
GDAL_ENABLED!$GDAL_ENABLED$ac_delim
OGR_ENABLED!$OGR_ENABLED$ac_delim
GDAL_INC!$GDAL_INC$ac_delim
GDAL_LIB!$GDAL_LIB$ac_delim
TIFF_ENABLED!$TIFF_ENABLED$ac_delim
TIFF_INC!$TIFF_INC$ac_delim
TIFF_LIB!$TIFF_LIB$ac_delim
PG_CONFIG!$PG_CONFIG$ac_delim
POSTGIS_ENABLED!$POSTGIS_ENABLED$ac_delim
POSTGIS_INC!$POSTGIS_INC$ac_delim
POSTGIS_LIB!$POSTGIS_LIB$ac_delim
MY_CONFIG!$MY_CONFIG$ac_delim
MYGIS_ENABLED!$MYGIS_ENABLED$ac_delim
MYGIS_INC!$MYGIS_INC$ac_delim
MYGIS_LIB!$MYGIS_LIB$ac_delim
ORACLESPATIAL_ENABLED!$ORACLESPATIAL_ENABLED$ac_delim
ORACLESPATIAL_INC!$ORACLESPATIAL_INC$ac_delim
ORACLESPATIAL_LIB!$ORACLESPATIAL_LIB$ac_delim
MING_ENABLED!$MING_ENABLED$ac_delim
MING_INC!$MING_INC$ac_delim
MING_LIB!$MING_LIB$ac_delim
WMS_SVR_ENABLED!$WMS_SVR_ENABLED$ac_delim
WFS_SVR_ENABLED!$WFS_SVR_ENABLED$ac_delim
WCS_SVR_ENABLED!$WCS_SVR_ENABLED$ac_delim
LIBCURL_CONFIG!$LIBCURL_CONFIG$ac_delim
CURL_INC!$CURL_INC$ac_delim
CURL_LIB!$CURL_LIB$ac_delim
LIBXML2_CONFIG!$LIBXML2_CONFIG$ac_delim
XML2_INC!$XML2_INC$ac_delim
XML2_LIB!$XML2_LIB$ac_delim
WMS_LYR_ENABLED!$WMS_LYR_ENABLED$ac_delim
WFS_LYR_ENABLED!$WFS_LYR_ENABLED$ac_delim
SOS_SVR_ENABLED!$SOS_SVR_ENABLED$ac_delim
FRIBIDI_CONFIG!$FRIBIDI_CONFIG$ac_delim
FRIBIDI_ENABLED!$FRIBIDI_ENABLED$ac_delim
FRIBIDI_INC!$FRIBIDI_INC$ac_delim
FRIBIDI_LIB!$FRIBIDI_LIB$ac_delim
CAIRO_ENABLED!$CAIRO_ENABLED$ac_delim
CAIRO_INC!$CAIRO_INC$ac_delim
CAIRO_LIB!$CAIRO_LIB$ac_delim
FASTCGI_ENABLED!$FASTCGI_ENABLED$ac_delim
FASTCGI_INC!$FASTCGI_INC$ac_delim
FASTCGI_LIB!$FASTCGI_LIB$ac_delim
HTTPD!$HTTPD$ac_delim
MS_INC!$MS_INC$ac_delim
MS_LIB!$MS_LIB$ac_delim
IGNORE_MISSING_DATA!$IGNORE_MISSING_DATA$ac_delim
USE_POINT_Z_M!$USE_POINT_Z_M$ac_delim
USE_NINT!$USE_NINT$ac_delim
DEBUG_FLAGS!$DEBUG_FLAGS$ac_delim
LD_SHARED!$LD_SHARED$ac_delim
SO_EXT!$SO_EXT$ac_delim
SO_COMMAND_NAME!$SO_COMMAND_NAME$ac_delim
PHP_LD_SHARED!$PHP_LD_SHARED$ac_delim
PHP_VERSION_FLAG!$PHP_VERSION_FLAG$ac_delim
PHP_SRC_DIR!$PHP_SRC_DIR$ac_delim
PHP_CC!$PHP_CC$ac_delim
PHP_LD!$PHP_LD$ac_delim
PHP_REGEX_INC!$PHP_REGEX_INC$ac_delim
PHP_REGEX_OBJ!$PHP_REGEX_OBJ$ac_delim
USE_PHP_REGEX!$USE_PHP_REGEX$ac_delim
MAKE_PHPMS!$MAKE_PHPMS$ac_delim
MAKE_PHPMS_CLEAN!$MAKE_PHPMS_CLEAN$ac_delim
APACHE_INC!$APACHE_INC$ac_delim
OS_INCLUDE_DIR!$OS_INCLUDE_DIR$ac_delim
ALL_ENABLED!$ALL_ENABLED$ac_delim
ALL_INC!$ALL_INC$ac_delim
ALL_LIB!$ALL_LIB$ac_delim
ALL_STATIC_LIB!$ALL_STATIC_LIB$ac_delim
RPATHS!$RPATHS$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
    break
  elif $ac_last_try; then
    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
   { (exit 1); exit 1; }; }
  else
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  fi
done

ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
if test -n "$ac_eof"; then
  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
  ac_eof=`expr $ac_eof + 1`
fi

cat >>$CONFIG_STATUS <<_ACEOF
cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
_ACEOF
sed '
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
s/^/s,@/; s/!/@,|#_!!_#|/
:n
t n
s/'"$ac_delim"'$/,g/; t
s/$/\\/; p
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
' >>$CONFIG_STATUS <conf$$subs.sed
rm -f conf$$subs.sed
cat >>$CONFIG_STATUS <<_ACEOF
:end
s/|#_!!_#|//g
CEOF$ac_eof
_ACEOF


# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
s/:*\$(srcdir):*/:/
s/:*\${srcdir}:*/:/
s/:*@srcdir@:*/:/
s/^\([^=]*=[	 ]*\):*/\1/
s/:*$//
s/^[^=]*=[	 ]*$//
}'
fi

cat >>$CONFIG_STATUS <<\_ACEOF
fi # test -n "$CONFIG_FILES"


for ac_tag in  :F $CONFIG_FILES
do
  case $ac_tag in
  :[FHLC]) ac_mode=$ac_tag; continue;;
  esac
  case $ac_mode$ac_tag in
  :[FHL]*:*);;
  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
echo "$as_me: error: Invalid tag $ac_tag." >&2;}
   { (exit 1); exit 1; }; };;
  :[FH]-) ac_tag=-:-;;
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
  esac
  ac_save_IFS=$IFS
  IFS=:
  set x $ac_tag
  IFS=$ac_save_IFS
  shift
  ac_file=$1
  shift

  case $ac_mode in
  :L) ac_source=$1;;
  :[FH])
    ac_file_inputs=
    for ac_f
    do
      case $ac_f in
      -) ac_f="$tmp/stdin";;
      *) # Look for the file first in the build tree, then in the source tree
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
	 # because $ac_f cannot contain `:'.
	 test -f "$ac_f" ||
	   case $ac_f in
	   [\\/$]*) false;;
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
	   esac ||
	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
echo "$as_me: error: cannot find input file: $ac_f" >&2;}
   { (exit 1); exit 1; }; };;
      esac
      ac_file_inputs="$ac_file_inputs $ac_f"
    done

    # Let's still pretend it is `configure' which instantiates (i.e., don't
    # use $as_me), people would be surprised to read:
    #    /* config.h.  Generated by config.status.  */
    configure_input="Generated from "`IFS=:
	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
    if test x"$ac_file" != x-; then
      configure_input="$ac_file.  $configure_input"
      { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
    fi

    case $ac_tag in
    *:-:* | *:-) cat >"$tmp/stdin";;
    esac
    ;;
  esac

  ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
  { as_dir="$ac_dir"
  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
echo "$as_me: error: cannot create directory $as_dir" >&2;}
   { (exit 1); exit 1; }; }; }
  ac_builddir=.

case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A ".." for each directory in $ac_dir_suffix.
  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
  case $ac_top_builddir_sub in
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix

case $srcdir in
  .)  # We are building in place.
    ac_srcdir=.
    ac_top_srcdir=$ac_top_builddir_sub
    ac_abs_top_srcdir=$ac_pwd ;;
  [\\/]* | ?:[\\/]* )  # Absolute name.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir
    ac_abs_top_srcdir=$srcdir ;;
  *) # Relative name.
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_build_prefix$srcdir
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix


  case $ac_mode in
  :F)
  #
  # CONFIG_FILE
  #

_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=

case `sed -n '/datarootdir/ {
  p
  q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p
' $ac_file_inputs` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
  ac_datarootdir_hack='
  s&@datadir@&$datadir&g
  s&@docdir@&$docdir&g
  s&@infodir@&$infodir&g
  s&@localedir@&$localedir&g
  s&@mandir@&$mandir&g
    s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF

# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF
  sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s&@configure_input@&$configure_input&;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
$ac_datarootdir_hack
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out

test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined." >&5
echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined.  Please make sure it is defined." >&2;}

  rm -f "$tmp/stdin"
  case $ac_file in
  -) cat "$tmp/out"; rm -f "$tmp/out";;
  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
  esac
 ;;



  esac

done # for ac_tag


{ (exit 0); exit 0; }
_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  ac_config_status_args=
  test "$silent" = yes &&
    ac_config_status_args="$ac_config_status_args --quiet"
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || { (exit 1); exit 1; }
fi




{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }
{ echo "$as_me:$LINENO: result: MapServer is now configured for ${host}" >&5
echo "${ECHO_T}MapServer is now configured for ${host}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }
{ echo "$as_me:$LINENO: result:  -------------- Compiler Info ------------- " >&5
echo "${ECHO_T} -------------- Compiler Info ------------- " >&6; }
{ echo "$as_me:$LINENO: result:   C compiler:                ${CC} ${CFLAGS}" >&5
echo "${ECHO_T}  C compiler:                ${CC} ${CFLAGS}" >&6; }
{ echo "$as_me:$LINENO: result:   C++ compiler:              ${CXX} ${CXXFLAGS}" >&5
echo "${ECHO_T}  C++ compiler:              ${CXX} ${CXXFLAGS}" >&6; }
{ echo "$as_me:$LINENO: result:   Debug:                     ${REPORT_ENABLE_DEBUG}${DEBUG_FLAGS}" >&5
echo "${ECHO_T}  Debug:                     ${REPORT_ENABLE_DEBUG}${DEBUG_FLAGS}" >&6; }
{ echo "$as_me:$LINENO: result:   Generic NINT:              ${USE_NINT}" >&5
echo "${ECHO_T}  Generic NINT:              ${USE_NINT}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }
{ echo "$as_me:$LINENO: result:  -------------- Renderer Settings --------- " >&5
echo "${ECHO_T} -------------- Renderer Settings --------- " >&6; }
{ echo "$as_me:$LINENO: result:   OpenGL support:            ${OGL_ENABLED}" >&5
echo "${ECHO_T}  OpenGL support:            ${OGL_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   zlib support:              ${ZLIB_ENABLED}" >&5
echo "${ECHO_T}  zlib support:              ${ZLIB_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   png support:               ${PNG_SETTING}" >&5
echo "${ECHO_T}  png support:               ${PNG_SETTING}" >&6; }
{ echo "$as_me:$LINENO: result:   palette rgba png support:  ${RGBA_PNG_ENABLED}" >&5
echo "${ECHO_T}  palette rgba png support:  ${RGBA_PNG_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   jpeg support:              ${JPEG_ENABLED}" >&5
echo "${ECHO_T}  jpeg support:              ${JPEG_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   iconv support:             ${ICONV_ENABLED}" >&5
echo "${ECHO_T}  iconv support:             ${ICONV_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   AGG support:               ${AGG_ENABLED}" >&5
echo "${ECHO_T}  AGG support:               ${AGG_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Cairo (SVG,PDF) support:   ${CAIRO_ENABLED}" >&5
echo "${ECHO_T}  Cairo (SVG,PDF) support:   ${CAIRO_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Ming(flash) support:       ${MING_ENABLED}" >&5
echo "${ECHO_T}  Ming(flash) support:       ${MING_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   PDFLib support:            ${PDF_ENABLED}" >&5
echo "${ECHO_T}  PDFLib support:            ${PDF_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }

{ echo "$as_me:$LINENO: result:  -------------- Support Libraries --------- " >&5
echo "${ECHO_T} -------------- Support Libraries --------- " >&6; }
{ echo "$as_me:$LINENO: result:   Proj.4 support:            ${PROJ_ENABLED}" >&5
echo "${ECHO_T}  Proj.4 support:            ${PROJ_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Libxml2 support:           ${XML2_ENABLED}" >&5
echo "${ECHO_T}  Libxml2 support:           ${XML2_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   FriBidi support:           ${FRIBIDI_ENABLED}" >&5
echo "${ECHO_T}  FriBidi support:           ${FRIBIDI_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Curl support:              ${CURL_ENABLED}" >&5
echo "${ECHO_T}  Curl support:              ${CURL_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   FastCGI support:           ${FASTCGI_ENABLED}" >&5
echo "${ECHO_T}  FastCGI support:           ${FASTCGI_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Threading support:         ${THREAD_FLAG}" >&5
echo "${ECHO_T}  Threading support:         ${THREAD_FLAG}" >&6; }
{ echo "$as_me:$LINENO: result:   GEOS support:              ${GEOS_ENABLED}" >&5
echo "${ECHO_T}  GEOS support:              ${GEOS_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }

{ echo "$as_me:$LINENO: result:  -------------- Data Format Drivers ------- " >&5
echo "${ECHO_T} -------------- Data Format Drivers ------- " >&6; }
{ echo "$as_me:$LINENO: result:   native tiff support:       ${TIFF_ENABLED}" >&5
echo "${ECHO_T}  native tiff support:       ${TIFF_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   PostGIS support:           ${POSTGIS_ENABLED}" >&5
echo "${ECHO_T}  PostGIS support:           ${POSTGIS_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   EPPL7 support:             ${EPPL_ENABLED}" >&5
echo "${ECHO_T}  EPPL7 support:             ${EPPL_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   ArcSDE support:            ${SDE_ENABLED}" >&5
echo "${ECHO_T}  ArcSDE support:            ${SDE_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   OGR support:               ${OGR_ENABLED}" >&5
echo "${ECHO_T}  OGR support:               ${OGR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   GDAL support:              ${GDAL_ENABLED}" >&5
echo "${ECHO_T}  GDAL support:              ${GDAL_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   Oracle Spatial support:    ${ORACLESPATIAL_ENABLED}" >&5
echo "${ECHO_T}  Oracle Spatial support:    ${ORACLESPATIAL_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }

{ echo "$as_me:$LINENO: result:  -------------- OGC Services -------------- " >&5
echo "${ECHO_T} -------------- OGC Services -------------- " >&6; }
{ echo "$as_me:$LINENO: result:   WMS Server:                ${WMS_SVR_ENABLED}" >&5
echo "${ECHO_T}  WMS Server:                ${WMS_SVR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   WMS Client:                ${WMS_LYR_ENABLED}" >&5
echo "${ECHO_T}  WMS Client:                ${WMS_LYR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   WFS Server:                ${WFS_SVR_ENABLED}" >&5
echo "${ECHO_T}  WFS Server:                ${WFS_SVR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   WFS Client:                ${WMS_LYR_ENABLED}" >&5
echo "${ECHO_T}  WFS Client:                ${WMS_LYR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   WCS Server:                ${WCS_SVR_ENABLED}" >&5
echo "${ECHO_T}  WCS Server:                ${WCS_SVR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result:   SOS Server:                ${SOS_SVR_ENABLED}" >&5
echo "${ECHO_T}  SOS Server:                ${SOS_SVR_ENABLED}" >&6; }
{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }

{ echo "$as_me:$LINENO: result:  -------------- MapScript ----------------- " >&5
echo "${ECHO_T} -------------- MapScript ----------------- " >&6; }
if test -n "${PHP_SRC_DIR}"; then
  { echo "$as_me:$LINENO: result:   PHP MapScript:             yes" >&5
echo "${ECHO_T}  PHP MapScript:             yes" >&6; }
else
  { echo "$as_me:$LINENO: result:   PHP MapScript:             no" >&5
echo "${ECHO_T}  PHP MapScript:             no" >&6; }
fi

{ echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6; }