#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
# Copyright (C) 2003 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 Bourne compatible
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+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi
DUALCASE=1; export DUALCASE # for MKS sh

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


# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
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
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; 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'`


# PATH needs CR, and LINENO needs CR and PATH.
# 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


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  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

       ;;
  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_me: error: cannot find myself; rerun with an absolute path" >&2
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    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=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # 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 before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, 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
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\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 sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
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$$.file

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

as_executable_p="test -f"

# 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'"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH


# 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`

exec 6>&1

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

# Maximum number of lines to put in a shell here document.
# This variable seems obsolete.  It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}

# 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>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
# if HAVE_STDINT_H
#  include <stdint.h>
# endif
#endif
#if 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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX RANLIB ac_ct_RANLIB LEX LEXLIB LEX_OUTPUT_ROOT YACC XTRALIBS CPP EGREP C_PIC STRINGS MS_VERSION PKG_CONFIG FT_BIN FT_ENABLED FT_INC FT_LIB ZLIB_ENABLED ZLIB_INC ZLIB_LIB PNG_ENABLED PNG_INC PNG_LIB GIF_ENABLED GIF_INC GIF_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 FTGL_ENABLED FTGL_INC FTGL_LIB OGL_ENABLED OGL_INC OGL_LIB AGG_LIB AGG_INC AGG_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 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 XSLT_ENABLED XSLT_INC XSLT_LIB EXSLT_ENABLED EXSLT_INC EXSLT_LIB 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=''

# 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.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

ac_prev=
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

  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`

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

  case $ac_option in

  -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 | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir=$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" ;;

  -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'`
    case $ac_option in
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
      *) ac_optarg=yes ;;
    esac
    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 ;;

  -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 ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    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 ;;

  -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'`
    case $ac_option in
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
      *) ac_optarg=yes ;;
    esac
    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; }; }
    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
    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 paths.
for ac_var in exec_prefix prefix
do
  eval ac_val=$`echo $ac_var`
  case $ac_val in
    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; };;
  esac
done

# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
	      localstatedir libdir includedir oldincludedir infodir mandir
do
  eval ac_val=$`echo $ac_var`
  case $ac_val in
    [\\/$]* | ?:[\\/]* ) ;;
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; };;
  esac
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


# 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 its parent.
  ac_confdir=`(dirname "$0") 2>/dev/null ||
$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
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
   { (exit 1); exit 1; }; }
  else
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
   { (exit 1); exit 1; }; }
  fi
fi
(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
   { (exit 1); exit 1; }; }
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
ac_env_build_alias_set=${build_alias+set}
ac_env_build_alias_value=$build_alias
ac_cv_env_build_alias_set=${build_alias+set}
ac_cv_env_build_alias_value=$build_alias
ac_env_host_alias_set=${host_alias+set}
ac_env_host_alias_value=$host_alias
ac_cv_env_host_alias_set=${host_alias+set}
ac_cv_env_host_alias_value=$host_alias
ac_env_target_alias_set=${target_alias+set}
ac_env_target_alias_value=$target_alias
ac_cv_env_target_alias_set=${target_alias+set}
ac_cv_env_target_alias_value=$target_alias
ac_env_CC_set=${CC+set}
ac_env_CC_value=$CC
ac_cv_env_CC_set=${CC+set}
ac_cv_env_CC_value=$CC
ac_env_CFLAGS_set=${CFLAGS+set}
ac_env_CFLAGS_value=$CFLAGS
ac_cv_env_CFLAGS_set=${CFLAGS+set}
ac_cv_env_CFLAGS_value=$CFLAGS
ac_env_LDFLAGS_set=${LDFLAGS+set}
ac_env_LDFLAGS_value=$LDFLAGS
ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
ac_cv_env_LDFLAGS_value=$LDFLAGS
ac_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_env_CPPFLAGS_value=$CPPFLAGS
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
ac_env_CXX_set=${CXX+set}
ac_env_CXX_value=$CXX
ac_cv_env_CXX_set=${CXX+set}
ac_cv_env_CXX_value=$CXX
ac_env_CXXFLAGS_set=${CXXFLAGS+set}
ac_env_CXXFLAGS_value=$CXXFLAGS
ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
ac_cv_env_CXXFLAGS_value=$CXXFLAGS
ac_env_CPP_set=${CPP+set}
ac_env_CPP_value=$CPP
ac_cv_env_CPP_set=${CPP+set}
ac_cv_env_CPP_value=$CPP

#
# 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 \`..']

_ACEOF

  cat <<_ACEOF
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]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --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]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]
_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-cgi-cl-debug-args
                          Enable mapserv CGI command-line debug arguments
                          (disabled by default). These command-line args may
                          be insecure and should be enabled only on
                          development servers and only if you understand the
                          security implications.
  --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-gif=DIR          Specify where GIF is installed (DIR is path to
                              GIF 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).
  --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-expat=DIR          Specify expat location, needed for SVG symbol parsing
  --with-agg-svg-symbols[=yes/no]
                          Include AGG SVG symbol support (Requires expat).
  --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)
  --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, libcurl and
                          GDAL 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-kml=                KML output Support (ARG=yes/no).
  --with-xml2-config=PATH Specify path to xml2-config.
  --with-xml-mapfile=                Include xml-mapfile Support (ARG=yes/no).
  --with-xslt=DIR         Include xslt Support (ARG=yes/path to
                          to xslt install dir).
  --with-exslt=DIR         Include exslt Support (ARG=yes/path to
                           to exslt install dir).
  --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 PHP5'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>
  CPPFLAGS    C/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
  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
fi

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

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac

# Do not use `cd foo && pwd` to compute absolute paths, because
# the directories may not exist.
case `pwd` in
.) ac_abs_builddir="$ac_dir";;
*)
  case "$ac_dir" in
  .) ac_abs_builddir=`pwd`;;
  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_builddir=${ac_top_builddir}.;;
*)
  case ${ac_top_builddir}. in
  .) ac_abs_top_builddir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_srcdir=$ac_srcdir;;
*)
  case $ac_srcdir in
  .) ac_abs_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_srcdir=$ac_top_srcdir;;
*)
  case $ac_top_srcdir in
  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  esac;;
esac

    cd $ac_dir
    # Check for guested configure; otherwise get Cygnus style 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
    elif test -f $ac_srcdir/configure.ac ||
	   test -f $ac_srcdir/configure.in; then
      echo
      $ac_configure --help
    else
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    fi
    cd $ac_popdir
  done
fi

test -n "$ac_init_help" && exit 0
if $ac_init_version; then
  cat <<\_ACEOF

Copyright (C) 2003 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 0
fi
exec 5>config.log
cat >&5 <<_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.59.  Invocation command line was

  $ $0 $@

_ACEOF
{
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`
hostinfo               = `(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

} >&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_sep=
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_sep'$ac_arg'"
      # Get rid of the leading space.
      ac_sep=" "
      ;;
    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: Be sure not to use single quotes in there, as some shells,
# such as our DU 5.0 friend, will then `close' the trap.
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,
{
  (set) 2>&1 |
    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
    *ac_space=\ *)
      sed -n \
	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
      ;;
    *)
      sed -n \
	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
      ;;
    esac;
}
    echo

    cat <<\_ASBOX
## ----------------- ##
## Output variables. ##
## ----------------- ##
_ASBOX
    echo
    for ac_var in $ac_subst_vars
    do
      eval ac_val=$`echo $ac_var`
      echo "$ac_var='"'"'$ac_val'"'"'"
    done | sort
    echo

    if test -n "$ac_subst_files"; then
      cat <<\_ASBOX
## ------------- ##
## Output files. ##
## ------------- ##
_ASBOX
      echo
      for ac_var in $ac_subst_files
      do
	eval ac_val=$`echo $ac_var`
	echo "$ac_var='"'"'$ac_val'"'"'"
      done | sort
      echo
    fi

    if test -s confdefs.h; then
      cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
      echo
      sed "/^$/d" confdefs.h | sort
      echo
    fi
    test "$ac_signal" != 0 &&
      echo "$as_me: caught signal $ac_signal"
    echo "$as_me: exit $exit_status"
  } >&5
  rm -f core *.core &&
  rm -rf 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 -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo >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 -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; 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 `(set) 2>&1 |
	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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 $as_executable_p "$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

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 $as_executable_p "$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

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

  CC=$ac_ct_CC
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 $as_executable_p "$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

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 "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_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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CC="cc"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

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

  CC=$ac_ct_CC
else
  CC="$ac_cv_prog_CC"
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 $as_executable_p "$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

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
  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 $as_executable_p "$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

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
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 $as_executable_p "$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

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

  CC=$ac_ct_CC
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`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&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[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
  (eval $ac_link_default) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # Find the output, starting from the most likely.  This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
# resort.

# Be careful to initialize this variable, since it used to be cached.
# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
ac_cv_exeext=
# b.out is created by i960 compilers.
for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
do
  test -f "$ac_file" || continue
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
	;;
    conftest.$ac_ext )
	# This is the source file.
	;;
    [ab].out )
	# We found the default executable, but exeext='' is most
	# certainly right.
	break;;
    *.* )
	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	# FIXME: I believe we export ac_cv_exeext for Libtool,
	# but it would be cool to find out if it's true.  Does anybody
	# maintain Libtool? --akim.
	export ac_cv_exeext
	break;;
    * )
	break;;
  esac
done
else
  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
echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6

# Check 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'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 | *.o | *.obj ) ;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
	  export ac_cv_exeext
	  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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
    *) 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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
CFLAGS="-g"
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
  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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cc_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_prog_cc_g=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
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 ANSI C" >&5
echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
if test "${ac_cv_prog_cc_stdc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_prog_cc_stdc=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 -std1 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 -std1.  */
int osf4_cc_array ['\x00' == 0 ? 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
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX			-qlanglvl=ansi
# Ultrix and OSF/1	-std1
# HP-UX 10.20 and later	-Ae
# HP-UX older versions	-Aa -D_HPUX_SOURCE
# SVR4			-Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cc_stdc=$ac_arg
break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC

fi

case "x$ac_cv_prog_cc_stdc" in
  x|xno)
    echo "$as_me:$LINENO: result: none needed" >&5
echo "${ECHO_T}none needed" >&6 ;;
  *)
    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
    CC="$CC $ac_cv_prog_cc_stdc" ;;
esac

# Some people use a C++ compiler to compile C.  Since we use `exit',
# in C++ we need to declare it.  In case someone uses the same compiler
# for both compiling C and C++ we need to have the C++ compiler decide
# the declaration of exit, since it's the most demanding environment.
cat >conftest.$ac_ext <<_ACEOF
#ifndef __cplusplus
  choke me
#endif
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  for ac_declaration in \
   '' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
#include <stdlib.h>
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

continue
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
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=cc
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 -n "$ac_tool_prefix"; then
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 $as_executable_p "$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

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 $CCC g++ c++ gpp aCC CC cxx cc++ cl 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 $as_executable_p "$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

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
test -n "$ac_ct_CXX" || ac_ct_CXX="g++"

  CXX=$ac_ct_CXX
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`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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
CXXFLAGS="-g"
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
  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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_prog_cxx_g=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
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
for ac_declaration in \
   '' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
#include <stdlib.h>
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

continue
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
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 $as_executable_p "$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

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 $as_executable_p "$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

  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
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

  RANLIB=$ac_ct_RANLIB
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 $as_executable_p "$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

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 -z "$LEXLIB"
then
  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
if test "${ac_cv_lib_fl_yywrap+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lfl  $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char yywrap ();
int
main ()
{
yywrap ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_fl_yywrap=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_fl_yywrap=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
if test $ac_cv_lib_fl_yywrap = yes; then
  LEXLIB="-lfl"
else
  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
if test "${ac_cv_lib_l_yywrap+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ll  $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char yywrap ();
int
main ()
{
yywrap ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_l_yywrap=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_l_yywrap=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
if test $ac_cv_lib_l_yywrap = yes; then
  LEXLIB="-ll"
fi

fi

fi

if test "x$LEX" != "x:"; then
  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
  # The minimal lex program is just a single line: %%.  But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
cat >conftest.l <<_ACEOF
%%
%%
_ACEOF
{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
  (eval $LEX conftest.l) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
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
rm -f conftest.l
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root

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
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS=$LIBS
LIBS="$LIBS $LEXLIB"
cat >conftest.$ac_ext <<_ACEOF
`cat $LEX_OUTPUT_ROOT.c`
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_save_LIBS
rm -f "${LEX_OUTPUT_ROOT}.c"

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

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 $as_executable_p "$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

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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char exp ();
int
main ()
{
exp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char __gxx_personality_v0 ();
int
main ()
{
__gxx_personality_v0 ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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 non-existent 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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 egrep" >&5
echo $ECHO_N "checking for egrep... $ECHO_C" >&6
if test "${ac_cv_prog_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_prog_egrep='grep -E'
    else ac_cv_prog_egrep='egrep'
    fi
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
echo "${ECHO_T}$ac_cv_prog_egrep" >&6
 EGREP=$ac_cv_prog_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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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>
#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))
      exit(2);
  exit (0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strcasecmp;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strcasecmp;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strncasecmp;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strncasecmp;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strdup;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strdup;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strrstr;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strrstr;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strcasestr;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strcasestr;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = strlcat;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strlcat;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 strlcpy" >&5
echo $ECHO_N "checking for strlcpy... $ECHO_C" >&6
if test "${ac_cv_func_strlcpy+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 strlcpy to an innocuous variant, in case <limits.h> declares strlcpy.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define strlcpy innocuous_strlcpy

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strlcpy (); 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 strlcpy

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char strlcpy ();
/* 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_strlcpy) || defined (__stub___strlcpy)
choke me
#else
char (*f) () = strlcpy;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != strlcpy;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_strlcpy=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_strlcpy=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_strlcpy" >&5
echo "${ECHO_T}$ac_cv_func_strlcpy" >&6
if test $ac_cv_func_strlcpy = yes; then
  :
else
  STRINGS="-DNEED_STRLCPY $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
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
#else
char (*f) () = vsnprintf;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != vsnprintf;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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 $as_executable_p "$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

  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 or --without-freetype was given.
if test "${with_freetype+set}" = set; then
  withval="$with_freetype"
  FT_DIR=$withval
else
  FT_DIR=''
fi;

FT_LDFLAGS=''
FT_CFLAGS=''
FT_BIN=''

if test "x$FT_DIR" = "xno" ; then
    { { echo "$as_me:$LINENO: error: Freetype support disabled but is now mandatory. Rerun without --without-freetype or --with-freetype=no" >&5
echo "$as_me: error: Freetype support disabled but is now mandatory. Rerun without --without-freetype or --with-freetype=no" >&2;}
   { (exit 1); exit 1; }; }
fi


if test -z "$FT_DIR" -o "$FT_DIR" = "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 $as_executable_p "$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

  test -z "$ac_cv_path_FT_BIN" && ac_cv_path_FT_BIN=""""
  ;;
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 "x$FT_BIN" = "xno" ; then
                echo "$as_me:$LINENO: checking for Freetype2.x in system locations" >&5
echo $ECHO_N "checking for Freetype2.x in system locations... $ECHO_C" >&6
        test -f /usr/include/ft2build.h -a -d /usr/include/freetype2 && FT_CFLAGS=-I/usr/include/freetype2
        test -f /usr/local/include/ft2build.h -a -d /usr/local/include/freetype2 && FT_CFLAGS=-I/usr/local/include -I/usr/local/include/freetype2
        FT_LDFLAGS="-lfreetype -lz"
        fi
else

  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 for Freetype2.x in $FT_DIR" >&5
echo $ECHO_N "checking for Freetype2.x in $FT_DIR... $ECHO_C" >&6
    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 "x$FT_BIN" = "x"; then
        test -f $FT_DIR/ft2build.h -a -d $FT_DIR/freetype2 && FT_CFLAGS="-I$FT_DIR -I$FT_DIR/freetype2"
        test -f $FT_DIR/include/ft2build.h -a -d $FT_DIR/include/freetype2 && FT_CFLAGS="-I$FT_DIR/include -I$FT_DIR/include/freetype2"
        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_LDFLAGS="-L$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_LDFLAGS="-L$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_LDFLAGS="-L$FT_DIR"
        fi
fi

if test "x$FT_BIN" != "x" ; then
        FT_LDFLAGS=`$FT_BIN --libs`
        FT_CFLAGS=`$FT_BIN --cflags`
fi


_cppflags="$CPPFLAGS"
_ldflags="$LDFLAGS"
CPPFLAGS="$FT_CFLAGS $CPPFLAGS"
LDFLAGS="$FT_LDFLAGS $LDFLAGS"


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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char FT_Init_FreeType ();
int
main ()
{
FT_Init_FreeType ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBFREETYPE 1
_ACEOF

  LIBS="-lfreetype $LIBS"

else
  { { echo "$as_me:$LINENO: error: unable to link - reconfigure with correct --with-freetype=dir " >&5
echo "$as_me: error: unable to link - reconfigure with correct --with-freetype=dir " >&2;}
   { (exit 1); exit 1; }; }
fi


# 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 eval "test \"\${$as_ac_Header+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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



for ac_header in ft2build.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header 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 <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 $ac_header presence" >&5
echo $ECHO_N "checking $ac_header 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 <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

else
  { { echo "$as_me:$LINENO: error: ft2build.h header not found - reconfigure with correct --with-freetype=dir " >&5
echo "$as_me: error: ft2build.h header not found - reconfigure with correct --with-freetype=dir " >&2;}
   { (exit 1); exit 1; }; }
fi

done


CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
FT_ENABLED="-DUSE_FREETYPE"
FT_ENABLED=$FT_ENABLED

FT_INC=$FT_CFLAGS

FT_LIB=$FT_LDFLAGS

ALL_ENABLED="$FT_ENABLED $ALL_ENABLED"
ALL_INC="$FT_CFLAGS $ALL_INC"
ALL_LIB="$FT_LDFLAGS $ALL_LIB"



unset ac_cv_lib_z_zlibVersion


# Check whether --with-zlib or --without-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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char zlibVersion ();
int
main ()
{
zlibVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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=''
PNG_INC=''
PNG_ENABLED=''


if test -n "$PNG_DIR" ; then
    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"
    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_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: error: cannot find png lib in $PNG_DIR" >&5
echo "$as_me: error: cannot find png lib in $PNG_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$PNG_INCLUDE" ; then
            old_cflags="$CFLAGS"
      CFLAGS="$ZLIB_INC $CFLAGS"
      as_ac_Header=`echo "ac_cv_header_$PNG_INCLUDE/png.h" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+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 eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&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 eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  PNG_INC=-I$PNG_INCLUDE
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"
      ALL_INC="$PNG_INC $ALL_INC"
    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
    PNG_ENABLED="-DUSE_PNG"
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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char png_init_io ();
int
main ()
{
png_init_io ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 "${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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&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


  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: error: PNG (libpng) library cannot be found. install or reconfigure with --with-png=DIR" >&5
echo "$as_me: error: PNG (libpng) library cannot be found. install or reconfigure with --with-png=DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi
  PNG_ENABLED="-DUSE_PNG"
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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&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



ALL_ENABLED="$PNG_ENABLED $ALL_ENABLED"
PNG_ENABLED=$PNG_ENABLED

PNG_INC=$PNG_INC

PNG_LIB=$PNG_LIB





# Check whether --with-gif or --without-gif was given.
if test "${with_gif+set}" = set; then
  withval="$with_gif"
  GIF_DIR=$withval
else
  GIF_DIR=''
fi;


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

{ echo "$as_me:$LINENO: checking where GIF is installed..." >&5
echo "$as_me: checking where GIF is installed..." >&6;}
GIF_LIB=''
GIF_INC=''
GIF_ENABLED=''


if test -n "$GIF_DIR" -a "GIF_DIR" != "yes" ; then
    test -f $GIF_DIR/lib/libgif.a -o -f $GIF_DIR/lib/libgif.so -o -f $GIF_DIR/lib/libgif.sl -o -f $GIF_DIR/lib/libgif.dylib && GIF_LIBDIR="$GIF_DIR/lib"
    test -f $GIF_DIR/lib64/libgif.a -o -f $GIF_DIR/lib64/libgif.so -o -f $GIF_DIR/lib64/libgif.sl -o -f $GIF_DIR/libgif.dylib && GIF_LIBDIR="$GIF_DIR/lib64"
    test -f $GIF_DIR/libgif.a -o -f $GIF_DIR/libgif.so -o -f $GIF_DIR/libgif.sl -o -f $GIF_DIR/libgif.dylib && GIF_LIBDIR="$GIF_DIR"
    test -f $GIF_DIR/include/gif_lib.h && GIF_INCLUDE="$GIF_DIR/include"
    test -f $GIF_DIR/lib/gif_lib.h && GIF_INCLUDE="$GIF_DIR/lib"
    test -f $GIF_DIR/gif_lib.h && GIF_INCLUDE="$GIF_DIR"

    if test -n "$GIF_LIBDIR" ; then
      GIF_LIB="-L$GIF_LIBDIR -lgif"
      echo "$as_me:$LINENO: result:         using libgif from $GIF_LIB" >&5
echo "${ECHO_T}        using libgif from $GIF_LIB" >&6

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

  if test -z ""$GIF_LIBDIR"" || echo ""$GIF_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$GIF_LIBDIR""
  else
    ai_p="`pwd`/"$GIF_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: cannot find gif lib in $GIF_DIR" >&5
echo "$as_me: error: cannot find gif lib in $GIF_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$GIF_INCLUDE" ; then
      as_ac_Header=`echo "ac_cv_header_$GIF_INCLUDE/png.h" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $GIF_INCLUDE/png.h" >&5
echo $ECHO_N "checking for $GIF_INCLUDE/png.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $GIF_INCLUDE/png.h usability" >&5
echo $ECHO_N "checking $GIF_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 <$GIF_INCLUDE/png.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 $GIF_INCLUDE/png.h presence" >&5
echo $ECHO_N "checking $GIF_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 <$GIF_INCLUDE/png.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: $GIF_INCLUDE/png.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $GIF_INCLUDE/png.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $GIF_INCLUDE/png.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $GIF_INCLUDE/png.h" >&5
echo $ECHO_N "checking for $GIF_INCLUDE/png.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  GIF_INC=-I$GIF_INCLUDE
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


      ALL_INC="$GIF_INC $ALL_INC"
    else
        { { echo "$as_me:$LINENO: error: cannot find gif headers in $GIF_DIR" >&5
echo "$as_me: error: cannot find gif headers in $GIF_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi
    GIF_ENABLED="-DUSE_GIF"
else


  echo "$as_me:$LINENO: checking for DGifOpenFileHandle in -lgif" >&5
echo $ECHO_N "checking for DGifOpenFileHandle in -lgif... $ECHO_C" >&6
if test "${ac_cv_lib_gif_DGifOpenFileHandle+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgif  $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char DGifOpenFileHandle ();
int
main ()
{
DGifOpenFileHandle ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gif_DGifOpenFileHandle=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gif_DGifOpenFileHandle=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gif_DGifOpenFileHandle" >&5
echo "${ECHO_T}$ac_cv_lib_gif_DGifOpenFileHandle" >&6
if test $ac_cv_lib_gif_DGifOpenFileHandle = yes; then
  GIF_LIB="-lgif"
fi

  if test "${ac_cv_header_gif_lib_h+set}" = set; then
  echo "$as_me:$LINENO: checking for gif_lib.h" >&5
echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6
if test "${ac_cv_header_gif_lib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking gif_lib.h usability" >&5
echo $ECHO_N "checking gif_lib.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 <gif_lib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 gif_lib.h presence" >&5
echo $ECHO_N "checking gif_lib.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 <gif_lib.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: gif_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: gif_lib.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: gif_lib.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: gif_lib.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: gif_lib.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: gif_lib.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for gif_lib.h" >&5
echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6
if test "${ac_cv_header_gif_lib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_gif_lib_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6

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


  if test -n "$GIF_LIB" ; then
    echo "$as_me:$LINENO: result:         using libgif from system libs." >&5
echo "${ECHO_T}        using libgif from system libs." >&6
  else
    { { echo "$as_me:$LINENO: error: GIF (libgif) library cannot be found. install or reconfigure with --with-gif=DIR" >&5
echo "$as_me: error: GIF (libgif) library cannot be found. install or reconfigure with --with-gif=DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi
  GIF_ENABLED="-DUSE_GIF"
fi

ALL_ENABLED="$GIF_ENABLED $ALL_ENABLED"
GIF_ENABLED=$GIF_ENABLED

GIF_INC=$GIF_INC

GIF_LIB=$GIF_LIB




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 or --without-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_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
        { { echo "$as_me:$LINENO: error: \"Could not find jpeglib.h or libjpeg.a/libjpeg.so/libjpeg.dylib in $JPEG_DIR.\"" >&5
echo "$as_me: error: \"Could not find jpeglib.h or libjpeg.a/libjpeg.so/libjpeg.dylib in $JPEG_DIR.\"" >&2;}
   { (exit 1); exit 1; }; }
  fi


    _cppflags="$CPPFLAGS"
    _ldflags="$LDFLAGS"
    CPPFLAGS="$JPEG_INC $CPPFLAGS"
    LDFLAGS="$JPEG_LIB $LDFLAGS"

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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF

  LIBS="-ljpeg $LIBS"

else
  { { echo "$as_me:$LINENO: error: \"cannot link with libjpeg\"" >&5
echo "$as_me: error: \"cannot link with libjpeg\"" >&2;}
   { (exit 1); exit 1; }; }
fi

    if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo "$as_me:$LINENO: checking for jpeglib.h" >&5
echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6
if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5
echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking jpeglib.h usability" >&5
echo $ECHO_N "checking jpeglib.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 <jpeglib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 jpeglib.h presence" >&5
echo $ECHO_N "checking jpeglib.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 <jpeglib.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: jpeglib.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: jpeglib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for jpeglib.h" >&5
echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6
if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_jpeglib_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5
echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6

fi
if test $ac_cv_header_jpeglib_h = yes; then
  :
else
  { { echo "$as_me:$LINENO: error: \"cannot find jpeg headers\"" >&5
echo "$as_me: error: \"cannot find jpeg headers\"" >&2;}
   { (exit 1); exit 1; }; }
fi


    JPEG_ENABLED="-DUSE_JPEG"
    CPPFLAGS=$_cppflags
    LDFLAGS=$_ldflags
    echo "$as_me:$LINENO: result:         using libjpeg from system $JPEG_LIB" >&5
echo "${ECHO_T}        using libjpeg from system $JPEG_LIB" >&6

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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF

  LIBS="-ljpeg $LIBS"

else
  { { echo "$as_me:$LINENO: error: \"cannot link with libjpeg\"" >&5
echo "$as_me: error: \"cannot link with libjpeg\"" >&2;}
   { (exit 1); exit 1; }; }
fi

    if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo "$as_me:$LINENO: checking for jpeglib.h" >&5
echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6
if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5
echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking jpeglib.h usability" >&5
echo $ECHO_N "checking jpeglib.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 <jpeglib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 jpeglib.h presence" >&5
echo $ECHO_N "checking jpeglib.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 <jpeglib.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: jpeglib.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: jpeglib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for jpeglib.h" >&5
echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6
if test "${ac_cv_header_jpeglib_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_jpeglib_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5
echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6

fi
if test $ac_cv_header_jpeglib_h = yes; then
  :
else
  { { echo "$as_me:$LINENO: error: \"cannot find jpeg headers\"" >&5
echo "$as_me: error: \"cannot find jpeg headers\"" >&2;}
   { (exit 1); exit 1; }; }
fi


    JPEG_ENABLED="-DUSE_JPEG"
    JPEG_LIB="-ljpeg"
    echo "$as_me:$LINENO: result:         using libjpeg from system libs." >&5
echo "${ECHO_T}        using libjpeg from system libs." >&6
fi

JPEG_ENABLED=$JPEG_ENABLED

JPEG_INC=$JPEG_INC

JPEG_LIB=$JPEG_LIB



unset ac_cv_lib_Xpm_XpmFreeXpmImage


# Check whether --with-xpm or --without-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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XpmFreeXpmImage ();
int
main ()
{
XpmFreeXpmImage ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv_open ();
int
main ()
{
iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv_open ();
int
main ()
{
libiconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv_open ();
int
main ()
{
iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv_open ();
int
main ()
{
iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv_open ();
int
main ()
{
libiconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv_open ();
int
main ()
{
iconv_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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_gdImageCreatePaletteFromTrueColor

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

# Check whether --with-gd or --without-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 gdImageCreatePaletteFromTrueColor in -lgd" >&5
echo $ECHO_N "checking for gdImageCreatePaletteFromTrueColor in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreatePaletteFromTrueColor ();
int
main ()
{
gdImageCreatePaletteFromTrueColor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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


  if test "$IS_GD2" = "false" -a -n "$ICONV_LIB"; then
        unset ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor
    { 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 gdImageCreatePaletteFromTrueColor in -lgd" >&5
echo $ECHO_N "checking for gdImageCreatePaletteFromTrueColor in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreatePaletteFromTrueColor ();
int
main ()
{
gdImageCreatePaletteFromTrueColor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&6
if test $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor = 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.28 (or higher) from $GD_LIB $GD_XTRA_LIBS" >&5
echo "${ECHO_T}        using libgd 2.0.28 (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.28 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.28 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 gdImageCreatePaletteFromTrueColor in -lgd" >&5
echo $ECHO_N "checking for gdImageCreatePaletteFromTrueColor in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreatePaletteFromTrueColor ();
int
main ()
{
gdImageCreatePaletteFromTrueColor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&6
if test $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor = 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_gdImageCreatePaletteFromTrueColor
      echo "$as_me:$LINENO: checking for gdImageCreatePaletteFromTrueColor in -lgd" >&5
echo $ECHO_N "checking for gdImageCreatePaletteFromTrueColor in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreatePaletteFromTrueColor ();
int
main ()
{
gdImageCreatePaletteFromTrueColor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor" >&6
if test $ac_cv_lib_gd_gdImageCreatePaletteFromTrueColor = 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.28 (or higher) from system libs ($GD_LIB $GD_XTRA_LIBS)." >&5
echo "${ECHO_T}        using libgd 2.0.28 (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.28 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.28 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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGif ();
int
main ()
{
gdImageGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImagePng ();
int
main ()
{
gdImagePng ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageJpeg ();
int
main ()
{
gdImageJpeg ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageWBMP ();
int
main ()
{
gdImageWBMP ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringFT ();
int
main ()
{
gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringFT ();
int
main ()
{
gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageSetResolution ();
int
main ()
{
gdImageSetResolution ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageOpenPolygon ();
int
main ()
{
gdImageOpenPolygon ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGifPtr ();
int
main ()
{
gdImageGifPtr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdFontGetTiny ();
int
main ()
{
gdFontGetTiny ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GETBITMAPFONTS"
fi


        GD_HAS_GET_TRUE_COLOR_PIXEL=

    CFLAGS_BACKUP="$CFLAGS"
  CXXFLAGS_BACKUP="$CXXFLAGS"
  CFLAGS="$CFLAGS $GD_INC"
  CXXFLAGS="$CXXFLAGS $GD_INC"
  echo "$as_me:$LINENO: checking whether gdImageGetTrueColorPixel is declared" >&5
echo $ECHO_N "checking whether gdImageGetTrueColorPixel is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_gdImageGetTrueColorPixel+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 <gd.h>

int
main ()
{
#ifndef gdImageGetTrueColorPixel
  char *p = (char *) gdImageGetTrueColorPixel;
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_have_decl_gdImageGetTrueColorPixel=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_have_decl_gdImageGetTrueColorPixel=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_decl_gdImageGetTrueColorPixel" >&5
echo "${ECHO_T}$ac_cv_have_decl_gdImageGetTrueColorPixel" >&6
if test $ac_cv_have_decl_gdImageGetTrueColorPixel = yes; then
  GD_HAS_GET_TRUE_COLOR_PIXEL=yes
fi

  CFLAGS="$CFLAGS_BACKUP"
  CXXFLAGS="$CXXFLAGS_BACKUP"

    if test .$GD_HAS_GET_TRUE_COLOR_PIXEL = .yes ; then
    as_ac_Lib=`echo "ac_cv_lib_$GD_CHECKLIB''_gdImageGetTrueColorPixel" | $as_tr_sh`
echo "$as_me:$LINENO: checking for gdImageGetTrueColorPixel in -l$GD_CHECKLIB" >&5
echo $ECHO_N "checking for gdImageGetTrueColorPixel in -l$GD_CHECKLIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGetTrueColorPixel ();
int
main ()
{
gdImageGetTrueColorPixel ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
  GD_DEF="$GD_DEF -DGD_HAS_GET_TRUE_COLOR_PIXEL"
fi

  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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreate ();
int
main ()
{
gdImageCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGif ();
int
main ()
{
gdImageGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImagePng ();
int
main ()
{
gdImagePng ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageJpeg ();
int
main ()
{
gdImageJpeg ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageWBMP ();
int
main ()
{
gdImageWBMP ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringFT ();
int
main ()
{
gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageOpenPolygon ();
int
main ()
{
gdImageOpenPolygon ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGifPtr ();
int
main ()
{
gdImageGifPtr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdFontGetTiny ();
int
main ()
{
gdFontGetTiny ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageSetResolution ();
int
main ()
{
gdImageSetResolution ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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

        GD_HAS_GET_TRUE_COLOR_PIXEL=
  echo "$as_me:$LINENO: checking whether gdImageGetTrueColorPixel is declared" >&5
echo $ECHO_N "checking whether gdImageGetTrueColorPixel is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_gdImageGetTrueColorPixel+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 <gd.h>

int
main ()
{
#ifndef gdImageGetTrueColorPixel
  char *p = (char *) gdImageGetTrueColorPixel;
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_have_decl_gdImageGetTrueColorPixel=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_have_decl_gdImageGetTrueColorPixel=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_have_decl_gdImageGetTrueColorPixel" >&5
echo "${ECHO_T}$ac_cv_have_decl_gdImageGetTrueColorPixel" >&6
if test $ac_cv_have_decl_gdImageGetTrueColorPixel = yes; then
  GD_HAS_GET_TRUE_COLOR_PIXEL=yes
fi

    if test .$GD_HAS_GET_TRUE_COLOR_PIXEL = .yes ; then
    echo "$as_me:$LINENO: checking for gdImageGetTrueColorPixel in -lgd" >&5
echo $ECHO_N "checking for gdImageGetTrueColorPixel in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageGetTrueColorPixel+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGetTrueColorPixel ();
int
main ()
{
gdImageGetTrueColorPixel ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageGetTrueColorPixel=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

  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"



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 or --without-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


  FTGL_FLAG=""
  if  test -f $FTGL_DIR/include/FTGL/ftgl.h -a -f $FTGL_DIR/include/FTGL/FTGLTextureFont.h ; then
      FTGL_INCLUDE="-I$FTGL_DIR/include/FTGL/"
  elif  test -f $FTGL_DIR/include/FTGL/FTGL.h -a -f $FTGL_DIR/include/FTGL/FTGLTextureFont.h ; then
      FTGL_INCLUDE="-I$FTGL_DIR/include/FTGL/"
      FTGL_FLAG="-DUSE_FTGL_2_1_2"
  fi

  if test -z "$FTGL_INCLUDE" ; then
      { { echo "$as_me:$LINENO: error: \"could not find ftgl.h/FTGL.h in $FTGL_DIR/include/FTGL.\"" >&5
echo "$as_me: error: \"could not find ftgl.h/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_FLAG"
  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 or --without-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"





# Check whether --with-expat or --without-expat was given.
if test "${with_expat+set}" = set; then
  withval="$with_expat"
  EXPAT_DIR=$withval
else
  EXPAT_DIR=''
fi;


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

{ echo "$as_me:$LINENO: checking where EXPAT is installed..." >&5
echo "$as_me: checking where EXPAT is installed..." >&6;}
EXPAT_LIB=''
EXPAT_INC=''
EXPAT_FOUND='no'


if test -n "$EXPAT_DIR" ; then
    test -f $EXPAT_DIR/lib/libexpat.a -o -f $EXPAT_DIR/lib/libexpat.so -o -f $EXPAT_DIR/lib/libexpat.sl -o -f $EXPAT_DIR/lib/libexpat.dylib && EXPAT_LIBDIR="$PNG_DIR/lib"
    test -f $EXPAT_DIR/lib64/libexpat.a -o -f $EXPAT_DIR/lib64/libexpat.so -o -f $EXPAT_DIR/lib64/libexpat.sl -o -f $EXPAT_DIR/libexpat.dylib && EXPAT_LIBDIR="$PNG_DIR/lib64"
    test -f $EXPAT_DIR/libexpat.a -o -f $EXPAT_DIR/libexpat.so -o -f $EXPAT_DIR/libexpat.sl -o -f $PNG_DIR/libexpat.dylib && EXPAT_LIBDIR="$PNG_DIR"
    test -f $EXPAT_DIR/include/expat.h && EXPAT_INCDIR="$EXPAT_DIR/include"
    test -f $EXPAT_DIR/lib/expat.h && EXPAT_INCDIR="$EXPAT_DIR/lib"
    test -f $EXPAT_DIR/expat.h && EXPAT_INCDIR="$EXPAT_DIR"

    if test -n "$EXPAT_LIBDIR" ; then
      EXPAT_LIB="-L$EXPAT_LIBDIR -lexpat"
      echo "$as_me:$LINENO: result:         using libexpat from $EXPAT_LIB" >&5
echo "${ECHO_T}        using libexpat from $EXPAT_LIB" >&6

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

  if test -z ""$EXPAT_LIBDIR"" || echo ""$EXPAT_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p=""$EXPAT_LIBDIR""
  else
    ai_p="`pwd`/"$EXPAT_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: cannot find expat lib in $EXPAT_DIR" >&5
echo "$as_me: error: cannot find expat lib in $EXPAT_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$EXPAT_INCDIR" ; then
      as_ac_Header=`echo "ac_cv_header_$EXPAT_INCDIR/expat.h" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $EXPAT_INCDIR/expat.h" >&5
echo $ECHO_N "checking for $EXPAT_INCDIR/expat.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $EXPAT_INCDIR/expat.h usability" >&5
echo $ECHO_N "checking $EXPAT_INCDIR/expat.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 <$EXPAT_INCDIR/expat.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 $EXPAT_INCDIR/expat.h presence" >&5
echo $ECHO_N "checking $EXPAT_INCDIR/expat.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 <$EXPAT_INCDIR/expat.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: $EXPAT_INCDIR/expat.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $EXPAT_INCDIR/expat.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $EXPAT_INCDIR/expat.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $EXPAT_INCDIR/expat.h" >&5
echo $ECHO_N "checking for $EXPAT_INCDIR/expat.h... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

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


      ALL_INC="$EXPAT_INC $ALL_INC"
    else
        { { echo "$as_me:$LINENO: error: cannot find expat headers in $EXPAT_DIR" >&5
echo "$as_me: error: cannot find expat headers in $EXPAT_DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi
    EXPAT_FOUND="yes"
else


  echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5
echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6
if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lexpat  $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XML_ParserCreate ();
int
main ()
{
XML_ParserCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_expat_XML_ParserCreate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_expat_XML_ParserCreate=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5
echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6
if test $ac_cv_lib_expat_XML_ParserCreate = yes; then
  EXPAT_LIB="-lexpat"
fi

  if test "${ac_cv_header_expat_h+set}" = set; then
  echo "$as_me:$LINENO: checking for expat.h" >&5
echo $ECHO_N "checking for expat.h... $ECHO_C" >&6
if test "${ac_cv_header_expat_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5
echo "${ECHO_T}$ac_cv_header_expat_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking expat.h usability" >&5
echo $ECHO_N "checking expat.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 <expat.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 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 expat.h presence" >&5
echo $ECHO_N "checking expat.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 <expat.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_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: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: expat.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: expat.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for expat.h" >&5
echo $ECHO_N "checking for expat.h... $ECHO_C" >&6
if test "${ac_cv_header_expat_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_expat_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5
echo "${ECHO_T}$ac_cv_header_expat_h" >&6

fi
if test $ac_cv_header_expat_h = yes; then
  :
else
  EXPAT_HEADER_FOUND="no"
fi


  if test -n "$EXPAT_LIB" -a "$EXPAT_HEADER_FOUND" != "no"; then
    echo "$as_me:$LINENO: result:         using libexpat from system libs." >&5
echo "${ECHO_T}        using libexpat from system libs." >&6
    EXPAT_FOUND='yes'
  else
    echo "$as_me:$LINENO: result:         not found in system libs. svg symbol support will be disabled" >&5
echo "${ECHO_T}        not found in system libs. svg symbol support will be disabled" >&6
    EXPAT_FOUND='no'
  fi

fi


echo "$as_me:$LINENO: checking for AGG support" >&5
echo $ECHO_N "checking for AGG support... $ECHO_C" >&6
AGG_ENABLED="internal"
echo "$as_me:$LINENO: result:         yes" >&5
echo "${ECHO_T}        yes" >&6
AGG_OBJ="renderers/agg/src/clipper.o 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"
AGG_LIB=""
AGG_INC="-Irenderers/agg/include"
ALL_INC="$AGG_INC $ALL_INC"


echo "$as_me:$LINENO: checking if SVG Symbol support requested" >&5
echo $ECHO_N "checking if SVG Symbol support requested... $ECHO_C" >&6

# Check whether --with-agg-svg-symbols or --without-agg-svg-symbols was given.
if test "${with_agg_svg_symbols+set}" = set; then
  withval="$with_agg_svg_symbols"

fi;


if test "$with_agg_svg_symbols" != "no" ; then
    if test "$EXPAT_FOUND" = "yes" ; then
                AGG_OBJ="$AGG_OBJ renderers/agg/src/agg_svg_parser.o renderers/agg/src/agg_svg_path_renderer.o renderers/agg/src/agg_svg_path_tokenizer.o"
        AGG_LIB="$AGG_LIB $EXPAT_LIB"
        AGG_LIB=$AGG_LIB

        ALL_LIB="$AGG_LIB $ALL_LIB"
        AGG_INC="$AGG_INC $EXPAT_INC"
        AGG_INC=$AGG_INC

        ALL_INC="$AGG_INC $ALL_INC"
        AGG_SVG_SYMBOLS_ENABLED="-DUSE_AGG_SVG_SYMBOLS"
        ALL_ENABLED="$AGG_SVG_SYMBOLS_ENABLED $ALL_ENABLED"
        echo "$as_me:$LINENO: result:         enabled" >&5
echo "${ECHO_T}        enabled" >&6

    else
        echo "$as_me:$LINENO: result:         disabled due to missing expat dependency" >&5
echo "${ECHO_T}        disabled due to missing expat dependency" >&6
    fi
fi

AGG_OBJ=$AGG_OBJ







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 or --without-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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pj_init ();
int
main ()
{
pj_init ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pj_transform ();
int
main ()
{
pj_transform ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pj_transform ();
int
main ()
{
pj_transform ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pthread_create ();
int
main ()
{
pthread_create ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-sde was given.
if test "${with_sde+set}" = set; then
  withval="$with_sde"

fi;


# Check whether --with-sde-version or --without-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 eval "test \"\${$as_ac_Lib+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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SE_connection_create ();
int
main ()
{
SE_connection_create ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 ()
{
main ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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 $as_executable_p "$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

  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=3.0.0

  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 or --without-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 $as_executable_p "$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

  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 or --without-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 $as_executable_p "$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

  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"




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 or --without-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 $as_executable_p "$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

  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`"

  old_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS -L`$PG_CONFIG --libdir`"
  echo "$as_me:$LINENO: checking for PQserverVersion in -lpq" >&5
echo $ECHO_N "checking for PQserverVersion in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQserverVersion+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQserverVersion ();
int
main ()
{
PQserverVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQserverVersion=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQserverVersion=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQserverVersion" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQserverVersion" >&6
if test $ac_cv_lib_pq_PQserverVersion = yes; then
  POSTGIS_ENABLED="$POSTGIS_ENABLED -DPOSTGIS_HAS_SERVER_VERSION"
fi

  LDFLAGS="$old_LDFLAGS"

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 or --without-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 $as_executable_p "$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

  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 or --without-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 or --without-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 or --without-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 or --without-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 or --without-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 or --without-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" -o -z "$GDAL_ENABLED"; then

  echo "$as_me:$LINENO: result:         OGC WMS Client Connections not enabled (PROJ.4, libcurl and GDAL required)." >&5
echo "${ECHO_T}        OGC WMS Client Connections not enabled (PROJ.4, libcurl and GDAL 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 or --without-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 or --without-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 or --without-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 $as_executable_p "$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

  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}'`
  CURL_FLAGS=""

  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

    echo "$as_me:$LINENO: checking for CURLOPT_PROXYAUTH support" >&5
echo $ECHO_N "checking for CURLOPT_PROXYAUTH support... $ECHO_C" >&6
  if test -z "$CURL_VERNUM" -o `expr "0x$CURL_VERNUM" \>= "0x070a07"` = 1; then
    echo "$as_me:$LINENO: result: yes." >&5
echo "${ECHO_T}yes." >&6
    CURL_FLAGS="-DUSE_CURLOPT_PROXYAUTH"
  else
    echo "$as_me:$LINENO: result: no." >&5
echo "${ECHO_T}no." >&6
  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 $CURL_FLAGS"

fi

CURL_INC=$CURL_INC

CURL_LIB=$CURL_LIB


ALL_INC="$CURL_INC $ALL_INC"
ALL_LIB="$CURL_LIB $ALL_LIB"



# Check whether --with-kml or --without-kml was given.
if test "${with_kml+set}" = set; then
  withval="$with_kml"

fi;

echo "$as_me:$LINENO: checking if KML output is requested" >&5
echo $ECHO_N "checking if KML output is requested... $ECHO_C" >&6
KML_REQUESTED=""

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


echo "$as_me:$LINENO: checking for libxml2" >&5
echo $ECHO_N "checking for libxml2... $ECHO_C" >&6


# Check whether --with-xml2-config or --without-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$KML_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
  elif test "x$WFS_SVR_ENABLED" != "x" ; then
    with_xml2_config=yes
    echo "$as_me:$LINENO: result: libxml2 requested for WFS Server." >&5
echo "${ECHO_T}libxml2 requested for WFS 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 WFS 1.1 support will be disabled." >&5
echo "${ECHO_T}      but WFS 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 $as_executable_p "$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

  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
  if test "$KML_REQUESTED" = "yes" ; then
    KML_ENABLED="-DUSE_KML"
  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 $KML_ENABLED $ALL_ENABLED"




# Check whether --with-xml-mapfile or --without-xml-mapfile was given.
if test "${with_xml_mapfile+set}" = set; then
  withval="$with_xml_mapfile"
  XMLMAPFILE_REQUESTED=""
fi;

echo "$as_me:$LINENO: checking if xml-mapfile is requested" >&5
echo $ECHO_N "checking if xml-mapfile is requested... $ECHO_C" >&6
XMLMAPFILE_ENABLED=""

if test "$with_xml_mapfile" = "yes"; then
  XMLMAPFILE_ENABLED="-DUSE_XMLMAPFILE"
  echo "$as_me:$LINENO: result: yes.. xslt and exslt support needed" >&5
echo "${ECHO_T}yes.. xslt and exslt support needed" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

ALL_ENABLED="$XMLMAPFILE_ENABLED $ALL_ENABLED"



# Check whether --with-xslt or --without-xslt was given.
if test "${with_xslt+set}" = set; then
  withval="$with_xslt"
  XSLT_DIR=$withval
else
  XSLT_DIR=''
fi;

echo "$as_me:$LINENO: checking if xslt is requested" >&5
echo $ECHO_N "checking if xslt is requested... $ECHO_C" >&6
XSLT_LIB=''

if test -z "$XMLMAPFILE_ENABLED" -a \( "$with_xslt" = "no" -o "$with_xslt" = ""  \); then
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
else

  if test "$XSLT_DIR" = "yes" -o "$XSLT_DIR" = ""; then
     XSLT_DIR="/usr"
  fi

  test -f $XSLT_DIR/include/libxslt/xslt.h && XSLT_INCDIR="$XSLT_DIR/include"
  test -f $XSLT_DIR/lib/libxslt.so && XSLT_LIBDIR="$XSLT_DIR/lib"

  if test -n "$XSLT_LIBDIR" -a -n "$XSLT_INCDIR" ; then
                XSLT_ENABLED="-DUSE_XSLT"
    XSLT_INC="-I$XSLT_INCDIR"
    XSLT_LIB="-L$XSLT_LIBDIR -lxslt"
    echo "$as_me:$LINENO: result: using xslt from $XSLT_LIB ($XSLT_ENABLED)" >&5
echo "${ECHO_T}using xslt from $XSLT_LIB ($XSLT_ENABLED)" >&6

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

  if test -z ""$XSLT_DIR"" || echo ""$XSLT_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$XSLT_DIR""
  else
    ai_p="`pwd`/"$XSLT_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: error: '$XSLT_DIR' not a valid installation path of xslt." >&5
echo "$as_me: error: '$XSLT_DIR' not a valid installation path of xslt." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi

XSLT_ENABLED=$XSLT_ENABLED

XSLT_INC=$XSLT_INC

XSLT_LIB=$XSLT_LIB


ALL_ENABLED="$XSLT_ENABLED $ALL_ENABLED"
ALL_INC="$XSLT_INC $ALL_INC"
ALL_LIB="$XSLT_LIB $ALL_LIB"



# Check whether --with-exslt or --without-exslt was given.
if test "${with_exslt+set}" = set; then
  withval="$with_exslt"
  EXSLT_DIR=$withval
else
  EXSLT_DIR=''
fi;

echo "$as_me:$LINENO: checking if exslt is requested" >&5
echo $ECHO_N "checking if exslt is requested... $ECHO_C" >&6
EXSLT_LIB=''

if test -z "$XMLMAPFILE_ENABLED" -a \( "$with_exslt" = "no" -o "$with_exslt" = ""  \); then
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
else

  if test "$EXSLT_DIR" = "yes" -o "$EXSLT_DIR" = ""; then
     EXSLT_DIR="/usr"
  fi

  test -f $EXSLT_DIR/include/libexslt/exslt.h && EXSLT_INCDIR="$EXSLT_DIR/include"
  test -f $EXSLT_DIR/lib/libexslt.so && EXSLT_LIBDIR="$EXSLT_DIR/lib"

  if test -n "$EXSLT_LIBDIR" -a -n "$EXSLT_INCDIR" ; then
                EXSLT_ENABLED="-DUSE_EXSLT"
    EXSLT_INC="-I$EXSLT_INCDIR"
    EXSLT_LIB="-L$EXSLT_LIBDIR -lexslt"
    echo "$as_me:$LINENO: result: using exslt from $EXSLT_LIB ($EXSLT_ENABLED)" >&5
echo "${ECHO_T}using exslt from $EXSLT_LIB ($EXSLT_ENABLED)" >&6

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

  if test -z ""$EXSLT_DIR"" || echo ""$EXSLT_DIR"" | grep '^/' >/dev/null ; then
    ai_p=""$EXSLT_DIR""
  else
    ai_p="`pwd`/"$EXSLT_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: error: '$EXSLT_DIR' not a valid installation path of exslt." >&5
echo "$as_me: error: '$EXSLT_DIR' not a valid installation path of exslt." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi

EXSLT_ENABLED=$EXSLT_ENABLED

EXSLT_INC=$EXSLT_INC

EXSLT_LIB=$EXSLT_LIB


ALL_ENABLED="$EXSLT_ENABLED $ALL_ENABLED"
ALL_INC="$EXSLT_INC $ALL_INC"
ALL_LIB="$EXSLT_LIB $ALL_LIB"



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 or --without-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 $as_executable_p "$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

  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 or --without-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 or --without-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 -I$with_fastcgi/include/fastcgi"
    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 gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char FCGI_Accept ();
int
main ()
{
FCGI_Accept ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \
      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 or --without-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 $as_executable_p "$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

  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 -a `expr "$APACHE_VERSION" \< "2000049"` = 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.0.0-2.0.48 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.0.0-2.0.48 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 or --disable-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 or --disable-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 or --disable-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 or --without-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 or --disable-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 -DNDEBUG " | sed "s/-g //"`
  CFLAGS=`echo "$CFLAGS -DNDEBUG " | sed "s/-g //"`
fi


{ echo "$as_me:$LINENO: checking whether we should enable mapserv CGI command-line debug arguments..." >&5
echo "$as_me: checking whether we should enable mapserv CGI command-line debug arguments..." >&6;}
# Check whether --enable-cgi-cl-debug-args or --disable-cgi-cl-debug-args was given.
if test "${enable_cgi_cl_debug_args+set}" = set; then
  enableval="$enable_cgi_cl_debug_args"

fi;

if test "$enable_cgi_cl_debug_args" = "yes" ; then
  DEBUG_FLAGS="$DEBUG_FLAGS -DMS_ENABLE_CGI_CL_DEBUG_ARGS"
  echo "$as_me:$LINENO: result:         Enabling (potentially insecure) mapserv CGI command-line debug arguments: -DMS_ENABLE_CGI_CL_DEBUG_ARGS." >&5
echo "${ECHO_T}        Enabling (potentially insecure) mapserv CGI command-line debug arguments: -DMS_ENABLE_CGI_CL_DEBUG_ARGS." >&6
fi

DEBUG_FLAGS=$DEBUG_FLAGS

ALL_ENABLED="$DEBUG_FLAGS $ALL_ENABLED"



# Check whether --enable-gcov or --disable-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 or --without-php was given.
if test "${with_php+set}" = set; then
  withval="$with_php"

fi;

# Check whether --enable-internal-ld-detect or --disable-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 or --without-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 php_config.h" >&5
echo $ECHO_N "checking for location of php_config.h... $ECHO_C" >&6
    test -f "$PHP_SRC_DIR/main/php_config.h" && test -f "$PHP_SRC_DIR/main/php_version.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 php_config.h and php_version.h in $PHP_SRC_DIR.          !!!
!!! Has PHP been configured yet?                                      !!!" >&5
echo "$as_me: error:
!!! Could not find php_config.h and php_version.h in $PHP_SRC_DIR.          !!!
!!! Has PHP been configured yet?                                      !!!" >&2;}
   { (exit 1); exit 1; }; }
  fi


        echo "$as_me:$LINENO: checking if we have PHP 5.2.0+" >&5
echo $ECHO_N "checking if we have PHP 5.2.0+... $ECHO_C" >&6
  PHP_VERSION=`grep 'PHP_VERSION_ID' $PHP_SRC_DIR/main/php_version.h | cut -d' ' -f3`
  if test -z "$PHP_VERSION" || test $PHP_VERSION -lt 50200; then
    { { echo "$as_me:$LINENO: error:
!!! PHP MapScript now requires PHP 5.2.0 or more recent.              !!!
!!! Support for PHP3 has been dropped after MapServer version 3.5.    !!!
!!! Support for PHP4 has been dropped after MapServer version 5.6.    !!!" >&5
echo "$as_me: error:
!!! PHP MapScript now requires PHP 5.2.0 or more recent.              !!!
!!! Support for PHP3 has been dropped after MapServer version 3.5.    !!!
!!! Support for PHP4 has been dropped after MapServer version 5.6.    !!!" >&2;}
   { (exit 1); exit 1; }; }
  else
     echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  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="-I$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="-I$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/php/Makefile
  MAKE_PHPMS=php_mapscript
  MAKE_PHPMS_CLEAN=php_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 or --without-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 or --without-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 or --without-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 or --disable-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 or --without-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, don't put newlines in cache variables' values.
# 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.
{
  (set) 2>&1 |
    case `(ac_space=' '; set | grep ac_space) 2>&1` in
    *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 \
	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
      ;;
    esac;
} |
  sed '
     t clear
     : clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     /^ac_cv_env/!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 "updating cache $cache_file"
    cat confcache >$cache_file
  else
    echo "not updating unwritable cache $cache_file"
  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}'

# 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

# 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 we branch to the quote section.  Otherwise,
# look for a macro that doesn't take arguments.
cat >confdef2opt.sed <<\_ACEOF
t clear
: clear
s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
t quote
s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
t quote
d
: quote
s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
s,\[,\\&,g
s,\],\\&,g
s,\$,$$,g
p
_ACEOF
# We use echo to avoid assuming a particular line-breaking character.
# The extra dot is to prevent the shell from consuming trailing
# line-breaks from the sub-command output.  A line-break within
# single-quotes doesn't work because, if this script is created in a
# platform that uses two characters for line-breaks (e.g., DOS), tr
# would break.
ac_LF_and_DOT=`echo; echo .`
DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
rm -f confdef2opt.sed


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_i=`echo "$ac_i" |
	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
  # 2. Add them.
  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
  ac_ltlibobjs="$ac_ltlibobjs $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 Bourne compatible
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+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi
DUALCASE=1; export DUALCASE # for MKS sh

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


# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
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
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; 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'`


# PATH needs CR, and LINENO needs CR and PATH.
# 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


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  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

       ;;
  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_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    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=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # 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 before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, 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
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
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 sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
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$$.file

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

as_executable_p="test -f"

# 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'"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH

exec 6>&1

# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.  Logging --version etc. is OK.
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF

This file was extended by $as_me, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

_CSEOF
echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
echo >&5
_ACEOF

# Files that config.status was made for.
if test -n "$ac_config_files"; then
  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_headers"; then
  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_links"; then
  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_commands"; then
  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
fi

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, 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.59,
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
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
    ;;
  *) # This is not an option, so the user has probably given explicit
     # arguments.
     ac_option=$1
     ac_need_defaults=false;;
  esac

  case $ac_option in
  # Handling of the options.
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --vers* | -V )
    echo "$ac_cs_version"; exit 0 ;;
  --he | --h)
    # Conflict between --help and --header
    { { echo "$as_me:$LINENO: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
   { (exit 1); exit 1; }; };;
  --help | --hel | -h )
    echo "$ac_cs_usage"; exit 0 ;;
  --debug | --d* | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift
    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
    ac_need_defaults=false;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
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" ;;

  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 $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi

_ACEOF





cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
  case "$ac_config_target" in
  # Handling of arguments.
  "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 to put it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
  trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=./confstat$$-$RANDOM
  (umask 077 && mkdir $tmp)
} ||
{
   echo "$me: cannot create a temporary directory in ." >&2
   { (exit 1); exit 1; }
}

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF

#
# 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
  # Protect against being on the right side of a sed subst in config.status.
  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
s,@SHELL@,$SHELL,;t t
s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
s,@exec_prefix@,$exec_prefix,;t t
s,@prefix@,$prefix,;t t
s,@program_transform_name@,$program_transform_name,;t t
s,@bindir@,$bindir,;t t
s,@sbindir@,$sbindir,;t t
s,@libexecdir@,$libexecdir,;t t
s,@datadir@,$datadir,;t t
s,@sysconfdir@,$sysconfdir,;t t
s,@sharedstatedir@,$sharedstatedir,;t t
s,@localstatedir@,$localstatedir,;t t
s,@libdir@,$libdir,;t t
s,@includedir@,$includedir,;t t
s,@oldincludedir@,$oldincludedir,;t t
s,@infodir@,$infodir,;t t
s,@mandir@,$mandir,;t t
s,@build_alias@,$build_alias,;t t
s,@host_alias@,$host_alias,;t t
s,@target_alias@,$target_alias,;t t
s,@DEFS@,$DEFS,;t t
s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
s,@LIBS@,$LIBS,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@LEX@,$LEX,;t t
s,@LEXLIB@,$LEXLIB,;t t
s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
s,@YACC@,$YACC,;t t
s,@XTRALIBS@,$XTRALIBS,;t t
s,@CPP@,$CPP,;t t
s,@EGREP@,$EGREP,;t t
s,@C_PIC@,$C_PIC,;t t
s,@STRINGS@,$STRINGS,;t t
s,@MS_VERSION@,$MS_VERSION,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@FT_BIN@,$FT_BIN,;t t
s,@FT_ENABLED@,$FT_ENABLED,;t t
s,@FT_INC@,$FT_INC,;t t
s,@FT_LIB@,$FT_LIB,;t t
s,@ZLIB_ENABLED@,$ZLIB_ENABLED,;t t
s,@ZLIB_INC@,$ZLIB_INC,;t t
s,@ZLIB_LIB@,$ZLIB_LIB,;t t
s,@PNG_ENABLED@,$PNG_ENABLED,;t t
s,@PNG_INC@,$PNG_INC,;t t
s,@PNG_LIB@,$PNG_LIB,;t t
s,@GIF_ENABLED@,$GIF_ENABLED,;t t
s,@GIF_INC@,$GIF_INC,;t t
s,@GIF_LIB@,$GIF_LIB,;t t
s,@JPEG_ENABLED@,$JPEG_ENABLED,;t t
s,@JPEG_INC@,$JPEG_INC,;t t
s,@JPEG_LIB@,$JPEG_LIB,;t t
s,@ICONV_ENABLED@,$ICONV_ENABLED,;t t
s,@ICONV_INC@,$ICONV_INC,;t t
s,@ICONV_LIB@,$ICONV_LIB,;t t
s,@GD_DEF@,$GD_DEF,;t t
s,@GD_INC@,$GD_INC,;t t
s,@GD_LIB@,$GD_LIB,;t t
s,@GD_STATIC@,$GD_STATIC,;t t
s,@MAKE_GD@,$MAKE_GD,;t t
s,@MAKE_GD_CLEAN@,$MAKE_GD_CLEAN,;t t
s,@FTGL_ENABLED@,$FTGL_ENABLED,;t t
s,@FTGL_INC@,$FTGL_INC,;t t
s,@FTGL_LIB@,$FTGL_LIB,;t t
s,@OGL_ENABLED@,$OGL_ENABLED,;t t
s,@OGL_INC@,$OGL_INC,;t t
s,@OGL_LIB@,$OGL_LIB,;t t
s,@AGG_LIB@,$AGG_LIB,;t t
s,@AGG_INC@,$AGG_INC,;t t
s,@AGG_OBJ@,$AGG_OBJ,;t t
s,@PROJ_ENABLED@,$PROJ_ENABLED,;t t
s,@PROJ_INC@,$PROJ_INC,;t t
s,@PROJ_LIBS@,$PROJ_LIBS,;t t
s,@THREAD_FLAG@,$THREAD_FLAG,;t t
s,@THREAD_LIB@,$THREAD_LIB,;t t
s,@SDE_ENABLED@,$SDE_ENABLED,;t t
s,@SDE_INC@,$SDE_INC,;t t
s,@SDE_LIB@,$SDE_LIB,;t t
s,@GEOS_CONFIG@,$GEOS_CONFIG,;t t
s,@GEOS_ENABLED@,$GEOS_ENABLED,;t t
s,@GEOS_INC@,$GEOS_INC,;t t
s,@GEOS_LIB@,$GEOS_LIB,;t t
s,@GDAL_CONFIG@,$GDAL_CONFIG,;t t
s,@GDAL_ENABLED@,$GDAL_ENABLED,;t t
s,@OGR_ENABLED@,$OGR_ENABLED,;t t
s,@GDAL_INC@,$GDAL_INC,;t t
s,@GDAL_LIB@,$GDAL_LIB,;t t
s,@PG_CONFIG@,$PG_CONFIG,;t t
s,@POSTGIS_ENABLED@,$POSTGIS_ENABLED,;t t
s,@POSTGIS_INC@,$POSTGIS_INC,;t t
s,@POSTGIS_LIB@,$POSTGIS_LIB,;t t
s,@MY_CONFIG@,$MY_CONFIG,;t t
s,@MYGIS_ENABLED@,$MYGIS_ENABLED,;t t
s,@MYGIS_INC@,$MYGIS_INC,;t t
s,@MYGIS_LIB@,$MYGIS_LIB,;t t
s,@ORACLESPATIAL_ENABLED@,$ORACLESPATIAL_ENABLED,;t t
s,@ORACLESPATIAL_INC@,$ORACLESPATIAL_INC,;t t
s,@ORACLESPATIAL_LIB@,$ORACLESPATIAL_LIB,;t t
s,@MING_ENABLED@,$MING_ENABLED,;t t
s,@MING_INC@,$MING_INC,;t t
s,@MING_LIB@,$MING_LIB,;t t
s,@WMS_SVR_ENABLED@,$WMS_SVR_ENABLED,;t t
s,@WFS_SVR_ENABLED@,$WFS_SVR_ENABLED,;t t
s,@WCS_SVR_ENABLED@,$WCS_SVR_ENABLED,;t t
s,@LIBCURL_CONFIG@,$LIBCURL_CONFIG,;t t
s,@CURL_INC@,$CURL_INC,;t t
s,@CURL_LIB@,$CURL_LIB,;t t
s,@LIBXML2_CONFIG@,$LIBXML2_CONFIG,;t t
s,@XML2_INC@,$XML2_INC,;t t
s,@XML2_LIB@,$XML2_LIB,;t t
s,@WMS_LYR_ENABLED@,$WMS_LYR_ENABLED,;t t
s,@WFS_LYR_ENABLED@,$WFS_LYR_ENABLED,;t t
s,@SOS_SVR_ENABLED@,$SOS_SVR_ENABLED,;t t
s,@XSLT_ENABLED@,$XSLT_ENABLED,;t t
s,@XSLT_INC@,$XSLT_INC,;t t
s,@XSLT_LIB@,$XSLT_LIB,;t t
s,@EXSLT_ENABLED@,$EXSLT_ENABLED,;t t
s,@EXSLT_INC@,$EXSLT_INC,;t t
s,@EXSLT_LIB@,$EXSLT_LIB,;t t
s,@FRIBIDI_CONFIG@,$FRIBIDI_CONFIG,;t t
s,@FRIBIDI_ENABLED@,$FRIBIDI_ENABLED,;t t
s,@FRIBIDI_INC@,$FRIBIDI_INC,;t t
s,@FRIBIDI_LIB@,$FRIBIDI_LIB,;t t
s,@CAIRO_ENABLED@,$CAIRO_ENABLED,;t t
s,@CAIRO_INC@,$CAIRO_INC,;t t
s,@CAIRO_LIB@,$CAIRO_LIB,;t t
s,@FASTCGI_ENABLED@,$FASTCGI_ENABLED,;t t
s,@FASTCGI_INC@,$FASTCGI_INC,;t t
s,@FASTCGI_LIB@,$FASTCGI_LIB,;t t
s,@HTTPD@,$HTTPD,;t t
s,@MS_INC@,$MS_INC,;t t
s,@MS_LIB@,$MS_LIB,;t t
s,@IGNORE_MISSING_DATA@,$IGNORE_MISSING_DATA,;t t
s,@USE_POINT_Z_M@,$USE_POINT_Z_M,;t t
s,@USE_NINT@,$USE_NINT,;t t
s,@DEBUG_FLAGS@,$DEBUG_FLAGS,;t t
s,@LD_SHARED@,$LD_SHARED,;t t
s,@SO_EXT@,$SO_EXT,;t t
s,@SO_COMMAND_NAME@,$SO_COMMAND_NAME,;t t
s,@PHP_LD_SHARED@,$PHP_LD_SHARED,;t t
s,@PHP_VERSION_FLAG@,$PHP_VERSION_FLAG,;t t
s,@PHP_SRC_DIR@,$PHP_SRC_DIR,;t t
s,@PHP_CC@,$PHP_CC,;t t
s,@PHP_LD@,$PHP_LD,;t t
s,@PHP_REGEX_INC@,$PHP_REGEX_INC,;t t
s,@PHP_REGEX_OBJ@,$PHP_REGEX_OBJ,;t t
s,@USE_PHP_REGEX@,$USE_PHP_REGEX,;t t
s,@MAKE_PHPMS@,$MAKE_PHPMS,;t t
s,@MAKE_PHPMS_CLEAN@,$MAKE_PHPMS_CLEAN,;t t
s,@APACHE_INC@,$APACHE_INC,;t t
s,@OS_INCLUDE_DIR@,$OS_INCLUDE_DIR,;t t
s,@ALL_ENABLED@,$ALL_ENABLED,;t t
s,@ALL_INC@,$ALL_INC,;t t
s,@ALL_LIB@,$ALL_LIB,;t t
s,@ALL_STATIC_LIB@,$ALL_STATIC_LIB,;t t
s,@RPATHS@,$RPATHS,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF

_ACEOF

  cat >>$CONFIG_STATUS <<\_ACEOF
  # Split the substitutions into bite-sized pieces for seds with
  # small command number limits, like on Digital OSF/1 and HP-UX.
  ac_max_sed_lines=48
  ac_sed_frag=1 # Number of current file.
  ac_beg=1 # First line for current file.
  ac_end=$ac_max_sed_lines # Line after last line for current file.
  ac_more_lines=:
  ac_sed_cmds=
  while $ac_more_lines; do
    if test $ac_beg -gt 1; then
      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
    else
      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
    fi
    if test ! -s $tmp/subs.frag; then
      ac_more_lines=false
    else
      # The purpose of the label and of the branching condition is to
      # speed up the sed processing (if there are no `@' at all, there
      # is no need to browse any of the substitutions).
      # These are the two extra sed commands mentioned above.
      (echo ':t
  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
      if test -z "$ac_sed_cmds"; then
	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
      else
	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
      fi
      ac_sed_frag=`expr $ac_sed_frag + 1`
      ac_beg=$ac_end
      ac_end=`expr $ac_end + $ac_max_sed_lines`
    fi
  done
  if test -z "$ac_sed_cmds"; then
    ac_sed_cmds=cat
  fi
fi # test -n "$CONFIG_FILES"

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case $ac_file in
  - | *:- | *:-:* ) # input from stdin
	cat >$tmp/stdin
	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  * )   ac_file_in=$ac_file.in ;;
  esac

  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$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'`
  { if $as_mkdir_p; then
    mkdir -p "$ac_dir"
  else
    as_dir="$ac_dir"
    as_dirs=
    while test ! -d "$as_dir"; do
      as_dirs="$as_dir $as_dirs"
      as_dir=`(dirname "$as_dir") 2>/dev/null ||
$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'`
    done
    test ! -n "$as_dirs" || mkdir $as_dirs
  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }; }

  ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac

# Do not use `cd foo && pwd` to compute absolute paths, because
# the directories may not exist.
case `pwd` in
.) ac_abs_builddir="$ac_dir";;
*)
  case "$ac_dir" in
  .) ac_abs_builddir=`pwd`;;
  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_builddir=${ac_top_builddir}.;;
*)
  case ${ac_top_builddir}. in
  .) ac_abs_top_builddir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_srcdir=$ac_srcdir;;
*)
  case $ac_srcdir in
  .) ac_abs_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_srcdir=$ac_top_srcdir;;
*)
  case $ac_top_srcdir in
  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  esac;;
esac



  if test x"$ac_file" != x-; then
    { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
    rm -f "$ac_file"
  fi
  # 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.  */
  if test x"$ac_file" = x-; then
    configure_input=
  else
    configure_input="$ac_file.  "
  fi
  configure_input=$configure_input"Generated from `echo $ac_file_in |
				     sed 's,.*/,,'` by configure."

  # First look for the input files in the build tree, otherwise in the
  # src tree.
  ac_file_inputs=`IFS=:
    for f in $ac_file_in; do
      case $f in
      -) echo $tmp/stdin ;;
      [\\/$]*)
	 # Absolute (can't be DOS-style, as IFS=:)
	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 echo "$f";;
      *) # Relative
	 if test -f "$f"; then
	   # Build tree
	   echo "$f"
	 elif test -f "$srcdir/$f"; then
	   # Source tree
	   echo "$srcdir/$f"
	 else
	   # /dev/null tree
	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 fi;;
      esac
    done` || { (exit 1); exit 1; }
_ACEOF
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,@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,@top_builddir@,$ac_top_builddir,;t t
s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
  rm -f $tmp/stdin
  if test x"$ac_file" != x-; then
    mv $tmp/out $ac_file
  else
    cat $tmp/out
    rm -f $tmp/out
  fi

done
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF

{ (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_ENABLED}" >&5
echo "${ECHO_T}  png support:               ${PNG_ENABLED}" >&6
echo "$as_me:$LINENO: result:   gif support:               ${GIF_ENABLED}" >&5
echo "${ECHO_T}  gif support:               ${GIF_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:   freetype support:          ${FT_ENABLED}" >&5
echo "${ECHO_T}  freetype support:          ${FT_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:   SVG Symbol support:        ${AGG_SVG_SYMBOLS_ENABLED}" >&5
echo "${ECHO_T}  SVG Symbol support:        ${AGG_SVG_SYMBOLS_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:   KML support:               ${KML_ENABLED}" >&5
echo "${ECHO_T}  KML support:               ${KML_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:   XML Mapfile support:        ${XMLMAPFILE_ENABLED}" >&5
echo "${ECHO_T}  XML Mapfile support:        ${XMLMAPFILE_ENABLED}" >&6
echo "$as_me:$LINENO: result:   XSLT support:              ${XSLT_ENABLED}" >&5
echo "${ECHO_T}  XSLT support:              ${XSLT_ENABLED}" >&6
echo "$as_me:$LINENO: result:   EXSLT support:              ${EXSLT_ENABLED}" >&5
echo "${ECHO_T}  EXSLT support:              ${EXSLT_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:   PostGIS support:           ${POSTGIS_ENABLED}" >&5
echo "${ECHO_T}  PostGIS support:           ${POSTGIS_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