#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_default_prefix=/usr/local
ac_help="$ac_help
  --enable-macosx-app     create a MacOSX application"
ac_help="$ac_help
  --enable-shared         build and link with shared libraries [--enable-shared]"
ac_help="$ac_help
  --enable-64bit          enable 64bit support (where applicable)"
ac_help="$ac_help
  --enable-64bit-vis      enable 64bit Sparc VIS support"
ac_help="$ac_help
  --enable-w11            use W11 library for Windows X11 emulation"
ac_help="$ac_help
  --with-cxx              support C++ functionality (default: no)"
ac_help="$ac_help
  --with-macosx-archs[=arch list]
                          compile multiple architectures on MacOSX, ie.
                          universal.  Valid architectures are i386, ppc,
                          x86_64 and ppc64. (default: no [native])"
ac_help="$ac_help
  --with-macosx-sdk[=path/sdk]
                          compile with a system SDK on MacOSX. (default: no)"
ac_help="$ac_help
  --with-tiff             support TIFF functionality (default: yes)"
ac_help="$ac_help
  --with-png              support PNG functionality (default: yes)"
ac_help="$ac_help
  --with-tcltk            support Tcl/Tk functionality (default: yes)"
ac_help="$ac_help
  --with-postgres         support PostgreSQL functionality (default: no)"
ac_help="$ac_help
  --with-mysql            support MySQL functionality (default: no)"
ac_help="$ac_help
  --with-sqlite           support SQLite functionality (default: no)"
ac_help="$ac_help
  --with-ffmpeg           support FFMPEG functionality (default: no)"
ac_help="$ac_help
  --with-opengl           support OpenGL functionality (default: yes)"
ac_help="$ac_help
  --with-odbc             support ODBC functionality (default: no)"
ac_help="$ac_help
  --with-fftw             support FFTW functionality (default: yes)"
ac_help="$ac_help
  --with-blas             support BLAS functionality (default: no)"
ac_help="$ac_help
  --with-lapack           support LAPACK functionality (default: no)"
ac_help="$ac_help
  --with-motif            support Motif functionality (default: no)"
ac_help="$ac_help
  --with-cairo            support Cairo functionality (default: no)"
ac_help="$ac_help
  --with-freetype         support FreeType functionality (default: no)"
ac_help="$ac_help
  --with-glw              support GLw functionality (default: no)"
ac_help="$ac_help
  --with-nls              support NLS functionality (default: no)"
ac_help="$ac_help
  --with-readline         support Readline functionality (default: no)"
ac_help="$ac_help
  --with-opendwg          support openDWG functionality (default: no)"
ac_help="$ac_help
  --with-curses           support Curses functionality (default: yes)"
ac_help="$ac_help
  --with-regex            support regex functionality (default: yes)"
ac_help="$ac_help
  --with-gdal[=path/gdal-config]
                          enable GDAL/OGR support (gdal-config with path,
                          e.g. '--with-gdal=/usr/local/bin/gdal-config')"
ac_help="$ac_help
  --with-python[=path/python-config]
                          enable support for wxGUI Python extensions
                          (python-config with path, e.g.
                          '--with-python=/usr/bin/python2.5-config',
                          default: no)"
ac_help="$ac_help
  --with-wxwidgets[=path/wx-config]
                          enable wxWidgets support (wx-config with path,
                          e.g. '--with-wxwidgets=/usr/local/bin/wx-config',
                          default: no)"
ac_help="$ac_help
  --with-geos[=path/geos-config]
                          enable GEOS support (geos-config with path,
                          e.g. '--with-geos=/usr/local/bin/geos-config',
                          default: no)"
ac_help="$ac_help
  --with-includes=DIRS    site include files are in DIRS"
ac_help="$ac_help
  --with-libs=DIRS        site library files are in DIRS"
ac_help="$ac_help
  --with-zlib-includes=DIRS
                          zlib include files are in DIRS"
ac_help="$ac_help
  --with-zlib-libs=DIRS   zlib library files are in DIRS"
ac_help="$ac_help
  --with-readline-includes=DIRS
                          Readline include files are in DIRS"
ac_help="$ac_help
  --with-readline-libs=DIRS
                          Readline library files are in DIRS"
ac_help="$ac_help
  --with-tiff-includes=DIRS
                          TIFF include files are in DIRS"
ac_help="$ac_help
  --with-tiff-libs=DIRS   TIFF library files are in DIRS"
ac_help="$ac_help
  --with-png-includes=DIRS
                          PNG include files are in DIRS"
ac_help="$ac_help
  --with-png-libs=DIRS    PNG library files are in DIRS"
ac_help="$ac_help
  --with-tcltk-includes=DIRS
                          Tcl/Tk include files are in DIRS"
ac_help="$ac_help
  --with-tcltk-libs=DIRS  Tcl/Tk library files are in DIRS"
ac_help="$ac_help
  --with-postgres-includes=DIRS
                          PostgreSQL include files are in DIRS"
ac_help="$ac_help
  --with-postgres-libs=DIRS
                          PostgreSQL library files are in DIRS"
ac_help="$ac_help
  --with-mysql-includes=DIRS
                          MySQL include files are in DIRS"
ac_help="$ac_help
  --with-mysql-libs=DIRS  MySQL library files are in DIRS"
ac_help="$ac_help
  --with-sqlite-includes=DIRS
                          SQLite include files are in DIRS"
ac_help="$ac_help
  --with-sqlite-libs=DIRS SQLite library files are in DIRS"
ac_help="$ac_help
  --with-ffmpeg-includes=DIRS
                          FFMPEG include files are in DIRS"
ac_help="$ac_help
  --with-ffmpeg-libs=DIRS FFMPEG library files are in DIRS"
ac_help="$ac_help
  --with-opengl-includes=DIRS
                          OpenGL include files are in DIRS"
ac_help="$ac_help
  --with-opengl-libs=DIRS OpenGL library files are in DIRS"
ac_help="$ac_help
  --with-odbc-includes=DIRS
                          ODBC include files are in DIRS"
ac_help="$ac_help
  --with-odbc-libs=DIRS   ODBC library files are in DIRS"
ac_help="$ac_help
  --with-fftw-includes=DIRS
                          FFTW include files are in DIRS"
ac_help="$ac_help
  --with-fftw-libs=DIRS   FFTW library files are in DIRS"
ac_help="$ac_help
  --with-blas-includes=DIRS
                          BLAS include files are in DIRS"
ac_help="$ac_help
  --with-blas-libs=DIRS   BLAS library files are in DIRS"
ac_help="$ac_help
  --with-lapack-includes=DIRS
                          LAPACK include files are in DIRS"
ac_help="$ac_help
  --with-lapack-libs=DIRS LAPACK library files are in DIRS"
ac_help="$ac_help
  --with-cairo-includes=DIRS
                          cairo include files are in DIRS"
ac_help="$ac_help
  --with-cairo-libs=DIRS  cairo library files are in DIRS"
ac_help="$ac_help
  --with-cairo-ldflags=FLAGS
                          cairo needs FLAGS when linking"
ac_help="$ac_help
  --with-motif-includes=DIRS
                          Motif include files are in DIRS"
ac_help="$ac_help
  --with-motif-libs=DIRS  Motif library files are in DIRS"
ac_help="$ac_help
  --with-freetype-includes=DIRS
                          FreeType include files are in DIRS"
ac_help="$ac_help
  --with-freetype-libs=DIRS
                          FreeType library files are in DIRS"
ac_help="$ac_help
  --with-glw-includes=DIRS
                          GLw include files are in DIRS"
ac_help="$ac_help
  --with-glw-libs=DIRS    GLw library files are in DIRS"
ac_help="$ac_help
  --with-proj-includes=DIRS
                          External PROJ.4 include files are in DIRS"
ac_help="$ac_help
  --with-proj-libs=DIRS   External PROJ.4 library files are in DIRS"
ac_help="$ac_help
  --with-proj-share=DIR   External PROJ.4 data files are in DIR"
ac_help="$ac_help
  --with-opendwg-includes=DIRS
                          openDWG include files are in DIRS"
ac_help="$ac_help
  --with-opendwg-libs=DIRS
                          openDWG library files are in DIRS"
ac_help="$ac_help
  --with-regex-includes=DIRS
                          regex include files are in DIRS"
ac_help="$ac_help
  --with-regex-libs=DIRS  regex library files are in DIRS"
ac_help="$ac_help
  --with-x                use the X Window System"
ac_help="$ac_help
  --enable-largefile      enable support for large files (LFS)"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
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'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

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

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # 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 ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$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" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) 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)
    # 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 << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$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)
    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 ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

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

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

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

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# 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

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=configure.in

# 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_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# 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 "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done


ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi





ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:752: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:775: checking for $ac_word" >&5

if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:802: checking for $ac_word" >&5

if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 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
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:850: checking for $ac_word" >&5

if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:879: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 890 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:926: checking whether we are using GNU C" >&5

cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:951: checking whether ${CC-cc} accepts -g" >&5

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


echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:980: checking for Cygwin environment" >&5

cat > conftest.$ac_ext <<EOF
#line 983 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cygwin=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cygwin=no
fi
rm -f conftest*
rm -f conftest*

echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:1010: checking for mingw32 environment" >&5

cat > conftest.$ac_ext <<EOF
#line 1013 "configure"
#include "confdefs.h"

int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:1020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_mingw32=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_mingw32=no
fi
rm -f conftest*
rm -f conftest*

echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes


echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:1038: checking for executable suffix" >&5

if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  ac_cv_exeext=.exe
else
  ac_cv_exeext=no
fi

EXEEXT=""
test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
echo "$ac_t""${ac_cv_exeext}" 1>&6
ac_exeext=$EXEEXT



# Check for full floating-point support, including Infinity and NaN
IEEEFLAG=

echo $ac_n "checking for full floating-point support""... $ac_c" 1>&6
echo "configure:1057: checking for full floating-point support" >&5
if test "$cross_compiling" = yes; then
     echo "$ac_t""unknown (cross-compiling)" 1>&6
     
echo $ac_n "checking whether "cc -mieee" works""... $ac_c" 1>&6
echo "configure:1062: checking whether "cc -mieee" works" >&5
ac_save_cflags=${CFLAGS}
CFLAGS="$CFLAGS -mieee"
cat > conftest.$ac_ext <<EOF
#line 1066 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
     echo "$ac_t""yes" 1>&6
        IEEEFLAG="-mieee"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
     echo "$ac_t""no" 1>&6
fi
rm -f conftest*
CFLAGS=${ac_save_cflags}
 

else
  cat > conftest.$ac_ext <<EOF
#line 1089 "configure"
#include "confdefs.h"

#include <float.h>
int main(void) {
 double one = 1.0;
 double zero = 0.0;
 if (one/zero > DBL_MAX)        /* infinity */
   if (zero/zero != zero/zero)  /* NaN */
     return 0;
 return 1;
}

EOF
if { (eval echo configure:1103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
     echo "$ac_t""yes" 1>&6
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
     echo "$ac_t""no" 1>&6
     ac_save_cflags=${CFLAGS}
  CFLAGS=-mieee
  
echo $ac_n "checking for full floating-point support with -mieee""... $ac_c" 1>&6
echo "configure:1116: checking for full floating-point support with -mieee" >&5
if test "$cross_compiling" = yes; then
     echo "$ac_t""unknown (cross-compiling)" 1>&6
    { echo "configure: error: *** INTERNAL CONFIGURE ERROR" 1>&2; exit 1; }

else
  cat > conftest.$ac_ext <<EOF
#line 1123 "configure"
#include "confdefs.h"

#include <float.h>
int main(void) {
 double one = 1.0;
 double zero = 0.0;
 if (one/zero > DBL_MAX)        /* infinity */
   if (zero/zero != zero/zero)  /* NaN */
     return 0;
 return 1;
}

EOF
if { (eval echo configure:1137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
     echo "$ac_t""yes" 1>&6
    IEEEFLAG="-mieee"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
     echo "$ac_t""no" 1>&6
    echo "configure: warning: *** Incomplete floating-point support." 1>&2
fi
rm -fr conftest*
fi


  CFLAGS=${ac_save_cflags}
fi
rm -fr conftest*
fi


CFLAGS="$CFLAGS $IEEEFLAG"

# Set BINDIR

if test -n "${bindir}"; then
BINDIR="${bindir}"
else
BINDIR=/usr/local/bin
fi


# Set SRCDIR and DSTDIR

# Extract the first word of "pwd", so it can be a program name with args.
set dummy pwd; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1174: checking for $ac_word" >&5

case "$pwd" in
  /*)
  ac_cv_path_pwd="$pwd" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_pwd="$pwd" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_pwd="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_pwd" && ac_cv_path_pwd="pwd"
  ;;
esac
pwd="$ac_cv_path_pwd"
if test -n "$pwd"; then
  echo "$ac_t""$pwd" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test "$MINGW32" = yes ; then
  winpwd="$pwd -W"
else
  winpwd="$pwd"
fi

echo $ac_n "checking for source directory""... $ac_c" 1>&6
echo "configure:1212: checking for source directory" >&5

if test -z "$srcdir" ; then
  SRCDIR=`$pwd`
else
  SRCDIR=`(cd "$srcdir" ; $pwd)`
fi

echo "$ac_t"""$SRCDIR"" 1>&6

echo $ac_n "checking for build directory""... $ac_c" 1>&6
echo "configure:1223: checking for build directory" >&5

DSTDIR=`$pwd`
WINDSTDIR=`$winpwd`

echo "$ac_t"""$DSTDIR"" 1>&6




# Set ARCH

ARCH=
if test -z "${host}"; then
ARCH="unknown"
else
ARCH="${host}"
fi



# Use absolute path for aux directory so that install-sh works

ac_aux_dir=
for ac_dir in $SRCDIR $srcdir/$SRCDIR; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $SRCDIR $srcdir/$SRCDIR" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Set GISBASE and GRASS_BIN

GISBASE="${WINDSTDIR}/dist.${ARCH}"
GRASS_BIN="${DSTDIR}/bin.${ARCH}"




# Set GRASS_VERSION_*

GRASS_VERSION_FILE=include/VERSION
GRASS_VERSION_MAJOR=`sed -n 1p "${GRASS_VERSION_FILE}"`
GRASS_VERSION_MINOR=`sed -n 2p "${GRASS_VERSION_FILE}"`
GRASS_VERSION_RELEASE=`sed -n 3p "${GRASS_VERSION_FILE}"`
GRASS_VERSION_DATE=`sed -n 4p "${GRASS_VERSION_FILE}"`
GRASS_VERSION_NUMBER=`echo ${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}`
NAME_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/\..*//'`

LIB_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/^\([0-9.]*\).*$/\1/'`


GRASS_VERSION_SVN=
# Extract the first word of "svnversion", so it can be a program name with args.
set dummy svnversion; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1291: checking for $ac_word" >&5

case "$SVN_VERSION" in
  /*)
  ac_cv_path_SVN_VERSION="$SVN_VERSION" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_SVN_VERSION="$SVN_VERSION" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_SVN_VERSION="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_SVN_VERSION" && ac_cv_path_SVN_VERSION="no"
  ;;
esac
SVN_VERSION="$ac_cv_path_SVN_VERSION"
if test -n "$SVN_VERSION"; then
  echo "$ac_t""$SVN_VERSION" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$SVN_VERSION" != "no" ; then
   GRASS_VERSION_SVN=`$SVN_VERSION -c | cut -f2 -d:`
   if test "$GRASS_VERSION_SVN" = "exported" -o "$GRASS_VERSION_SVN" = "Unversioned directory" ; then
      GRASS_VERSION_SVN=
   fi
fi











# Check for MacOSX App

# Check whether --enable-macosx-app or --disable-macosx-app was given.
if test "${enable_macosx_app+set}" = set; then
  enableval="$enable_macosx_app"
  :
else
  enable_macosx_app=no
fi


echo $ac_n "checking for MacOSX App""... $ac_c" 1>&6
echo "configure:1350: checking for MacOSX App" >&5
case "$enable_macosx_app" in
	yes)	MACOSX_APP=1	;;
	no)	MACOSX_APP=	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac
echo "$ac_t"""$enable_macosx_app"" 1>&6


# Check for MacOSX archs

echo $ac_n "checking for MacOSX architectures""... $ac_c" 1>&6
echo "configure:1362: checking for MacOSX architectures" >&5

MACOSX_ARCHS=

if test -z "$with_macosx_archs" ; then
  echo "$ac_t""no" 1>&6
else
  for a in $with_macosx_archs
  do
    # check if valid arch?
    case "$a" in
      i386|ppc|x86_64|ppc64)
        MACOSX_ARCHS="$MACOSX_ARCHS -arch $a"
        ;;
    esac
  done
  echo "$ac_t""$MACOSX_ARCHS" 1>&6
  LDFLAGS="$LDFLAGS $MACOSX_ARCHS"
  CFLAGS="$CFLAGS $MACOSX_ARCHS"
  CXXFLAGS="$CXXFLAGS $MACOSX_ARCHS"
fi



# Done checking MacOSX archs

# Check for MacOSX SDK

echo $ac_n "checking for MacOSX SDK""... $ac_c" 1>&6
echo "configure:1391: checking for MacOSX SDK" >&5

MACOSX_SDK=

if test -z "$with_macosx_sdk" ; then
  echo "$ac_t""no" 1>&6
else
  
ac_safe=`echo "$with_macosx_sdk/SDKSettings.plist" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $with_macosx_sdk/SDKSettings.plist""... $ac_c" 1>&6
echo "configure:1401: checking for $with_macosx_sdk/SDKSettings.plist" >&5

if test "$cross_compiling" = yes; then
    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
else
  if test -r $with_macosx_sdk/SDKSettings.plist; then
    eval "ac_cv_file_$ac_safe=yes"
  else
    eval "ac_cv_file_$ac_safe=no"
  fi
fi
if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    MACOSX_SDK="-isysroot $with_macosx_sdk"
else
  echo "$ac_t""no" 1>&6

    { echo "configure: error: *** specified SDK does not exist or is not a SDK" 1>&2; exit 1; }
fi

  LDFLAGS="$LDFLAGS $MACOSX_SDK"
  CFLAGS="$CFLAGS $MACOSX_SDK"
  CXXFLAGS="$CXXFLAGS $MACOSX_SDK"
fi



# Done checking MacOSX SDK

# Set INST_DIR

if test -n "$MACOSX_APP" ; then
    INSTDIR='${prefix}'"/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.app/Contents/MacOS"
else
    INSTDIR='${prefix}'"/grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}"
fi



# Get flags for building shared libraries


    echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
echo "configure:1445: checking how to build libraries" >&5
    # Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
  shared_ok=$enableval
else
  shared_ok=yes
fi


    if test "${enable_shared+set}" = set; then
	enableval="$enable_shared"
	shared_ok=$enableval
    else
	shared_ok=yes
    fi

    if test "$shared_ok" = "yes" ; then
	echo "$ac_t""shared" 1>&6
	SHARED_BUILD=1
	GRASS_LIB_PREFIX='$(SHLIB_PREFIX)'
	GRASS_LIB_SUFFIX='$(SHLIB_SUFFIX)'
	GRASS_LIBRARY_TYPE='shlib'
    else
	echo "$ac_t""static" 1>&6
	SHARED_BUILD=0
	cat >> confdefs.h <<\EOF
#define STATIC_BUILD 1
EOF

	GRASS_LIB_PREFIX='$(STLIB_PREFIX)'
	GRASS_LIB_SUFFIX='$(STLIB_SUFFIX)'
	GRASS_LIBRARY_TYPE='stlib'
    fi
    
    
    


ac_save_ldflags="$LDFLAGS"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1488: checking for $ac_word" >&5

if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1513: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then

  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 1526 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 1543 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 1560 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6



    # Step 0.a: Enable 64 bit support?

    echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
echo "configure:1594: checking if 64bit support is requested" >&5
    # Check whether --enable-64bit or --disable-64bit was given.
if test "${enable_64bit+set}" = set; then
  enableval="$enable_64bit"
  :
else
  enableval="no"
fi


    if test "$enableval" = "yes"; then
	do64bit=yes
    else
	do64bit=no
    fi
    echo "$ac_t""$do64bit" 1>&6

    # Step 0.b: Enable Solaris 64 bit VIS support?

    echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6
echo "configure:1614: checking if 64bit Sparc VIS support is requested" >&5
    # Check whether --enable-64bit-vis or --disable-64bit-vis was given.
if test "${enable_64bit_vis+set}" = set; then
  enableval="$enable_64bit_vis"
  :
else
  enableval="no"
fi


    if test "$enableval" = "yes"; then
	# Force 64bit on with VIS
	do64bit=yes
	do64bitVIS=yes
    else
	do64bitVIS=no
    fi
    echo "$ac_t""$do64bitVIS" 1>&6

    # Step 1: set the variable "system" to hold the name and version number
    # for the system.  This can usually be done via the "uname" command, but
    # there are a few systems, like Next, where this doesn't work.

    echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6
echo "configure:1638: checking system version (for dynamic loading)" >&5
    if test -f /usr/lib/NextStep/software_version; then
	system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
    else
	system=`uname -s`-`uname -r`
	if test "$?" -ne 0 ; then
	    echo "$ac_t""unknown (can't find uname command)" 1>&6
	    system=unknown
	else
	    # Special check for weird MP-RAS system (uname returns weird
	    # results, and the version is kept in special file).
	
	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
		system=MP-RAS-`awk '{print }' /etc/.relid`
	    fi
	    if test "`uname -s`" = "AIX" ; then
		system=AIX-`uname -v`.`uname -r`
	    fi
	    echo "$ac_t""$system" 1>&6
	fi
    fi

    # Step 2: check for existence of -ldl library.  This is needed because
    # Linux can use either -ldl or -ldld for dynamic loading.

    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:1664: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1670 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  have_dl=yes
else
  echo "$ac_t""no" 1>&6
have_dl=no
fi


    # Require ranlib early so we can override it in special cases below.

    

    # Step 3: set configuration options based on system name and version.

    do64bit_ok=no
    EXTRA_CFLAGS=""
    GRASS_EXPORT_FILE_SUFFIX=""
    UNSHARED_LIB_SUFFIX=""
    GRASS_TRIM_DOTS='`echo ${LIB_VER} | tr -d .`'
    ECHO_VERSION='`echo ${LIB_VER}`'
    GRASS_LIB_VERSIONS_OK=ok
    CFLAGS_DEBUG=-g
    CFLAGS_OPTIMIZE=-O
    if test "$GCC" = "yes" ; then
	CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
    else
	CFLAGS_WARNING=""
    fi
    GRASS_NEEDS_EXP_FILE=0
    GRASS_BUILD_EXP_FILE=""
    GRASS_EXP_FILE=""
    # Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1728: checking for $ac_word" >&5

if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="ar"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    if test "${AR}" = "" ; then
	{ echo "configure: error: Required archive tool 'ar' not found on PATH." 1>&2; exit 1; }
    fi
    STLIB_LD='${AR} cr'
    LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
    PLAT_OBJS=""
    case $system in
	AIX-5.*)
	    if test "${GRASS_THREADS}" = "1" -a "$GCC" != "yes" ; then
		# AIX requires the _r compiler when gcc isn't being used
		if test "${CC}" != "cc_r" ; then
		    CC=${CC}_r
		fi
		echo "$ac_t""Using $CC for compiling with threads" 1>&6
	    fi
	    LIBS="$LIBS -lc"
	    # AIX-5 uses ELF style dynamic libraries
	    SHLIB_CFLAGS=""
	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
	    # symbols when dynamically loaded into tclsh.
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"

	    LDFLAGS=""

	    LD_LIBRARY_PATH_VAR="LIBPATH"

	    # Check to enable 64-bit flags for compiler/linker
	    if test "$do64bit" = "yes" ; then
		if test "$GCC" = "yes" ; then
		    echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
		else 
		    do64bit_ok=yes
		    EXTRA_CFLAGS="-q64"
		    LDFLAGS="-q64"
		    RANLIB="${RANLIB} -X64"
		    AR="${AR} -X64"
		    SHLIB_LD_FLAGS="-b64"
		fi
	    fi

	    if test "`uname -m`" = "ia64" ; then
		# AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
		# AIX-5 has dl* in libc.so
		if test "$GCC" = "yes" ; then
		    CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
		else
		    CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
		fi
		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
	    else
		#SHLIB_LD="${SRCDIR}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
		SHLIB_LD="$CC -shared"
		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
		GRASS_NEEDS_EXP_FILE=1
		GRASS_EXPORT_FILE_SUFFIX='${LIB_VER}.exp'
	    fi
	    ;;
	AIX-*)
	    if test "${GRASS_THREADS}" = "1" -a "$GCC" != "yes" ; then
		# AIX requires the _r compiler when gcc isn't being used
		if test "${CC}" != "cc_r" ; then
		    CC=${CC}_r
		fi
		echo "$ac_t""Using $CC for compiling with threads" 1>&6
	    fi
	    LIBS="$LIBS -lc"
	    SHLIB_CFLAGS=""
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    LD_LIBRARY_PATH_VAR="LIBPATH"
	    GRASS_NEEDS_EXP_FILE=1
	    GRASS_EXPORT_FILE_SUFFIX='${LIB_VER}.exp'

	    # Check to enable 64-bit flags for compiler/linker
	    if test "$do64bit" = "yes" ; then
		if test "$GCC" = "yes" ; then
		    echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
		else 
		    do64bit_ok=yes
		    EXTRA_CFLAGS="-q64"
		    LDFLAGS="-q64"
		    RANLIB="${RANLIB} -X64"
		    AR="${AR} -X64"
		    SHLIB_LD_FLAGS="-b64"
		fi
	    fi
	    #SHLIB_LD="${SRCDIR}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}"
	    SHLIB_LD="$CC -shared"

	    # On AIX <=v4 systems, libbsd.a has to be linked in to support
	    # non-blocking file IO.  This library has to be linked in after
	    # the MATH_LIBS or it breaks the pow() function.  The way to
	    # insure proper sequencing, is to add it to the tail of MATH_LIBS.
	    # This library also supplies gettimeofday.
	    #
	    # AIX does not have a timezone field in struct tm. When the AIX
	    # bsd library is used, the timezone global and the gettimeofday
	    # methods are to be avoided for timezone deduction instead, we
	    # deduce the timezone by comparing the localtime result on a
	    # known GMT value.

	    echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
echo "configure:1859: checking for gettimeofday in -lbsd" >&5
ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lbsd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1865 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gettimeofday();

int main() {
gettimeofday()
; return 0; }
EOF
if { (eval echo configure:1876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  libbsd=yes
else
  echo "$ac_t""no" 1>&6
libbsd=no
fi

	    if test $libbsd = yes; then
	    	MATH_LIBS="$MATH_LIBS -lbsd"
	    	cat >> confdefs.h <<\EOF
#define USE_DELTA_FOR_TZ 1
EOF

	    fi
	    ;;
	BeOS*)
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD="${CC} -nostart"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""

	    #-----------------------------------------------------------
	    # Check for inet_ntoa in -lbind, for BeOS (which also needs
	    # -lsocket, even if the network functions are in -lnet which
	    # is always linked to, for compatibility.
	    #-----------------------------------------------------------
	    echo $ac_n "checking for inet_ntoa in -lbind""... $ac_c" 1>&6
echo "configure:1917: checking for inet_ntoa in -lbind" >&5
ac_lib_var=`echo bind'_'inet_ntoa | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lbind  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1923 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char inet_ntoa();

int main() {
inet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -lbind -lsocket"
else
  echo "$ac_t""no" 1>&6
fi

	    ;;
	BSD/OS-2.1*|BSD/OS-3*)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="shlicc -r"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	BSD/OS-4.*)
	    SHLIB_CFLAGS="-export-dynamic -fPIC"
	    SHLIB_LD="cc -shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS="-export-dynamic"
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	dgux*)
	    SHLIB_CFLAGS="-K PIC"
	    SHLIB_LD="cc -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	HP-UX-*.11.*)
	    # Use updated header definitions where possible
	    cat >> confdefs.h <<\EOF
#define _XOPEN_SOURCE 1
EOF
          # Use the XOPEN network library
	    cat >> confdefs.h <<\EOF
#define _XOPEN_SOURCE_EXTENDED 1
EOF
 # Use the XOPEN network library
	    LIBS="$LIBS -lxnet"               # Use the XOPEN network library

	    SHLIB_SUFFIX=".sl"
	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "configure:1995: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2001 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shl_load();

int main() {
shl_load()
; return 0; }
EOF
if { (eval echo configure:2012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  shared_ok=yes
else
  echo "$ac_t""no" 1>&6
shared_ok=no
fi

	    if test "$shared_ok" = yes; then
		SHLIB_CFLAGS="+z"
		SHLIB_LD="ld -b"
		SHLIB_LD_LIBS='${LIBS}'
		LDFLAGS="-Wl,-E"
		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
	    fi

	    # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
	    #EXTRA_CFLAGS="+DAportable"

	    # Check to enable 64-bit flags for compiler/linker
	    if test "$do64bit" = "yes" ; then
		if test "$GCC" = "yes" ; then
		    hpux_arch=`gcc -dumpmachine`
		    case $hpux_arch in
			hppa64*)
			    # 64-bit gcc in use.  Fix flags for GNU ld.
			    do64bit_ok=yes
			    SHLIB_LD="gcc -shared"
			    SHLIB_LD_LIBS=""
			    LD_SEARCH_FLAGS=''
			    CC_SEARCH_FLAGS=''
			    ;;
			*)
			    echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
			    ;;
		    esac
		else
		    do64bit_ok=yes
		    if test "`uname -m`" = "ia64" ; then
			EXTRA_CFLAGS="+DD64"
			LDFLAGS="+DD64 $LDFLAGS"
		    else
			EXTRA_CFLAGS="+DA2.0W"
			LDFLAGS="+DA2.0W $LDFLAGS"
		    fi
		fi
	    fi
	    ;;
	HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
	    SHLIB_SUFFIX=".sl"
	    echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "configure:2077: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2083 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shl_load();

int main() {
shl_load()
; return 0; }
EOF
if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  shared_ok=yes
else
  echo "$ac_t""no" 1>&6
shared_ok=no
fi

	    if test "$shared_ok" = yes; then
		SHLIB_CFLAGS="+z"
		SHLIB_LD="ld -b"
		SHLIB_LD_LIBS=""
		LDFLAGS="-Wl,-E"
		CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
		LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
		LD_LIBRARY_PATH_VAR="SHLIB_PATH"
	    fi
	    ;;
	IRIX-4.*)
	    SHLIB_CFLAGS="-G 0"
	    SHLIB_SUFFIX=".a"
	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
	    SHLIB_LD_LIBS='${LIBS}'
	    LDFLAGS="-Wl,-D,08000000"
	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    SHARED_LIB_SUFFIX='${LIB_VER}.a'
	    ;;
	IRIX-5.*)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="ld -shared -rdata_shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
	    EXTRA_CFLAGS=""
	    LDFLAGS=""
	    ;;
	IRIX-6.2)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="ld -shared -rdata_shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
	    ;;
	IRIX-6.*|IRIX64-6.5*)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="ld -n32 -shared -rdata_shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
	    if test "$GCC" = "yes" ; then
		EXTRA_CFLAGS="-mabi=n32"
		LDFLAGS="-mabi=n32"
	    else
		case $system in
		    IRIX-6.3)
			# Use to build 6.2 compatible binaries on 6.3.
			EXTRA_CFLAGS="-n32 -D_OLD_TERMIOS"
			;;
		    *)
			EXTRA_CFLAGS="-n32"
			;;
		esac
		LDFLAGS="-n32"
	    fi
	    ;;
	IRIX64-6.*)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="ld -n32 -shared -rdata_shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'

	    # Check to enable 64-bit flags for compiler/linker

	    if test "$do64bit" = "yes" ; then
	        if test "$GCC" = "yes" ; then
	            echo "configure: warning: 64bit mode not supported by gcc" 1>&2
	        else
	            do64bit_ok=yes
	            SHLIB_LD="ld -64 -shared -rdata_shared"
	            EXTRA_CFLAGS="-64"
	            LDFLAGS="-64"
	        fi
	    fi
	    ;;
	Linux*)
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"

	    CFLAGS_OPTIMIZE=-O2
	    # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings 
	    # when you inline the string and math operations.  Turn this off to
	    # get rid of the warnings.
	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"

	    if test "$have_dl" = yes; then
		SHLIB_LD="${CC} -shared"
		LDFLAGS="-Wl,--export-dynamic"
		CC_SEARCH_FLAGS='-Wl,-rpath-link,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    else
		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dld.h""... $ac_c" 1>&6
echo "configure:2216: checking for dld.h" >&5

cat > conftest.$ac_ext <<EOF
#line 2219 "configure"
#include "confdefs.h"
#include <dld.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
		    SHLIB_LD="ld -shared"
		    LDFLAGS=""
		    CC_SEARCH_FLAGS=""
		    LD_SEARCH_FLAGS=""
else
  echo "$ac_t""no" 1>&6
fi

	    fi
	    if test "`uname -m`" = "alpha" ; then
		EXTRA_CFLAGS="-mieee"
	    fi

	    # The combo of gcc + glibc has a bug related
	    # to inlining of functions like strtod(). The
	    # -fno-builtin flag should address this problem
	    # but it does not work. The -fno-inline flag
	    # is kind of overkill but it works.
	    # Disable inlining only when one of the
	    # files in compat/*.c is being linked in.
	    if test x"${USE_COMPAT}" != x ; then
	        EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
	    fi

	    # XIM peeking works under XFree86.
	    cat >> confdefs.h <<\EOF
#define PEEK_XCLOSEIM 1
EOF


	    ;;
	GNU*)
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"

	    if test "$have_dl" = yes; then
		SHLIB_LD="${CC} -shared"
		LDFLAGS="-Wl,--export-dynamic"
		CC_SEARCH_FLAGS=""
		LD_SEARCH_FLAGS=""
	    else
		ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dld.h""... $ac_c" 1>&6
echo "configure:2284: checking for dld.h" >&5

cat > conftest.$ac_ext <<EOF
#line 2287 "configure"
#include "confdefs.h"
#include <dld.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
		    SHLIB_LD="ld -shared"
		    LDFLAGS=""
		    CC_SEARCH_FLAGS=""
		    LD_SEARCH_FLAGS=""
else
  echo "$ac_t""no" 1>&6
fi

	    fi
	    if test "`uname -m`" = "alpha" ; then
		EXTRA_CFLAGS="-mieee"
	    fi
	    ;;
        CYGWIN*)
            SHLIB_CFLAGS=""
	    SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".dll"

            SHLIB_LD="${CC} -shared"
            LDFLAGS="-Wl,--export-dynamic"
            CC_SEARCH_FLAGS=""
            LD_SEARCH_FLAGS=""
	    LD_LIBRARY_PATH_VAR="PATH"
	    ;;
        MINGW* | MSYS*)
            SHLIB_CFLAGS=""
            SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".dll"

            SHLIB_LD="${CC} -shared"
            LDFLAGS="-Wl,--export-dynamic,--enable-runtime-pseudo-reloc"
            CC_SEARCH_FLAGS=""
            LD_SEARCH_FLAGS=""
            LD_LIBRARY_PATH_VAR="PATH"
            ;;
	MP-RAS-02*)
	    SHLIB_CFLAGS="-K PIC"
	    SHLIB_LD="cc -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	MP-RAS-*)
	    SHLIB_CFLAGS="-K PIC"
	    SHLIB_LD="cc -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS="-Wl,-Bexport"
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	NetBSD-*)
	    # NetBSD has ELF.
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD="ld -Bshareable -x"
	    SHLIB_LD_LIBS="${LIBS}"
	    SHLIB_SUFFIX=".so"
	    LDFLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR} -export-dynamic'
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    if test "${GRASS_THREADS}" = "1" ; then
		# The -pthread needs to go in the CFLAGS, not LIBS
		LIBS=`echo $LIBS | sed s/-pthread//`
		EXTRA_CFLAGS="-pthread"
		LDFLAGS="$LDFLAGS -pthread"
	    fi
	    # NetBSD doesn't handle version numbers with dots.
	    UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so',
	    GRASS_LIB_VERSIONS_OK=nodots
	    ;;
	OpenBSD-*)
	    SHLIB_LD="${CC} -shared"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    echo $ac_n "checking for ELF""... $ac_c" 1>&6
echo "configure:2389: checking for ELF" >&5
	    cat > conftest.$ac_ext <<EOF
#line 2391 "configure"
#include "confdefs.h"

#ifdef __ELF__
	yes
#endif
	    
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
		SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
		SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
	    
fi
rm -f conftest*


	    # OpenBSD doesn't do version numbers with dots.
	    UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    GRASS_LIB_VERSIONS_OK=nodots
	    ;;
	FreeBSD-[1-2].*)
	    # Not available on all versions:  check for include file.
	    ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:2421: checking for dlfcn.h" >&5

cat > conftest.$ac_ext <<EOF
#line 2424 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
		SHLIB_CFLAGS="-fPIC"
		SHLIB_LD="ld -Bshareable -x"
		SHLIB_LD_LIBS=""
		SHLIB_SUFFIX=".so"
		LDFLAGS=""
		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
		echo $ac_n "checking for ELF""... $ac_c" 1>&6
echo "configure:2453: checking for ELF" >&5
		cat > conftest.$ac_ext <<EOF
#line 2455 "configure"
#include "confdefs.h"

#ifdef __ELF__
	yes
#endif
		
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
		    SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so'
else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
		    SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
		
fi
rm -f conftest*

	    
else
  echo "$ac_t""no" 1>&6

		SHLIB_CFLAGS=""
		SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
		SHLIB_LD_LIBS='${LIBS}'
		SHLIB_SUFFIX=".a"
		LDFLAGS=""
		CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
		SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    
fi

	    UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    GRASS_LIB_VERSIONS_OK=nodots
	    ;;
	FreeBSD-*)
	    # FreeBSD 3.* and greater have ELF.
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD="ld -Bshareable -x"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS="-export-dynamic"
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
	    if test "${GRASS_THREADS}" = "1" ; then
		# The -pthread needs to go in the CFLAGS, not LIBS
		LIBS=`echo $LIBS | sed s/-pthread//`
		EXTRA_CFLAGS="-pthread"
	    	LDFLAGS="$LDFLAGS -pthread"
	    fi
	    case $system in
	    FreeBSD-3.*)
	    	# FreeBSD-3 doesn't handle version numbers with dots.
	    	UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    	SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so'
	    	GRASS_LIB_VERSIONS_OK=nodots
		;;
	    esac
	    ;;
	Rhapsody-*|Darwin-*)
	    SHLIB_CFLAGS="-fno-common"
	    SHLIB_LD="cc -dynamiclib -compatibility_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -current_version \${GRASS_VERSION_MAJOR}.\${GRASS_VERSION_MINOR} -install_name \${INST_DIR}/lib/lib\${LIB_NAME}\${SHLIB_SUFFIX}"
	    GRASS_SHLIB_LD_EXTRAS=""
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".dylib"
	    PLAT_OBJS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    CFLAGS_OPTIMIZE="-Os"
	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
	    # for compatibility with autoconf vers 2.13 :
	    HACK=""
	    EXTRA_CFLAGS=""
	    LIBS="$LIBS"
	    ;;
	NEXTSTEP-*)
	    SHLIB_CFLAGS=""
	    SHLIB_LD="cc -nostdlib -r"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	OS/390-*)
	    CFLAGS_OPTIMIZE=""      # Optimizer is buggy
	    cat >> confdefs.h <<\EOF
#define _OE_SOCKETS 1
EOF
  # needed in sys/socket.h
	    ;;      
	OSF1-1.0|OSF1-1.1|OSF1-1.2)
	    # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
	    SHLIB_CFLAGS=""
	    # Hack: make package name same as library name
	    SHLIB_LD='ld -R -export :'
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	OSF1-1.*)
	    # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
	    SHLIB_CFLAGS="-fPIC"
	    if test "$SHARED_BUILD" = "1" ; then
	        SHLIB_LD="ld -shared"
	    else
	        SHLIB_LD="ld -non_shared"
	    fi
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	OSF1-V*)
	    # Digital OSF/1
	    SHLIB_CFLAGS=""
	    if test "$SHARED_BUILD" = "1" ; then
	        SHLIB_LD='ld -shared -expect_unresolved "*"'
	    else
	        SHLIB_LD='ld -non_shared -expect_unresolved "*"'
	    fi
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
	    if test "$GCC" = "yes" ; then
		EXTRA_CFLAGS="-mieee"
            else
		EXTRA_CFLAGS="-DHAVE_TZSET -std1 -ieee"
	    fi
	    # see pthread_intro(3) for pthread support on osf1, k.furukawa
	    if test "${GRASS_THREADS}" = "1" ; then
		EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
		EXTRA_CFLAGS="${EXTRA_CFLAGS} -DGRASS_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
		LIBS=`echo $LIBS | sed s/-lpthreads//`
		if test "$GCC" = "yes" ; then
		    LIBS="$LIBS -lpthread -lmach -lexc"
		else
		    EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
		    LDFLAGS="-pthread"
		fi
	    fi

	    ;;
	QNX-6*)
	    # QNX RTP
	    # This may work for all QNX, but it was only reported for v6.
	    SHLIB_CFLAGS="-fPIC"
	    SHLIB_LD="ld -Bshareable -x"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	RISCos-*)
	    SHLIB_CFLAGS="-G 0"
	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".a"
	    LDFLAGS="-Wl,-D,08000000"
	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    ;;
	SCO_SV-3.2*)
	    # Note, dlopen is available only on SCO 3.2.5 and greater. However,
	    # this test works, since "uname -s" was non-standard in 3.2.4 and
	    # below.
	    if test "$GCC" = "yes" ; then
	    	SHLIB_CFLAGS="-fPIC -melf"
	    	LDFLAGS="-melf -Wl,-Bexport"
	    else
	    	SHLIB_CFLAGS="-Kpic -belf"
	    	LDFLAGS="-belf -Wl,-Bexport"
	    fi
	    SHLIB_LD="ld -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	SINIX*5.4*)
	    SHLIB_CFLAGS="-K PIC"
	    SHLIB_LD="cc -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
	SunOS-4*)
	    SHLIB_CFLAGS="-PIC"
	    SHLIB_LD="ld"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}

	    # SunOS can't handle version numbers with dots in them in library
	    # specs, like -ltcl7.5, so use -ltcl75 instead.  Also, it
	    # requires an extra version number at the end of .so file names.
	    # So, the library has to have a name like libtcl75.so.1.0

	    SHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.so.1.0'
	    UNSHARED_LIB_SUFFIX='${GRASS_TRIM_DOTS}.a'
	    GRASS_LIB_VERSIONS_OK=nodots
	    ;;
	SunOS-5.[0-6].*)

	    # Note: If _REENTRANT isn't defined, then Solaris
	    # won't define thread-safe library routines.

	    cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

	    cat >> confdefs.h <<\EOF
#define _POSIX_PTHREAD_SEMANTICS 1
EOF


	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
	    # symbols when dynamically loaded into tclsh.

	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    LDFLAGS=""
	    if test "$GCC" = "yes" ; then
		SHLIB_CFLAGS="-fPIC"
		SHLIB_LD="$CC -shared"
		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    else
		SHLIB_CFLAGS="-KPIC"
		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
		CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    fi
	    ;;
	SunOS-5*)

	    # Note: If _REENTRANT isn't defined, then Solaris
	    # won't define thread-safe library routines.

	    cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF

	    cat >> confdefs.h <<\EOF
#define _POSIX_PTHREAD_SEMANTICS 1
EOF


	    LDFLAGS=""
    
	    # Check to enable 64-bit flags for compiler/linker
	    if test "$do64bit" = "yes" ; then
		arch=`isainfo`
		if test "$arch" = "sparcv9 sparc" ; then
			if test "$GCC" = "yes" ; then
			    echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
			else
			    SHLIB_CFLAGS="-KPIC"
			    do64bit_ok=yes
			    if test "$do64bitVIS" = "yes" ; then
				EXTRA_CFLAGS="-xarch=v9a"
			    	LDFLAGS="-xarch=v9a"
			    else
				EXTRA_CFLAGS="-xarch=v9"
			    	LDFLAGS="-xarch=v9"
			    fi
			fi
		else
		    echo "configure: warning: "64bit mode only supported sparcv9 system"" 1>&2
		fi
	    fi
	    
	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
	    # symbols when dynamically loaded into tclsh.

	    SHLIB_LD_LIBS='${LIBS}'
	    SHLIB_SUFFIX=".so"
	    if test "$GCC" = "yes" ; then
		SHLIB_CFLAGS="-fPIC"
		SHLIB_LD="$CC -shared"
		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    else
		SHLIB_CFLAGS="-KPIC"
		SHLIB_LD="CC -G -z text"
		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
	    fi
	    ;;
	ULTRIX-4.*)
	    SHLIB_CFLAGS="-G 0"
	    SHLIB_SUFFIX=".a"
	    SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
	    SHLIB_LD_LIBS='${LIBS}'
	    LDFLAGS="-Wl,-D,08000000"
	    CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
	    LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
	    if test "$GCC" != "yes" ; then
		EXTRA_CFLAGS="-DHAVE_TZSET -std1"
	    fi
	    ;;
	UNIX_SV* | UnixWare-5*)
	    SHLIB_CFLAGS="-KPIC"
	    SHLIB_LD="cc -G"
	    SHLIB_LD_LIBS=""
	    SHLIB_SUFFIX=".so"
	    # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
	    # that don't grok the -Bexport option.  Test that it does.
	    hold_ldflags=$LDFLAGS
	    echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6
echo "configure:2779: checking for ld accepts -Bexport flag" >&5
	    LDFLAGS="${LDFLAGS} -Wl,-Bexport"
	    cat > conftest.$ac_ext <<EOF
#line 2782 "configure"
#include "confdefs.h"

int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:2789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  found=no
fi
rm -f conftest*
	    LDFLAGS=$hold_ldflags
	    echo "$ac_t""$found" 1>&6
	    if test $found = yes; then
	    LDFLAGS="-Wl,-Bexport"
	    else
	    LDFLAGS=""
	    fi
	    CC_SEARCH_FLAGS=""
	    LD_SEARCH_FLAGS=""
	    ;;
    esac

    # If we're running gcc, then change the C flags for compiling shared
    # libraries to the right flags for gcc, instead of those for the
    # standard manufacturer compiler.

	if test "$GCC" = "yes" ; then
	    case $system in
		AIX-*)
		    ;;
		BSD/OS*)
		    ;;
                *)
		    ;;
		NetBSD-*|FreeBSD-*)
		    ;;
		Rhapsody-*|Darwin-*)
		    ;;
		RISCos-*)
		    ;;
		SCO_SV-3.2*)
		    ;;
		ULTRIX-4.*)
		    ;;
		*)
		    SHLIB_CFLAGS="-fPIC"
		    ;;
	    esac
	fi

    if test "$SHARED_LIB_SUFFIX" = "" ; then
	SHARED_LIB_SUFFIX='${LIB_VER}${SHLIB_SUFFIX}'
    fi
    if test "$UNSHARED_LIB_SUFFIX" = "" ; then
	UNSHARED_LIB_SUFFIX='${LIB_VER}.a'
    fi

    if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
        LIB_SUFFIX=${SHARED_LIB_SUFFIX}
        MAKE_LIB='${SHLIB_LD} -o $@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${GRASS_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
        INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
    else
        LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}

        if test "$RANLIB" = "" ; then
            MAKE_LIB='$(STLIB_LD) $@ ${OBJS}'
            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
        else
            MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@'
            INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
        fi

    fi


    # Stub lib does not depend on shared/static configuration
    if test "$RANLIB" = "" ; then
        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}'
        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
    else
        MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@'
        INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
    fi

    
    
    
    
    
    

    
    
    
    
    
    

    
    
    
    
    
    
    

    
    
    
    
    

LDFLAGS="${ac_save_ldflags} $LDFLAGS"

# Enable options

# Check whether --enable-w11 or --disable-w11 was given.
if test "${enable_w11+set}" = set; then
  enableval="$enable_w11"
  :
else
  enable_w11=no
fi


# With options


# Check whether --with-cxx or --without-cxx was given.
if test "${with_cxx+set}" = set; then
  withval="$with_cxx"
  :
else
  with_cxx=no
fi


#LOC_ARG_WITH(g77, GNU Fortran 77, no)

# Check whether --with-macosx-archs or --without-macosx-archs was given.
if test "${with_macosx_archs+set}" = set; then
  withval="$with_macosx_archs"
  :
else
  with_macosx_archs="no"
fi

# Check whether --with-macosx-sdk or --without-macosx-sdk was given.
if test "${with_macosx_sdk+set}" = set; then
  withval="$with_macosx_sdk"
  :
else
  with_macosx_sdk="no"
fi


# Check whether --with-tiff or --without-tiff was given.
if test "${with_tiff+set}" = set; then
  withval="$with_tiff"
  :
else
  with_tiff=yes
fi



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



# Check whether --with-tcltk or --without-tcltk was given.
if test "${with_tcltk+set}" = set; then
  withval="$with_tcltk"
  :
else
  with_tcltk=yes
fi



# Check whether --with-postgres or --without-postgres was given.
if test "${with_postgres+set}" = set; then
  withval="$with_postgres"
  :
else
  with_postgres=no
fi



# Check whether --with-mysql or --without-mysql was given.
if test "${with_mysql+set}" = set; then
  withval="$with_mysql"
  :
else
  with_mysql=no
fi



# Check whether --with-sqlite or --without-sqlite was given.
if test "${with_sqlite+set}" = set; then
  withval="$with_sqlite"
  :
else
  with_sqlite=no
fi



# Check whether --with-ffmpeg or --without-ffmpeg was given.
if test "${with_ffmpeg+set}" = set; then
  withval="$with_ffmpeg"
  :
else
  with_ffmpeg=no
fi



# Check whether --with-opengl or --without-opengl was given.
if test "${with_opengl+set}" = set; then
  withval="$with_opengl"
  :
else
  with_opengl=yes
fi



# Check whether --with-odbc or --without-odbc was given.
if test "${with_odbc+set}" = set; then
  withval="$with_odbc"
  :
else
  with_odbc=no
fi



# Check whether --with-fftw or --without-fftw was given.
if test "${with_fftw+set}" = set; then
  withval="$with_fftw"
  :
else
  with_fftw=yes
fi



# Check whether --with-blas or --without-blas was given.
if test "${with_blas+set}" = set; then
  withval="$with_blas"
  :
else
  with_blas=no
fi



# Check whether --with-lapack or --without-lapack was given.
if test "${with_lapack+set}" = set; then
  withval="$with_lapack"
  :
else
  with_lapack=no
fi



# Check whether --with-motif or --without-motif was given.
if test "${with_motif+set}" = set; then
  withval="$with_motif"
  :
else
  with_motif=no
fi



# Check whether --with-cairo or --without-cairo was given.
if test "${with_cairo+set}" = set; then
  withval="$with_cairo"
  :
else
  with_cairo=no
fi



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



# Check whether --with-glw or --without-glw was given.
if test "${with_glw+set}" = set; then
  withval="$with_glw"
  :
else
  with_glw=no
fi



# Check whether --with-nls or --without-nls was given.
if test "${with_nls+set}" = set; then
  withval="$with_nls"
  :
else
  with_nls=no
fi



# Check whether --with-readline or --without-readline was given.
if test "${with_readline+set}" = set; then
  withval="$with_readline"
  :
else
  with_readline=no
fi



# Check whether --with-opendwg or --without-opendwg was given.
if test "${with_opendwg+set}" = set; then
  withval="$with_opendwg"
  :
else
  with_opendwg=no
fi



# Check whether --with-curses or --without-curses was given.
if test "${with_curses+set}" = set; then
  withval="$with_curses"
  :
else
  with_curses=yes
fi



# Check whether --with-regex or --without-regex was given.
if test "${with_regex+set}" = set; then
  withval="$with_regex"
  :
else
  with_regex=yes
fi



# Check whether --with-gdal or --without-gdal was given.
if test "${with_gdal+set}" = set; then
  withval="$with_gdal"
  :
fi


# Check whether --with-python or --without-python was given.
if test "${with_python+set}" = set; then
  withval="$with_python"
  :
else
  with_python="no"
fi


# Check whether --with-wxwidgets or --without-wxwidgets was given.
if test "${with_wxwidgets+set}" = set; then
  withval="$with_wxwidgets"
  :
else
  with_wxwidgets="no"
fi


# With includes and libs options

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


# Check whether --with-includes or --without-includes was given.
if test "${with_includes+set}" = set; then
  withval="$with_includes"
  :
fi


# Check whether --with-libs or --without-libs was given.
if test "${with_libs+set}" = set; then
  withval="$with_libs"
  :
fi



# Check whether --with-zlib-includes or --without-zlib-includes was given.
if test "${with_zlib_includes+set}" = set; then
  withval="$with_zlib_includes"
  :
fi



# Check whether --with-zlib-libs or --without-zlib-libs was given.
if test "${with_zlib_libs+set}" = set; then
  withval="$with_zlib_libs"
  :
fi




# Check whether --with-readline-includes or --without-readline-includes was given.
if test "${with_readline_includes+set}" = set; then
  withval="$with_readline_includes"
  :
fi



# Check whether --with-readline-libs or --without-readline-libs was given.
if test "${with_readline_libs+set}" = set; then
  withval="$with_readline_libs"
  :
fi




# Check whether --with-tiff-includes or --without-tiff-includes was given.
if test "${with_tiff_includes+set}" = set; then
  withval="$with_tiff_includes"
  :
fi



# Check whether --with-tiff-libs or --without-tiff-libs was given.
if test "${with_tiff_libs+set}" = set; then
  withval="$with_tiff_libs"
  :
fi




# Check whether --with-png-includes or --without-png-includes was given.
if test "${with_png_includes+set}" = set; then
  withval="$with_png_includes"
  :
fi



# Check whether --with-png-libs or --without-png-libs was given.
if test "${with_png_libs+set}" = set; then
  withval="$with_png_libs"
  :
fi




# Check whether --with-tcltk-includes or --without-tcltk-includes was given.
if test "${with_tcltk_includes+set}" = set; then
  withval="$with_tcltk_includes"
  :
fi



# Check whether --with-tcltk-libs or --without-tcltk-libs was given.
if test "${with_tcltk_libs+set}" = set; then
  withval="$with_tcltk_libs"
  :
fi




# Check whether --with-postgres-includes or --without-postgres-includes was given.
if test "${with_postgres_includes+set}" = set; then
  withval="$with_postgres_includes"
  :
fi



# Check whether --with-postgres-libs or --without-postgres-libs was given.
if test "${with_postgres_libs+set}" = set; then
  withval="$with_postgres_libs"
  :
fi




# Check whether --with-mysql-includes or --without-mysql-includes was given.
if test "${with_mysql_includes+set}" = set; then
  withval="$with_mysql_includes"
  :
fi



# Check whether --with-mysql-libs or --without-mysql-libs was given.
if test "${with_mysql_libs+set}" = set; then
  withval="$with_mysql_libs"
  :
fi




# Check whether --with-sqlite-includes or --without-sqlite-includes was given.
if test "${with_sqlite_includes+set}" = set; then
  withval="$with_sqlite_includes"
  :
fi



# Check whether --with-sqlite-libs or --without-sqlite-libs was given.
if test "${with_sqlite_libs+set}" = set; then
  withval="$with_sqlite_libs"
  :
fi




# Check whether --with-ffmpeg-includes or --without-ffmpeg-includes was given.
if test "${with_ffmpeg_includes+set}" = set; then
  withval="$with_ffmpeg_includes"
  :
fi



# Check whether --with-ffmpeg-libs or --without-ffmpeg-libs was given.
if test "${with_ffmpeg_libs+set}" = set; then
  withval="$with_ffmpeg_libs"
  :
fi




# Check whether --with-opengl-includes or --without-opengl-includes was given.
if test "${with_opengl_includes+set}" = set; then
  withval="$with_opengl_includes"
  :
fi



# Check whether --with-opengl-libs or --without-opengl-libs was given.
if test "${with_opengl_libs+set}" = set; then
  withval="$with_opengl_libs"
  :
fi




# Check whether --with-odbc-includes or --without-odbc-includes was given.
if test "${with_odbc_includes+set}" = set; then
  withval="$with_odbc_includes"
  :
fi



# Check whether --with-odbc-libs or --without-odbc-libs was given.
if test "${with_odbc_libs+set}" = set; then
  withval="$with_odbc_libs"
  :
fi




# Check whether --with-fftw-includes or --without-fftw-includes was given.
if test "${with_fftw_includes+set}" = set; then
  withval="$with_fftw_includes"
  :
fi



# Check whether --with-fftw-libs or --without-fftw-libs was given.
if test "${with_fftw_libs+set}" = set; then
  withval="$with_fftw_libs"
  :
fi




# Check whether --with-blas-includes or --without-blas-includes was given.
if test "${with_blas_includes+set}" = set; then
  withval="$with_blas_includes"
  :
fi



# Check whether --with-blas-libs or --without-blas-libs was given.
if test "${with_blas_libs+set}" = set; then
  withval="$with_blas_libs"
  :
fi




# Check whether --with-lapack-includes or --without-lapack-includes was given.
if test "${with_lapack_includes+set}" = set; then
  withval="$with_lapack_includes"
  :
fi



# Check whether --with-lapack-libs or --without-lapack-libs was given.
if test "${with_lapack_libs+set}" = set; then
  withval="$with_lapack_libs"
  :
fi




# Check whether --with-cairo-includes or --without-cairo-includes was given.
if test "${with_cairo_includes+set}" = set; then
  withval="$with_cairo_includes"
  :
fi



# Check whether --with-cairo-libs or --without-cairo-libs was given.
if test "${with_cairo_libs+set}" = set; then
  withval="$with_cairo_libs"
  :
fi



# Check whether --with-cairo-ldflags or --without-cairo-ldflags was given.
if test "${with_cairo_ldflags+set}" = set; then
  withval="$with_cairo_ldflags"
  :
fi




# Check whether --with-motif-includes or --without-motif-includes was given.
if test "${with_motif_includes+set}" = set; then
  withval="$with_motif_includes"
  :
fi



# Check whether --with-motif-libs or --without-motif-libs was given.
if test "${with_motif_libs+set}" = set; then
  withval="$with_motif_libs"
  :
fi




# Check whether --with-freetype-includes or --without-freetype-includes was given.
if test "${with_freetype_includes+set}" = set; then
  withval="$with_freetype_includes"
  :
fi



# Check whether --with-freetype-libs or --without-freetype-libs was given.
if test "${with_freetype_libs+set}" = set; then
  withval="$with_freetype_libs"
  :
fi




# Check whether --with-glw-includes or --without-glw-includes was given.
if test "${with_glw_includes+set}" = set; then
  withval="$with_glw_includes"
  :
fi



# Check whether --with-glw-libs or --without-glw-libs was given.
if test "${with_glw_libs+set}" = set; then
  withval="$with_glw_libs"
  :
fi




# Check whether --with-proj-includes or --without-proj-includes was given.
if test "${with_proj_includes+set}" = set; then
  withval="$with_proj_includes"
  :
fi



# Check whether --with-proj-libs or --without-proj-libs was given.
if test "${with_proj_libs+set}" = set; then
  withval="$with_proj_libs"
  :
fi



# Check whether --with-proj-share or --without-proj-share was given.
if test "${with_proj_share+set}" = set; then
  withval="$with_proj_share"
  :
fi




# Check whether --with-opendwg-includes or --without-opendwg-includes was given.
if test "${with_opendwg_includes+set}" = set; then
  withval="$with_opendwg_includes"
  :
fi



# Check whether --with-opendwg-libs or --without-opendwg-libs was given.
if test "${with_opendwg_libs+set}" = set; then
  withval="$with_opendwg_libs"
  :
fi




# Check whether --with-regex-includes or --without-regex-includes was given.
if test "${with_regex_includes+set}" = set; then
  withval="$with_regex_includes"
  :
fi



# Check whether --with-regex-libs or --without-regex-libs was given.
if test "${with_regex_libs+set}" = set; then
  withval="$with_regex_libs"
  :
fi



# Put this early on so CPPFLAGS and LDFLAGS have any additional dirs

# With includes option

# Handle Fortran compiler choice
#LOC_CHECK_USE(g77, GNU Fortran 77, USE_G77)
# Done checking fortran

echo $ac_n "checking for additional include dirs""... $ac_c" 1>&6
echo "configure:3587: checking for additional include dirs" >&5
case "$with_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to list --with-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_includes" 1>&6

if test -n "$with_includes"; then
    for dir in $with_includes; do
        if test -d "$dir"; then
            INCLUDE_DIRS="$INCLUDE_DIRS -I$dir"
        else
            { echo "configure: error: *** Include directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
    CPPFLAGS="$CPPFLAGS $INCLUDE_DIRS"
fi


# With libs option

echo $ac_n "checking for additional library dirs""... $ac_c" 1>&6
echo "configure:3610: checking for additional library dirs" >&5
case "$with_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory list to --with-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_libs" 1>&6

if test -n "$with_libs"; then
    for dir in $with_libs; do
        if test -d "$dir"; then
            LIBRARY_DIRS="$LIBRARY_DIRS -L$dir"
        else
            { echo "configure: error: *** Library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
    LDFLAGS="$LDFLAGS $LIBRARY_DIRS"
fi


# Programs and standard headers, libraries, functions

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:3644: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then

  IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'


# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3697: checking for $ac_word" >&5

if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LEX="flex"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
  echo "$ac_t""$LEX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:3728: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3734 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* 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; }
EOF
if { (eval echo configure:3745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LEXLIB="-l$ac_lib"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test "$LEX" = "lex"; then
    # Extract the first word of "lex", so it can be a program name with args.
set dummy lex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3770: checking for $ac_word" >&5

case "$LEXPATH" in
  /*)
  ac_cv_path_LEXPATH="$LEXPATH" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_LEXPATH="$LEXPATH" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_LEXPATH="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_LEXPATH" && ac_cv_path_LEXPATH="no"
  ;;
esac
LEXPATH="$ac_cv_path_LEXPATH"
if test -n "$LEXPATH"; then
  echo "$ac_t""$LEXPATH" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    if test "$LEXPATH" = "no"; then
	{ echo "configure: error: *** Unable to locate lex." 1>&2; exit 1; }
    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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3810: checking for $ac_word" >&5

if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_YACC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
YACC="$ac_cv_prog_YACC"
if test -n "$YACC"; then
  echo "$ac_t""$YACC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

if test "$YACC" = "yacc"; then
    # Extract the first word of "yacc", so it can be a program name with args.
set dummy yacc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3841: checking for $ac_word" >&5

case "$YACCPATH" in
  /*)
  ac_cv_path_YACCPATH="$YACCPATH" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_YACCPATH="$YACCPATH" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_YACCPATH="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_YACCPATH" && ac_cv_path_YACCPATH="no"
  ;;
esac
YACCPATH="$ac_cv_path_YACCPATH"
if test -n "$YACCPATH"; then
  echo "$ac_t""$YACCPATH" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    if test "$YACCPATH" = "no"; then
	{ echo "configure: error: *** Unable to locate yacc." 1>&2; exit 1; }
    fi
fi

# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3879: checking for $ac_word" >&5

if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

for ac_prog in ar
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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3908: checking for $ac_word" >&5

if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AR" && break
done

for ac_prog in env
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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3939: checking for $ac_word" >&5

if test -n "$ENV"; then
  ac_cv_prog_ENV="$ENV" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_ENV="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
ENV="$ac_cv_prog_ENV"
if test -n "$ENV"; then
  echo "$ac_t""$ENV" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$ENV" && break
done

# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3968: checking for $ac_word" >&5

case "$PERL" in
  /*)
  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PERL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
  ;;
esac
PERL="$ac_cv_path_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
  
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:3999: checking for ANSI C header files" >&5

cat > conftest.$ac_ext <<EOF
#line 4002 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 4027 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  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 <<EOF
#line 4045 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  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 <<EOF
#line 4066 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#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); }

EOF
if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

#AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h)
for ac_hdr in limits.h termio.h termios.h unistd.h values.h f2c.h g2c.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4104: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 4107 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4112: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_hdr in sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4141: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 4144 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_hdr in sys/timeb.h sys/types.h sys/utsname.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4178: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 4181 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_hdr in libintl.h iconv.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4215: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 4218 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_hdr in langinfo.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4252: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 4255 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:4286: checking whether time.h and sys/time.h may both be included" >&5

cat > conftest.$ac_ext <<EOF
#line 4289 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:4298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*

echo "$ac_t""$ac_cv_header_time" 1>&6
if test $ac_cv_header_time = yes; then
  cat >> confdefs.h <<\EOF
#define TIME_WITH_SYS_TIME 1
EOF

fi

echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:4318: checking for off_t" >&5

cat > conftest.$ac_ext <<EOF
#line 4321 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_off_t=yes
else
  rm -rf conftest*
  ac_cv_type_off_t=no
fi
rm -f conftest*

echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
  cat >> confdefs.h <<\EOF
#define off_t long
EOF

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:4348: checking for uid_t in sys/types.h" >&5

cat > conftest.$ac_ext <<EOF
#line 4351 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*


echo "$ac_t""$ac_cv_type_uid_t" 1>&6
if test $ac_cv_type_uid_t = no; then
  cat >> confdefs.h <<\EOF
#define uid_t int
EOF

  cat >> confdefs.h <<\EOF
#define gid_t int
EOF

fi

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:4379: checking return type of signal handlers" >&5

cat > conftest.$ac_ext <<EOF
#line 4382 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:4399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_type_signal=void
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_type_signal=int
fi
rm -f conftest*

echo "$ac_t""$ac_cv_type_signal" 1>&6
cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF


echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:4417: checking for Cygwin environment" >&5

cat > conftest.$ac_ext <<EOF
#line 4420 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:4431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cygwin=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cygwin=no
fi
rm -f conftest*
rm -f conftest*

echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
for ac_func in ftime gethostname gettimeofday lseek nice time uname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4449: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 4452 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in seteuid setpriority setreuid setruid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4501: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 4504 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in drand48
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4553: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 4556 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in putenv setenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4605: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 4608 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in nanosleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4657: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 4660 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

if test "$cross_compiling" != "yes" ; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
echo "configure:4708: checking whether setpgrp takes no argument" >&5

if test "$cross_compiling" = yes; then
  { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 4714 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

/*
 * If this system has a BSD-style setpgrp, which takes arguments, exit
 * successfully.
 */
main()
{
    if (setpgrp(1,1) == -1)
	exit(0);
    else
	exit(1);
}

EOF
if { (eval echo configure:4734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_setpgrp_void=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_setpgrp_void=yes
fi
rm -fr conftest*
fi



echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
if test $ac_cv_func_setpgrp_void = yes; then
  cat >> confdefs.h <<\EOF
#define SETPGRP_VOID 1
EOF

fi

else
CROSS_COMPILING=1

fi

echo $ac_n "checking for long long int""... $ac_c" 1>&6
echo "configure:4762: checking for long long int" >&5
cat > conftest.$ac_ext <<EOF
#line 4764 "configure"
#include "confdefs.h"

int main() {
long long int x;
; return 0; }
EOF
if { (eval echo configure:4771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
#define HAVE_LONG_LONG_INT 1
EOF


else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
echo "$ac_t""no" 1>&6

fi
rm -f conftest*

echo $ac_n "checking for W11""... $ac_c" 1>&6
echo "configure:4791: checking for W11" >&5
case "$enable_w11" in
	yes|no)	echo "$ac_t"""$enable_w11"" 1>&6	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac

USE_X11=
USE_W11=
XLIB=
XTLIB=

if test "$enable_w11" = "yes" ; then
    X_CFLAGS=-I${SRCDIR}/display/drivers/windows/libW11
    X_LIBS='-L$(LIBDIR)'
    
    

    USE_W11="1"
    USE_X11="1"
    XLIB=-lX11

    CFLAGS="$CFLAGS -D__W98__"
else
    # If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:4819: checking for X" >&5

# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
  withval="$with_x"
  :
fi

# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
if test "x$with_x" = xno; then
  # The user explicitly disabled X.
  have_x=disabled
else
  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
    # Both variables are already set.
    have_x=yes
  else

# One or both of the vars are not set, and there is no cached value.
ac_x_includes=NO ac_x_libraries=NO
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  cat > Imakefile <<'EOF'
acfindx:
	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    for ac_extension in a so sl; do
      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
        test -f $ac_im_libdir/libX11.$ac_extension; then
        ac_im_usrlibdir=$ac_im_libdir; break
      fi
    done
    # Screen out bogus values from the imake configuration.  They are
    # bogus both because they are the default anyway, and because
    # using them would break gcc on systems where it needs fixed includes.
    case "$ac_im_incroot" in
	/usr/include) ;;
	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
    esac
    case "$ac_im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test "$ac_x_includes" = NO; then
  # Guess where to find include files, by looking for this one X11 .h file.
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h

  # First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 4879 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  # We can compile using X headers with no special include directory.
ac_x_includes=
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  # Look for the header file in a standard set of common directories.
# Check X11 before X11Rn because it is often a symlink to the current release.
  for ac_dir in               \
    /usr/X11/include          \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11          \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11/include    \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/include              \
    /usr/local/include        \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
                              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    ; \
  do
    if test -r "$ac_dir/$x_direct_test_include"; then
      ac_x_includes=$ac_dir
      break
    fi
  done
fi
rm -f conftest*
fi # $ac_x_includes = NO

if test "$ac_x_libraries" = NO; then
  # Check for the libraries.

  test -z "$x_direct_test_library" && x_direct_test_library=Xt
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc

  # See if we find them without any special options.
  # Don't add to $LIBS permanently.
  ac_save_LIBS="$LIBS"
  LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4953 "configure"
#include "confdefs.h"

int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
ac_x_libraries=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# First see if replacing the include by lib works.
# Check X11 before X11Rn because it is often a symlink to the current release.
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
    /usr/X11/lib          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    /lib/usr/lib/X11	  \
                          \
    /usr/openwin/lib      \
    /usr/openwin/share/lib \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
      ac_x_libraries=$ac_dir
      break 2
    fi
  done
done
fi
rm -f conftest*
fi # $ac_x_libraries = NO

if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
  # Didn't find X anywhere.  Cache the known absence of X.
  ac_cv_have_x="have_x=no"
else
  # Record where we found X for the cache.
  ac_cv_have_x="have_x=yes \
	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
fi
  fi
  eval "$ac_cv_have_x"
fi # $with_x != no

if test "$have_x" != yes; then
  echo "$ac_t""$have_x" 1>&6
  no_x=yes
else
  # If each of the values was on the command line, it overrides each guess.
  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  # Update the cache value to reflect the command line values.
  ac_cv_have_x="have_x=yes \
		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
fi

if test "$no_x" = yes; then
  # Not all programs may use this symbol, but it does not hurt to define it.
  cat >> confdefs.h <<\EOF
#define X_DISPLAY_MISSING 1
EOF

  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
  if test -n "$x_includes"; then
    X_CFLAGS="$X_CFLAGS -I$x_includes"
  fi

  # It would also be nice to do this for all -L options, not just this one.
  if test -n "$x_libraries"; then
    X_LIBS="$X_LIBS -L$x_libraries"
    # For Solaris; some versions of Sun CC require a space after -R and
    # others require no space.  Words are not sufficient . . . .
    case "`(uname -sr) 2>/dev/null`" in
    "SunOS 5"*)
      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:5065: checking whether -R must be followed by a space" >&5
      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
      cat > conftest.$ac_ext <<EOF
#line 5068 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:5075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_nospace=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_nospace=no
fi
rm -f conftest*
      if test $ac_R_nospace = yes; then
	echo "$ac_t""no" 1>&6
	X_LIBS="$X_LIBS -R$x_libraries"
      else
	LIBS="$ac_xsave_LIBS -R $x_libraries"
	cat > conftest.$ac_ext <<EOF
#line 5091 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:5098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_space=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_space=no
fi
rm -f conftest*
	if test $ac_R_space = yes; then
	  echo "$ac_t""yes" 1>&6
	  X_LIBS="$X_LIBS -R $x_libraries"
	else
	  echo "$ac_t""neither works" 1>&6
	fi
      fi
      LIBS="$ac_xsave_LIBS"
    esac
  fi

  # Check for system-dependent libraries X programs must link with.
  # Do this before checking for the system-independent R6 libraries
  # (-lICE), since we may need -lsocket or whatever for X linking.

  if test "$ISC" = yes; then
    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
  else
    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
    # libraries were built with DECnet support.  And karl@cs.umb.edu says
    # the Alpha needs dnet_stub (dnet does not exist).
    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:5130: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldnet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5136 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:5147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:5168: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5174 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnet_ntoa();

int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:5185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
    # to get the SysV transport functions.
    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
    # needs -lnsl.
    # The nsl library prevents programs from opening the X display
    # on Irix 5.2, according to dickey@clark.net.
    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:5213: checking for gethostbyname" >&5

cat > conftest.$ac_ext <<EOF
#line 5216 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {

/* 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_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
gethostbyname();
#endif

; return 0; }
EOF
if { (eval echo configure:5239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_gethostbyname = no; then
      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:5259: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5265 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # lieder@skyler.mavd.honeywell.com says without -lsocket,
    # socket/setsockopt and other routines are undefined under SCO ODT
    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
    # on later versions), says simon@lia.di.epfl.ch: it contains
    # gethostby* variants that don't use the nameserver (or something).
    # -lsocket must be given before -lnsl if both are needed.
    # We assume that if connect needs -lnsl, so does gethostbyname.
    echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:5305: checking for connect" >&5

cat > conftest.$ac_ext <<EOF
#line 5308 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char connect(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char connect();

int main() {

/* 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_connect) || defined (__stub___connect)
choke me
#else
connect();
#endif

; return 0; }
EOF
if { (eval echo configure:5331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_connect=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_connect=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_connect = no; then
      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:5351: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5357 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char connect();

int main() {
connect()
; return 0; }
EOF
if { (eval echo configure:5368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
    echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:5391: checking for remove" >&5

cat > conftest.$ac_ext <<EOF
#line 5394 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char remove(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char remove();

int main() {

/* 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_remove) || defined (__stub___remove)
choke me
#else
remove();
#endif

; return 0; }
EOF
if { (eval echo configure:5417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_remove=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_remove=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_remove = no; then
      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:5437: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lposix  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5443 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char remove();

int main() {
remove()
; return 0; }
EOF
if { (eval echo configure:5454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
    echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:5477: checking for shmat" >&5

cat > conftest.$ac_ext <<EOF
#line 5480 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char shmat(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shmat();

int main() {

/* 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_shmat) || defined (__stub___shmat)
choke me
#else
shmat();
#endif

; return 0; }
EOF
if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_shmat=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_shmat=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
fi

    if test $ac_cv_func_shmat = no; then
      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:5523: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lipc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5529 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shmat();

int main() {
shmat()
; return 0; }
EOF
if { (eval echo configure:5540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
else
  echo "$ac_t""no" 1>&6
fi

    fi
  fi

  # Check for libraries that X11R6 Xt/Xaw programs need.
  ac_save_LDFLAGS="$LDFLAGS"
  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  # check for ICE first), but we must link in the order -lSM -lICE or
  # we get undefined symbols.  So assume we have SM if we have ICE.
  # These have to be linked with before -lX11, unlike the other
  # libraries we check for below, so use a different variable.
  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:5572: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5578 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char IceConnectionNumber();

int main() {
IceConnectionNumber()
; return 0; }
EOF
if { (eval echo configure:5589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
else
  echo "$ac_t""no" 1>&6
fi

  LDFLAGS="$ac_save_LDFLAGS"

fi

    if test "$no_x" != "yes"; then
        USE_X11="1"
        XLIB=-lX11
        XTLIB=-lXt
    fi
fi





# Enable Curses option


echo $ac_n "checking whether to use Curses""... $ac_c" 1>&6
echo "configure:5627: checking whether to use Curses" >&5
echo "$ac_t"""$with_curses"" 1>&6
case "$with_curses" in
	"no")	USE_CURSES=	;;
	"yes")	USE_CURSES="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



if test -n "$USE_CURSES"; then


ac_save_cppflags="$CPPFLAGS"
CPPFLAGS=" $CPPFLAGS"
for ac_hdr in curses.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:5646: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 5649 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate curses includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


echo $ac_n "checking curses.h WINDOW structure component""... $ac_c" 1>&6
echo "configure:5685: checking curses.h WINDOW structure component" >&5
CURSES_MAXY=NONE
cat > conftest.$ac_ext <<EOF
#line 5688 "configure"
#include "confdefs.h"

#include <curses.h>
  
int main() {
WINDOW w; w.maxy = 0;
; return 0; }
EOF
if { (eval echo configure:5697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  CURSES_MAXY=maxy
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 5706 "configure"
#include "confdefs.h"

#include <curses.h>
  
int main() {
WINDOW w; w._maxy = 0;
; return 0; }
EOF
if { (eval echo configure:5715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  CURSES_MAXY=_maxy
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
cat >> confdefs.h <<EOF
#define CURSES_MAXY $CURSES_MAXY
EOF


echo "$ac_t""$CURSES_MAXY" 1>&6

echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
echo "configure:5731: checking for initscr in -lncurses" >&5
ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lncurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5737 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:5748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  CURSESLIB=-lncurses
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
echo "configure:5767: checking for initscr in -lcurses" >&5
ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lcurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5773 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  CURSESLIB=-lcurses
else
  echo "$ac_t""no" 1>&6

    { echo "configure: error: *** Unable to locate curses library." 1>&2; exit 1; }
    CURSESLIB=

fi

fi




echo $ac_n "checking for keypad in -lncurses""... $ac_c" 1>&6
echo "configure:5813: checking for keypad in -lncurses" >&5
ac_lib_var=`echo ncurses'_'keypad | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lncurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5819 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char keypad();

int main() {
keypad()
; return 0; }
EOF
if { (eval echo configure:5830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_KEYPAD 1
EOF

else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for keypad in -lcurses""... $ac_c" 1>&6
echo "configure:5852: checking for keypad in -lcurses" >&5
ac_lib_var=`echo curses'_'keypad | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lcurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5858 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char keypad();

int main() {
keypad()
; return 0; }
EOF
if { (eval echo configure:5869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_KEYPAD 1
EOF

else
  echo "$ac_t""no" 1>&6


fi

fi


fi # $USE_CURSES

echo $ac_n "checking for gtty in -lcompat""... $ac_c" 1>&6
echo "configure:5899: checking for gtty in -lcompat" >&5
ac_lib_var=`echo compat'_'gtty | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lcompat  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5905 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gtty();

int main() {
gtty()
; return 0; }
EOF
if { (eval echo configure:5916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  COMPATLIB=-lcompat
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for gtty in -lbsd-compat""... $ac_c" 1>&6
echo "configure:5935: checking for gtty in -lbsd-compat" >&5
ac_lib_var=`echo bsd-compat'_'gtty | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lbsd-compat  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5941 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gtty();

int main() {
gtty()
; return 0; }
EOF
if { (eval echo configure:5952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  COMPATLIB=-lbsd-compat
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for gtty in -lbsd""... $ac_c" 1>&6
echo "configure:5971: checking for gtty in -lbsd" >&5
ac_lib_var=`echo bsd'_'gtty | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lbsd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5977 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gtty();

int main() {
gtty()
; return 0; }
EOF
if { (eval echo configure:5988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  COMPATLIB=-lbsd
else
  echo "$ac_t""no" 1>&6

    COMPATLIB=

fi

fi

fi



# Note that some systems (FreeBSD for example) need an extra library for
# cuserid
ac_save_libs="$LIBS"
LIBS=""

echo $ac_n "checking for library containing cuserid""... $ac_c" 1>&6
echo "configure:6022: checking for library containing cuserid" >&5

ac_func_search_save_LIBS="$LIBS"
ac_cv_search_cuserid="no"
cat > conftest.$ac_ext <<EOF
#line 6027 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cuserid();

int main() {
cuserid()
; return 0; }
EOF
if { (eval echo configure:6038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_cuserid="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_cuserid" = "no" && for i in compat; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 6049 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cuserid();

int main() {
cuserid()
; return 0; }
EOF
if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_cuserid="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"

echo "$ac_t""$ac_cv_search_cuserid" 1>&6
if test "$ac_cv_search_cuserid" != "no"; then
  test "$ac_cv_search_cuserid" = "none required" || LIBS="$ac_cv_search_cuserid $LIBS"
  
else :
  
fi
DBMIEXTRALIB="$LIBS"
LIBS="$ac_save_libs"


# Note: -lxdr -liberty -lws2_32 is for MinGW

echo $ac_n "checking for xdrmem_create""... $ac_c" 1>&6
echo "configure:6086: checking for xdrmem_create" >&5

cat > conftest.$ac_ext <<EOF
#line 6089 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char xdrmem_create(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char xdrmem_create();

int main() {

/* 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_xdrmem_create) || defined (__stub___xdrmem_create)
choke me
#else
xdrmem_create();
#endif

; return 0; }
EOF
if { (eval echo configure:6112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_xdrmem_create=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_xdrmem_create=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'xdrmem_create`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XDRLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for xdrmem_create in -lsun""... $ac_c" 1>&6
echo "configure:6130: checking for xdrmem_create in -lsun" >&5
ac_lib_var=`echo sun'_'xdrmem_create | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsun  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6136 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char xdrmem_create();

int main() {
xdrmem_create()
; return 0; }
EOF
if { (eval echo configure:6147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XDRLIB=-lsun
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for xdrmem_create in -lnsl""... $ac_c" 1>&6
echo "configure:6166: checking for xdrmem_create in -lnsl" >&5
ac_lib_var=`echo nsl'_'xdrmem_create | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6172 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char xdrmem_create();

int main() {
xdrmem_create()
; return 0; }
EOF
if { (eval echo configure:6183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XDRLIB=-lnsl
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for xdrmem_create in -lrpclib""... $ac_c" 1>&6
echo "configure:6202: checking for xdrmem_create in -lrpclib" >&5
ac_lib_var=`echo rpclib'_'xdrmem_create | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lrpclib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6208 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char xdrmem_create();

int main() {
xdrmem_create()
; return 0; }
EOF
if { (eval echo configure:6219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XDRLIB=-lrpclib
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for xdrmem_create in -lxdr""... $ac_c" 1>&6
echo "configure:6238: checking for xdrmem_create in -lxdr" >&5
ac_lib_var=`echo xdr'_'xdrmem_create | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lxdr -liberty -lws2_32  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6244 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char xdrmem_create();

int main() {
xdrmem_create()
; return 0; }
EOF
if { (eval echo configure:6255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XDRLIB="-lxdr -liberty -lws2_32" 
else
  echo "$ac_t""no" 1>&6
 { echo "configure: error: *** Unable to locate XDR functions." 1>&2; exit 1; } 
fi


fi

fi

fi

fi



for ac_func in asprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6289: checking for $ac_func" >&5

cat > conftest.$ac_ext <<EOF
#line 6292 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:6315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done



# Test if mathlib needs -lm flag or is included with libc
echo $ac_n "checking for atan""... $ac_c" 1>&6
echo "configure:6342: checking for atan" >&5

cat > conftest.$ac_ext <<EOF
#line 6345 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char atan(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char atan();

int main() {

/* 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_atan) || defined (__stub___atan)
choke me
#else
atan();
#endif

; return 0; }
EOF
if { (eval echo configure:6368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_atan=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_atan=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'atan`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MATHLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for atan in -lm""... $ac_c" 1>&6
echo "configure:6386: checking for atan in -lm" >&5
ac_lib_var=`echo m'_'atan | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6392 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char atan();

int main() {
atan()
; return 0; }
EOF
if { (eval echo configure:6403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MATHLIB=-lm
else
  echo "$ac_t""no" 1>&6

    { echo "configure: error: *** Failed check for math library." 1>&2; exit 1; }

fi

fi



echo $ac_n "checking for dlsym""... $ac_c" 1>&6
echo "configure:6430: checking for dlsym" >&5

cat > conftest.$ac_ext <<EOF
#line 6433 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dlsym(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlsym();

int main() {

/* 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_dlsym) || defined (__stub___dlsym)
choke me
#else
dlsym();
#endif

; return 0; }
EOF
if { (eval echo configure:6456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_dlsym=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_dlsym=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'dlsym`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  DLLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6
echo "configure:6474: checking for dlsym in -ldl" >&5
ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6480 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlsym();

int main() {
dlsym()
; return 0; }
EOF
if { (eval echo configure:6491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  DLLIB=-ldl
else
  echo "$ac_t""no" 1>&6

    DLLIB=

fi

fi



echo $ac_n "checking for iconv""... $ac_c" 1>&6
echo "configure:6518: checking for iconv" >&5

cat > conftest.$ac_ext <<EOF
#line 6521 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char iconv(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv();

int main() {

/* 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_iconv) || defined (__stub___iconv)
choke me
#else
iconv();
#endif

; return 0; }
EOF
if { (eval echo configure:6544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_iconv=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_iconv=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'iconv`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
echo "configure:6562: checking for iconv in -liconv" >&5
ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-liconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6568 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv();

int main() {
iconv()
; return 0; }
EOF
if { (eval echo configure:6579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=-liconv
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for iconv in -lgiconv""... $ac_c" 1>&6
echo "configure:6598: checking for iconv in -lgiconv" >&5
ac_lib_var=`echo giconv'_'iconv | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lgiconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6604 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv();

int main() {
iconv()
; return 0; }
EOF
if { (eval echo configure:6615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=-lgiconv
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for libiconv""... $ac_c" 1>&6
echo "configure:6634: checking for libiconv" >&5

cat > conftest.$ac_ext <<EOF
#line 6637 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char libiconv(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char libiconv();

int main() {

/* 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_libiconv) || defined (__stub___libiconv)
choke me
#else
libiconv();
#endif

; return 0; }
EOF
if { (eval echo configure:6660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_libiconv=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_libiconv=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'libiconv`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6
echo "configure:6678: checking for libiconv in -liconv" >&5
ac_lib_var=`echo iconv'_'libiconv | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-liconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6684 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char libiconv();

int main() {
libiconv()
; return 0; }
EOF
if { (eval echo configure:6695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=-liconv
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for libiconv in -lgiconv""... $ac_c" 1>&6
echo "configure:6714: checking for libiconv in -lgiconv" >&5
ac_lib_var=`echo giconv'_'libiconv | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lgiconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6720 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char libiconv();

int main() {
libiconv()
; return 0; }
EOF
if { (eval echo configure:6731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ICONVLIB=-lgiconv
else
  echo "$ac_t""no" 1>&6

    echo "configure: warning: *** Unable to locate iconv() function." 1>&2
    ICONVLIB=

fi

fi

fi

fi

fi

fi



have_socket=1
echo $ac_n "checking for socket""... $ac_c" 1>&6
echo "configure:6768: checking for socket" >&5

cat > conftest.$ac_ext <<EOF
#line 6771 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char socket(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {

/* 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_socket) || defined (__stub___socket)
choke me
#else
socket();
#endif

; return 0; }
EOF
if { (eval echo configure:6794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_socket=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_socket=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SOCKLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:6812: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6818 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:6829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SOCKLIB=-lsocket
else
  echo "$ac_t""no" 1>&6

    have_socket=0
    echo "configure: warning: *** Unable to locate socket() function." 1>&2

fi

fi


if test "$have_socket" = 1 ; then
  HAVE_SOCKET=1
  cat >> confdefs.h <<\EOF
#define HAVE_SOCKET 1
EOF

else
  HAVE_SOCKET=
fi



# Mandatory zlib dependency

ZLIBLIBPATH=
ZLIBINCPATH=
ZLIB=

# With zlib includes directory


echo $ac_n "checking for location of zlib includes""... $ac_c" 1>&6
echo "configure:6877: checking for location of zlib includes" >&5
case "$with_zlib_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-zlib-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_zlib_includes" 1>&6

if test -n "$with_zlib_includes" ; then
    for dir in $with_zlib_includes; do
        if test -d "$dir"; then
            ZLIBINCPATH="$ZLIBINCPATH -I$dir"
        else
            { echo "configure: error: *** zlib includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$ZLIBINCPATH $CPPFLAGS"
for ac_hdr in zlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6903: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 6906 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate zlib includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With zlib library directory


echo $ac_n "checking for location of zlib library""... $ac_c" 1>&6
echo "configure:6945: checking for location of zlib library" >&5
case "$with_zlib_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-zlib-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_zlib_libs" 1>&6

if test -n "$with_zlib_libs"; then
    for dir in $with_zlib_libs; do
        if test -d "$dir"; then
            ZLIBLIBPATH="$ZLIBLIBPATH -L$dir"
        else
            { echo "configure: error: *** zlib library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$ZLIBLIBPATH $LDFLAGS"


echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
echo "configure:6970: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lz  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6976 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char deflate();

int main() {
deflate()
; return 0; }
EOF
if { (eval echo configure:6987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ZLIB="$ZLIB -lz "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate zlib library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


#





# Done checking zlib

# Mandatory PROJ dependency

PROJINC=
PROJLIB=
PROJSHARE=

# With PROJ includes directory


echo $ac_n "checking for location of External PROJ.4 includes""... $ac_c" 1>&6
echo "configure:7035: checking for location of External PROJ.4 includes" >&5
case "$with_proj_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-proj-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_proj_includes" 1>&6

if test -n "$with_proj_includes" ; then
    for dir in $with_proj_includes; do
        if test -d "$dir"; then
            PROJINC="$PROJINC -I$dir"
        else
            { echo "configure: error: *** External PROJ.4 includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$PROJINC $CPPFLAGS"
for ac_hdr in proj_api.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7061: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 7064 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate External PROJ.4 includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# PROJ version check

if test "$cross_compiling" = yes; then
    echo "configure: warning: *** Cannot check PROJ.4 version (cross-compiling)." 1>&2
else
    
echo $ac_n "checking External PROJ.4 version""... $ac_c" 1>&6
echo "configure:7106: checking External PROJ.4 version" >&5
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$PROJINC $CPPFLAGS"
if test "$cross_compiling" = yes; then
     proj_ver=0
        echo "$ac_t""unknown (cross-compiling)" 1>&6 
else
  cat > conftest.$ac_ext <<EOF
#line 7114 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <proj_api.h>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 fprintf(fp, "%d", PJ_VERSION);
 return 0;
}
    
EOF
if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
     proj_ver=`cat conftestdata`
        echo "$ac_t""$proj_ver" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
     { echo "configure: error: *** Could not determine External PROJ.4 version." 1>&2; exit 1; } 
fi
rm -fr conftest*
fi

CPPFLAGS=$ac_save_cppflags


    if test `expr "$proj_ver" \< 446` = 1 ; then
        { echo "configure: error: *** PROJ.4.4.6 or later is required." 1>&2; exit 1; }
    fi
fi

# With PROJ library directory


echo $ac_n "checking for location of External PROJ.4 library""... $ac_c" 1>&6
echo "configure:7151: checking for location of External PROJ.4 library" >&5
case "$with_proj_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-proj-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_proj_libs" 1>&6

if test -n "$with_proj_libs"; then
    for dir in $with_proj_libs; do
        if test -d "$dir"; then
            PROJLIB="$PROJLIB -L$dir"
        else
            { echo "configure: error: *** External PROJ.4 library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$PROJLIB $LDFLAGS"


echo $ac_n "checking for pj_get_def in -lproj""... $ac_c" 1>&6
echo "configure:7176: checking for pj_get_def in -lproj" >&5
ac_lib_var=`echo proj'_'pj_get_def | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lproj  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7182 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pj_get_def();

int main() {
pj_get_def()
; return 0; }
EOF
if { (eval echo configure:7193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PROJLIB="$PROJLIB -lproj "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate External PROJ.4 library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


# With PROJ share directory


echo $ac_n "checking for location of External PROJ.4 data files""... $ac_c" 1>&6
echo "configure:7227: checking for location of External PROJ.4 data files" >&5
case "$with_proj_share" in
y | ye | yes | n | no)
        { echo "configure: error: *** You must supply a directory to --with-proj-share." 1>&2; exit 1; }
        ;;
esac
echo "$ac_t""$with_proj_share" 1>&6

if test -n "$with_proj_share" ; then
    if test -d "$with_proj_share"; then
        PROJSHARE="$with_proj_share"
    else
        { echo "configure: error: *** External PROJ.4 data directory $dir does not exist." 1>&2; exit 1; }
    fi
fi

if test -z "$PROJSHARE" ; then
    echo "configure: warning: *** External PROJ.4 directory not specified; default will be used" 1>&2
    PROJSHARE=/usr/local/share/proj
fi

# LOC_CHECK_SHARE does not work when cross compiling
if test "$cross_compiling" = "yes" ; then
    echo $ac_n "checking for epsg""... $ac_c" 1>&6
echo "configure:7251: checking for epsg" >&5
    echo "$ac_t""unknown (cross-compiling)" 1>&6
else
    

ac_safe=`echo "$PROJSHARE/epsg" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $PROJSHARE/epsg""... $ac_c" 1>&6
echo "configure:7258: checking for $PROJSHARE/epsg" >&5

if test "$cross_compiling" = yes; then
    { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; }
else
  if test -r $PROJSHARE/epsg; then
    eval "ac_cv_file_$ac_safe=yes"
  else
    eval "ac_cv_file_$ac_safe=no"
  fi
fi
if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
echo "configure: warning: *** Unable to locate PROJ data files." 1>&2
    
fi


fi





# nad2bin needs to be in path for installing datum gridshift files

# Extract the first word of "nad2bin", so it can be a program name with args.
set dummy nad2bin; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7290: checking for $ac_word" >&5

case "$NAD2BIN" in
  /*)
  ac_cv_path_NAD2BIN="$NAD2BIN" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NAD2BIN="$NAD2BIN" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_NAD2BIN="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NAD2BIN" && ac_cv_path_NAD2BIN="no"
  ;;
esac
NAD2BIN="$ac_cv_path_NAD2BIN"
if test -n "$NAD2BIN"; then
  echo "$ac_t""$NAD2BIN" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$NAD2BIN" = "no"; then
    { echo "configure: error: *** Unable to locate nad2bin (needs to be in PATH)." 1>&2; exit 1; }
fi

# Done checking PROJ

# Enable regex option


echo $ac_n "checking whether to use regex""... $ac_c" 1>&6
echo "configure:7330: checking whether to use regex" >&5
echo "$ac_t"""$with_regex"" 1>&6
case "$with_regex" in
	"no")	USE_REGEX=	;;
	"yes")	USE_REGEX="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



REGEXINCPATH=
REGEXLIBPATH=
REGEXLIB=

if test -n "$USE_REGEX"; then

# With regex includes directory


echo $ac_n "checking for location of regex includes""... $ac_c" 1>&6
echo "configure:7350: checking for location of regex includes" >&5
case "$with_regex_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-regex-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_regex_includes" 1>&6

if test -n "$with_regex_includes" ; then
    for dir in $with_regex_includes; do
        if test -d "$dir"; then
            REGEXINCPATH="$REGEXINCPATH -I$dir"
        else
            { echo "configure: error: *** regex includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$REGEXINCPATH $CPPFLAGS"
for ac_hdr in regex.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7376: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 7379 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate regex includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With regex library directory


echo $ac_n "checking for location of regex library""... $ac_c" 1>&6
echo "configure:7418: checking for location of regex library" >&5
case "$with_regex_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-regex-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_regex_libs" 1>&6

if test -n "$with_regex_libs"; then
    for dir in $with_regex_libs; do
        if test -d "$dir"; then
            REGEXLIBPATH="$REGEXLIBPATH -L$dir"
        else
            { echo "configure: error: *** regex library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_libs="$LIBS"
ac_save_ldflags="$LDFLAGS"
LIBS="  $LIBS"
LDFLAGS=" $LDFLAGS"
echo $ac_n "checking for regcomp""... $ac_c" 1>&6
echo "configure:7443: checking for regcomp" >&5

cat > conftest.$ac_ext <<EOF
#line 7446 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char regcomp(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char regcomp();

int main() {

/* 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_regcomp) || defined (__stub___regcomp)
choke me
#else
regcomp();
#endif

; return 0; }
EOF
if { (eval echo configure:7469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_regcomp=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_regcomp=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'regcomp`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  

    REGEXLIB="$REGEXLIB "


else
  echo "$ac_t""no" 1>&6


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$REGEXLIBPATH $LDFLAGS"


echo $ac_n "checking for regcomp in -lregex""... $ac_c" 1>&6
echo "configure:7496: checking for regcomp in -lregex" >&5
ac_lib_var=`echo regex'_'regcomp | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lregex  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7502 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char regcomp();

int main() {
regcomp()
; return 0; }
EOF
if { (eval echo configure:7513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  REGEXLIB="$REGEXLIB -lregex "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate regex library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}



fi

LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}


fi # $USE_REGEX






# Done checking regex

# Enable Readline option


echo $ac_n "checking whether to use Readline""... $ac_c" 1>&6
echo "configure:7563: checking whether to use Readline" >&5
echo "$ac_t"""$with_readline"" 1>&6
case "$with_readline" in
	"no")	USE_READLINE=	;;
	"yes")	USE_READLINE="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



READLINEINCPATH=
READLINELIBPATH=
READLINELIB=
HISTORYLIB=

if test -n "$USE_READLINE"; then

# With Readline includes directory


echo $ac_n "checking for location of Readline includes""... $ac_c" 1>&6
echo "configure:7584: checking for location of Readline includes" >&5
case "$with_readline_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-readline-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_readline_includes" 1>&6

if test -n "$with_readline_includes" ; then
    for dir in $with_readline_includes; do
        if test -d "$dir"; then
            READLINEINCPATH="$READLINEINCPATH -I$dir"
        else
            { echo "configure: error: *** Readline includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$READLINEINCPATH $CPPFLAGS"
for ac_hdr in readline/readline.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7610: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 7613 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Readline includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$READLINEINCPATH $CPPFLAGS"
for ac_hdr in readline/history.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7654: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 7657 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Readline includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With Readline library directory


echo $ac_n "checking for location of Readline library""... $ac_c" 1>&6
echo "configure:7696: checking for location of Readline library" >&5
case "$with_readline_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-readline-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_readline_libs" 1>&6

if test -n "$with_readline_libs"; then
    for dir in $with_readline_libs; do
        if test -d "$dir"; then
            READLINELIBPATH="$READLINELIBPATH -L$dir"
        else
            { echo "configure: error: *** Readline library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$READLINELIBPATH $LDFLAGS"


echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
echo "configure:7721: checking for readline in -lreadline" >&5
ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lreadline  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char readline();

int main() {
readline()
; return 0; }
EOF
if { (eval echo configure:7738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  READLINELIB="$READLINELIB -lreadline "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate Readline library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$READLINELIBPATH $LDFLAGS"


echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6
echo "configure:7773: checking for add_history in -lhistory" >&5
ac_lib_var=`echo history'_'add_history | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lhistory  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7779 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char add_history();

int main() {
add_history()
; return 0; }
EOF
if { (eval echo configure:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  HISTORYLIB="$HISTORYLIB -lhistory "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate History library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_READLINE






# Done checking Readline

# GDAL option

echo $ac_n "checking whether to use GDAL""... $ac_c" 1>&6
echo "configure:7832: checking whether to use GDAL" >&5

GDAL_LIBS=
GDAL_CFLAGS=
USE_GDAL=
USE_OGR=

if test "`basename xx/$with_gdal`" = "gdal-config" ; then
  GDAL_CONFIG="$with_gdal"
fi

if test "$with_gdal" = "no" ; then
  echo "$ac_t""no" 1>&6
else
  echo "$ac_t""yes" 1>&6
  # Extract the first word of "gdal-config", so it can be a program name with args.
set dummy gdal-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7850: checking for $ac_word" >&5

case "$GDAL_CONFIG" in
  /*)
  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GDAL_CONFIG="$GDAL_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_GDAL_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_GDAL_CONFIG" && ac_cv_path_GDAL_CONFIG="no"
  ;;
esac
GDAL_CONFIG="$ac_cv_path_GDAL_CONFIG"
if test -n "$GDAL_CONFIG"; then
  echo "$ac_t""$GDAL_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test "$GDAL_CONFIG" = "no" ; then
    { echo "configure: error: *** couldn't find gdal-config" 1>&2; exit 1; }
  fi

  if test "$GDAL_CONFIG" != "" ; then
    GDAL_LIBS=`"$GDAL_CONFIG" --libs`
    GDAL_DEP_LIBS=`"$GDAL_CONFIG" --dep-libs`
    GDAL_CFLAGS=`"$GDAL_CONFIG" --cflags`
    USE_GDAL=1
    if test `"$GDAL_CONFIG" --ogr-enabled` = "yes" ; then
      cat >> confdefs.h <<\EOF
#define HAVE_OGR 1
EOF

      USE_OGR=1
    fi
  fi

  GDAL=
  ac_save_libs="$LIBS"
  ac_save_cflags="$CFLAGS"
  LIBS="$LIBS $GDAL_LIBS"
  CFLAGS="$CFLAGS $GDAL_CFLAGS"
  cat > conftest.$ac_ext <<EOF
#line 7905 "configure"
#include "confdefs.h"
#include <gdal.h>
int main() {
GDALOpen("foo", GA_ReadOnly);
; return 0; }
EOF
if { (eval echo configure:7912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
  LIBS="$LIBS $GDAL_DEP_LIBS"
  cat > conftest.$ac_ext <<EOF
#line 7921 "configure"
#include "confdefs.h"
#include <gdal.h>
int main() {
GDALOpen("foo", GA_ReadOnly);
; return 0; }
EOF
if { (eval echo configure:7928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
  { echo "configure: error: *** Unable to locate GDAL library." 1>&2; exit 1; }
  
fi
rm -f conftest*
  
fi
rm -f conftest*
  LIBS=${ac_save_libs}
  CFLAGS=${ac_save_cflags}

  cat >> confdefs.h <<\EOF
#define HAVE_GDAL 1
EOF

fi






# GEOS option

echo $ac_n "checking whether to use GEOS""... $ac_c" 1>&6
echo "configure:7960: checking whether to use GEOS" >&5

GEOS_LIBS=
GGEOS_CFLAGS=
USE_GEOS=

# FIXME: "quote" $with_geos ?
if test "`basename xx/$with_geos`" = "geos-config" ; then
  GEOS_CONFIG="$with_geos"
fi

if test "$with_geos" = "no" ; then
  echo "$ac_t""no" 1>&6
else
  echo "$ac_t""yes" 1>&6
  # Extract the first word of "geos-config", so it can be a program name with args.
set dummy geos-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7978: checking for $ac_word" >&5

case "$GEOS_CONFIG" in
  /*)
  ac_cv_path_GEOS_CONFIG="$GEOS_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GEOS_CONFIG="$GEOS_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_GEOS_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_GEOS_CONFIG" && ac_cv_path_GEOS_CONFIG="no"
  ;;
esac
GEOS_CONFIG="$ac_cv_path_GEOS_CONFIG"
if test -n "$GEOS_CONFIG"; then
  echo "$ac_t""$GEOS_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test "$GEOS_CONFIG" = "no" ; then
    { echo "configure: error: *** couldn't find geos-config" 1>&2; exit 1; }
  fi
  
  if test "$GEOS_CONFIG" != "" ; then
    GEOS_LIBS=`"$GEOS_CONFIG" --libs`
    GEOS_CFLAGS=`"$GEOS_CONFIG" --cflags`
    USE_GEOS=1
  fi
  
  
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$GEOS_CFLAGS $CPPFLAGS"
for ac_hdr in geos_c.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8026: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 8029 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate GEOS includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags

### geos 3.3.6 installs geos_c.lib, see http://osgeo-org.1560.n6.nabble.com/osgeo4w-329-update-geos-to-3-3-6-td5024605.html
#  if test "$MINGW32" = yes ; then
#    LOC_CHECK_LIBS(geos_c_i,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
#  else
  
ac_save_ldflags="$LDFLAGS"
LDFLAGS="$GEOS_LIBS $LDFLAGS"


echo $ac_n "checking for initGEOS in -lgeos_c""... $ac_c" 1>&6
echo "configure:8073: checking for initGEOS in -lgeos_c" >&5
ac_lib_var=`echo geos_c'_'initGEOS | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lgeos_c  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8079 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initGEOS();

int main() {
initGEOS()
; return 0; }
EOF
if { (eval echo configure:8090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  GEOS_LIBS="$GEOS_LIBS -lgeos_c "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate GEOS library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}

#  fi
  
  cat >> confdefs.h <<\EOF
#define HAVE_GEOS 1
EOF

fi





# Enable TIFF option


echo $ac_n "checking whether to use TIFF""... $ac_c" 1>&6
echo "configure:8135: checking whether to use TIFF" >&5
echo "$ac_t"""$with_tiff"" 1>&6
case "$with_tiff" in
	"no")	USE_TIFF=	;;
	"yes")	USE_TIFF="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



TIFF_INCLUDE_DIRS=
TIFF_LIBRARY_DIRS=
TIFFLIB=

if test -n "$USE_TIFF"; then

# With TIFF includes directory


echo $ac_n "checking for location of TIFF includes""... $ac_c" 1>&6
echo "configure:8155: checking for location of TIFF includes" >&5
case "$with_tiff_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-tiff-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_tiff_includes" 1>&6

if test -n "$with_tiff_includes" ; then
    for dir in $with_tiff_includes; do
        if test -d "$dir"; then
            TIFF_INCLUDE_DIRS="$TIFF_INCLUDE_DIRS -I$dir"
        else
            { echo "configure: error: *** TIFF includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$TIFF_INCLUDE_DIRS $CPPFLAGS"
for ac_hdr in tiffio.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8181: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 8184 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate TIFF includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With TIFF library directory


echo $ac_n "checking for location of TIFF library""... $ac_c" 1>&6
echo "configure:8223: checking for location of TIFF library" >&5
case "$with_tiff_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-tiff-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_tiff_libs" 1>&6

if test -n "$with_tiff_libs"; then
    for dir in $with_tiff_libs; do
        if test -d "$dir"; then
            TIFF_LIBRARY_DIRS="$TIFF_LIBRARY_DIRS -L$dir"
        else
            { echo "configure: error: *** TIFF library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TIFF_LIBRARY_DIRS $LDFLAGS"








echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8254: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8260 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8290: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8296 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8326: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff $ZLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8332 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff $ZLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8362: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff $ZLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8368 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff $ZLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8398: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff -ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8404 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff -ljpeg"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8434: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff -ljpeg $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8440 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff -ljpeg $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8470: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff -ljpeg $ZLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8476 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff -ljpeg $ZLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:8506: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltiff -ljpeg $ZLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8512 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

int main() {
TIFFOpen()
; return 0; }
EOF
if { (eval echo configure:8523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TIFFLIB="$TIFFLIB -ltiff -ljpeg $ZLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate TIFF library." 1>&2; exit 1; }


fi




fi







fi




fi










fi




fi







fi




fi












LDFLAGS=${ac_save_ldflags}


fi # $USE_TIFF





# Done checking TIFF

# Enable PNG option


echo $ac_n "checking whether to use PNG""... $ac_c" 1>&6
echo "configure:8621: checking whether to use PNG" >&5
echo "$ac_t"""$with_png"" 1>&6
case "$with_png" in
	"no")	USE_PNG=	;;
	"yes")	USE_PNG="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



PNGINC=
PNGLIB=

if test -n "$USE_PNG"; then

# With PNG includes directory


echo $ac_n "checking for location of PNG includes""... $ac_c" 1>&6
echo "configure:8640: checking for location of PNG includes" >&5
case "$with_png_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-png-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_png_includes" 1>&6

if test -n "$with_png_includes" ; then
    for dir in $with_png_includes; do
        if test -d "$dir"; then
            PNGINC="$PNGINC -I$dir"
        else
            { echo "configure: error: *** PNG includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$PNGINC $CPPFLAGS"
for ac_hdr in png.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8666: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 8669 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate PNG includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With PNG library directory


echo $ac_n "checking for location of PNG library""... $ac_c" 1>&6
echo "configure:8708: checking for location of PNG library" >&5
case "$with_png_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-png-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_png_libs" 1>&6

if test -n "$with_png_libs"; then
    for dir in $with_png_libs; do
        if test -d "$dir"; then
            PNGLIB="$PNGLIB -L$dir"
        else
            { echo "configure: error: *** PNG library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$PNGLIB $LDFLAGS"


echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
echo "configure:8733: checking for png_read_image in -lpng" >&5
ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpng $ZLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8739 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_read_image();

int main() {
png_read_image()
; return 0; }
EOF
if { (eval echo configure:8750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PNGLIB="$PNGLIB -lpng $ZLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate PNG library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_PNG





# Done checking PNG

# Enable PostgreSQL option


echo $ac_n "checking whether to use PostgreSQL""... $ac_c" 1>&6
echo "configure:8792: checking whether to use PostgreSQL" >&5
echo "$ac_t"""$with_postgres"" 1>&6
case "$with_postgres" in
	"no")	USE_POSTGRES=	;;
	"yes")	USE_POSTGRES="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



if test -n "$USE_POSTGRES"; then
cat >> confdefs.h <<\EOF
#define HAVE_POSTGRES 1
EOF

fi # $USE_POSTGRES

PQINCPATH=
PQLIBPATH=
PQLIB=

if test -n "$USE_POSTGRES"; then

# With PostgreSQL includes directory


echo $ac_n "checking for location of PostgreSQL includes""... $ac_c" 1>&6
echo "configure:8819: checking for location of PostgreSQL includes" >&5
case "$with_postgres_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-postgres-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_postgres_includes" 1>&6

if test -n "$with_postgres_includes" ; then
    for dir in $with_postgres_includes; do
        if test -d "$dir"; then
            PQINCPATH="$PQINCPATH -I$dir"
        else
            { echo "configure: error: *** PostgreSQL includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$PQINCPATH $CPPFLAGS"
for ac_hdr in libpq-fe.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:8845: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 8848 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate PostgreSQL includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


fi # $USE_POSTGRES

if test -n "$USE_POSTGRES"; then

# With PostgreSQL library directory


echo $ac_n "checking for location of PostgreSQL library""... $ac_c" 1>&6
echo "configure:8891: checking for location of PostgreSQL library" >&5
case "$with_postgres_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-postgres-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_postgres_libs" 1>&6

if test -n "$with_postgres_libs"; then
    for dir in $with_postgres_libs; do
        if test -d "$dir"; then
            PQLIBPATH="$PQLIBPATH -L$dir"
        else
            { echo "configure: error: *** PostgreSQL library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$PQLIBPATH $LDFLAGS"






echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6
echo "configure:8920: checking for PQsetdbLogin in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8926 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQsetdbLogin();

int main() {
PQsetdbLogin()
; return 0; }
EOF
if { (eval echo configure:8937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PQLIB="$PQLIB -lpq "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6
echo "configure:8956: checking for PQsetdbLogin in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq -lssl -lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8962 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQsetdbLogin();

int main() {
PQsetdbLogin()
; return 0; }
EOF
if { (eval echo configure:8973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PQLIB="$PQLIB -lpq -lssl -lcrypto"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6
echo "configure:8992: checking for PQsetdbLogin in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq -lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8998 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQsetdbLogin();

int main() {
PQsetdbLogin()
; return 0; }
EOF
if { (eval echo configure:9009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PQLIB="$PQLIB -lpq -lcrypt"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for PQsetdbLogin in -lpq""... $ac_c" 1>&6
echo "configure:9028: checking for PQsetdbLogin in -lpq" >&5
ac_lib_var=`echo pq'_'PQsetdbLogin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq -lcrypt -lssl -lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9034 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQsetdbLogin();

int main() {
PQsetdbLogin()
; return 0; }
EOF
if { (eval echo configure:9045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  PQLIB="$PQLIB -lpq -lcrypt -lssl -lcrypto"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate PostgreSQL library." 1>&2; exit 1; }


fi




fi







fi




fi









LDFLAGS=${ac_save_ldflags}


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS $PQLIBPATH"
echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6
echo "configure:9102: checking for PQcmdTuples in -lpq" >&5
ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9108 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQcmdTuples();

int main() {
PQcmdTuples()
; return 0; }
EOF
if { (eval echo configure:9119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PQCMDTUPLES 1
EOF

else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6
echo "configure:9141: checking for PQcmdTuples in -lpq" >&5
ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lpq -lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9147 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQcmdTuples();

int main() {
PQcmdTuples()
; return 0; }
EOF
if { (eval echo configure:9158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PQCMDTUPLES 1
EOF

else
  echo "$ac_t""no" 1>&6


fi


fi

LDFLAGS="${ac_save_ldflags}"

fi # $USE_POSTGRES







# Done checking PostgreSQL

# Enable MySQL option


echo $ac_n "checking whether to use MySQL""... $ac_c" 1>&6
echo "configure:9201: checking whether to use MySQL" >&5
echo "$ac_t"""$with_mysql"" 1>&6
case "$with_mysql" in
	"no")	USE_MYSQL=	;;
	"yes")	USE_MYSQL="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



MYSQLINCPATH=
MYSQLLIBPATH=
MYSQLLIB=

if test -n "$USE_MYSQL"; then

# With MySQL includes directory


echo $ac_n "checking for location of MySQL includes""... $ac_c" 1>&6
echo "configure:9221: checking for location of MySQL includes" >&5
case "$with_mysql_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-mysql-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_mysql_includes" 1>&6

if test -n "$with_mysql_includes" ; then
    for dir in $with_mysql_includes; do
        if test -d "$dir"; then
            MYSQLINCPATH="$MYSQLINCPATH -I$dir"
        else
            { echo "configure: error: *** MySQL includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$MYSQLINCPATH $CPPFLAGS"
for ac_hdr in mysql.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:9247: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 9250 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate MySQL includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


fi # $USE_MYSQL

if test -n "$USE_MYSQL"; then
  # With MySQL library directory

  
echo $ac_n "checking for location of MySQL library""... $ac_c" 1>&6
echo "configure:9292: checking for location of MySQL library" >&5
case "$with_mysql_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-mysql-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_mysql_libs" 1>&6

if test -n "$with_mysql_libs"; then
    for dir in $with_mysql_libs; do
        if test -d "$dir"; then
            MYSQLLIBPATH="$MYSQLLIBPATH -L$dir"
        else
            { echo "configure: error: *** MySQL library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


  
ac_save_ldflags="$LDFLAGS"
LDFLAGS="$MYSQLLIBPATH $LDFLAGS"








echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9323: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9329 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9359: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9365 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9395: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $SOCKLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9401 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $SOCKLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9431: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $SOCKLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9437 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $SOCKLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9467: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $ZLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9473 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9503: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $ZLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9509 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9539: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $ZLIB $SOCKLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9545 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $SOCKLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for mysql_query in -lmysqlclient""... $ac_c" 1>&6
echo "configure:9575: checking for mysql_query in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_query | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $ZLIB $SOCKLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9581 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_query();

int main() {
mysql_query()
; return 0; }
EOF
if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MYSQLLIB="$MYSQLLIB -lmysqlclient $ZLIB $SOCKLIB $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate MySQL library." 1>&2; exit 1; }


fi




fi







fi




fi










fi




fi







fi




fi












LDFLAGS=${ac_save_ldflags}


  # Check for libmysqld (for embeded version of the driver)
  # Extract the first word of "mysql_config", so it can be a program name with args.
set dummy mysql_config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:9682: checking for $ac_word" >&5

case "$MYSQLD_CONFIG" in
  /*)
  ac_cv_path_MYSQLD_CONFIG="$MYSQLD_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_MYSQLD_CONFIG="$MYSQLD_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_MYSQLD_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_MYSQLD_CONFIG" && ac_cv_path_MYSQLD_CONFIG="no"
  ;;
esac
MYSQLD_CONFIG="$ac_cv_path_MYSQLD_CONFIG"
if test -n "$MYSQLD_CONFIG"; then
  echo "$ac_t""$MYSQLD_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test "$MYSQLD_CONFIG" = "no" ; then
    { echo "configure: error: *** couldn't find mysql_config" 1>&2; exit 1; }
  fi

  if test "$MYSQLD_CONFIG" != "" ; then
    ac_save_libs="$LIBS"
    MYSQLDLIB=`"$MYSQLD_CONFIG" --libmysqld-libs`

    LIBS="$MYSQLDLIB $LIBS"
    echo $ac_n "checking for mysql_server_init""... $ac_c" 1>&6
echo "configure:9723: checking for mysql_server_init" >&5

cat > conftest.$ac_ext <<EOF
#line 9726 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char mysql_server_init(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_server_init();

int main() {

/* 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_mysql_server_init) || defined (__stub___mysql_server_init)
choke me
#else
mysql_server_init();
#endif

; return 0; }
EOF
if { (eval echo configure:9749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_mysql_server_init=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_mysql_server_init=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'mysql_server_init`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
MYSQLDLIB="";
                  echo "configure: warning: libmysqld not found" 1>&2 
fi

    LIBS=$ac_save_libs
  fi

fi # $USE_MYSQL








# Done checking MySQL

# Enable SQLite option


echo $ac_n "checking whether to use SQLite""... $ac_c" 1>&6
echo "configure:9787: checking whether to use SQLite" >&5
echo "$ac_t"""$with_sqlite"" 1>&6
case "$with_sqlite" in
	"no")	USE_SQLITE=	;;
	"yes")	USE_SQLITE="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



SQLITEINCPATH=
SQLITELIBPATH=
SQLITELIB=

if test -n "$USE_SQLITE"; then

# With SQLite includes directory


echo $ac_n "checking for location of SQLite includes""... $ac_c" 1>&6
echo "configure:9807: checking for location of SQLite includes" >&5
case "$with_sqlite_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-sqlite-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_sqlite_includes" 1>&6

if test -n "$with_sqlite_includes" ; then
    for dir in $with_sqlite_includes; do
        if test -d "$dir"; then
            SQLITEINCPATH="$SQLITEINCPATH -I$dir"
        else
            { echo "configure: error: *** SQLite includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$SQLITEINCPATH $CPPFLAGS"
for ac_hdr in sqlite3.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:9833: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 9836 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate SQLite includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


cat >> confdefs.h <<\EOF
#define HAVE_SQLITE 1
EOF


fi # $USE_SQLITE

if test -n "$USE_SQLITE"; then

# With SQLite library directory


echo $ac_n "checking for location of SQLite library""... $ac_c" 1>&6
echo "configure:9884: checking for location of SQLite library" >&5
case "$with_sqlite_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-sqlite-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_sqlite_libs" 1>&6

if test -n "$with_sqlite_libs"; then
    for dir in $with_sqlite_libs; do
        if test -d "$dir"; then
            SQLITELIBPATH="$SQLITELIBPATH -L$dir"
        else
            { echo "configure: error: *** SQLite library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$SQLITELIBPATH $LDFLAGS"






echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6
echo "configure:9913: checking for sqlite3_open in -lsqlite3" >&5
ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsqlite3  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9919 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sqlite3_open();

int main() {
sqlite3_open()
; return 0; }
EOF
if { (eval echo configure:9930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SQLITELIB="$SQLITELIB -lsqlite3 "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6
echo "configure:9949: checking for sqlite3_open in -lsqlite3" >&5
ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsqlite3 $DLLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9955 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sqlite3_open();

int main() {
sqlite3_open()
; return 0; }
EOF
if { (eval echo configure:9966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SQLITELIB="$SQLITELIB -lsqlite3 $DLLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6
echo "configure:9985: checking for sqlite3_open in -lsqlite3" >&5
ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsqlite3 $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9991 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sqlite3_open();

int main() {
sqlite3_open()
; return 0; }
EOF
if { (eval echo configure:10002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SQLITELIB="$SQLITELIB -lsqlite3 $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for sqlite3_open in -lsqlite3""... $ac_c" 1>&6
echo "configure:10021: checking for sqlite3_open in -lsqlite3" >&5
ac_lib_var=`echo sqlite3'_'sqlite3_open | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsqlite3 $MATHLIB $DLLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10027 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sqlite3_open();

int main() {
sqlite3_open()
; return 0; }
EOF
if { (eval echo configure:10038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SQLITELIB="$SQLITELIB -lsqlite3 $MATHLIB $DLLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate SQLite library." 1>&2; exit 1; }


fi




fi







fi




fi









LDFLAGS=${ac_save_ldflags}


fi # $USE_SQLITE







# Done checking SQLite


# Enable FFMPEG option


echo $ac_n "checking whether to use FFMPEG""... $ac_c" 1>&6
echo "configure:10107: checking whether to use FFMPEG" >&5
echo "$ac_t"""$with_ffmpeg"" 1>&6
case "$with_ffmpeg" in
	"no")	USE_FFMPEG=	;;
	"yes")	USE_FFMPEG="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



FFMPEGINCPATH=
FFMPEGLIBPATH=
FFMPEGLIB=

if test -n "$USE_FFMPEG"; then

# With FFMPEG includes directory


echo $ac_n "checking for location of FFMPEG includes""... $ac_c" 1>&6
echo "configure:10127: checking for location of FFMPEG includes" >&5
case "$with_ffmpeg_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-ffmpeg-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_ffmpeg_includes" 1>&6

if test -n "$with_ffmpeg_includes" ; then
    for dir in $with_ffmpeg_includes; do
        if test -d "$dir"; then
            FFMPEGINCPATH="$FFMPEGINCPATH -I$dir"
        else
            { echo "configure: error: *** FFMPEG includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$FFMPEGINCPATH $CPPFLAGS"
for ac_hdr in avcodec.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10153: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 10156 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate FFMPEG includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$FFMPEGINCPATH $CPPFLAGS"
for ac_hdr in avformat.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10197: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 10200 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate FFMPEG includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$FFMPEGINCPATH $CPPFLAGS"
for ac_hdr in swscale.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10241: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 10244 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate FFMPEG includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


cat >> confdefs.h <<\EOF
#define HAVE_FFMPEG 1
EOF


fi # $USE_FFMPEG

if test -n "$USE_FFMPEG"; then

# With FFMPEG library directory


echo $ac_n "checking for location of FFMPEG library""... $ac_c" 1>&6
echo "configure:10292: checking for location of FFMPEG library" >&5
case "$with_ffmpeg_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-ffmpeg-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_ffmpeg_libs" 1>&6

if test -n "$with_ffmpeg_libs"; then
    for dir in $with_ffmpeg_libs; do
        if test -d "$dir"; then
            FFMPEGLIBPATH="$FFMPEGLIBPATH -L$dir"
        else
            { echo "configure: error: *** FFMPEG library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFMPEGLIBPATH $LDFLAGS"




echo $ac_n "checking for av_free in -lavutil""... $ac_c" 1>&6
echo "configure:10319: checking for av_free in -lavutil" >&5
ac_lib_var=`echo avutil'_'av_free | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavutil  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10325 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char av_free();

int main() {
av_free()
; return 0; }
EOF
if { (eval echo configure:10336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavutil "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for av_free in -lavutil""... $ac_c" 1>&6
echo "configure:10355: checking for av_free in -lavutil" >&5
ac_lib_var=`echo avutil'_'av_free | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavutil $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10361 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char av_free();

int main() {
av_free()
; return 0; }
EOF
if { (eval echo configure:10372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavutil $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate FFMPEG library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFMPEGLIBPATH $LDFLAGS"




echo $ac_n "checking for avcodec_register in -lavcodec""... $ac_c" 1>&6
echo "configure:10417: checking for avcodec_register in -lavcodec" >&5
ac_lib_var=`echo avcodec'_'avcodec_register | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavcodec $FFMPEGLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10423 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char avcodec_register();

int main() {
avcodec_register()
; return 0; }
EOF
if { (eval echo configure:10434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavcodec "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for avcodec_register in -lavcodec""... $ac_c" 1>&6
echo "configure:10453: checking for avcodec_register in -lavcodec" >&5
ac_lib_var=`echo avcodec'_'avcodec_register | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavcodec $FFMPEGLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10459 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char avcodec_register();

int main() {
avcodec_register()
; return 0; }
EOF
if { (eval echo configure:10470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavcodec $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate FFMPEG library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFMPEGLIBPATH $LDFLAGS"




echo $ac_n "checking for avformat_alloc_context in -lavformat""... $ac_c" 1>&6
echo "configure:10515: checking for avformat_alloc_context in -lavformat" >&5
ac_lib_var=`echo avformat'_'avformat_alloc_context | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavformat $FFMPEGLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10521 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char avformat_alloc_context();

int main() {
avformat_alloc_context()
; return 0; }
EOF
if { (eval echo configure:10532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavformat "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for avformat_alloc_context in -lavformat""... $ac_c" 1>&6
echo "configure:10551: checking for avformat_alloc_context in -lavformat" >&5
ac_lib_var=`echo avformat'_'avformat_alloc_context | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lavformat $FFMPEGLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10557 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char avformat_alloc_context();

int main() {
avformat_alloc_context()
; return 0; }
EOF
if { (eval echo configure:10568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFMPEGLIB="$FFMPEGLIB -lavformat $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate FFMPEG library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}


fi # $USE_FFMPEG







# Done checking FFMPEG

# Enable OpenGL option

OPENGLINC=
OPENGLLIB=
OPENGLULIB=
USE_OPENGL=
OPENGL_X11=
OPENGL_AQUA=
OPENGL_WINDOWS=

echo $ac_n "checking whether to use OpenGL""... $ac_c" 1>&6
echo "configure:10627: checking whether to use OpenGL" >&5
echo "$ac_t"""$with_opengl"" 1>&6
case "$with_opengl" in
	n|no)
		OPENGL_TYPE=none
		;;
	y|yes|x|x11|glx)
		OPENGL_TYPE=X11
		USE_OPENGL=1
		OPENGL_X11=1
		;;
	aqua|mac|osx|macosx|agl)
		OPENGL_TYPE=Aqua
		USE_OPENGL=1
		OPENGL_AQUA=1
		;;
	win|windows|mswin|wgl)
		OPENGL_TYPE=Windows
		USE_OPENGL=1
		OPENGL_WINDOWS=1
		;;
	*)
		{ echo "configure: error: *** Valid arguments for --with-opengl= are yes,no,x11,aqua,windows." 1>&2; exit 1; }
		;;
esac

if test -n "$USE_OPENGL" ; then

if test "$OPENGL_X11" = 1 ; then

# With OpenGL includes directory


echo $ac_n "checking for location of OpenGL includes""... $ac_c" 1>&6
echo "configure:10661: checking for location of OpenGL includes" >&5
case "$with_opengl_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opengl-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opengl_includes" 1>&6

if test -n "$with_opengl_includes" ; then
    for dir in $with_opengl_includes; do
        if test -d "$dir"; then
            OPENGLINC="$OPENGLINC -I$dir"
        else
            { echo "configure: error: *** OpenGL includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$OPENGLINC $X_CFLAGS $CPPFLAGS"
for ac_hdr in GL/gl.h GL/glu.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10687: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 10690 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate OpenGL includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With OpenGL library directory


echo $ac_n "checking for location of OpenGL library""... $ac_c" 1>&6
echo "configure:10729: checking for location of OpenGL library" >&5
case "$with_opengl_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opengl-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opengl_libs" 1>&6

if test -n "$with_opengl_libs"; then
    for dir in $with_opengl_libs; do
        if test -d "$dir"; then
            OPENGL_LIB_PATH="$OPENGL_LIB_PATH -L$dir"
        else
            { echo "configure: error: *** OpenGL library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS"






echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6
echo "configure:10758: checking for glBegin in -lGL" >&5
ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10764 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glBegin();

int main() {
glBegin()
; return 0; }
EOF
if { (eval echo configure:10775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLLIB="$OPENGLLIB -lGL "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6
echo "configure:10794: checking for glBegin in -lGL" >&5
ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lXext $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10800 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glBegin();

int main() {
glBegin()
; return 0; }
EOF
if { (eval echo configure:10811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLLIB="$OPENGLLIB -lGL -lXext"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6
echo "configure:10830: checking for glBegin in -lGL" >&5
ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10836 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glBegin();

int main() {
glBegin()
; return 0; }
EOF
if { (eval echo configure:10847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLLIB="$OPENGLLIB -lGL -lpthread"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for glBegin in -lGL""... $ac_c" 1>&6
echo "configure:10866: checking for glBegin in -lGL" >&5
ac_lib_var=`echo GL'_'glBegin | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGL $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lpthread -lXext $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10872 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glBegin();

int main() {
glBegin()
; return 0; }
EOF
if { (eval echo configure:10883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLLIB="$OPENGLLIB -lGL -lpthread -lXext"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate OpenGL library." 1>&2; exit 1; }


fi




fi







fi




fi









LDFLAGS=${ac_save_ldflags}



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS"




echo $ac_n "checking for gluBeginCurve in -lGLU""... $ac_c" 1>&6
echo "configure:10945: checking for gluBeginCurve in -lGLU" >&5
ac_lib_var=`echo GLU'_'gluBeginCurve | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10951 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gluBeginCurve();

int main() {
gluBeginCurve()
; return 0; }
EOF
if { (eval echo configure:10962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLULIB="$OPENGLULIB -lGLU "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for gluBeginCurve in -lGLU""... $ac_c" 1>&6
echo "configure:10981: checking for gluBeginCurve in -lGLU" >&5
ac_lib_var=`echo GLU'_'gluBeginCurve | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLU $OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB -lstdc++ $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10987 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gluBeginCurve();

int main() {
gluBeginCurve()
; return 0; }
EOF
if { (eval echo configure:10998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLULIB="$OPENGLULIB -lGLU -lstdc++"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate GLU library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}


OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS $OPENGLLIB"
echo $ac_n "checking for glXCreatePbuffer""... $ac_c" 1>&6
echo "configure:11042: checking for glXCreatePbuffer" >&5

cat > conftest.$ac_ext <<EOF
#line 11045 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char glXCreatePbuffer(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glXCreatePbuffer();

int main() {

/* 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_glXCreatePbuffer) || defined (__stub___glXCreatePbuffer)
choke me
#else
glXCreatePbuffer();
#endif

; return 0; }
EOF
if { (eval echo configure:11068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_glXCreatePbuffer=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_glXCreatePbuffer=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'glXCreatePbuffer`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PBUFFERS 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for glXCreateGLXPixmap""... $ac_c" 1>&6
echo "configure:11090: checking for glXCreateGLXPixmap" >&5

cat > conftest.$ac_ext <<EOF
#line 11093 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char glXCreateGLXPixmap(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glXCreateGLXPixmap();

int main() {

/* 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_glXCreateGLXPixmap) || defined (__stub___glXCreateGLXPixmap)
choke me
#else
glXCreateGLXPixmap();
#endif

; return 0; }
EOF
if { (eval echo configure:11116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_glXCreateGLXPixmap=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_glXCreateGLXPixmap=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'glXCreateGLXPixmap`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_PIXMAPS 1
EOF

else
  echo "$ac_t""no" 1>&6
fi

LDFLAGS="${ac_save_ldflags}"

cat >> confdefs.h <<\EOF
#define OPENGL_X11 1
EOF


fi # $OPENGL_X11

if test "$OPENGL_AQUA" = 1 ; then

with_opengl_includes=/System/Library/Frameworks/OpenGL.framework/Headers
with_opengl_libs="-framework OpenGL -framework AGL -framework ApplicationServices"

# With OpenGL includes directory


echo $ac_n "checking for location of OpenGL includes""... $ac_c" 1>&6
echo "configure:11155: checking for location of OpenGL includes" >&5
case "$with_opengl_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opengl-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opengl_includes" 1>&6

if test -n "$with_opengl_includes" ; then
    for dir in $with_opengl_includes; do
        if test -d "$dir"; then
            OPENGLINC="$OPENGLINC -I$dir"
        else
            { echo "configure: error: *** OpenGL includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$OPENGLINC $CPPFLAGS"
for ac_hdr in OpenGL/gl.h OpenGL/glu.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:11181: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 11184 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate OpenGL includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With OpenGL library directory

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$with_opengl_libs $LDFLAGS"
echo $ac_n "checking for glBegin""... $ac_c" 1>&6
echo "configure:11224: checking for glBegin" >&5

cat > conftest.$ac_ext <<EOF
#line 11227 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char glBegin(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glBegin();

int main() {

/* 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_glBegin) || defined (__stub___glBegin)
choke me
#else
glBegin();
#endif

; return 0; }
EOF
if { (eval echo configure:11250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_glBegin=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_glBegin=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'glBegin`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
echo $ac_n "checking for gluBeginCurve""... $ac_c" 1>&6
echo "configure:11265: checking for gluBeginCurve" >&5

cat > conftest.$ac_ext <<EOF
#line 11268 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gluBeginCurve(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gluBeginCurve();

int main() {

/* 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_gluBeginCurve) || defined (__stub___gluBeginCurve)
choke me
#else
gluBeginCurve();
#endif

; return 0; }
EOF
if { (eval echo configure:11291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gluBeginCurve=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gluBeginCurve=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'gluBeginCurve`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
OPENGLLIB="$with_opengl_libs"
USE_OPENGL=1
OPENGL_AQUA=1

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate GLU library." 1>&2; exit 1; }
fi


else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate OpenGL library." 1>&2; exit 1; }
fi

LDFLAGS="${ac_save_ldflags}"

cat >> confdefs.h <<\EOF
#define OPENGL_AQUA 1
EOF


fi # $OPENGL_AQUA

if test "$OPENGL_WINDOWS" = 1 ; then

# With OpenGL includes directory


echo $ac_n "checking for location of OpenGL includes""... $ac_c" 1>&6
echo "configure:11335: checking for location of OpenGL includes" >&5
case "$with_opengl_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opengl-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opengl_includes" 1>&6

if test -n "$with_opengl_includes" ; then
    for dir in $with_opengl_includes; do
        if test -d "$dir"; then
            OPENGLINC="$OPENGLINC -I$dir"
        else
            { echo "configure: error: *** OpenGL includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$OPENGLINC $CPPFLAGS"
for ac_hdr in GL/gl.h GL/glu.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:11361: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 11364 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate OpenGL includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With OpenGL library directory


echo $ac_n "checking for location of OpenGL library""... $ac_c" 1>&6
echo "configure:11403: checking for location of OpenGL library" >&5
case "$with_opengl_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opengl-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opengl_libs" 1>&6

if test -n "$with_opengl_libs"; then
    for dir in $with_opengl_libs; do
        if test -d "$dir"; then
            OPENGL_LIB_PATH="$OPENGL_LIB_PATH -L$dir"
        else
            { echo "configure: error: *** OpenGL library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


ac_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS $OPENGLINC"

ac_save_ldflags="$LDFLAGS"
ac_save_libs="$LIBS"
echo $ac_n "checking for OpenGL library""... $ac_c" 1>&6
echo "configure:11428: checking for OpenGL library" >&5
LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS"
LIBS="-lopengl32  "
cat > conftest.$ac_ext <<EOF
#line 11432 "configure"
#include "confdefs.h"
#include <GL/gl.h>
int main() {
glEnd();
; return 0; }
EOF
if { (eval echo configure:11439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
echo "$ac_t""found" 1>&6
OPENGLLIB="$OPENGLLIB -lopengl32 "

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  

    { echo "configure: error: *** Unable to locate OpenGL library." 1>&2; exit 1; }


fi
rm -f conftest*
LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}


ac_save_ldflags="$LDFLAGS"
ac_save_libs="$LIBS"
echo $ac_n "checking for GLU library""... $ac_c" 1>&6
echo "configure:11463: checking for GLU library" >&5
LDFLAGS="$OPENGL_LIB_PATH $LDFLAGS"
LIBS="-lglu32 $OPENGLLIB "
cat > conftest.$ac_ext <<EOF
#line 11467 "configure"
#include "confdefs.h"
#include <GL/glu.h>
int main() {
gluNewQuadric();
; return 0; }
EOF
if { (eval echo configure:11474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
echo "$ac_t""found" 1>&6
OPENGLULIB="$OPENGLULIB -lglu32 "

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  

    { echo "configure: error: *** Unable to locate GLU library." 1>&2; exit 1; }


fi
rm -f conftest*
LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}

CFLAGS="${ac_save_cflags}"

OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"

cat >> confdefs.h <<\EOF
#define OPENGL_WINDOWS 1
EOF


fi # $OPENGL_WINDOWS

fi # $USE_OPENGL










# Done checking OpenGL

# Enable TCLTK option


echo $ac_n "checking whether to use Tcl/Tk""... $ac_c" 1>&6
echo "configure:11523: checking whether to use Tcl/Tk" >&5
echo "$ac_t"""$with_tcltk"" 1>&6
case "$with_tcltk" in
	"no")	USE_TCLTK=	;;
	"yes")	USE_TCLTK="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



TCLINCDIR=
TCLTKLIBPATH=
TCLTKLIBS=

if test -n "$USE_TCLTK"; then

# With Tcl/Tk includes directory


echo $ac_n "checking for location of Tcl/Tk includes""... $ac_c" 1>&6
echo "configure:11543: checking for location of Tcl/Tk includes" >&5
case "$with_tcltk_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-tcltk-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_tcltk_includes" 1>&6

if test -n "$with_tcltk_includes" ; then
    for dir in $with_tcltk_includes; do
        if test -d "$dir"; then
            TCLINCDIR="$TCLINCDIR -I$dir"
        else
            { echo "configure: error: *** Tcl/Tk includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$TCLINCDIR $CPPFLAGS"
for ac_hdr in tcl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:11569: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 11572 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Tcl includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$TCLINCDIR $X_CFLAGS $CPPFLAGS"
for ac_hdr in tk.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:11614: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 11617 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Tk includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# Tcl/Tk version checks

echo $ac_n "checking Tcl version""... $ac_c" 1>&6
echo "configure:11655: checking Tcl version" >&5
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$TCLINCDIR $CPPFLAGS"
if test "$cross_compiling" = yes; then
     tcl_ver=UNKNOWN
    echo "$ac_t""unknown (cross-compiling)" 1>&6 
else
  cat > conftest.$ac_ext <<EOF
#line 11663 "configure"
#include "confdefs.h"

#include <stdio.h> 
#include <tcl.h>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 fputs(TCL_VERSION, fp);
 return 0;
}

EOF
if { (eval echo configure:11675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
     tcl_ver=`cat conftestdata`
    echo "$ac_t""$tcl_ver" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
     { echo "configure: error: *** Could not determine Tcl version." 1>&2; exit 1; } 
fi
rm -fr conftest*
fi

CPPFLAGS=$ac_save_cppflags



echo $ac_n "checking Tk version""... $ac_c" 1>&6
echo "configure:11693: checking Tk version" >&5
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$TCLINCDIR $X_CFLAGS $CPPFLAGS"
if test "$cross_compiling" = yes; then
     tk_ver=UNKNOWN
    echo "$ac_t""unknown (cross-compiling)" 1>&6 
else
  cat > conftest.$ac_ext <<EOF
#line 11701 "configure"
#include "confdefs.h"

#include <stdio.h> 
#include <tk.h>
int main(void) {
 FILE *fp = fopen("conftestdata","w");
 fputs(TK_VERSION, fp);
 return 0;
}

EOF
if { (eval echo configure:11713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
     tk_ver=`cat conftestdata`
    echo "$ac_t""$tk_ver" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
     { echo "configure: error: *** Could not determine Tk version." 1>&2; exit 1; } 
fi
rm -fr conftest*
fi

CPPFLAGS=$ac_save_cppflags


if test "$tcl_ver" = "$tk_ver" ; then
    tcltk_ver="$tcl_ver"
else
    { echo "configure: error: *** Tcl/Tk version mismatch." 1>&2; exit 1; }
fi

TCL_VERSION="$tcl_ver"

# FreeBSD and CygWin don't have a "dot" between major/minor version number
tcltk_ver2=`echo "$tcltk_ver" | sed 's/\.//g'`

# With Tcl/Tk library directory


echo $ac_n "checking for location of Tcl/Tk library""... $ac_c" 1>&6
echo "configure:11744: checking for location of Tcl/Tk library" >&5
case "$with_tcltk_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-tcltk-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_tcltk_libs" 1>&6

if test -n "$with_tcltk_libs"; then
    for dir in $with_tcltk_libs; do
        if test -d "$dir"; then
            TCLTKLIBPATH="$TCLTKLIBPATH -L$dir"
        else
            { echo "configure: error: *** Tcl/Tk library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


TCLLIB=
TKLIB=
MACOSX_ARCHS_TCLTK=

# Can't test tcl/tk libs on 64bit OSX Aqua for now
# assume that if OpenGL Aqua, then user specifies TclTk Aqua
if test "$OPENGL_AQUA" = 1 ; then
    save_CFLAGS="$CFLAGS"
    CFLAGS="`echo \"$CFLAGS\" | sed -E 's/-arch +x86_64//g' | sed -E 's/-arch +ppc64//g'`"
    save_LDFLAGS="$LDFLAGS"
    LDFLAGS="`echo \"$LDFLAGS\" | sed -E 's/-arch +x86_64//g' | sed -E 's/-arch +ppc64//g'`"
fi


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tcl_Init in -ltcl""... $ac_c" 1>&6
echo "configure:11784: checking for Tcl_Init in -ltcl" >&5
ac_lib_var=`echo tcl'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11790 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tcl_Init in -ltcl""... $ac_c" 1>&6
echo "configure:11820: checking for Tcl_Init in -ltcl" >&5
ac_lib_var=`echo tcl'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl $MATHLIB $DLLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11826 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl $MATHLIB $DLLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tcl_Init in -ltcl$tcltk_ver""... $ac_c" 1>&6
echo "configure:11864: checking for Tcl_Init in -ltcl$tcltk_ver" >&5
ac_lib_var=`echo tcl$tcltk_ver'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl$tcltk_ver $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11870 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl$tcltk_ver $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tcl_Init in -ltcl$tcltk_ver""... $ac_c" 1>&6
echo "configure:11900: checking for Tcl_Init in -ltcl$tcltk_ver" >&5
ac_lib_var=`echo tcl$tcltk_ver'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl$tcltk_ver $MATHLIB $DLLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11906 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl$tcltk_ver $MATHLIB $DLLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tcl_Init in -ltcl$tcltk_ver2""... $ac_c" 1>&6
echo "configure:11944: checking for Tcl_Init in -ltcl$tcltk_ver2" >&5
ac_lib_var=`echo tcl$tcltk_ver2'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl$tcltk_ver2 $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11950 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl$tcltk_ver2 $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tcl_Init in -ltcl$tcltk_ver2""... $ac_c" 1>&6
echo "configure:11980: checking for Tcl_Init in -ltcl$tcltk_ver2" >&5
ac_lib_var=`echo tcl$tcltk_ver2'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltcl$tcltk_ver2 $MATHLIB $DLLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11986 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:11997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TCLLIB="$TCLLIB -ltcl$tcltk_ver2 $MATHLIB $DLLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate Tcl library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}



fi




fi






LDFLAGS=${ac_save_ldflags}



fi




fi






LDFLAGS=${ac_save_ldflags}



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tk_MainWindow in -ltk""... $ac_c" 1>&6
echo "configure:12075: checking for Tk_MainWindow in -ltk" >&5
ac_lib_var=`echo tk'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk $TCLLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12081 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tk_MainWindow in -ltk""... $ac_c" 1>&6
echo "configure:12111: checking for Tk_MainWindow in -ltk" >&5
ac_lib_var=`echo tk'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk $TCLLIB $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12117 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tk_MainWindow in -ltk$tcltk_ver""... $ac_c" 1>&6
echo "configure:12155: checking for Tk_MainWindow in -ltk$tcltk_ver" >&5
ac_lib_var=`echo tk$tcltk_ver'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk$tcltk_ver $TCLLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12161 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk$tcltk_ver $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tk_MainWindow in -ltk$tcltk_ver""... $ac_c" 1>&6
echo "configure:12191: checking for Tk_MainWindow in -ltk$tcltk_ver" >&5
ac_lib_var=`echo tk$tcltk_ver'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk$tcltk_ver $TCLLIB $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12197 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk$tcltk_ver $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$TCLTKLIBPATH $LDFLAGS"




echo $ac_n "checking for Tk_MainWindow in -ltk$tcltk_ver2""... $ac_c" 1>&6
echo "configure:12235: checking for Tk_MainWindow in -ltk$tcltk_ver2" >&5
ac_lib_var=`echo tk$tcltk_ver2'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk$tcltk_ver2 $TCLLIB $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12241 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk$tcltk_ver2 $MATHLIB"
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for Tk_MainWindow in -ltk$tcltk_ver2""... $ac_c" 1>&6
echo "configure:12271: checking for Tk_MainWindow in -ltk$tcltk_ver2" >&5
ac_lib_var=`echo tk$tcltk_ver2'_'Tk_MainWindow | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ltk$tcltk_ver2 $TCLLIB $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12277 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tk_MainWindow();

int main() {
Tk_MainWindow()
; return 0; }
EOF
if { (eval echo configure:12288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TKLIB="$TKLIB -ltk$tcltk_ver2 $MATHLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate Tk library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}



fi




fi






LDFLAGS=${ac_save_ldflags}



fi




fi






LDFLAGS=${ac_save_ldflags}


# restore CFLAGS/LDLFAGS from Aqua 64bit strip
# only Tcl/Tk-based makefiles will strip 64bit out during compile
if test "$OPENGL_AQUA" = 1 ; then
   CFLAGS="$save_CFLAGS"
   LDFLAGS="$save_LDFLAGS"
fi

TCLTKLIBS="$TKLIB $TCLLIB"

# check for available OSX archs in TclTk
if test -n "$MACOSX_ARCHS" ; then
  save_LDFLAGS="$LDFLAGS"
  LDFLAGS=
  save_CFLAGS="$CFLAGS"
  CFLAGS=
  tlib=`echo "$TCLLIB" | sed -e 's/-l//' -e 's/^  *//' -e 's/  *$//'`
  for a in i386 ppc x86_64 ppc64
  do
    # add only if in MACOSX_ARCHS
    echo $ac_n "checking for Tcl_Init in -l$tlib""... $ac_c" 1>&6
echo "configure:12378: checking for Tcl_Init in -l$tlib" >&5
ac_lib_var=`echo $tlib'_'Tcl_Init | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-l$tlib -arch $a $MACOSX_SDK $TCLTKLIBPATH $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12384 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Tcl_Init();

int main() {
Tcl_Init()
; return 0; }
EOF
if { (eval echo configure:12395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
      if test -n "`echo "$MACOSX_ARCHS" | grep $a`" ; then
        MACOSX_ARCHS_TCLTK="$MACOSX_ARCHS_TCLTK -arch $a"
      fi
      
else
  echo "$ac_t""no" 1>&6
fi

  done
  LDFLAGS="$save_LDFLAGS"
  CFLAGS="$save_CFLAGS"
fi

cat >> confdefs.h <<\EOF
#define HAVE_TCLTK 1
EOF


fi # $USE_TCLTK

TKINCDIR=$TCLINCDIR







# Done checking Tcl/Tk

# Enable ODBC option


echo $ac_n "checking whether to use ODBC""... $ac_c" 1>&6
echo "configure:12444: checking whether to use ODBC" >&5
echo "$ac_t"""$with_odbc"" 1>&6
case "$with_odbc" in
	"no")	USE_ODBC=	;;
	"yes")	USE_ODBC="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



ODBCINC=
ODBCLIB=

if test -n "$USE_ODBC"; then

# With ODBC includes directory


echo $ac_n "checking for location of ODBC includes""... $ac_c" 1>&6
echo "configure:12463: checking for location of ODBC includes" >&5
case "$with_odbc_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-odbc-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_odbc_includes" 1>&6

if test -n "$with_odbc_includes" ; then
    for dir in $with_odbc_includes; do
        if test -d "$dir"; then
            ODBCINC="$ODBCINC -I$dir"
        else
            { echo "configure: error: *** ODBC includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$ODBCINC $CPPFLAGS"
for ac_hdr in sql.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:12489: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 12492 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate ODBC includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With ODBC library directory


echo $ac_n "checking for location of ODBC library""... $ac_c" 1>&6
echo "configure:12531: checking for location of ODBC library" >&5
case "$with_odbc_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-odbc-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_odbc_libs" 1>&6

if test -n "$with_odbc_libs"; then
    for dir in $with_odbc_libs; do
        if test -d "$dir"; then
            ODBCLIB="$ODBCLIB -L$dir"
        else
            { echo "configure: error: *** ODBC library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$ODBCLIB $LDFLAGS"


echo $ac_n "checking for SQLConnect in -lodbc""... $ac_c" 1>&6
echo "configure:12556: checking for SQLConnect in -lodbc" >&5
ac_lib_var=`echo odbc'_'SQLConnect | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lodbc $ICONVLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12562 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SQLConnect();

int main() {
SQLConnect()
; return 0; }
EOF
if { (eval echo configure:12573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ODBCLIB="$ODBCLIB -lodbc "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$ODBCLIB $LDFLAGS"


echo $ac_n "checking for SQLConnect in -liodbc""... $ac_c" 1>&6
echo "configure:12598: checking for SQLConnect in -liodbc" >&5
ac_lib_var=`echo iodbc'_'SQLConnect | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-liodbc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12604 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SQLConnect();

int main() {
SQLConnect()
; return 0; }
EOF
if { (eval echo configure:12615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  ODBCLIB="$ODBCLIB -liodbc "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}
ac_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS $ODBCINC"

ac_save_ldflags="$LDFLAGS"
ac_save_libs="$LIBS"
echo $ac_n "checking for ODBC library""... $ac_c" 1>&6
echo "configure:12640: checking for ODBC library" >&5
LDFLAGS="$ODBCLIB $LDFLAGS"
LIBS="-lodbc32  "
cat > conftest.$ac_ext <<EOF
#line 12644 "configure"
#include "confdefs.h"
#include <windows.h>
#include <sql.h>
int main() {
SQLAllocEnv((SQLHENV *)0);
; return 0; }
EOF
if { (eval echo configure:12652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
echo "$ac_t""found" 1>&6
ODBCLIB="$ODBCLIB -lodbc32 "

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  

    { echo "configure: error: *** Unable to locate ODBC library." 1>&2; exit 1; }


fi
rm -f conftest*
LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}

CFLAGS="${ac_save_cflags}"


fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_ODBC




# Done checking ODBC

# Enable FFTW option


echo $ac_n "checking whether to use FFTW""... $ac_c" 1>&6
echo "configure:12701: checking whether to use FFTW" >&5
echo "$ac_t"""$with_fftw"" 1>&6
case "$with_fftw" in
	"no")	USE_FFTW=	;;
	"yes")	USE_FFTW="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



FFTWINC=
FFTWLIB=

if test -n "$USE_FFTW"; then

# With FFTW includes directory


echo $ac_n "checking for location of FFTW includes""... $ac_c" 1>&6
echo "configure:12720: checking for location of FFTW includes" >&5
case "$with_fftw_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-fftw-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_fftw_includes" 1>&6

if test -n "$with_fftw_includes" ; then
    for dir in $with_fftw_includes; do
        if test -d "$dir"; then
            FFTWINC="$FFTWINC -I$dir"
        else
            { echo "configure: error: *** FFTW includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$FFTWINC $CPPFLAGS"
for ac_hdr in fftw3.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:12746: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 12749 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS=" $CPPFLAGS"
for ac_hdr in fftw.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:12782: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 12785 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS=" $CPPFLAGS"
for ac_hdr in dfftw.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:12818: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 12821 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate FFTW includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


fi
done

CPPFLAGS=$ac_save_cppflags


fi
done

CPPFLAGS=$ac_save_cppflags


# With FFTW library directory


echo $ac_n "checking for location of FFTW library""... $ac_c" 1>&6
echo "configure:12872: checking for location of FFTW library" >&5
case "$with_fftw_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-fftw-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_fftw_libs" 1>&6

if test -n "$with_fftw_libs"; then
    for dir in $with_fftw_libs; do
        if test -d "$dir"; then
            FFTWLIB="$FFTWLIB -L$dir"
        else
            { echo "configure: error: *** FFTW library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFTWLIB $LDFLAGS"


echo $ac_n "checking for fftw_execute in -lfftw3""... $ac_c" 1>&6
echo "configure:12897: checking for fftw_execute in -lfftw3" >&5
ac_lib_var=`echo fftw3'_'fftw_execute | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lfftw3 $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12903 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fftw_execute();

int main() {
fftw_execute()
; return 0; }
EOF
if { (eval echo configure:12914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFTWLIB="$FFTWLIB -lfftw3 $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFTWLIB $LDFLAGS"


echo $ac_n "checking for fftwnd_one in -lfftw""... $ac_c" 1>&6
echo "configure:12939: checking for fftwnd_one in -lfftw" >&5
ac_lib_var=`echo fftw'_'fftwnd_one | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lfftw $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12945 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fftwnd_one();

int main() {
fftwnd_one()
; return 0; }
EOF
if { (eval echo configure:12956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFTWLIB="$FFTWLIB -lfftw $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FFTWLIB $LDFLAGS"


echo $ac_n "checking for fftwnd_one in -ldfftw""... $ac_c" 1>&6
echo "configure:12981: checking for fftwnd_one in -ldfftw" >&5
ac_lib_var=`echo dfftw'_'fftwnd_one | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldfftw $MATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12987 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fftwnd_one();

int main() {
fftwnd_one()
; return 0; }
EOF
if { (eval echo configure:12998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFTWLIB="$FFTWLIB -ldfftw $MATHLIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate FFTW library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_FFTW




# Done checking FFTW

# Enable BLAS option


echo $ac_n "checking whether to use BLAS""... $ac_c" 1>&6
echo "configure:13055: checking whether to use BLAS" >&5
echo "$ac_t"""$with_blas"" 1>&6
case "$with_blas" in
	"no")	USE_BLAS=	;;
	"yes")	USE_BLAS="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



BLASLIB=
BLASINC=

if test -n "$USE_BLAS"; then

# With BLAS includes directory
# BLAS doesn't have includes (FORTRAN library)
# With BLAS library directory


echo $ac_n "checking for location of BLAS includes""... $ac_c" 1>&6
echo "configure:13076: checking for location of BLAS includes" >&5
case "$with_blas_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-blas-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_blas_includes" 1>&6

if test -n "$with_blas_includes" ; then
    for dir in $with_blas_includes; do
        if test -d "$dir"; then
            BLASINC="$BLASINC -I$dir"
        else
            { echo "configure: error: *** BLAS includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


echo $ac_n "checking for location of BLAS library""... $ac_c" 1>&6
echo "configure:13096: checking for location of BLAS library" >&5
case "$with_blas_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-blas-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_blas_libs" 1>&6

if test -n "$with_blas_libs"; then
    for dir in $with_blas_libs; do
        if test -d "$dir"; then
            BLASLIB="$BLASLIB -L$dir"
        else
            { echo "configure: error: *** BLAS library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


# See if cblas.h exists (CBLAS,ATLAS,others)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$BLASINC $CPPFLAGS"
for ac_hdr in cblas.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13122: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 13125 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

CPPFLAGS="$save_CPPFLAGS"


ac_save_ldflags="$LDFLAGS"
LDFLAGS="$BLASLIB $LDFLAGS"




echo $ac_n "checking for dnrm2_ in -lblas""... $ac_c" 1>&6
echo "configure:13165: checking for dnrm2_ in -lblas" >&5
ac_lib_var=`echo blas'_'dnrm2_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lblas $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13171 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnrm2_();

int main() {
dnrm2_()
; return 0; }
EOF
if { (eval echo configure:13182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLASLIB="$BLASLIB -lblas "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for dnrm2_ in -lblas""... $ac_c" 1>&6
echo "configure:13201: checking for dnrm2_ in -lblas" >&5
ac_lib_var=`echo blas'_'dnrm2_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lblas $MATHLIB -lg2c $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13207 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnrm2_();

int main() {
dnrm2_()
; return 0; }
EOF
if { (eval echo configure:13218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLASLIB="$BLASLIB -lblas -lg2c"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate BLAS library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}


blas_ok=no

# Check for ATLAS
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$BLASLIB $LDFLAGS"
echo $ac_n "checking for ATL_xerbla in -latlas""... $ac_c" 1>&6
echo "configure:13262: checking for ATL_xerbla in -latlas" >&5
ac_lib_var=`echo atlas'_'ATL_xerbla | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-latlas  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13268 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ATL_xerbla();

int main() {
ATL_xerbla()
; return 0; }
EOF
if { (eval echo configure:13279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for sgemm_ in -lf77blas""... $ac_c" 1>&6
echo "configure:13294: checking for sgemm_ in -lf77blas" >&5
ac_lib_var=`echo f77blas'_'sgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lf77blas -latlas $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13300 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sgemm_();

int main() {
sgemm_()
; return 0; }
EOF
if { (eval echo configure:13311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for cblas_dgemm in -lcblas""... $ac_c" 1>&6
echo "configure:13326: checking for cblas_dgemm in -lcblas" >&5
ac_lib_var=`echo cblas'_'cblas_dgemm | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lcblas -lf77blas -latlas $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13332 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cblas_dgemm();

int main() {
cblas_dgemm()
; return 0; }
EOF
if { (eval echo configure:13343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  blas_ok=yes; BLASLIB="-lcblas -lf77blas -latlas"
else
  echo "$ac_t""no" 1>&6
fi

else
  echo "$ac_t""no" 1>&6
fi


else
  echo "$ac_t""no" 1>&6
fi

LDFLAGS="$save_LDFLAGS"

# Do we have ATLAS?
if test $blas_ok = yes; then
	cat >> confdefs.h <<\EOF
#define HAVE_LIBATLAS 1
EOF

fi

# BLAS in Apple vecLib framework? (Mac OS-X)
#  not dependent on APP build
#if test -n "$MACOSX_APP"; then
if test $blas_ok = no; then
	vlib_flags="-framework vecLib"
	save_LIBS="$LIBS"
	LIBS="$vlib_flags $LIBS"
	echo $ac_n "checking for sgemm in $vlib_flags""... $ac_c" 1>&6
echo "configure:13389: checking for sgemm in $vlib_flags" >&5
	cat > conftest.$ac_ext <<EOF
#line 13391 "configure"
#include "confdefs.h"

int main() {
sgemm
; return 0; }
EOF
if { (eval echo configure:13398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  blas_ok=yes; BLASLIB="$vlib_flags"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  BLASLIB=""
fi
rm -f conftest*
	echo "$ac_t""$blas_ok" 1>&6
	LIBS="$save_LIBS"
fi
#fi # $MACOSX_APP

# BLAS in PhiPACK libraries? (requires generic BLAS, too)
if test $blas_ok = no; then
	echo $ac_n "checking for sgemm_ in -lblas""... $ac_c" 1>&6
echo "configure:13416: checking for sgemm_ in -lblas" >&5
ac_lib_var=`echo blas'_'sgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lblas  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13422 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sgemm_();

int main() {
sgemm_()
; return 0; }
EOF
if { (eval echo configure:13433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for dgemm_ in -ldgemm""... $ac_c" 1>&6
echo "configure:13448: checking for dgemm_ in -ldgemm" >&5
ac_lib_var=`echo dgemm'_'dgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-ldgemm -lblas $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13454 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dgemm_();

int main() {
dgemm_()
; return 0; }
EOF
if { (eval echo configure:13465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for sgemm_ in -lsgemm""... $ac_c" 1>&6
echo "configure:13480: checking for sgemm_ in -lsgemm" >&5
ac_lib_var=`echo sgemm'_'sgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsgemm -lblas $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13486 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sgemm_();

int main() {
sgemm_()
; return 0; }
EOF
if { (eval echo configure:13497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  blas_ok=yes; BLASLIB="-lsgemm -ldgemm -lblas"
else
  echo "$ac_t""no" 1>&6
fi

else
  echo "$ac_t""no" 1>&6
fi

	
else
  echo "$ac_t""no" 1>&6
fi

fi

# BLAS in Sun Performance library?
if test $blas_ok = no; then
	if test "x$GCC" != xyes; then # only works with Sun CC
		echo $ac_n "checking for acosp in -lsunmath""... $ac_c" 1>&6
echo "configure:13531: checking for acosp in -lsunmath" >&5
ac_lib_var=`echo sunmath'_'acosp | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsunmath  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13537 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char acosp();

int main() {
acosp()
; return 0; }
EOF
if { (eval echo configure:13548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for sgemm_ in -lsunperf""... $ac_c" 1>&6
echo "configure:13563: checking for sgemm_ in -lsunperf" >&5
ac_lib_var=`echo sunperf'_'sgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lsunperf -lsunmath $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13569 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sgemm_();

int main() {
sgemm_()
; return 0; }
EOF
if { (eval echo configure:13580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  blas_ok=yes; BLASLIB="-xlic_lib=sunperf -lsunmath"
else
  echo "$ac_t""no" 1>&6
fi

		
else
  echo "$ac_t""no" 1>&6
fi

	fi
fi

# Generic BLAS library
if test $blas_ok = no; then
	echo $ac_n "checking for sgemm_ in -lblas""... $ac_c" 1>&6
echo "configure:13610: checking for sgemm_ in -lblas" >&5
ac_lib_var=`echo blas'_'sgemm_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lblas  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13616 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sgemm_();

int main() {
sgemm_()
; return 0; }
EOF
if { (eval echo configure:13627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  blas_ok=yes; BLASLIB="-lblas"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test $blas_ok = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_LIBBLAS 1
EOF

fi

fi # $USE_BLAS




# Done checking BLAS

# Enable LAPACK option


echo $ac_n "checking whether to use LAPACK""... $ac_c" 1>&6
echo "configure:13666: checking whether to use LAPACK" >&5
echo "$ac_t"""$with_lapack"" 1>&6
case "$with_lapack" in
	"no")	USE_LAPACK=	;;
	"yes")	USE_LAPACK="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



LAPACKLIB=
LAPACKINC=

# LAPACK is useless without BLAS
if test -n "$USE_BLAS"; then
if test -n "$USE_LAPACK"; then

# With LAPACK includes directory
# LAPACK doesn't have includes (FORTRAN library)
# With LAPACK library directory

lapack_ok=no


echo $ac_n "checking for location of LAPACK includes""... $ac_c" 1>&6
echo "configure:13691: checking for location of LAPACK includes" >&5
case "$with_lapack_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-lapack-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_lapack_includes" 1>&6

if test -n "$with_lapack_includes" ; then
    for dir in $with_lapack_includes; do
        if test -d "$dir"; then
            LAPACKINC="$LAPACKINC -I$dir"
        else
            { echo "configure: error: *** LAPACK includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


echo $ac_n "checking for location of LAPACK library""... $ac_c" 1>&6
echo "configure:13711: checking for location of LAPACK library" >&5
case "$with_lapack_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-lapack-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_lapack_libs" 1>&6

if test -n "$with_lapack_libs"; then
    for dir in $with_lapack_libs; do
        if test -d "$dir"; then
            LAPACKLIB="$LAPACKLIB -L$dir"
        else
            { echo "configure: error: *** LAPACK library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


# See if clapack.h exists (ATLAS)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LAPACKINC $CPPFLAGS"
for ac_hdr in clapack.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:13737: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 13740 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

CPPFLAGS="$save_CPPFLAGS"

# LAPACK linked to by default?
if test lapack_ok=no; then
	save_LIBS="$LIBS"; LIBS="$LIBS $BLASLIB $MATHLIB $FLIBS"
	save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
	echo $ac_n "checking for dsegv_""... $ac_c" 1>&6
echo "configure:13777: checking for dsegv_" >&5

cat > conftest.$ac_ext <<EOF
#line 13780 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dsegv_(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dsegv_();

int main() {

/* 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_dsegv_) || defined (__stub___dsegv_)
choke me
#else
dsegv_();
#endif

; return 0; }
EOF
if { (eval echo configure:13803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_dsegv_=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_dsegv_=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'dsegv_`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lapack_ok=yes
else
  echo "$ac_t""no" 1>&6
fi

	LIBS="$save_LIBS"
	LDFLAGS="$save_LDFLAGS"
fi

# Generic LAPACK library?
if test $lapack_ok = no; then
	save_libs="$LIBS"; LIBS="$BLASLIB $MATHLIB $LIBS"
	save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
	echo $ac_n "checking for desgv_ in -llapack""... $ac_c" 1>&6
echo "configure:13830: checking for desgv_ in -llapack" >&5
ac_lib_var=`echo lapack'_'desgv_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-llapack $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13836 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char desgv_();

int main() {
desgv_()
; return 0; }
EOF
if { (eval echo configure:13847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lapack_ok=yes; LAPACKLIB="-llapack"
else
  echo "$ac_t""no" 1>&6
fi

	LIBS="$save_LIBS"
	LDFLAGS="$save_LDFLAGS"
fi

if test $lapack_ok = no; then
	
ac_save_ldflags="$LDFLAGS"
LDFLAGS="$LAPACKLIB $LDFLAGS"




echo $ac_n "checking for dgesv_ in -llapack""... $ac_c" 1>&6
echo "configure:13879: checking for dgesv_ in -llapack" >&5
ac_lib_var=`echo lapack'_'dgesv_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-llapack $BLASLIB $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13885 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dgesv_();

int main() {
dgesv_()
; return 0; }
EOF
if { (eval echo configure:13896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LAPACKLIB="$LAPACKLIB -llapack "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for dgesv_ in -llapack""... $ac_c" 1>&6
echo "configure:13915: checking for dgesv_ in -llapack" >&5
ac_lib_var=`echo lapack'_'dgesv_ | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-llapack $BLASLIB $MATHLIB -lg2c $LIBS"
cat > conftest.$ac_ext <<EOF
#line 13921 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dgesv_();

int main() {
dgesv_()
; return 0; }
EOF
if { (eval echo configure:13932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LAPACKLIB="$LAPACKLIB -llapack -lg2c"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate LAPACK library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}

fi

cat >> confdefs.h <<\EOF
#define HAVE_LIBLAPACK 1
EOF


fi # $USE_LAPACK
fi # $USE_BLAS




# Done checking LAPACK

# Enable Motif option


echo $ac_n "checking whether to use Motif""... $ac_c" 1>&6
echo "configure:13988: checking whether to use Motif" >&5
echo "$ac_t"""$with_motif"" 1>&6
case "$with_motif" in
	"no")	USE_MOTIF=	;;
	"yes")	USE_MOTIF="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



XMINC=
XMLIB=

if test -n "$USE_MOTIF"; then

# With Motif includes directory


echo $ac_n "checking for location of Motif includes""... $ac_c" 1>&6
echo "configure:14007: checking for location of Motif includes" >&5
case "$with_motif_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-motif-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_motif_includes" 1>&6

if test -n "$with_motif_includes" ; then
    for dir in $with_motif_includes; do
        if test -d "$dir"; then
            XMINC="$XMINC -I$dir"
        else
            { echo "configure: error: *** Motif includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$XMINC $X_CFLAGS $CPPFLAGS"
for ac_hdr in Xm/Xm.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:14033: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 14036 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Motif includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With Motif library directory


echo $ac_n "checking for location of Motif library""... $ac_c" 1>&6
echo "configure:14075: checking for location of Motif library" >&5
case "$with_motif_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-motif-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_motif_libs" 1>&6

if test -n "$with_motif_libs"; then
    for dir in $with_motif_libs; do
        if test -d "$dir"; then
            XMLIB="$XMLIB -L$dir"
        else
            { echo "configure: error: *** Motif library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$XMLIB $LDFLAGS"


echo $ac_n "checking for XmStringCreate in -lXm""... $ac_c" 1>&6
echo "configure:14100: checking for XmStringCreate in -lXm" >&5
ac_lib_var=`echo Xm'_'XmStringCreate | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lXm $X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14106 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XmStringCreate();

int main() {
XmStringCreate()
; return 0; }
EOF
if { (eval echo configure:14117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  XMLIB="$XMLIB -lXm "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate Motif library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_MOTIF




# Done checking Motif

# Enable Cairo display driver option


echo $ac_n "checking whether to use Cairo""... $ac_c" 1>&6
echo "configure:14158: checking whether to use Cairo" >&5
echo "$ac_t"""$with_cairo"" 1>&6
case "$with_cairo" in
	"no")	USE_CAIRO=	;;
	"yes")	USE_CAIRO="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



CAIROINC=
CAIROLIB=

if test -n "$USE_CAIRO"; then

cairo="cairo"
pkgs="cairo-ft cairo-fc"
if test -n "$USE_X11"; then
	pkgs="$pkgs cairo-xlib-xrender"
fi
for pkg in $pkgs ; do
    if pkg-config --exists $pkg ; then
        cairo="$cairo $pkg"
    fi
done

# With Cairo includes directory
#FIXME: somehow quote dirs with spaces in $cairo ?
CAIROINC=`pkg-config --cflags $cairo`


echo $ac_n "checking for location of cairo includes""... $ac_c" 1>&6
echo "configure:14190: checking for location of cairo includes" >&5
case "$with_cairo_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-cairo-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_cairo_includes" 1>&6

if test -n "$with_cairo_includes" ; then
    for dir in $with_cairo_includes; do
        if test -d "$dir"; then
            CAIROINC="$CAIROINC -I$dir"
        else
            { echo "configure: error: *** cairo includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CAIROINC $CPPFLAGS"
for ac_hdr in cairo.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:14216: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 14219 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Cairo includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With Cairo library directory

CAIROLIB=`pkg-config --libs $cairo`


echo $ac_n "checking for location of cairo library""... $ac_c" 1>&6
echo "configure:14260: checking for location of cairo library" >&5
case "$with_cairo_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-cairo-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_cairo_libs" 1>&6

if test -n "$with_cairo_libs"; then
    for dir in $with_cairo_libs; do
        if test -d "$dir"; then
            CAIROLIB="$CAIROLIB -L$dir"
        else
            { echo "configure: error: *** cairo library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


echo $ac_n "checking for cairo linking flags""... $ac_c" 1>&6
echo "configure:14280: checking for cairo linking flags" >&5
case "$with_cairo_ldflags" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-cairo-ldflags." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_cairo_ldflags" 1>&6
CAIROLIB="$CAIROLIB $with_cairo_ldflags"



ac_save_libs="$LIBS"
ac_save_ldflags="$LDFLAGS"
LIBS=" $CAIROLIB $LIBS"
LDFLAGS=" $LDFLAGS"
echo $ac_n "checking for cairo_create""... $ac_c" 1>&6
echo "configure:14296: checking for cairo_create" >&5

cat > conftest.$ac_ext <<EOF
#line 14299 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char cairo_create(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cairo_create();

int main() {

/* 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_cairo_create) || defined (__stub___cairo_create)
choke me
#else
cairo_create();
#endif

; return 0; }
EOF
if { (eval echo configure:14322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_cairo_create=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_cairo_create=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'cairo_create`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
:

else
  echo "$ac_t""no" 1>&6


{ echo "configure: error: *** Unable to locate cairo_create." 1>&2; exit 1; }


fi

LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}


ac_save_libs="$LIBS"
ac_save_ldflags="$LDFLAGS"
LIBS=" $CAIROLIB $LIBS"
LDFLAGS=" $LDFLAGS"
echo $ac_n "checking for cairo_xlib_surface_create_with_xrender_format""... $ac_c" 1>&6
echo "configure:14356: checking for cairo_xlib_surface_create_with_xrender_format" >&5

cat > conftest.$ac_ext <<EOF
#line 14359 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char cairo_xlib_surface_create_with_xrender_format(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cairo_xlib_surface_create_with_xrender_format();

int main() {

/* 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_cairo_xlib_surface_create_with_xrender_format) || defined (__stub___cairo_xlib_surface_create_with_xrender_format)
choke me
#else
cairo_xlib_surface_create_with_xrender_format();
#endif

; return 0; }
EOF
if { (eval echo configure:14382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_cairo_xlib_surface_create_with_xrender_format=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_cairo_xlib_surface_create_with_xrender_format=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'cairo_xlib_surface_create_with_xrender_format`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
CAIRO_HAS_XRENDER=1

else
  echo "$ac_t""no" 1>&6

CAIRO_HAS_XRENDER=0

fi

LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}



ac_save_libs="$LIBS"
ac_save_ldflags="$LDFLAGS"
LIBS=" $CAIROLIB $LIBS"
LDFLAGS=" $LDFLAGS"
echo $ac_n "checking for cairo_xlib_surface_get_xrender_format""... $ac_c" 1>&6
echo "configure:14415: checking for cairo_xlib_surface_get_xrender_format" >&5

cat > conftest.$ac_ext <<EOF
#line 14418 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char cairo_xlib_surface_get_xrender_format(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cairo_xlib_surface_get_xrender_format();

int main() {

/* 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_cairo_xlib_surface_get_xrender_format) || defined (__stub___cairo_xlib_surface_get_xrender_format)
choke me
#else
cairo_xlib_surface_get_xrender_format();
#endif

; return 0; }
EOF
if { (eval echo configure:14441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_cairo_xlib_surface_get_xrender_format=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_cairo_xlib_surface_get_xrender_format=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'cairo_xlib_surface_get_xrender_format`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
CAIRO_HAS_XRENDER_SURFACE=1

else
  echo "$ac_t""no" 1>&6

CAIRO_HAS_XRENDER_SURFACE=

fi

LIBS=${ac_save_libs}
LDFLAGS=${ac_save_ldflags}



CAIROLIB="$CAIROLIB $CAIROLDFLAGS"

fi # $USE_CAIRO





# Done checking Cairo

# Enable GLw option


echo $ac_n "checking whether to use GLw""... $ac_c" 1>&6
echo "configure:14483: checking whether to use GLw" >&5
echo "$ac_t"""$with_glw"" 1>&6
case "$with_glw" in
	"no")	USE_GLW=	;;
	"yes")	USE_GLW="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



OPENGLWINC=
OPENGLWM=

if test -n "$USE_GLW"; then

# With GLw includes directory


echo $ac_n "checking for location of GLw includes""... $ac_c" 1>&6
echo "configure:14502: checking for location of GLw includes" >&5
case "$with_glw_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-glw-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_glw_includes" 1>&6

if test -n "$with_glw_includes" ; then
    for dir in $with_glw_includes; do
        if test -d "$dir"; then
            OPENGLWINC="$OPENGLWINC -I$dir"
        else
            { echo "configure: error: *** GLw includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$OPENGLWINC $XMINC $X_CFLAGS $OPENGLINC $CPPFLAGS"
for ac_hdr in GL/GLwMDrawA.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:14528: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 14531 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS=" $CPPFLAGS"
for ac_hdr in X11/GLw/GLwMDrawA.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:14564: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 14567 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate GLwM includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


fi
done

CPPFLAGS=$ac_save_cppflags


# With GLw library directory


echo $ac_n "checking for location of GLw library""... $ac_c" 1>&6
echo "configure:14612: checking for location of GLw library" >&5
case "$with_glw_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-glw-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_glw_libs" 1>&6

if test -n "$with_glw_libs"; then
    for dir in $with_glw_libs; do
        if test -d "$dir"; then
            OPENGLWM="$OPENGLWM -L$dir"
        else
            { echo "configure: error: *** GLw library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateMDrawingArea in -lGLw""... $ac_c" 1>&6
echo "configure:14637: checking for GLwCreateMDrawingArea in -lGLw" >&5
ac_lib_var=`echo GLw'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLw $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14643 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:14654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLw "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateM1DrawingArea in -lGLw""... $ac_c" 1>&6
echo "configure:14679: checking for GLwCreateM1DrawingArea in -lGLw" >&5
ac_lib_var=`echo GLw'_'GLwCreateM1DrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLw $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14685 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateM1DrawingArea();

int main() {
GLwCreateM1DrawingArea()
; return 0; }
EOF
if { (eval echo configure:14696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLw "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateM2DrawingArea in -lGLw""... $ac_c" 1>&6
echo "configure:14721: checking for GLwCreateM2DrawingArea in -lGLw" >&5
ac_lib_var=`echo GLw'_'GLwCreateM2DrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLw $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14727 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateM2DrawingArea();

int main() {
GLwCreateM2DrawingArea()
; return 0; }
EOF
if { (eval echo configure:14738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLw "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateMDrawingArea in -lGLwM""... $ac_c" 1>&6
echo "configure:14763: checking for GLwCreateMDrawingArea in -lGLwM" >&5
ac_lib_var=`echo GLwM'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLwM $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14769 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:14780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLwM "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateM1DrawingArea in -lGLwM""... $ac_c" 1>&6
echo "configure:14805: checking for GLwCreateM1DrawingArea in -lGLwM" >&5
ac_lib_var=`echo GLwM'_'GLwCreateM1DrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLwM $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14811 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateM1DrawingArea();

int main() {
GLwCreateM1DrawingArea()
; return 0; }
EOF
if { (eval echo configure:14822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLwM "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"


echo $ac_n "checking for GLwCreateM2DrawingArea in -lGLwM""... $ac_c" 1>&6
echo "configure:14847: checking for GLwCreateM2DrawingArea in -lGLwM" >&5
ac_lib_var=`echo GLwM'_'GLwCreateM2DrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lGLwM $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14853 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateM2DrawingArea();

int main() {
GLwCreateM2DrawingArea()
; return 0; }
EOF
if { (eval echo configure:14864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lGLwM "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"




echo $ac_n "checking for GLwCreateMDrawingArea in -lMesaGLw""... $ac_c" 1>&6
echo "configure:14891: checking for GLwCreateMDrawingArea in -lMesaGLw" >&5
ac_lib_var=`echo MesaGLw'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lMesaGLw $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14897 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:14908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lMesaGLw "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for GLwCreateMDrawingArea in -lMesaGLw""... $ac_c" 1>&6
echo "configure:14927: checking for GLwCreateMDrawingArea in -lMesaGLw" >&5
ac_lib_var=`echo MesaGLw'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lMesaGLw $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $OPENGLULIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14933 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:14944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lMesaGLw $OPENGLULIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$OPENGLWM $XMLIB $OPENGL_LIB_PATH $LDFLAGS"




echo $ac_n "checking for GLwCreateMDrawingArea in -lMesaGLwM""... $ac_c" 1>&6
echo "configure:14971: checking for GLwCreateMDrawingArea in -lMesaGLwM" >&5
ac_lib_var=`echo MesaGLwM'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lMesaGLwM $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14977 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:14988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lMesaGLwM "
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for GLwCreateMDrawingArea in -lMesaGLwM""... $ac_c" 1>&6
echo "configure:15007: checking for GLwCreateMDrawingArea in -lMesaGLwM" >&5
ac_lib_var=`echo MesaGLwM'_'GLwCreateMDrawingArea | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lMesaGLwM $X_LIBS $OPENGLLIB -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB $OPENGLULIB $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15013 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char GLwCreateMDrawingArea();

int main() {
GLwCreateMDrawingArea()
; return 0; }
EOF
if { (eval echo configure:15024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  OPENGLWM="$OPENGLWM -lMesaGLwM $OPENGLULIB"
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate GLwM library." 1>&2; exit 1; }


fi




fi






LDFLAGS=${ac_save_ldflags}



fi




fi






LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}



fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_OPENGL && $USE_MOTIF




# Done checking GLw

# Enable FreeType option


echo $ac_n "checking whether to use FreeType""... $ac_c" 1>&6
echo "configure:15137: checking whether to use FreeType" >&5
echo "$ac_t"""$with_freetype"" 1>&6
case "$with_freetype" in
	"no")	USE_FREETYPE=	;;
	"yes")	USE_FREETYPE="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



FTINC=
FTLIB=

if test -n "$USE_FREETYPE"; then

# With FreeType includes directory


echo $ac_n "checking for location of FreeType includes""... $ac_c" 1>&6
echo "configure:15156: checking for location of FreeType includes" >&5
case "$with_freetype_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-freetype-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_freetype_includes" 1>&6

if test -n "$with_freetype_includes" ; then
    for dir in $with_freetype_includes; do
        if test -d "$dir"; then
            FTINC="$FTINC -I$dir"
        else
            { echo "configure: error: *** FreeType includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$FTINC $CPPFLAGS"
for ac_hdr in ft2build.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:15182: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 15185 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate FreeType includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With FreeType library directory


echo $ac_n "checking for location of FreeType library""... $ac_c" 1>&6
echo "configure:15224: checking for location of FreeType library" >&5
case "$with_freetype_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-freetype-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_freetype_libs" 1>&6

if test -n "$with_freetype_libs"; then
    for dir in $with_freetype_libs; do
        if test -d "$dir"; then
            FTLIB="$FTLIB -L$dir"
        else
            { echo "configure: error: *** FreeType library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_ldflags="$LDFLAGS"
LDFLAGS="$FTLIB $LDFLAGS"


echo $ac_n "checking for FT_Init_FreeType in -lfreetype""... $ac_c" 1>&6
echo "configure:15249: checking for FT_Init_FreeType in -lfreetype" >&5
ac_lib_var=`echo freetype'_'FT_Init_FreeType | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lfreetype  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15255 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* 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; }
EOF
if { (eval echo configure:15266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FTLIB="$FTLIB -lfreetype "
else
  echo "$ac_t""no" 1>&6

LDFLAGS=${ac_save_ldflags}

    { echo "configure: error: *** Unable to locate FreeType library." 1>&2; exit 1; }


fi



LDFLAGS=${ac_save_ldflags}


fi # $USE_FREETYPE




# Done checking FreeType

# Enable NLS option


echo $ac_n "checking whether to use NLS""... $ac_c" 1>&6
echo "configure:15307: checking whether to use NLS" >&5
echo "$ac_t"""$with_nls"" 1>&6
case "$with_nls" in
	"no")	USE_NLS=	;;
	"yes")	USE_NLS="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



INTLLIB=
HAVE_NLS=

if test -n "${USE_NLS}" ; then
    cat >> confdefs.h <<\EOF
#define USE_NLS 1
EOF


echo $ac_n "checking for gettext""... $ac_c" 1>&6
echo "configure:15327: checking for gettext" >&5

cat > conftest.$ac_ext <<EOF
#line 15330 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gettext(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gettext();

int main() {

/* 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_gettext) || defined (__stub___gettext)
choke me
#else
gettext();
#endif

; return 0; }
EOF
if { (eval echo configure:15353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gettext=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gettext=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'gettext`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  INTLLIB=
else
  echo "$ac_t""no" 1>&6

echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
echo "configure:15371: checking for gettext in -lintl" >&5
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`

ac_save_LIBS="$LIBS"
LIBS="-lintl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15377 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gettext();

int main() {
gettext()
; return 0; }
EOF
if { (eval echo configure:15388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  INTLLIB=-lintl
else
  echo "$ac_t""no" 1>&6

    { echo "configure: error: *** Unable to locate gettext() function." 1>&2; exit 1; }

fi

fi


    HAVE_NLS=1
fi




# Enable C++ option
 

echo $ac_n "checking whether to use C++""... $ac_c" 1>&6
echo "configure:15423: checking whether to use C++" >&5
echo "$ac_t"""$with_cxx"" 1>&6
case "$with_cxx" in
	"no")	USE_CXX=	;;
	"yes")	USE_CXX="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



if test -n "$USE_CXX"; then
	for ac_prog in $CCC c++ g++ gcc CC cxx cc++ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15439: checking for $ac_word" >&5

if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:15468: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 15479 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:15484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:15510: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:15515: checking whether we are using GNU C++" >&5

cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:15522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:15540: checking whether ${CXX-g++} accepts -g" >&5

echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*


echo "$ac_t""$ac_cv_prog_cxx_g" 1>&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 \
   ''\
   '#include <stdlib.h>' \
   '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 <<EOF
#line 15578 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:15586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 15596 "configure"
#include "confdefs.h"
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
if { (eval echo configure:15603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi


else
	CXX=
	CXXFLAGS=
	
	
fi

# Done checking C++

# Enable openDWG option


echo $ac_n "checking whether to use openDWG""... $ac_c" 1>&6
echo "configure:15632: checking whether to use openDWG" >&5
echo "$ac_t"""$with_opendwg"" 1>&6
case "$with_opendwg" in
	"no")	USE_OPENDWG=	;;
	"yes")	USE_OPENDWG="1"	;;
	*)	{ echo "configure: error: *** You must answer yes or no." 1>&2; exit 1; }	;;
esac



OPENDWGINCPATH=
OPENDWGLIBPATH=
OPENDWGLIB=

if test -n "${USE_OPENDWG}"; then

# With OPENDWG includes directory


echo $ac_n "checking for location of openDGW includes""... $ac_c" 1>&6
echo "configure:15652: checking for location of openDGW includes" >&5
case "$with_opendwg_includes" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opendwg-includes." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opendwg_includes" 1>&6

if test -n "$with_opendwg_includes" ; then
    for dir in $with_opendwg_includes; do
        if test -d "$dir"; then
            OPENDWGINCPATH="$OPENDWGINCPATH -I$dir"
        else
            { echo "configure: error: *** openDGW includes directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi



ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$OPENDWGINCPATH $CPPFLAGS"
for ac_hdr in ad2.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:15678: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 15681 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate openDWG includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


# With OPENDWG library directory


echo $ac_n "checking for location of openDWG library""... $ac_c" 1>&6
echo "configure:15720: checking for location of openDWG library" >&5
case "$with_opendwg_libs" in
y | ye | yes | n | no)
	{ echo "configure: error: *** You must supply a directory to --with-opendwg-libs." 1>&2; exit 1; }
	;;
esac
echo "$ac_t""$with_opendwg_libs" 1>&6

if test -n "$with_opendwg_libs"; then
    for dir in $with_opendwg_libs; do
        if test -d "$dir"; then
            OPENDWGLIBPATH="$OPENDWGLIBPATH -L$dir"
        else
            { echo "configure: error: *** openDWG library directory $dir does not exist." 1>&2; exit 1; }
        fi
    done
fi


#search for ad2.a, ad3.a ... in openDWG toolkit directory:
#FIX ME  how to program this test??
#LOC_CHECK_LIBS(ad?.a,adSeekLayer,openDWG,$OPENDWGLIBPATH,OPENDWGLIB,,)
#
#for now hack (but working):
TRUEOPENDWGLIBPATH=`echo "$OPENDWGLIBPATH" | cut -b3-`
adlib=`ls -1 "$TRUEOPENDWGLIBPATH"/ad?.a | tail -1`
OPENDWGLIB="$adlib"

fi # $USE_OPENDWG






# Done checking OPENDWG

# Enable LFS (from cdr-tools)
# Check whether --enable-largefile or --disable-largefile was given.
if test "${enable_largefile+set}" = set; then
  enableval="$enable_largefile"
  :
fi

   if test "$enable_largefile" = yes; then

     echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6
echo "configure:15767: checking for special C compiler options needed for large files" >&5

ac_cv_sys_largefile_CC=no
        largefile_cc_opt=""
        if test "$GCC" != yes; then
	  # IRIX 6.2 and later do not support large files by default,
	  # so use the C compiler's -n32 option if that helps.
	  cat > conftest.$ac_ext <<EOF
#line 15775 "configure"
#include "confdefs.h"
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
int main() {

; return 0; }
EOF
if { (eval echo configure:15791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_save_CC="${CC-cc}"
	     CC="$CC -n32"
	     cat > conftest.$ac_ext <<EOF
#line 15800 "configure"
#include "confdefs.h"
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
int main() {

; return 0; }
EOF
if { (eval echo configure:15816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_sys_largefile_CC=' -n32'
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
	     CC="$ac_save_CC"
fi
rm -f conftest*
        fi

echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6
     if test "$ac_cv_sys_largefile_CC" != no; then
       CC="$CC$ac_cv_sys_largefile_CC"
       largefile_cc_opt="$ac_cv_sys_largefile_CC"
     fi

     echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6
echo "configure:15836: checking for _FILE_OFFSET_BITS value needed for large files" >&5

ac_cv_sys_file_offset_bits=no
      cat > conftest.$ac_ext <<EOF
#line 15840 "configure"
#include "confdefs.h"
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
int main() {

; return 0; }
EOF
if { (eval echo configure:15856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 15863 "configure"
#include "confdefs.h"
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
	   
int main() {

; return 0; }
EOF
if { (eval echo configure:15881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_sys_file_offset_bits=64
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
rm -f conftest*

echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6
   if test "$ac_cv_sys_file_offset_bits" != no; then
     cat >> confdefs.h <<EOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
EOF

   fi
     echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6
echo "configure:15900: checking for _LARGE_FILES value needed for large files" >&5

ac_cv_sys_large_files=no
      cat > conftest.$ac_ext <<EOF
#line 15904 "configure"
#include "confdefs.h"
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
int main() {

; return 0; }
EOF
if { (eval echo configure:15920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 15927 "configure"
#include "confdefs.h"
#define _LARGE_FILES 1
#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
  
	   
int main() {

; return 0; }
EOF
if { (eval echo configure:15945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_sys_large_files=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
rm -f conftest*

echo "$ac_t""$ac_cv_sys_large_files" 1>&6
   if test "$ac_cv_sys_large_files" != no; then
     cat >> confdefs.h <<EOF
#define _LARGE_FILES $ac_cv_sys_large_files
EOF

   fi
     echo $ac_n "checking for _LARGEFILE_SOURCE value needed for large files""... $ac_c" 1>&6
echo "configure:15964: checking for _LARGEFILE_SOURCE value needed for large files" >&5

ac_cv_sys_largefile_source=no
      cat > conftest.$ac_ext <<EOF
#line 15968 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
return !fseeko;
; return 0; }
EOF
if { (eval echo configure:15975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 15982 "configure"
#include "confdefs.h"
#define _LARGEFILE_SOURCE 1
#include <stdio.h>
	   
int main() {
return !fseeko;
; return 0; }
EOF
if { (eval echo configure:15991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_sys_largefile_source=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
rm -f conftest*

echo "$ac_t""$ac_cv_sys_largefile_source" 1>&6
   if test "$ac_cv_sys_largefile_source" != no; then
     cat >> confdefs.h <<EOF
#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
EOF

   fi
   fi
  
echo $ac_n "checking if system supports Large Files at all""... $ac_c" 1>&6
echo "configure:16012: checking if system supports Large Files at all" >&5

cat > conftest.$ac_ext <<EOF
#line 16015 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
int main() {

/*
 * Check that off_t can represent 2**63 - 1 correctly.
 * We can't simply "#define LARGE_OFF_T 9223372036854775807",
 * since some C++ compilers masquerading as C compilers
 * incorrectly reject 9223372036854775807.
 *
 * For MinGW, off64_t should be used and __MSVCRT_VERSION__ >= 0x0601
 * (msvcrt.dll version 6.10 or higher) is needed for _fstat64 and _stat64.
 */
#ifdef __MINGW32__
#   define LARGE_OFF_T (((off64_t) 1 << 62) - 1 + ((off64_t) 1 << 62))
#else
#   define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
#endif
    int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
			&& LARGE_OFF_T % 2147483647 == 1)
		       ? 1 : -1];
#ifdef __MINGW32__
return !fseeko64;
return !ftello64;
#else
return !fseeko;
return !ftello;
#endif
; return 0; }
EOF
if { (eval echo configure:16047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_largefiles=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_largefiles=no
fi
rm -f conftest*

echo "$ac_t""$ac_cv_largefiles" 1>&6
	if test $ac_cv_largefiles = yes; then
		cat >> confdefs.h <<\EOF
#define HAVE_LARGEFILES 1
EOF

	fi

USE_LARGEFILES=
if test $ac_cv_largefiles = yes; then
	USE_LARGEFILES=1
fi

# Done large file support

# Python check

echo $ac_n "checking whether to use Python""... $ac_c" 1>&6
echo "configure:16076: checking whether to use Python" >&5

PYTHONINC=
PYTHONCFLAGS=
PYTHONLDFLAGS=
USE_PYTHON=
MACOSX_ARCHS_PYTHON=

if test "$with_python" = "no" ; then
  echo "$ac_t""no" 1>&6
else
  echo "$ac_t""yes" 1>&6
  USE_PYTHON="1"
  if test "$with_python" != "yes" ; then
    PY_CONFIG="$with_python"
  fi

  # Extract the first word of "python-config", so it can be a program name with args.
set dummy python-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16096: checking for $ac_word" >&5

case "$PY_CONFIG" in
  /*)
  ac_cv_path_PY_CONFIG="$PY_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PY_CONFIG="$PY_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PY_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_PY_CONFIG" && ac_cv_path_PY_CONFIG="no"
  ;;
esac
PY_CONFIG="$ac_cv_path_PY_CONFIG"
if test -n "$PY_CONFIG"; then
  echo "$ac_t""$PY_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test "$PY_CONFIG" != "no" ; then
    # With Python includes directory 

    PYTHONINC=`"$PY_CONFIG" --includes`
    
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$PYTHONINC $CPPFLAGS"
for ac_hdr in Python.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:16138: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 16141 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate Python includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags


    PYTHONCFLAGS=`"$PY_CONFIG" --cflags`

    # With Python library directory

    PYTHONLDFLAGS=`"$PY_CONFIG" --ldflags`

    # shouldn't have arch flags in C/LD flags on OSX
    for a in i386 ppc x86_64 ppc64
    do
      PYTHONCFLAGS=`echo "$PYTHONCFLAGS" | sed "s/-arch  *$a//g"`
      PYTHONLDFLAGS=`echo "$PYTHONLDFLAGS" | sed "s/-arch  *$a//g"`
    done
  fi

  # check for available OSX archs in Python, assume framework
  if test -n "$MACOSX_ARCHS" ; then
    pylib=`"$PY_CONFIG" --prefix`/Python
    pylibinfo=`file "$pylib"`
    for a in i386 ppc x86_64 ppc64
    do
      # add only if in MACOSX_ARCHS
      if test -n "`echo \"$pylibinfo\" | grep \"library $a\"`" ; then
        if test -n "`echo "$MACOSX_ARCHS" | grep $a`" ; then
          MACOSX_ARCHS_PYTHON="$MACOSX_ARCHS_PYTHON -arch $a"
        fi
      fi
    done
  fi

fi # Done checking Python







# Enable wxWidgets support (for wxGUI)

echo $ac_n "checking whether to use wxWidgets""... $ac_c" 1>&6
echo "configure:16216: checking whether to use wxWidgets" >&5

WXVERSION=
WXWIDGETSCXXFLAGS= 
WXWIDGETSCPPFLAGS=  
WXWIDGETSLIB=  
USE_WXWIDGETS=
MACOSX_ARCHS_WXPYTHON=

if test "$with_wxwidgets" = "no" ; then
  echo "$ac_t""no" 1>&6
else
  echo "$ac_t""yes" 1>&6
  USE_WXWIDGETS="1"
  if test "$with_wxwidgets" != "yes" ; then
    WX_CONFIG="$with_wxwidgets"
  fi

  # Extract the first word of "wx-config", so it can be a program name with args.
set dummy wx-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16237: checking for $ac_word" >&5

case "$WX_CONFIG" in
  /*)
  ac_cv_path_WX_CONFIG="$WX_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_WX_CONFIG="$WX_CONFIG" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_WX_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_WX_CONFIG" && ac_cv_path_WX_CONFIG="no"
  ;;
esac
WX_CONFIG="$ac_cv_path_WX_CONFIG"
if test -n "$WX_CONFIG"; then
  echo "$ac_t""$WX_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test "$WX_CONFIG" = "no" ; then
    { echo "configure: error: *** couldn't find wx-config

  	  	  wxWidgets must be installed on your system.
  
                  Please check that wx-config is in path, the directory
                  where wxWidgets libraries are installed (returned by
                  'wx-config --libs' or 'wx-config --static --libs' command)
                  is in LD_LIBRARY_PATH or equivalent variable and
                  wxWidgets version is 2.8.1 or above." 1>&2; exit 1; }
 fi

 # Check wxWidgets version

 REQWX="2.8.1"

 echo $ac_n "checking wxWidgets version""... $ac_c" 1>&6
echo "configure:16285: checking wxWidgets version" >&5
 if WXVERSION=`"$WX_CONFIG" --version`; then
   echo "$ac_t""$WXVERSION" 1>&6
 else
   echo "$ac_t""not found" 1>&6
   { echo "configure: error: wxWidgets is required." 1>&2; exit 1; }
 fi
 if test `expr "$WXVERSION" \< "$REQWX"` = 1 ; then
   { echo "configure: error: *** wxWidgets "$REQWX" or later is required." 1>&2; exit 1; }
 fi

 # With wxWidgets includes directory 

 WXWIDGETSCXXFLAGS=`"$WX_CONFIG" --cxxflags`
 WXWIDGETSCPPFLAGS=`"$WX_CONFIG" --cppflags`

 
ac_save_cppflags="$CPPFLAGS"
CPPFLAGS="$WXWIDGETSCPPFLAGS $CPPFLAGS"
for ac_hdr in wx/wxprec.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:16308: checking for $ac_hdr" >&5

cat > conftest.$ac_ext <<EOF
#line 16311 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: *** Unable to locate wxWidgets includes." 1>&2; exit 1; }

fi
done

CPPFLAGS=$ac_save_cppflags
 

 # With wxWidgets library directory 

 WXWIDGETSLIB=`"$WX_CONFIG" --libs`

 # shouldn't have arch flags in C/LD flags on OSX
 for a in i386 ppc x86_64 ppc64
 do
   WXWIDGETSCXXFLAGS=`echo "$WXWIDGETSCXXFLAGS" | sed "s/-arch  *$a//g"`
   WXWIDGETSCPPFLAGS=`echo "$WXWIDGETSCPPFLAGS" | sed "s/-arch  *$a//g"`
   WXWIDGETSLIB=`echo "$WXWIDGETSLIB" | sed "s/-arch  *$a//g"`
 done

  # check for available OSX archs in wxPython
  if test -n "$MACOSX_ARCHS" ; then
    wxver=`"$WX_CONFIG" --version`
    wxlib=`"$WX_CONFIG" --prefix`/lib/lib`"$WX_CONFIG" --basename`-`echo "$wxver" | cut -d . -f1,2`.dylib
    wxlibinfo=`file -L "$wxlib"`
    for a in i386 ppc x86_64 ppc64
    do
      # add only if in MACOSX_ARCHS
      if test -n "`echo \"$wxlibinfo\" | grep \"library $a\"`" ; then
        if test -n "`echo \"$MACOSX_ARCHS\" | grep $a`" ; then
          MACOSX_ARCHS_WXPYTHON="$MACOSX_ARCHS_WXPYTHON -arch $a"
        fi
      fi
    done
  fi
fi # $USE_WXWIDGETS

 

 
 
 


# Done checking wxWidgets

USE_TERMIO=


STRIPFLAG=


GRASS_HOME="${DSTDIR}"


trap '' 1 2 15

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "include/Make/Grass.make include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex include/version.h include/winname.h grass.pc include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@CC@%$CC%g
s%@EXEEXT@%$EXEEXT%g
s%@MINGW32@%$MINGW32%g
s%@BINDIR@%$BINDIR%g
s%@pwd@%$pwd%g
s%@SRCDIR@%$SRCDIR%g
s%@DSTDIR@%$DSTDIR%g
s%@ARCH@%$ARCH%g
s%@GISBASE@%$GISBASE%g
s%@GRASS_BIN@%$GRASS_BIN%g
s%@SVN_VERSION@%$SVN_VERSION%g
s%@GRASS_VERSION_FILE@%$GRASS_VERSION_FILE%g
s%@GRASS_VERSION_MAJOR@%$GRASS_VERSION_MAJOR%g
s%@GRASS_VERSION_MINOR@%$GRASS_VERSION_MINOR%g
s%@GRASS_VERSION_RELEASE@%$GRASS_VERSION_RELEASE%g
s%@GRASS_VERSION_NUMBER@%$GRASS_VERSION_NUMBER%g
s%@GRASS_VERSION_DATE@%$GRASS_VERSION_DATE%g
s%@GRASS_VERSION_SVN@%$GRASS_VERSION_SVN%g
s%@NAME_VER@%$NAME_VER%g
s%@LIB_VER@%$LIB_VER%g
s%@MACOSX_APP@%$MACOSX_APP%g
s%@MACOSX_ARCHS@%$MACOSX_ARCHS%g
s%@MACOSX_SDK@%$MACOSX_SDK%g
s%@INSTDIR@%$INSTDIR%g
s%@GRASS_LIB_PREFIX@%$GRASS_LIB_PREFIX%g
s%@GRASS_LIB_SUFFIX@%$GRASS_LIB_SUFFIX%g
s%@GRASS_LIBRARY_TYPE@%$GRASS_LIBRARY_TYPE%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@CPP@%$CPP%g
s%@PLAT_OBJS@%$PLAT_OBJS%g
s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g
s%@LDFLAGS_OPTIMIZE@%$LDFLAGS_OPTIMIZE%g
s%@CC_SEARCH_FLAGS@%$CC_SEARCH_FLAGS%g
s%@LD_SEARCH_FLAGS@%$LD_SEARCH_FLAGS%g
s%@LD_LIBRARY_PATH_VAR@%$LD_LIBRARY_PATH_VAR%g
s%@STLIB_LD@%$STLIB_LD%g
s%@SHLIB_LD@%$SHLIB_LD%g
s%@GRASS_SHLIB_LD_EXTRAS@%$GRASS_SHLIB_LD_EXTRAS%g
s%@SHLIB_LD_FLAGS@%$SHLIB_LD_FLAGS%g
s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g
s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g
s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
s%@MAKE_LIB@%$MAKE_LIB%g
s%@MAKE_STUB_LIB@%$MAKE_STUB_LIB%g
s%@INSTALL_LIB@%$INSTALL_LIB%g
s%@INSTALL_STUB_LIB@%$INSTALL_STUB_LIB%g
s%@INCLUDE_DIRS@%$INCLUDE_DIRS%g
s%@LIBRARY_DIRS@%$LIBRARY_DIRS%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LEXPATH@%$LEXPATH%g
s%@YACC@%$YACC%g
s%@YACCPATH@%$YACCPATH%g
s%@ENV@%$ENV%g
s%@PERL@%$PERL%g
s%@CROSS_COMPILING@%$CROSS_COMPILING%g
s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
s%@XLIB@%$XLIB%g
s%@XTLIB@%$XTLIB%g
s%@USE_X11@%$USE_X11%g
s%@CURSES_MAXY@%$CURSES_MAXY%g
s%@CURSESLIB@%$CURSESLIB%g
s%@USE_CURSES@%$USE_CURSES%g
s%@COMPATLIB@%$COMPATLIB%g
s%@DBMIEXTRALIB@%$DBMIEXTRALIB%g
s%@XDRLIB@%$XDRLIB%g
s%@HAVE_ASPRINTF@%$HAVE_ASPRINTF%g
s%@MATHLIB@%$MATHLIB%g
s%@DLLIB@%$DLLIB%g
s%@ICONVLIB@%$ICONVLIB%g
s%@SOCKLIB@%$SOCKLIB%g
s%@HAVE_SOCKET@%$HAVE_SOCKET%g
s%@ZLIBINCPATH@%$ZLIBINCPATH%g
s%@ZLIBLIBPATH@%$ZLIBLIBPATH%g
s%@ZLIB@%$ZLIB%g
s%@PROJINC@%$PROJINC%g
s%@PROJLIB@%$PROJLIB%g
s%@PROJSHARE@%$PROJSHARE%g
s%@NAD2BIN@%$NAD2BIN%g
s%@REGEXINCPATH@%$REGEXINCPATH%g
s%@REGEXLIBPATH@%$REGEXLIBPATH%g
s%@REGEXLIB@%$REGEXLIB%g
s%@USE_REGEX@%$USE_REGEX%g
s%@READLINEINCPATH@%$READLINEINCPATH%g
s%@READLINELIBPATH@%$READLINELIBPATH%g
s%@READLINELIB@%$READLINELIB%g
s%@HISTORYLIB@%$HISTORYLIB%g
s%@GDAL_CONFIG@%$GDAL_CONFIG%g
s%@GDAL_LIBS@%$GDAL_LIBS%g
s%@GDAL_CFLAGS@%$GDAL_CFLAGS%g
s%@USE_GDAL@%$USE_GDAL%g
s%@USE_OGR@%$USE_OGR%g
s%@GEOS_CONFIG@%$GEOS_CONFIG%g
s%@GEOS_LIBS@%$GEOS_LIBS%g
s%@GEOS_CFLAGS@%$GEOS_CFLAGS%g
s%@USE_GEOS@%$USE_GEOS%g
s%@TIFF_INCLUDE_DIRS@%$TIFF_INCLUDE_DIRS%g
s%@TIFF_LIBRARY_DIRS@%$TIFF_LIBRARY_DIRS%g
s%@TIFFLIB@%$TIFFLIB%g
s%@PNGINC@%$PNGINC%g
s%@PNGLIB@%$PNGLIB%g
s%@USE_PNG@%$USE_PNG%g
s%@USE_POSTGRES@%$USE_POSTGRES%g
s%@PQINCPATH@%$PQINCPATH%g
s%@PQLIBPATH@%$PQLIBPATH%g
s%@PQLIB@%$PQLIB%g
s%@MYSQLD_CONFIG@%$MYSQLD_CONFIG%g
s%@USE_MYSQL@%$USE_MYSQL%g
s%@MYSQLINCPATH@%$MYSQLINCPATH%g
s%@MYSQLLIBPATH@%$MYSQLLIBPATH%g
s%@MYSQLLIB@%$MYSQLLIB%g
s%@MYSQLDLIB@%$MYSQLDLIB%g
s%@USE_SQLITE@%$USE_SQLITE%g
s%@SQLITEINCPATH@%$SQLITEINCPATH%g
s%@SQLITELIBPATH@%$SQLITELIBPATH%g
s%@SQLITELIB@%$SQLITELIB%g
s%@USE_FFMPEG@%$USE_FFMPEG%g
s%@FFMPEGINCPATH@%$FFMPEGINCPATH%g
s%@FFMPEGLIBPATH@%$FFMPEGLIBPATH%g
s%@FFMPEGLIB@%$FFMPEGLIB%g
s%@USE_OPENGL@%$USE_OPENGL%g
s%@OPENGL_X11@%$OPENGL_X11%g
s%@OPENGL_AQUA@%$OPENGL_AQUA%g
s%@OPENGL_WINDOWS@%$OPENGL_WINDOWS%g
s%@OPENGLINC@%$OPENGLINC%g
s%@OPENGLLIB@%$OPENGLLIB%g
s%@OPENGLULIB@%$OPENGLULIB%g
s%@TCLINCDIR@%$TCLINCDIR%g
s%@TKINCDIR@%$TKINCDIR%g
s%@TCLTKLIBPATH@%$TCLTKLIBPATH%g
s%@TCLTKLIBS@%$TCLTKLIBS%g
s%@TCL_VERSION@%$TCL_VERSION%g
s%@MACOSX_ARCHS_TCLTK@%$MACOSX_ARCHS_TCLTK%g
s%@ODBCINC@%$ODBCINC%g
s%@ODBCLIB@%$ODBCLIB%g
s%@FFTWINC@%$FFTWINC%g
s%@FFTWLIB@%$FFTWLIB%g
s%@BLASLIB@%$BLASLIB%g
s%@BLASINC@%$BLASINC%g
s%@LAPACKLIB@%$LAPACKLIB%g
s%@LAPACKINC@%$LAPACKINC%g
s%@XMINC@%$XMINC%g
s%@XMLIB@%$XMLIB%g
s%@CAIRO_HAS_XRENDER@%$CAIRO_HAS_XRENDER%g
s%@CAIRO_HAS_XRENDER_SURFACE@%$CAIRO_HAS_XRENDER_SURFACE%g
s%@CAIROINC@%$CAIROINC%g
s%@CAIROLIB@%$CAIROLIB%g
s%@USE_CAIRO@%$USE_CAIRO%g
s%@OPENGLWINC@%$OPENGLWINC%g
s%@OPENGLWM@%$OPENGLWM%g
s%@FTINC@%$FTINC%g
s%@FTLIB@%$FTLIB%g
s%@INTLLIB@%$INTLLIB%g
s%@HAVE_NLS@%$HAVE_NLS%g
s%@CXX@%$CXX%g
s%@OPENDWGINCPATH@%$OPENDWGINCPATH%g
s%@OPENDWGLIBPATH@%$OPENDWGLIBPATH%g
s%@OPENDWGLIB@%$OPENDWGLIB%g
s%@USE_OPENDWG@%$USE_OPENDWG%g
s%@USE_LARGEFILES@%$USE_LARGEFILES%g
s%@PY_CONFIG@%$PY_CONFIG%g
s%@PYTHONINC@%$PYTHONINC%g
s%@PYTHONCFLAGS@%$PYTHONCFLAGS%g
s%@PYTHONLDFLAGS@%$PYTHONLDFLAGS%g
s%@USE_PYTHON@%$USE_PYTHON%g
s%@MACOSX_ARCHS_PYTHON@%$MACOSX_ARCHS_PYTHON%g
s%@WX_CONFIG@%$WX_CONFIG%g
s%@WXVERSION@%$WXVERSION%g
s%@WXWIDGETSCXXFLAGS@%$WXWIDGETSCXXFLAGS%g
s%@WXWIDGETSCPPFLAGS@%$WXWIDGETSCPPFLAGS%g
s%@WXWIDGETSLIB@%$WXWIDGETSLIB%g
s%@USE_WXWIDGETS@%$USE_WXWIDGETS%g
s%@MACOSX_ARCHS_WXPYTHON@%$MACOSX_ARCHS_WXPYTHON%g
s%@USE_TERMIO@%$USE_TERMIO%g
s%@STRIPFLAG@%$STRIPFLAG%g
s%@GRASS_HOME@%$GRASS_HOME%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# 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_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"include/Make/Grass.make include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex include/version.h include/winname.h grass.pc"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="include/config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1



echo "Copying config.status to config.status.${ARCH}"

cp -f config.status config.status.${ARCH}

# Display configuration status

USE_TOGL=
if test -n "${USE_TCLTK}" -a -n "${USE_OPENGL}" ; then
    USE_TOGL="1"
fi


echo ""


echo "GRASS is now configured for:  ${host}"


echo ""


echo "  Source directory:            ${SRCDIR}"


echo "  Build directory:             ${DSTDIR}"


echo "  Installation directory:      ${INSTDIR}"


echo "  Startup script in directory: ${bindir}"


echo "  C compiler:                  ${CC} ${CFLAGS}"


echo "  C++ compiler:                ${CXX} ${CXXFLAGS}"

#LOC_MSG([  FORTRAN compiler:            ${F77} ${FFLAGS}])

echo "  Building shared libraries:   ${shared_ok}"


echo "  64bit support:               ${do64bit}"


echo "  OpenGL platform:             ${OPENGL_TYPE}"


echo ""


echo "  MacOSX application:         `if test -n "${MACOSX_APP}" ; then echo yes ; else echo no ; fi`"

echo "  MacOSX architectures:       ${MACOSX_ARCHS}"


echo "  MacOSX SDK:                 ${MACOSX_SDK}"


echo ""


echo "  Tcl/Tk NVIZ:                `if test -n "${USE_TOGL}" ; then echo yes ; else echo no ; fi`"

echo ""


echo "  BLAS support:               `if test -n "${USE_BLAS}" ; then echo yes ; else echo no ; fi`"

echo "  C++ support:                `if test -n "${USE_CXX}" ; then echo yes ; else echo no ; fi`"

echo "  Cairo support:              `if test -n "${USE_CAIRO}" ; then echo yes ; else echo no ; fi`"

echo "  DWG support:                `if test -n "${USE_OPENDWG}" ; then echo yes ; else echo no ; fi`"

echo "  FFMPEG support:             `if test -n "${USE_FFMPEG}" ; then echo yes ; else echo no ; fi`"

echo "  FFTW support:               `if test -n "${USE_FFTW}" ; then echo yes ; else echo no ; fi`"

echo "  FreeType support:           `if test -n "${USE_FREETYPE}" ; then echo yes ; else echo no ; fi`"

echo "  GDAL support:               `if test -n "${USE_GDAL}" ; then echo yes ; else echo no ; fi`"

echo "  GEOS support:               `if test -n "${USE_GEOS}" ; then echo yes ; else echo no ; fi`"

echo "  GLw support:                `if test -n "${USE_GLW}" ; then echo yes ; else echo no ; fi`"

echo "  LAPACK support:             `if test -n "${USE_LAPACK}" ; then echo yes ; else echo no ; fi`"

echo "  Large File support (LFS):   `if test -n "${USE_LARGEFILES}" ; then echo yes ; else echo no ; fi`"

echo "  Motif support:              `if test -n "${USE_MOTIF}" ; then echo yes ; else echo no ; fi`"

echo "  MySQL support:              `if test -n "${USE_MYSQL}" ; then echo yes ; else echo no ; fi`"

echo "  NLS support:                `if test -n "${USE_NLS}" ; then echo yes ; else echo no ; fi`"

echo "  ODBC support:               `if test -n "${USE_ODBC}" ; then echo yes ; else echo no ; fi`"

echo "  OGR support:                `if test -n "${USE_OGR}" ; then echo yes ; else echo no ; fi`"

echo "  OpenGL support:             `if test -n "${USE_OPENGL}" ; then echo yes ; else echo no ; fi`"

echo "  PNG support:                `if test -n "${USE_PNG}" ; then echo yes ; else echo no ; fi`"

echo "  PostgreSQL support:         `if test -n "${USE_POSTGRES}" ; then echo yes ; else echo no ; fi`"

echo "  Python support:             `if test -n "${USE_PYTHON}" ; then echo yes ; else echo no ; fi`"

echo "  Readline support:           `if test -n "${USE_READLINE}" ; then echo yes ; else echo no ; fi`"

echo "  SQLite support:             `if test -n "${USE_SQLITE}" ; then echo yes ; else echo no ; fi`"

echo "  Tcl/Tk support:             `if test -n "${USE_TCLTK}" ; then echo yes ; else echo no ; fi`"

echo "  wxWidgets support:          `if test -n "${USE_WXWIDGETS}" ; then echo yes ; else echo no ; fi`"

echo "  TIFF support:               `if test -n "${USE_TIFF}" ; then echo yes ; else echo no ; fi`"

echo "  X11 support:                `if test -n "${USE_X11}" ; then echo yes ; else echo no ; fi`"

echo ""

