#! /bin/sh










# Forbidden tokens and exceptions.



# Actually reserved by M4sh.

# All the M4sugar macros start with `m4_', except `dnl' kept as is
# for sake of simplicity.



# Check the divert push/pop perfect balance.


# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.




#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.











## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

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

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


# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '

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

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

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


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


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

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


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

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

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


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

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

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

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

as_executable_p="test -f"

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

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


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

# CDPATH.
$as_unset CDPATH





# Find the correct PATH separator.  Usually this is `:', but
# DJGPP uses `;' like DOS.
if test "X${PATH_SEPARATOR+set}" != Xset; then
  UNAME=${UNAME-`uname 2>/dev/null`}
  case X$UNAME in
    *-DOS) lt_cv_sys_path_separator=';' ;;
    *)     lt_cv_sys_path_separator=':' ;;
  esac
  PATH_SEPARATOR=$lt_cv_sys_path_separator
fi


# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}

case X$ECHO in
X*--fallback-echo)
  # Remove one level of quotation (which was required for Make).
  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
  ;;
esac

echo=${ECHO-echo}
if test "X$1" = X--no-reexec; then
  # Discard the --no-reexec flag, and continue.
  shift
elif test "X$1" = X--fallback-echo; then
  # Avoid inline document here, it may be left over
  :
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  # Yippee, $echo works!
  :
else
  # Restart under the correct shell.
  exec $SHELL "$0" --no-reexec ${1+"$@"}
fi

if test "X$1" = X--fallback-echo; then
  # used as fallback echo
  shift
  cat <<EOF

EOF
  exit 0
fi

# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi

if test -z "$ECHO"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
       echo_test_string="`eval $cmd`" &&
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
    then
      break
    fi
  done
fi

if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
   test "X$echo_testing_string" = "X$echo_test_string"; then
  :
else
  # The Solaris, AIX, and Digital Unix default echo programs unquote
  # backslashes.  This makes it impossible to quote backslashes using
  #   echo "$something" | sed 's/\\/\\\\/g'
  #
  # So, first we look for a working echo in the user's PATH.

  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  for dir in $PATH /usr/ucb; do
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
       test "X$echo_testing_string" = "X$echo_test_string"; then
      echo="$dir/echo"
      break
    fi
  done
  IFS="$save_ifs"

  if test "X$echo" = Xecho; then
    # We didn't find a better echo, so look for alternatives.
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
       test "X$echo_testing_string" = "X$echo_test_string"; then
      # This shell has a builtin print -r that does the trick.
      echo='print -r'
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
      # If we have ksh, try running configure again with it.
      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
      export ORIGINAL_CONFIG_SHELL
      CONFIG_SHELL=/bin/ksh
      export CONFIG_SHELL
      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
    else
      # Try using printf.
      echo='printf %s\n'
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
	 test "X$echo_testing_string" = "X$echo_test_string"; then
	# Cool, printf works
	:
      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
	   test "X$echo_testing_string" = 'X\t' &&
	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
	   test "X$echo_testing_string" = "X$echo_test_string"; then
	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
	export CONFIG_SHELL
	SHELL="$CONFIG_SHELL"
	export SHELL
	echo="$CONFIG_SHELL $0 --fallback-echo"
      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
	   test "X$echo_testing_string" = 'X\t' &&
	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
	   test "X$echo_testing_string" = "X$echo_test_string"; then
	echo="$CONFIG_SHELL $0 --fallback-echo"
      else
	# maybe with a smaller string...
	prev=:

	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
	  then
	    break
	  fi
	  prev="$cmd"
	done

	if test "$prev" != 'sed 50q "$0"'; then
	  echo_test_string=`eval $prev`
	  export echo_test_string
	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
	else
	  # Oops.  We lost completely, so just stick with echo.
	  echo=echo
	fi
      fi
    fi
  fi
fi
fi

# Copy echo and quote the copy suitably for passing to libtool from
# the Makefile, instead of quoting the original, which is used later.
ECHO=$echo
if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
fi








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

exec 6>&1

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

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

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

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

ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP CONFIGURE_COMMAND build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP RE2C LN_S AWK YACC LEX LEXLIB LEX_OUTPUT_ROOT PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS THREADED LIBOBJS PROG_SENDMAIL ALLOCA KRB5_CONFIG PKG_CONFIG OPENSSL_INCDIR_OPT FRIBIDI_CONFIG CXX CXXFLAGS ac_ct_CXX CXXCPP RANLIB ac_ct_RANLIB MYSQL_MODULE_TYPE MYSQL_LIBS MYSQL_INCLUDE OCI8_SHARED_LIBADD OCI8_DIR OCI8_VERSION ODBC_INCLUDE ODBC_LIBS ODBC_LFLAGS ODBC_TYPE ORACLE_SHARED_LIBADD ORACLE_DIR ORACLE_VERSION SNMP_CONFIG yazconfig INLINE_CFLAGS INCLUDE_PATH EXPANDED_PEAR_INSTALLDIR EXPANDED_EXTENSION_DIR EXPANDED_BINDIR EXPANDED_LIBDIR EXPANDED_DATADIR EXPANDED_SYSCONFDIR EXPANDED_LOCALSTATEDIR EXPANDED_PHP_CONFIG_FILE_PATH EXPANDED_PHP_CONFIG_FILE_SCAN_DIR abs_builddir abs_srcdir php_abs_top_builddir php_abs_top_srcdir DEBUG_CFLAGS EXTENSION_DIR EXTRA_LDFLAGS EXTRA_LDFLAGS_PROGRAM EXTRA_LIBS ZEND_EXTRA_LIBS INCLUDES EXTRA_INCLUDES INSTALL_IT NATIVE_RPATHS PEAR_INSTALLDIR PHP_LDFLAGS PHP_LIBS PHP_VERSION SHLIB_SUFFIX_NAME ECHO STRIP ac_ct_STRIP LIBTOOL LTLIBOBJS'
ac_subst_files=''

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

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

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

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

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

  case $ac_option in

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  esac
done

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

# Be sure to have absolute paths.
for ac_var in exec_prefix prefix
do
  eval ac_val=$`echo $ac_var`
  case $ac_val in
    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; };;
  esac
done

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

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

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

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

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


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

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

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

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

Defaults for the options are specified in brackets.

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

_ACEOF

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

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

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]
_ACEOF

  cat <<\_ACEOF

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi

if test -n "$ac_init_help"; then

  cat <<\_ACEOF

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]

SAPI modules:

  --disable-cli           Disable building CLI version of PHP
                          (this forces --without-pear).
  --enable-embed=TYPE   EXPERIMENTAL: Enable building of embedded SAPI library
                          TYPE is either 'shared' or 'static'. TYPE=shared
  --enable-roxen-zts      Build the Roxen module using Zend Thread Safety.
  --disable-cgi           Disable building CGI version of PHP
  --enable-force-cgi-redirect
                          Enable the security check for internal server
                          redirects.  You should use this if you are
                          running the CGI version with Apache.
  --enable-discard-path   If this is enabled, the PHP CGI binary
                          can safely be placed outside of the
                          web tree and people will not be able
                          to circumvent .htaccess security.
  --enable-fastcgi        If this is enabled, the cgi module will
                          be built with support for fastcgi also.
  --disable-path-info-check
                          If this is disabled, paths such as
                          /info.php/test?a=b will fail to work.

General settings:

  --enable-debug          Compile with debugging symbols.
  --enable-safe-mode      Enable safe mode by default.
  --enable-sigchild       Enable PHP's own SIGCHLD handler.
  --enable-magic-quotes   Enable magic quotes by default.
  --disable-rpath         Disable passing additional runtime library
                          search paths
  --enable-libgcc         Enable explicitly linking against libgcc
  --disable-short-tags    Disable the short-form <? start tag by default.
  --enable-dmalloc        Enable dmalloc
  --disable-ipv6          Disable IPv6 support
  --enable-versioning     Export only required symbols.
                          See INSTALL for more information

Extensions:

  --with-EXTENSION=shared[,PATH]

    NOTE: Not all extensions can be build as 'shared'.

    Example: --with-foobar=shared,/usr/local/foobar/

      o Builds the foobar extension as shared extension.
      o foobar package install prefix is /usr/local/foobar/


 --disable-all   Disable all extensions enabled by default.

  --enable-bcmath         Enable bc style precision math functions.
  --enable-calendar       Enable support for calendar conversion
  --disable-ctype         Disable ctype functions
  --enable-dba            Build DBA with builtin modules
  --enable-dbase          Enable the bundled dbase library
  --enable-dbx            Enable dbx
  --enable-dio            Enable direct I/O support
  --enable-eaccelerator                    Enable eaccelerator support
  --enable-exif           Enable EXIF (metadata from images) support
  --enable-filepro        Enable the bundled read-only filePro support.
  --enable-ftp            Enable FTP support
  --enable-gd-native-ttf    GD: Enable TrueType string function.
  --enable-gd-jis-conv      GD: Enable JIS-mapped Japanese font support.
  --enable-htscanner           Enable htscanner support
  --enable-mbstring       Enable multibyte string support.
  --disable-mbregex         MBSTRING: Disable multibyte regex support
  --disable-overload      Disable user-space object overloading support.
  --enable-pcntl          Enable experimental pcntl support (CLI/CGI only)
  --disable-posix         Disable POSIX-like functions
  --disable-session       Disable session support
  --enable-shmop          Enable shmop support
  --enable-ucd-snmp-hack  Enable UCD SNMP hack
  --enable-sockets        Enable sockets support
  --enable-sysvmsg        Enable sysvmsg support
  --enable-sysvsem        Enable System V semaphore support.
  --enable-sysvshm        Enable the System V shared memory support.
  --disable-tokenizer     Disable tokenizer support
  --enable-wddx           Enable WDDX support.
  --disable-xml           Disable XML support using bundled expat lib
  --enable-xslt           Enable xslt support.
  --enable-yp             Include YP support.

PEAR:


Zend:

  --disable-zend-memory-manager
                          Disable the Zend memory manager - FOR DEVELOPERS ONLY!!
  --enable-experimental-zts
                          This will most likely break your build
  --disable-inline-optimization
                          If building zend_execute.lo fails, try this switch.
  --enable-memory-limit   Compile with memory limit support.
  --enable-zend-multibyte Compile with zend multibyte support.

TSRM:


Libtool:

  --enable-shared=PKGS  build shared libraries default=yes
  --enable-static=PKGS  build static libraries default=yes
  --enable-fast-install=PKGS  optimize for fast installation default=yes
  --disable-libtool-lock  avoid locking (might break parallel builds)

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-aolserver=DIR    Specify path to the installed AOLserver
  --with-apxs=FILE      Build shared Apache 1.x module. FILE is the optional
                          pathname to the Apache apxs tool; defaults to "apxs".
  --with-apache=DIR     Build Apache 1.x module. DIR is the top-level Apache
                          build directory, defaults to /usr/local/apache.
  --with-mod_charset      Enable transfer tables for mod_charset (Rus Apache).
  --with-apxs2filter=FILE
                          EXPERIMENTAL: Build shared Apache 2.0 module. FILE is the optional
                          pathname to the Apache apxs tool; defaults to "apxs".
  --with-apxs2=FILE     EXPERIMENTAL: Build shared Apache 2.0 module. FILE is the optional
                          pathname to the Apache apxs tool; defaults to "apxs".
  --with-caudium=DIR    Build PHP as a Pike module for use with Caudium
                          DIR is the Caudium server dir, with the default value
                          /usr/local/caudium/server.
  --with-isapi=DIR      Build PHP as an ISAPI module for use with Zeus.
  --with-nsapi=DIR        Build PHP as NSAPI module for Netscape/iPlanet/SunONE
  --with-phttpd=DIR       Build PHP as phttpd module
  --with-pi3web=DIR     Build PHP as Pi3Web module
  --with-roxen=DIR        Build PHP as a Pike module. DIR is the base Roxen
                          directory, normally /usr/local/roxen/server.
  --with-servlet=DIR    Include servlet support. DIR is the base install
                          directory for the JSDK.  This SAPI prereqs the
                          java extension must be built as a shared dl.
  --with-thttpd=SRCDIR    Build PHP as thttpd module
  --with-tux=MODULEDIR    Build PHP as a TUX module (Linux only)
  --with-webjames=SRCDIR  Build PHP as a WebJames module (RISC OS only)
  --with-layout=TYPE      Sets how installed files will be laid out.  Type is
                          one of "PHP" (default) or "GNU"
  --with-config-file-path=PATH
                          Sets the path in which to look for php.ini,
                          defaults to PREFIX/lib
  --with-config-file-scan-dir=PATH
  --with-exec-dir=DIR   Only allow executables in DIR when in safe mode
                          defaults to /usr/local/php/bin
  --with-openssl=DIR    Include OpenSSL support (requires OpenSSL >= 0.9.6)
  --with-kerberos=DIR     OPENSSL: Include Kerberos support
  --without-pcre-regex    Do not include Perl Compatible Regular Expressions
                          support. Use --with-pcre-regex=DIR to specify DIR
                          where PCRE's include and library files are located,
                          if not using bundled library.
  --with-zlib=DIR       Include ZLIB support (requires zlib >= 1.0.9).
  --with-zlib-dir=<DIR>   Define the location of zlib install directory
  --with-bz2=DIR        Include BZip2 support
  --with-cpdflib=DIR    Include cpdflib support (requires cpdflib >= 2).
  --with-jpeg-dir=DIR     CPDF: Set the path to libjpeg install prefix.
  --with-tiff-dir=DIR     CPDF: Set the path to libtiff install prefix.
  --with-crack=DIR      Include crack support.
  --with-curl=DIR       Include CURL support
  --with-cyrus=DIR      Include Cyrus IMAP support
  --with-db               Include old xDBM support (deprecated, use --enable-dba instead)
  --with-gdbm=DIR         DBA: Include GDBM support
  --with-ndbm=DIR         DBA: Include NDBM support
  --with-db4=DIR          DBA: Include Berkeley DB4 support
  --with-db3=DIR          DBA: Include Berkeley DB3 support
  --with-db2=DIR          DBA: Include Berkeley DB2 support
  --with-dbm=DIR          DBA: Include DBM support
  --with-cdb=DIR          DBA: Include CDB support
  --with-inifile            DBA: Include INI support
  --with-flatfile           DBA: Include FlatFile support

  --with-dom=DIR        Include DOM support (requires libxml >= 2.4.14).
                          DIR is the libxml install directory.
  --with-zlib-dir=DIR     DOMXML: Set the path to libz install prefix.
  --with-dom-xslt=DIR     DOMXML: Include DOM XSLT support (requires libxslt >= 1.0.18).
                            DIR is the libxslt install directory.
  --with-dom-exslt=DIR    DOMXML: Include DOM EXSLT support (requires libxslt >= 1.0.18).
                            DIR is the libexslt install directory.
  --without-eaccelerator-crash-detection   Do not include eaccelerator crash detection
  --without-eaccelerator-optimizer         Do not include eaccelerator optimizer
  --without-eaccelerator-encoder           Do not include eaccelerator encoder
  --without-eaccelerator-loader            Do not include eaccelerator loader
  --with-eaccelerator-shared-memory        Include eaccelerator shared memory functions
  --with-eaccelerator-sessions             Include eaccelerator sessions
  --with-eaccelerator-content-caching      Include eaccelerator content caching
  --without-eaccelerator-info              Do not compile the eAccelerator information functions
  --with-eaccelerator-disassembler         Include disassembler
  --without-eaccelerator-use-inode         Don't use inodes to determine hash keys (never used on win32)
  --with-eaccelerator-debug                Enable the debug code so eaccelerator logs verbose.
  --with-eaccelerator-userid               eAccelerator runs under this userid, only needed when using sysvipc semaphores.
  --with-eaccelerator-doc-comment-inclusion  If you want eAccelerator to retain doc-comments in  internal php structures.
  --with-fbsql=DIR      Include FrontBase support. DIR is the FrontBase base directory.
  --with-fdftk=DIR      Include FDF support.
  --with-fribidi=DIR    Include FriBidi support (requires FriBidi >= 0.10.4).
  --with-gd=DIR         Include GD support where DIR is GD install prefix.
                          If DIR is not set, the bundled GD library will be used.
  --with-jpeg-dir=DIR     GD: Set the path to libjpeg install prefix.
  --with-png-dir=DIR      GD: Set the path to libpng install prefix.
  --with-zlib-dir=DIR     GD: Set the path to libz install prefix.
  --with-xpm-dir=DIR      GD: Set the path to libXpm install prefix.
  --with-ttf=DIR          GD: Include FreeType 1.x support
  --with-freetype-dir=DIR GD: Set the path to FreeType 2 install prefix.
  --with-t1lib=DIR        GD: Include T1lib support.
  --with-gettext=DIR    Include GNU gettext support.
  --with-gmp=DIR        Include GNU MP support
  --with-hwapi=DIR      Include official Hyperwave API support
  --with-hyperwave        Include Hyperwave support
  --with-iconv=DIR      Include iconv support
  --with-imap=DIR       Include IMAP support. DIR is the c-client install prefix.
  --with-kerberos=DIR     IMAP: Include Kerberos support. DIR is the Kerberos install prefix.
  --with-imap-ssl=DIR     IMAP: Include SSL support. DIR is the OpenSSL install prefix.
  --with-informix=DIR   Include Informix support.  DIR is the Informix base
                          install directory, defaults to ${INFORMIXDIR:-nothing}.
  --with-ingres=DIR     Include Ingres II support. DIR is the Ingres
                          base directory (default $II_SYSTEM/ingres)
  --with-interbase=DIR  Include InterBase support.  DIR is the InterBase base
                          install directory, defaults to /usr/interbase
  --with-java=DIR       Include Java support. DIR is the JDK base install directory.
                          This extension is always built as shared.
  --with-ldap=DIR       Include LDAP support.
 --with-magickwand=DIR	Enables the magickwand extension. DIR is the prefix to Imagemagick installation directory.
  --with-libmbfl=DIR      MBSTRING: Use external libmbfl. DIR is the libmbfl install prefix.
                            If DIR is not set, the bundled libmbfl will be used.
  --with-mcal=DIR       Include MCAL support.
  --with-mcrypt=DIR     Include mcrypt support.
  --with-mcve=DIR       Include MCVE support. libmcve >= 3.2.2 or libmonetra >= 4.0 required
  --with-openssl-dir=DIR  MCVE: openssl install prefix.
  --with-mhash=DIR      Include mhash support.
  --with-mime-magic=FILE
                          Include mime_magic support. FILE is the optional
                          pathname to the magic.mime file.
  --with-ming=DIR       Include MING support
  --with-mnogosearch=DIR
                          Include mnoGoSearch support.  DIR is the mnoGoSearch
                          base install directory, defaults to /usr/local/mnogosearch.
  --with-msession=DIR   Include msession support
  --with-msql=DIR       Include mSQL support.  DIR is the mSQL base
                          install directory, defaults to /usr/local/Hughes.
  --with-mssql=DIR      Include MSSQL-DB support.  DIR is the FreeTDS home
                          directory, defaults to /usr/local/freetds.
  --with-mysql=DIR      Include MySQL support. DIR is the MySQL base directory.
                          If unspecified, the bundled MySQL library will be used.
  --with-mysql-sock=DIR   MySQL: Location of the MySQL unix socket pointer.
                            If unspecified, the default locations are searched.
  --with-zlib-dir=DIR     MySQL: Set the path to libz install prefix.
  --with-ncurses=DIR    Include ncurses support (CLI/CGI only).
  --with-oci8=DIR       Include Oracle (OCI8) support using an ORACLE_HOME
                          install. The default DIR is ORACLE_HOME
  --with-oci8-instant-client=DIR
                          Include Oracle (OCI8) support using
                          Oracle Instant Client. DIR is the directory with the
                          Instant Client libraries. On Linux it will default to
                          /usr/lib/oracle/<most_recent_version>/client/lib
                          Other platforms will need to have it explicitly specified.
  --with-adabas=DIR     Include Adabas D support.  DIR is the Adabas base
                          install directory, defaults to /usr/local.
  --with-sapdb=DIR      Include SAP DB support.  DIR is SAP DB base
                          install directory, defaults to /usr/local.
  --with-solid=DIR      Include Solid support.  DIR is the Solid base
                          install directory, defaults to /usr/local/solid
  --with-ibm-db2=DIR    Include IBM DB2 support.  DIR is the DB2 base
                          install directory, defaults to /home/db2inst1/sqllib
  --with-empress=DIR    Include Empress support.  DIR is the Empress base
                          install directory, defaults to \$EMPRESSPATH.
                          From PHP 4, this option only supports Empress Version
                          8.60 and above
  --with-empress-bcs=DIR
                          Include Empress Local Access support.  DIR is the
                          Empress base install directory, defaults to
                          \$EMPRESSPATH.  From PHP 4, this option only supports
                          Empress Version 8.60 and above.
  --with-birdstep=DIR   Include Birdstep support.  DIR is the Birdstep base
                          install directory, defaults to /usr/local/birdstep.
  --with-custom-odbc=DIR
                          Include a user defined ODBC support.
                          The DIR is ODBC install base directory,
                          which defaults to /usr/local.
                          Make sure to define CUSTOM_ODBC_LIBS and
                          have some odbc.h in your include dirs.
                          E.g., you should define following for
                          Sybase SQL Anywhere 5.5.00 on QNX, prior to
                          run configure script:
                              CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\"
                              LDFLAGS=-lunix
                              CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\".
  --with-iodbc=DIR      Include iODBC support.  DIR is the iODBC base
                          install directory, defaults to /usr/local.
  --with-esoob=DIR      Include Easysoft OOB support. DIR is the OOB base
                          install directory,
                          defaults to /usr/local/easysoft/oob/client.
  --with-unixODBC=DIR   Include unixODBC support.  DIR is the unixODBC base
                          install directory, defaults to /usr/local.
  --with-dbmaker=DIR    Include DBMaker support.  DIR is the DBMaker base
                          install directory, defaults to where the latest
                          version of DBMaker is installed (such as
                          /home/dbmaker/3.6).
  --with-oracle=DIR     Include Oracle-oci7 support. Default DIR is ORACLE_HOME.
  --with-pdflib=DIR     Include PDFlib support.
  --with-jpeg-dir=DIR     PDFLIB: define libjpeg install directory.
                                     (OPTIONAL for PDFlib v4)
  --with-png-dir=DIR      PDFLIB: define libpng install directory.
                                     (OPTIONAL for PDFlib v4)
  --with-zlib-dir=DIR     PDFLIB: define libz install directory.
                                     (OPTIONAL for PDFlib v4)
  --with-tiff-dir=DIR     PDFLIB: define libtiff install directory.
                                     (OPTIONAL for PDFlib v4)
  --with-pfpro=DIR      Include Verisign Payflow Pro support.
  --with-pgsql=DIR      Include PostgreSQL support.  DIR is the PostgreSQL
                          base install directory or the path to pg_config
  --with-pspell=DIR     Include PSPELL support.
                          GNU Aspell version 0.50.0 or higher required.
  --with-qtdom            Include QtDOM support (requires Qt >= 2.2.0).
  --with-libedit=DIR    Include libedit readline replacement (CLI/CGI only)
  --with-readline=DIR   Include readline support (CLI/CGI only)
  --with-recode=DIR     Include recode support.
  --with-mm=DIR         Include mm support for session storage
  --with-snmp=DIR       Include SNMP support.
  --with-openssl-dir=DIR  SNMP: openssl install prefix.
  --with-regex=TYPE       regex library type: system, apache, php. Default: php
                          WARNING: Do NOT use unless you know what you are doing!
  --with-swf=DIR        Include swf support
  --with-sybase=DIR     Include Sybase-DB support.  DIR is the Sybase home
                          directory, defaults to /home/sybase.
  --with-sybase-ct=DIR  Include Sybase-CT support.  DIR is the Sybase home
                          directory. Defaults to /home/sybase.
  --with-expat-dir=<DIR>    XML: external libexpat install dir
  --with-xmlrpc=DIR     Include XMLRPC-EPI support.
  --with-expat-dir=<DIR>    XMLRPC-EPI: libexpat dir for XMLRPC-EPI.
  --with-iconv-dir=<DIR>    XMLRPC-EPI: iconv dir for XMLRPC-EPI.
  --with-xslt-sablot=<DIR>  XSLT: Enable the sablotron backend.
  --with-expat-dir=<DIR>    XSLT: libexpat dir for Sablotron.
  --with-iconv-dir=<DIR>    XSLT: iconv dir for Sablotron.
  --with-sablot-js=<DIR>    XSLT: enable JavaScript support for Sablotron.
  --with-yaz=DIR        Include YAZ support (ANSI/NISO Z39.50).
                          DIR is the YAZ bin install directory.
  --with-zip=DIR        Include ZIP support (requires zziplib >= 0.10.6).
  --with-pear=DIR         Install PEAR in DIR (default PREFIX/lib/php)
  --without-pear          Do not install PEAR
  --with-tsrm-pth=pth-config
                          Use GNU Pth.
  --with-tsrm-st          Use SGI's State Threads
  --with-tsrm-pthreads    Use POSIX threads (default)
  --with-gnu-ld           assume the C compiler uses GNU ld default=no
  --with-pic              try to use only PIC/non-PIC objects default=use both

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CXXCPP      C++ preprocessor

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

_ACEOF
fi

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

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

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

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

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

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

Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit 0
fi
exec 5>config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

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

  $ $0 $@

_ACEOF
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

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

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

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

_ASUNAME

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

} >&5

cat >&5 <<_ACEOF


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

_ACEOF


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

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Be sure not to use single quotes in there, as some shells,
# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo

    cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
    echo
    # The following way of writing the cache mishandles newlines in values,
{
  (set) 2>&1 |
    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
    *ac_space=\ *)
      sed -n \
	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
      ;;
    *)
      sed -n \
	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
      ;;
    esac;
}
    echo

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

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

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

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo >confdefs.h

# Predefined preprocessor variables.

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


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


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


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


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


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

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

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

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




















echo "$as_me:$LINENO: checking for egrep" >&5
echo $ECHO_N "checking for egrep... $ECHO_C" >&6
if test "${ac_cv_prog_egrep+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
    then ac_cv_prog_egrep='grep -E'
    else ac_cv_prog_egrep='egrep'
    fi
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
echo "${ECHO_T}$ac_cv_prog_egrep" >&6
 EGREP=$ac_cv_prog_egrep


echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
if test "${lt_cv_path_SED+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # Loop through the user's path and test for sed and gsed.
# Then use that list of sed's as ones to test for truncation.
as_executable_p="test -f"
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_prog in sed gsed; do
    for ac_exec_ext in '' $ac_executable_extensions; do
      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
      fi
    done
  done
done

  # Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  trap '{ (exit 1); exit 1; }' 1 2 13 15
}

# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=$TMPDIR/sed$$-$RANDOM
  (umask 077 && mkdir $tmp)
} ||
{
   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
   { (exit 1); exit 1; }
}
  _max=0
  _count=0
  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
  # along with /bin/sed that truncates output.
  for _sed in $_sed_list /usr/xpg4/bin/sed; do
    test ! -f ${_sed} && break
    cat /dev/null > "$tmp/sed.in"
    _count=0
    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
    # Check for GNU sed and select it if it is found.
    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
      lt_cv_path_SED=${_sed}
      break
    fi
    while true; do
      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
      mv "$tmp/sed.tmp" "$tmp/sed.in"
      cp "$tmp/sed.in" "$tmp/sed.nl"
      echo >>"$tmp/sed.nl"
      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
      # 40000 chars as input seems more than enough
      test $_count -gt 10 && break
      _count=`expr $_count + 1`
      if test $_count -gt $_max; then
        _max=$_count
        lt_cv_path_SED=$_sed
      fi
    done
  done
  rm -rf "$tmp"

fi

if test "X$SED" != "X"; then
  lt_cv_path_SED=$SED
else
  SED=$lt_cv_path_SED
fi
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6





  PHP_VAR_SUBST="$PHP_VAR_SUBST EGREP"


  PHP_VAR_SUBST="$PHP_VAR_SUBST SED"

  test -f config.nice && mv config.nice config.nice.old
  rm -f config.nice.old
  cat >config.nice<<EOF
#! /bin/sh
#
# Created by configure

EOF

  for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
    eval val=\$$var
    if test -n "$val"; then
      echo "$var='$val' \\" >> config.nice
    fi
  done

  echo "'$0' \\" >> config.nice
  if test `expr -- $0 : "'.*"` = 0; then
    CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$0'"
  else
    CONFIGURE_COMMAND="$CONFIGURE_COMMAND $0"
  fi
  for arg in $ac_configure_args; do
     if test `expr -- $arg : "'.*"` = 0; then
        if test `expr -- $arg : "--.*"` = 0; then
          break;
        fi
        echo "'$arg' \\" >> config.nice
        CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
     else
        if test `expr -- $arg : "'--.*"` = 0; then
          break;
        fi
        echo "$arg \\" >> config.nice
        CONFIGURE_COMMAND="$CONFIGURE_COMMAND $arg"
     fi
  done
  echo '"$@"' >> config.nice
  chmod +x config.nice


  PHP_VAR_SUBST="$PHP_VAR_SUBST CONFIGURE_COMMAND"





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
  elif test -f $ac_dir/shtool; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/shtool install -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
   { (exit 1); exit 1; }; }
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.

# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
   { (exit 1); exit 1; }; }

echo "$as_me:$LINENO: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6
if test "${ac_cv_build+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_build_alias=$build_alias
test -z "$ac_cv_build_alias" &&
  ac_cv_build_alias=`$ac_config_guess`
test -z "$ac_cv_build_alias" &&
  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
   { (exit 1); exit 1; }; }
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
   { (exit 1); exit 1; }; }

fi
echo "$as_me:$LINENO: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`


echo "$as_me:$LINENO: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_host_alias=$host_alias
test -z "$ac_cv_host_alias" &&
  ac_cv_host_alias=$ac_cv_build_alias
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
   { (exit 1); exit 1; }; }

fi
echo "$as_me:$LINENO: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`



      if test -z "$host_alias" && test -n "$host"; then
    host_alias=$host
  fi
  if test -z "$host_alias"; then
    { { echo "$as_me:$LINENO: error: host_alias is not set!" >&5
echo "$as_me: error: host_alias is not set!" >&2;}
   { (exit 1); exit 1; }; }
  fi

          ac_config_headers="$ac_config_headers main/php_config.h"


MAJOR_VERSION=4
MINOR_VERSION=4
RELEASE_VERSION=9
EXTRA_VERSION=""
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"



PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in to change version number */" >> php_version.h.new
echo "#define PHP_MAJOR_VERSION $MAJOR_VERSION" >> php_version.h.new
echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new
echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new
echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
    rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
    echo 'Updated main/php_version.h'
else
    rm -f php_version.h.new
fi



if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
  { { echo "$as_me:$LINENO: error: --with-shared-apache is not supported. Please refer to the documentation for using APXS" >&5
echo "$as_me: error: --with-shared-apache is not supported. Please refer to the documentation for using APXS" >&2;}
   { (exit 1); exit 1; }; }
fi

if test -n "$with_apache" && test -n "$with_apxs"; then
  { { echo "$as_me:$LINENO: error: --with-apache and --with-apxs cannot be used together" >&5
echo "$as_me: error: --with-apache and --with-apxs cannot be used together" >&2;}
   { (exit 1); exit 1; }; }
fi

if test -n "$with_apxs2filter" && test -n "$with_apxs2"; then
  { { echo "$as_me:$LINENO: error: --with-apxs2filter and --with-apxs2 cannot be used together" >&5
echo "$as_me: error: --with-apxs2filter and --with-apxs2 cannot be used together" >&2;}
   { (exit 1); exit 1; }; }
fi



cwd=`pwd`

php_shtool=$srcdir/build/shtool
T_MD=`$php_shtool echo -n -e %B`
T_ME=`$php_shtool echo -n -e %b`


test -d include || mkdir include
> Makefile.objects
> Makefile.fragments
pattern=define
egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch 2>/dev/null


test -z "$CFLAGS" && auto_cflags=1

abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`

php_abs_top_srcdir=$abs_srcdir
php_abs_top_builddir=$abs_builddir


$php_shtool mkdir -p libs
rm -f libs/*


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

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

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

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

  CC=$ac_ct_CC
else
  CC="$ac_cv_prog_CC"
fi

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

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

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

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

  CC=$ac_ct_CC
else
  CC="$ac_cv_prog_CC"
fi

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

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

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

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

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

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

  test -n "$ac_ct_CC" && break
done

  CC=$ac_ct_CC
fi

fi


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

# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
     "checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

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

int
main ()
{

  ;
  return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
  (eval $ac_link_default) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # Find the output, starting from the most likely.  This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
# resort.

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

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

ac_exeext=$ac_cv_exeext
echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6

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

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

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

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

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

int
main ()
{

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

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

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

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

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

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

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

int
main ()
{

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

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

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

int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  ;
  return 0;
}
_ACEOF
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX			-qlanglvl=ansi
# Ultrix and OSF/1	-std1
# HP-UX 10.20 and later	-Ae
# HP-UX older versions	-Aa -D_HPUX_SOURCE
# SVR4			-Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cc_stdc=$ac_arg
break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

fi

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

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

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

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

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

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

if test "x$CC" != xcc; then
  echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
else
  echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
fi
set dummy $CC; ac_cc=`echo $2 |
		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
   test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); };
then
  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
  if test "x$CC" != xcc; then
    # Test first that cc exists at all.
    if { ac_try='cc -c conftest.$ac_ext >&5'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
      if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); };
      then
	# cc works too.
	:
      else
	# cc exists but doesn't like -o.
	eval ac_cv_prog_cc_${ac_cc}_c_o=no
      fi
    fi
  fi
else
  eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

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

fi

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

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

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

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

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

    done
    ac_cv_prog_CPP=$CPP

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

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

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

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

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

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





echo "$as_me:$LINENO: checking for AIX" >&5
echo $ECHO_N "checking for AIX... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef _AIX
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
_ACEOF

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*





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

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

int
main ()
{

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

php_cv_cc_dashr=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
	LIBS=$SAVE_LIBS
fi

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

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

int
main ()
{

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

php_cv_cc_rpath=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
		LIBS=$SAVE_LIBS
fi

	echo "$as_me:$LINENO: result: $php_cv_cc_rpath" >&5
echo "${ECHO_T}$php_cv_cc_rpath" >&6
	if test $php_cv_cc_rpath = "yes"; then
		ld_runpath_switch=-Wl,-rpath,
	else
				ld_runpath_switch=-L
	fi
fi



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

  test -z "$ac_cv_prog_RE2C" && ac_cv_prog_RE2C="exit 0;"
fi
fi
RE2C=$ac_cv_prog_RE2C
if test -n "$RE2C"; then
  echo "$as_me:$LINENO: result: $RE2C" >&5
echo "${ECHO_T}$RE2C" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi


echo "$as_me:$LINENO: checking whether ln -s works" >&5
echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
echo "${ECHO_T}no, using $LN_S" >&6
fi

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

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

  test -n "$AWK" && break
done

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

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

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

if test "$YACC" != "bison -y"; then
    { echo "$as_me:$LINENO: WARNING: You will need bison if you want to regenerate the PHP parsers." >&5
echo "$as_me: WARNING: You will need bison if you want to regenerate the PHP parsers." >&2;}
else
    echo "$as_me:$LINENO: checking bison version" >&5
echo $ECHO_N "checking bison version... $ECHO_C" >&6
    set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'|tr -d a-z`
    if test "${1}" -ne "1" -o "(" "${2}" != "28" -a "${2}" != "35" -a "${2}" != "75" -a "${2}" != "875" ")"; then
      { echo "$as_me:$LINENO: WARNING: You will need bison 1.28" >&5
echo "$as_me: WARNING: You will need bison 1.28" >&2;}
    fi
    echo "$as_me:$LINENO: result: ${1}.${2} (ok)" >&5
echo "${ECHO_T}${1}.${2} (ok)" >&6
fi
for ac_prog in flex lex
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_LEX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_LEX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

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

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

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

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

ac_cv_lib_fl_yywrap=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
if test $ac_cv_lib_fl_yywrap = yes; then
  LEXLIB="-lfl"
else
  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
if test "${ac_cv_lib_l_yywrap+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ll  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

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

fi

fi

if test "x$LEX" != "x:"; then
  echo "$as_me:$LINENO: checking lex output file root" >&5
echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
if test "${ac_cv_prog_lex_root+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # The minimal lex program is just a single line: %%.  But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
cat >conftest.l <<_ACEOF
%%
%%
_ACEOF
{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
  (eval $LEX conftest.l) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
if test -f lex.yy.c; then
  ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
  ac_cv_prog_lex_root=lexyy
else
  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
   { (exit 1); exit 1; }; }
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
rm -f conftest.l
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_save_LIBS
rm -f "${LEX_OUTPUT_ROOT}.c"

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

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

fi

fi
if test -n "$LEX"; then

  :
fi
echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
  /* Ultrix mips cc rejects this.  */
  typedef int charset[2];
  const charset x;
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
  char **p;
  /* NEC SVR4.0.2 mips cc rejects this.  */
  struct point {int x, y;};
  static struct point const zero = {0,0};
  /* AIX XL C 1.02.0.0 rejects this.
     It does not let you subtract one const X* pointer from another in
     an arm of an if-expression whose if-part is not a constant
     expression */
  const char *g = "string";
  ccp = &g + (g ? g-g : 0);
  /* HPUX 7.0 cc rejects these. */
  ++ccp;
  p = (char**) ccp;
  ccp = (char const *const *) p;
  { /* SCO 3.2v4 cc rejects this.  */
    char *t;
    char const *s = 0 ? (char *) 0 : (char const *) 0;

    *t++ = 0;
  }
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    int x[] = {25, 17};
    const int *foo = &x[0];
    ++foo;
  }
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    typedef const int *iptr;
    iptr p = 0;
    ++p;
  }
  { /* AIX XL C 1.02.0.0 rejects this saying
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    struct s { int j; const int *ap[3]; };
    struct s *b; b->j = 5;
  }
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
    const int foo = 10;
  }
#endif

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

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

cat >>confdefs.h <<\_ACEOF
#define const
_ACEOF

fi

if test "$ac_cv_c_const" = "yes" ; then
  LEX_CFLAGS="-DYY_USE_CONST"
fi

echo "$as_me:$LINENO: checking flex version" >&5
echo $ECHO_N "checking flex version... $ECHO_C" >&6
if test "$LEX" ;then
	flexvers=`echo "" | $LEX -V -v --version 2>/dev/null |
		sed -e 's/^.* //' -e 's/\./ /g'`
	if test ! -z "$flexvers"; then
		set $flexvers
		if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
			{ echo "$as_me:$LINENO: WARNING: You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers." >&5
echo "$as_me: WARNING: You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers." >&2;}
		fi
	fi
echo "$as_me:$LINENO: result: ${1}.${2}.${3} (ok)" >&5
echo "${ECHO_T}${1}.${2}.${3} (ok)" >&6
else
	{ echo "$as_me:$LINENO: WARNING: You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers." >&5
echo "$as_me: WARNING: You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers." >&2;}
fi

echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
if test "${ac_cv_c_bigendian_php+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  ac_cv_c_bigendian_php=unknown
  if test "$cross_compiling" = yes; then
  ac_cv_c_bigendian_php=unknown
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int main(void)
{
	short one = 1;
	char *cp = (char *)&one;

	if (*cp == 0) {
		return(0);
	} else {
		return(1);
	}
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_bigendian_php=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN
_ACEOF

 fi




case $host_cpu in
alpha*)
    if test "$GCC" = "yes"; then
      CFLAGS="$CFLAGS -mieee"
    else
      CFLAGS="$CFLAGS -ieee"
    fi
    ;;
esac

case $host_alias in
*solaris*)
    CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
    if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then
      enable_libgcc=yes
    fi
    ;;
*dgux*)
    CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
*darwin*|*rhapsody*)
    CPPFLAGS="$CPPFLAGS -no-cpp-precomp"

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

    php_multiple_shlib_versions_ok=yes;;
*beos*)
    beos_threads=1
    LIBS="$LIBS -lbe -lroot";;
*mips*)
    CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
*hpux*)
    if test "$GCC" = "yes"; then
      CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
    fi
    ;;
*netware*)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program



  case /main in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "/main"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir//main/"; ac_bdir="/main/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in internal_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done




  case win32 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "win32"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/win32/"; ac_bdir="win32/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sendmail.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre -I$CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre -I$CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    PHP4LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\)
    EXTENSION_DIR=sys:/php$MAJOR_VERSION/ext

  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP4LIB_SHARED_LIBADD"


  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS) $(PHP4LIB_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS)  $(PHP4LIB_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS) $(PHP4LIB_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/php4lib.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_GLOBAL_OBJS"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/php4lib.$suffix: netware/php4lib.$suffix
	\$(LIBTOOL) --mode=install cp netware/php4lib.$suffix \$(phplibdir)

netware/php4lib.$suffix: \$(PHP_GLOBAL_OBJS) \$(PHP4LIB_SHARED_DEPENDENCIES)
	$link_cmd

EOF

    ;;
esac

# Disable PIC mode by default where it is known to be safe to do so,
# to avoid the performance hit from the lost register
echo "$as_me:$LINENO: checking whether to force non-PIC code in shared modules" >&5
echo $ECHO_N "checking whether to force non-PIC code in shared modules... $ECHO_C" >&6
case $host_alias in
i?86-*-linux*|i?86-*-freebsd*)
    if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then
      with_pic=no
      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
    else
      echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    fi
    ;;
*) echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6 ;;
esac



































































if test "$beos_threads" = "1"; then
  pthreads_working="yes"
  ac_cv_pthreads_cflags=""
else
  save_CFLAGS=$CFLAGS
  save_LIBS=$LIBS

if test -n "$ac_cv_pthreads_lib"; then
  LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi

if test -n "$ac_cv_pthreads_cflags"; then
  CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi


if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


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

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

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

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  LIBS=$save_LIBS
  CFLAGS=$save_CFLAGS

  echo "$as_me:$LINENO: checking for pthreads_cflags" >&5
echo $ECHO_N "checking for pthreads_cflags... $ECHO_C" >&6
if test "${ac_cv_pthreads_cflags+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  ac_cv_pthreads_cflags=
  if test "$pthreads_working" != "yes"; then
    for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
      ac_save=$CFLAGS
      CFLAGS="$CFLAGS $flag"

if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


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

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

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

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
      CFLAGS=$ac_save
      if test "$pthreads_working" = "yes"; then
        ac_cv_pthreads_cflags=$flag
        break
      fi
    done
  fi
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pthreads_cflags" >&5
echo "${ECHO_T}$ac_cv_pthreads_cflags" >&6

echo "$as_me:$LINENO: checking for pthreads_lib" >&5
echo $ECHO_N "checking for pthreads_lib... $ECHO_C" >&6
if test "${ac_cv_pthreads_lib+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
  for lib in pthread pthreads c_r; do
    ac_save=$LIBS
    LIBS="$LIBS -l$lib"

if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


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

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

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

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
    LIBS=$ac_save
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_lib=$lib
      break
    fi
  done
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pthreads_lib" >&5
echo "${ECHO_T}$ac_cv_pthreads_lib" >&6

if test "$pthreads_working" = "yes"; then
  threads_result="POSIX-Threads found"
else
  threads_result="POSIX-Threads not found"
fi


# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;



  PHP_VAR_SUBST="$PHP_VAR_SUBST SHLIB_SUFFIX_NAME"

  SHLIB_SUFFIX_NAME=so
  case $host_alias in
  *hpux*)
	SHLIB_SUFFIX_NAME=sl
	;;
  *darwin*)
	SHLIB_SUFFIX_NAME=dylib
	;;
  esac

PHP_SAPI=default

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program





SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
SAPI_STATIC=libs/libphp4.a
SAPI_LIBTOOL=libphp4.la


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring SAPI modules${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring SAPI modules${T_ME}" >&6




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

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

  PHP_AOLSERVER=$withval

else

  PHP_AOLSERVER=no

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

if test "$PHP_AOLSERVER" != "no"; then
  if test -d "$PHP_AOLSERVER/include"; then
    PHP_AOLSERVER_SRC=$PHP_AOLSERVER
  fi
  if test -z "$PHP_AOLSERVER_SRC" || test ! -d $PHP_AOLSERVER_SRC/include; then
    { { echo "$as_me:$LINENO: error: Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR" >&5
echo "$as_me: error: Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test ! -d $PHP_AOLSERVER/bin ; then
    { { echo "$as_me:$LINENO: error: Please specify the path to the root of AOLserver using --with-aolserver=DIR" >&5
echo "$as_me: error: Please specify the path to the root of AOLserver using --with-aolserver=DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$PHP_AOLSERVER_SRC/include" != "/usr/include"; then

  if test -z "$PHP_AOLSERVER_SRC/include" || echo "$PHP_AOLSERVER_SRC/include" | grep '^/' >/dev/null ; then
    ai_p=$PHP_AOLSERVER_SRC/include
  else

    ep_dir="`echo $PHP_AOLSERVER_SRC/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_AOLSERVER_SRC/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


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


  PHP_SAPI=aolserver

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/aolserver in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/aolserver"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/aolserver/"; ac_bdir="sapi/aolserver/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in aolserver.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_AOLSERVER/bin/"
fi




echo "$as_me:$LINENO: checking for Apache 1.x module support via DSO through APXS" >&5
echo $ECHO_N "checking for Apache 1.x module support via DSO through APXS... $ECHO_C" >&6

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

  if test "$withval" = "yes"; then
    APXS=apxs
    $APXS -q CFLAGS >/dev/null 2>&1
    if test "$?" != "0" && test -x /usr/sbin/apxs; then #SUSE 6.x
      APXS=/usr/sbin/apxs
    fi
  else

  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    APXS=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    APXS="$ep_realdir/`basename \"$withval\"`"
  fi

  fi

  $APXS -q CFLAGS >/dev/null 2>&1
  if test "$?" != "0"; then
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: Sorry, I was not able to successfully run APXS.  Possible reasons:" >&5
echo "${ECHO_T}Sorry, I was not able to successfully run APXS.  Possible reasons:" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: 1.  Perl is not installed;" >&5
echo "${ECHO_T}1.  Perl is not installed;" >&6
    echo "$as_me:$LINENO: result: 2.  Apache was not compiled with DSO support (--enable-module=so);" >&5
echo "${ECHO_T}2.  Apache was not compiled with DSO support (--enable-module=so);" >&6
    echo "$as_me:$LINENO: result: 3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs" >&5
echo "${ECHO_T}3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs" >&6
    echo "$as_me:$LINENO: result: The output of $APXS follows" >&5
echo "${ECHO_T}The output of $APXS follows" >&6
    $APXS -q CFLAGS
    { { echo "$as_me:$LINENO: error: Aborting" >&5
echo "$as_me: error: Aborting" >&2;}
   { (exit 1); exit 1; }; }
  fi

  APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@"
  APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  APXS_CFLAGS=`$APXS -q CFLAGS`
  APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
  APACHE_INCLUDE=-I$APXS_INCLUDEDIR

  # Test that we're trying to configure with apache 1.x

  ac_output=`$APXS_HTTPD -v 2>&1`
  ac_IFS=$IFS
IFS="- /.
"
  set $ac_output
  IFS=$ac_IFS

  APACHE_VERSION=`expr $4 \* 1000000 + $5 \* 1000 + $6`

  if test "$APACHE_VERSION" -ge 2000000; then
    { { echo "$as_me:$LINENO: error: You have enabled Apache 1.3 support while your server is Apache 2.  Please use the appropiate switch --with-apxs2" >&5
echo "$as_me: error: You have enabled Apache 1.3 support while your server is Apache 2.  Please use the appropiate switch --with-apxs2" >&2;}
   { (exit 1); exit 1; }; }
  fi

  for flag in $APXS_CFLAGS; do
    case $flag in
    -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
    esac
  done

  case $host_alias in
  *aix*)
    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
    PHP_AIX_LDFLAGS="-Wl,-brtl"
    build_type=shared
    ;;
  *darwin*)
    MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD"

  PHP_VAR_SUBST="$PHP_VAR_SUBST MH_BUNDLE_FLAGS"

    SAPI_SHARED=libs/libphp4.so
    build_type=bundle
    ;;
  *)
    build_type=shared
    ;;
  esac


  PHP_SAPI=apache

  case "$build_type" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache/"; ac_bdir="sapi/apache/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache.c mod_php4.c php_apache.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done




  # Test whether apxs support -S option
  $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1

  if test "$?" != "0"; then
    APACHE_INSTALL="$APXS -i -a -n php4 $SAPI_SHARED" # Old apxs does not have -S option
  else
    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
    if test -z `$APXS -q SYSCONFDIR`; then
      APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                       $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                             -i -n php4 $SAPI_SHARED"
    else
      APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
      APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                      \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                       $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                             -S SYSCONFDIR='$APXS_SYSCONFDIR' \
                             -i -a -n php4 $SAPI_SHARED"
    fi
  fi

  if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then
    PHP_APXS_BROKEN=yes
  fi
  STRONGHOLD=

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


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


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

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

else

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

fi;

if test "$PHP_SAPI" != "apache"; then
echo "$as_me:$LINENO: checking for Apache 1.x module support" >&5
echo $ECHO_N "checking for Apache 1.x module support... $ECHO_C" >&6

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


  APACHE_INSTALL_FILES="\$(srcdir)/sapi/apache/mod_php4.* sapi/apache/libphp4.module"

  if test "$withval" = "yes"; then
    # Apache's default directory
    withval=/usr/local/apache
  fi
  if test "$withval" != "no"; then

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

    APACHE_MODULE=yes

  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    withval=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    withval="$ep_realdir/`basename \"$withval\"`"
  fi

    # For Apache 1.2.x
    if test -f $withval/src/httpd.h; then
      APACHE_INCLUDE=-I$withval/src
      APACHE_TARGET=$withval/src

  PHP_SAPI=apache

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache/"; ac_bdir="sapi/apache/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache.c mod_php4.c php_apache.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_INCLUDE $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_INCLUDE $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



      APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
      PHP_LIBS="-L. -lphp3"
      echo "$as_me:$LINENO: result: yes - Apache 1.2.x" >&5
echo "${ECHO_T}yes - Apache 1.2.x" >&6
      STRONGHOLD=
      if test -f $withval/src/ap_config.h; then

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

      fi
    # For Apache 2.0.x
    elif test -f $withval/include/httpd.h &&
         test -f $withval/srclib/apr/include/apr_general.h ; then
      { { echo "$as_me:$LINENO: error: Use --with-apxs2 with Apache 2.x!" >&5
echo "$as_me: error: Use --with-apxs2 with Apache 2.x!" >&2;}
   { (exit 1); exit 1; }; }
    # For Apache 1.3.x
    elif test -f $withval/src/main/httpd.h; then
      APACHE_HAS_REGEX=1
      APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap"
      APACHE_TARGET=$withval/src/modules/php4
      if test ! -d $APACHE_TARGET; then
        mkdir $APACHE_TARGET
      fi

  PHP_SAPI=apache

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache/"; ac_bdir="sapi/apache/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache.c mod_php4.c php_apache.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_INCLUDE $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_INCLUDE $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



      APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
      PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
      echo "$as_me:$LINENO: result: yes - Apache 1.3.x" >&5
echo "${ECHO_T}yes - Apache 1.3.x" >&6
      STRONGHOLD=
      if test -f $withval/src/include/ap_config.h; then

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

      fi
      if test -f $withval/src/include/ap_compat.h; then

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

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { { echo "$as_me:$LINENO: error: Please run Apache\'s configure or src/Configure program once and try again" >&5
echo "$as_me: error: Please run Apache\'s configure or src/Configure program once and try again" >&2;}
   { (exit 1); exit 1; }; }
        fi
      else
        if test -f $withval/src/include/compat.h; then

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

        fi
      fi
    # Also for Apache 1.3.x
    elif test -f $withval/src/include/httpd.h; then
      APACHE_HAS_REGEX=1
      APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix"
      APACHE_TARGET=$withval/src/modules/php4
      if test ! -d $APACHE_TARGET; then
        mkdir $APACHE_TARGET
      fi

  PHP_SAPI=apache

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache/"; ac_bdir="sapi/apache/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache.c mod_php4.c php_apache.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_INCLUDE $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_INCLUDE $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



      PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
      APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
      echo "$as_me:$LINENO: result: yes - Apache 1.3.x" >&5
echo "${ECHO_T}yes - Apache 1.3.x" >&6
      STRONGHOLD=
      if test -f $withval/src/include/ap_config.h; then

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

      fi
      if test -f $withval/src/include/ap_compat.h; then

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

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { { echo "$as_me:$LINENO: error: Please run Apache\'s configure or src/Configure program once and try again" >&5
echo "$as_me: error: Please run Apache\'s configure or src/Configure program once and try again" >&2;}
   { (exit 1); exit 1; }; }
        fi
      else
        if test -f $withval/src/include/compat.h; then

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

        fi
      fi
    # For StrongHold 2.2
    elif test -f $withval/apache/httpd.h; then
      APACHE_INCLUDE="-I$withval/apache -I$withval/ssl/include"
      APACHE_TARGET=$withval/apache

  PHP_SAPI=apache

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache/"; ac_bdir="sapi/apache/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache.c mod_php4.c php_apache.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_INCLUDE $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_INCLUDE $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



      PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
      APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET"
      STRONGHOLD=-DSTRONGHOLD=1
      echo "$as_me:$LINENO: result: yes - StrongHold" >&5
echo "${ECHO_T}yes - StrongHold" >&6
      if test -f $withval/apache/ap_config.h; then

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

      fi
      if test -f $withval/src/ap_compat.h; then

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

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { { echo "$as_me:$LINENO: error: Please run Apache\'s configure or src/Configure program once and try again" >&5
echo "$as_me: error: Please run Apache\'s configure or src/Configure program once and try again" >&2;}
   { (exit 1); exit 1; }; }
        fi
      else
        if test -f $withval/src/compat.h; then

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

        fi
      fi
    else
      echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
      { { echo "$as_me:$LINENO: error: Invalid Apache directory - unable to find httpd.h under $withval" >&5
echo "$as_me: error: Invalid Apache directory - unable to find httpd.h under $withval" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

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

fi;

fi

echo "$as_me:$LINENO: checking for mod_charset compatibility option" >&5
echo $ECHO_N "checking for mod_charset compatibility option... $ECHO_C" >&6

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

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

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


else

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

fi;

if test -n "$APACHE_MODULE"; then

  if test -n "$GCC"; then

  gcc_arg_name=ac_cv_gcc_arg_rdynamic
  echo "$as_me:$LINENO: checking whether $CC supports -rdynamic" >&5
echo $ECHO_N "checking whether $CC supports -rdynamic... $ECHO_C" >&6
if test "${ac_cv_gcc_arg_rdynamic+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  echo 'void somefunc() { };' > conftest.c
  cmd='$CC -rdynamic -c conftest.c'
  if eval $cmd 2>&1 | egrep -e -rdynamic >/dev/null ; then
    ac_result=no
  else
    ac_result=yes
  fi
  eval $gcc_arg_name=$ac_result
  rm -f conftest.*

fi
echo "$as_me:$LINENO: result: $ac_cv_gcc_arg_rdynamic" >&5
echo "${ECHO_T}$ac_cv_gcc_arg_rdynamic" >&6
  if eval test "\$$gcc_arg_name" = "yes"; then
    gcc_rdynamic=yes
  else
    :

  fi

    if test "$gcc_rdynamic" = "yes"; then
      PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic"
    fi
  fi

  $php_shtool mkdir -p sapi/apache

  PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/apache/libphp4.module"

fi

if test -n "$APACHE_INSTALL"; then
  if test "x$APXS" != "x" -a "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then
    APXS_EXP=-bE:sapi/apache/mod_php4.exp
  fi


echo "$as_me:$LINENO: checking for member fd in BUFF *" >&5
echo $ECHO_N "checking for member fd in BUFF *... $ECHO_C" >&6
if test "${ac_cv_php_fd_in_buff+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  save=$CPPFLAGS
  if test -n "$APXS_INCLUDEDIR"; then
    CPPFLAGS="$CPPFLAGS -I$APXS_INCLUDEDIR"
  else
    CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE"
  fi
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <httpd.h>
int
main ()
{
conn_rec *c; int fd = c->client->fd;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

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

ac_cv_php_fd_in_buff=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  CPPFLAGS=$save

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

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

fi

  INSTALL_IT=$APACHE_INSTALL


  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS_EXP"


  PHP_VAR_SUBST="$PHP_VAR_SUBST APACHE_INCLUDE"


  PHP_VAR_SUBST="$PHP_VAR_SUBST APACHE_TARGET"


  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS_LDFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST APACHE_INSTALL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST STRONGHOLD"

fi



echo "$as_me:$LINENO: checking for Apache 2.0 filter-module support via DSO through APXS" >&5
echo $ECHO_N "checking for Apache 2.0 filter-module support via DSO through APXS... $ECHO_C" >&6

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

  if test "$withval" = "yes"; then
    APXS=apxs
    $APXS -q CFLAGS >/dev/null 2>&1
    if test "$?" != "0" && test -x /usr/sbin/apxs; then
      APXS=/usr/sbin/apxs
    fi
  else

  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    APXS=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    APXS="$ep_realdir/`basename \"$withval\"`"
  fi

  fi

  $APXS -q CFLAGS >/dev/null 2>&1
  if test "$?" != "0"; then
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: Sorry, I cannot run apxs.  Possible reasons follow:" >&5
echo "${ECHO_T}Sorry, I cannot run apxs.  Possible reasons follow:" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: 1. Perl is not installed" >&5
echo "${ECHO_T}1. Perl is not installed" >&6
    echo "$as_me:$LINENO: result: 2. apxs was not found. Try to pass the path using --with-apxs2filter=/path/to/apxs" >&5
echo "${ECHO_T}2. apxs was not found. Try to pass the path using --with-apxs2filter=/path/to/apxs" >&6
    echo "$as_me:$LINENO: result: 3. Apache was not built using --enable-so (the apxs usage page is displayed)" >&5
echo "${ECHO_T}3. Apache was not built using --enable-so (the apxs usage page is displayed)" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: The output of $APXS follows:" >&5
echo "${ECHO_T}The output of $APXS follows:" >&6
    $APXS -q CFLAGS
    { { echo "$as_me:$LINENO: error: Aborting" >&5
echo "$as_me: error: Aborting" >&2;}
   { (exit 1); exit 1; }; }
  fi

  APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  APXS_BINDIR=`$APXS -q BINDIR`
  APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
  APXS_CFLAGS=`$APXS -q CFLAGS`
  APXS_MPM=`$APXS -q MPM_NAME`
  APU_BINDIR=`$APXS -q APU_BINDIR`
  APR_BINDIR=`$APXS -q APR_BINDIR`

  # Pick up ap[ru]-N-config if using httpd >=2.1
  APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
    echo $APR_BINDIR/apr-config`
  APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
    echo $APU_BINDIR/apu-config`

  APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
  APU_CFLAGS="`$APU_CONFIG --includes`"

  for flag in $APXS_CFLAGS; do
    case $flag in
    -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
    esac
  done

  APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"

  # Test that we're trying to configure with apache 2.x

  ac_output=`$APXS_HTTPD -v 2>&1`
  ac_IFS=$IFS
IFS="- /.
"
  set $ac_output
  IFS=$ac_IFS

  APACHE_VERSION=`expr $4 \* 1000000 + $5 \* 1000 + $6`

  if test "$APACHE_VERSION" -le 2000000; then
    { { echo "$as_me:$LINENO: error: You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropiate switch --with-apxs (without the 2)" >&5
echo "$as_me: error: You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropiate switch --with-apxs (without the 2)" >&2;}
   { (exit 1); exit 1; }; }
  elif test "$APACHE_VERSION" -lt 2000040; then
    { { echo "$as_me:$LINENO: error: Please note that Apache version >= 2.0.40 is required." >&5
echo "$as_me: error: Please note that Apache version >= 2.0.40 is required." >&2;}
   { (exit 1); exit 1; }; }
  fi

  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
  if test -z `$APXS -q SYSCONFDIR`; then
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -i -n php4"
  else
    APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -S SYSCONFDIR='$APXS_SYSCONFDIR' \
                       -i -a -n php4"
  fi

  case $host_alias in
  *aix*)
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"

  PHP_SAPI=apache2filter

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2filter in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2filter/"; ac_bdir="sapi/apache2filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  *darwin*)
                    if test -x "$APR_CONFIG"; then
        MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
    fi
    if test -x "$APU_CONFIG"; then
        MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
    fi
    MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"

  PHP_VAR_SUBST="$PHP_VAR_SUBST MH_BUNDLE_FLAGS"


  PHP_SAPI=apache2filter

  case "bundle" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2filter in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2filter/"; ac_bdir="sapi/apache2filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    SAPI_SHARED=libs/libphp4.so
    INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
    ;;
  *beos*)
    if test -f _APP_; then `rm _APP_`; fi
    `ln -s $APXS_BINDIR/httpd _APP_`
    EXTRA_LIBS="$EXTRA_LIBS _APP_"

  PHP_SAPI=apache2filter

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2filter in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2filter/"; ac_bdir="sapi/apache2filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  *)

  PHP_SAPI=apache2filter

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2filter in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2filter"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2filter/"; ac_bdir="sapi/apache2filter/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  esac

  if test "$APXS_MPM" != "prefork"; then

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi

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


  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS"


else

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

fi;



echo "$as_me:$LINENO: checking for Apache 2.0 handler-module support via DSO through APXS" >&5
echo $ECHO_N "checking for Apache 2.0 handler-module support via DSO through APXS... $ECHO_C" >&6

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

  if test "$withval" = "yes"; then
    APXS=apxs
    $APXS -q CFLAGS >/dev/null 2>&1
    if test "$?" != "0" && test -x /usr/sbin/apxs; then
      APXS=/usr/sbin/apxs
    fi
  else

  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    APXS=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    APXS="$ep_realdir/`basename \"$withval\"`"
  fi

  fi

  $APXS -q CFLAGS >/dev/null 2>&1
  if test "$?" != "0"; then
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: Sorry, I cannot run apxs.  Possible reasons follow:" >&5
echo "${ECHO_T}Sorry, I cannot run apxs.  Possible reasons follow:" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: 1. Perl is not installed" >&5
echo "${ECHO_T}1. Perl is not installed" >&6
    echo "$as_me:$LINENO: result: 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs" >&5
echo "${ECHO_T}2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs" >&6
    echo "$as_me:$LINENO: result: 3. Apache was not built using --enable-so (the apxs usage page is displayed)" >&5
echo "${ECHO_T}3. Apache was not built using --enable-so (the apxs usage page is displayed)" >&6
    echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
    echo "$as_me:$LINENO: result: The output of $APXS follows:" >&5
echo "${ECHO_T}The output of $APXS follows:" >&6
    $APXS -q CFLAGS
    { { echo "$as_me:$LINENO: error: Aborting" >&5
echo "$as_me: error: Aborting" >&2;}
   { (exit 1); exit 1; }; }
  fi

  APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  APXS_BINDIR=`$APXS -q BINDIR`
  APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
  APXS_CFLAGS=`$APXS -q CFLAGS`
  APXS_MPM=`$APXS -q MPM_NAME`
  APU_BINDIR=`$APXS -q APU_BINDIR`
  APR_BINDIR=`$APXS -q APR_BINDIR`

  # Pick up ap[ru]-N-config if using httpd >=2.1
  APR_CONFIG=`$APXS -q APR_CONFIG 2>/dev/null ||
    echo $APR_BINDIR/apr-config`
  APU_CONFIG=`$APXS -q APU_CONFIG 2>/dev/null ||
    echo $APU_BINDIR/apu-config`

  APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
  APU_CFLAGS="`$APU_CONFIG --includes`"

  for flag in $APXS_CFLAGS; do
    case $flag in
    -D*) APACHE_CPPFLAGS="$APACHE_CPPFLAGS $flag";;
    esac
  done

  APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"

  # Test that we're trying to configure with apache 2.x

  ac_output=`$APXS_HTTPD -v 2>&1`
  ac_IFS=$IFS
IFS="- /.
"
  set $ac_output
  IFS=$ac_IFS

  APACHE_VERSION=`expr $4 \* 1000000 + $5 \* 1000 + $6`

  if test "$APACHE_VERSION" -le 2000000; then
    { { echo "$as_me:$LINENO: error: You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropiate switch --with-apxs (without the 2)" >&5
echo "$as_me: error: You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropiate switch --with-apxs (without the 2)" >&2;}
   { (exit 1); exit 1; }; }
  elif test "$APACHE_VERSION" -lt 2000044; then
    { { echo "$as_me:$LINENO: error: Please note that Apache version >= 2.0.44 is required." >&5
echo "$as_me: error: Please note that Apache version >= 2.0.44 is required." >&2;}
   { (exit 1); exit 1; }; }
  fi

  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
  if test -z `$APXS -q SYSCONFDIR`; then
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -i -n php4"
  else
    APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -S SYSCONFDIR='$APXS_SYSCONFDIR' \
                       -i -a -n php4"
  fi

  case $host_alias in
  *aix*)
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"

  PHP_SAPI=apache2handler

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2handler in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2handler"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2handler/"; ac_bdir="sapi/apache2handler/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  *darwin*)
                    if test -x "$APR_CONFIG"; then
        MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
    fi
    if test -x "$APU_CONFIG"; then
        MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
    fi
    MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"

  PHP_VAR_SUBST="$PHP_VAR_SUBST MH_BUNDLE_FLAGS"


  PHP_SAPI=apache2handler

  case "bundle" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2handler in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2handler"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2handler/"; ac_bdir="sapi/apache2handler/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    SAPI_SHARED=libs/libphp4.so
    INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
    ;;
  *beos*)
    if test -f _APP_; then `rm _APP_`; fi
    `ln -s $APXS_BINDIR/httpd _APP_`
    EXTRA_LIBS="$EXTRA_LIBS _APP_"

  PHP_SAPI=apache2handler

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2handler in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2handler"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2handler/"; ac_bdir="sapi/apache2handler/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  *)

  PHP_SAPI=apache2handler

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/apache2handler in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/apache2handler"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/apache2handler/"; ac_bdir="sapi/apache2handler/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sapi_apache2.c apache_config.c php_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $APACHE_CFLAGS $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $APACHE_CFLAGS $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



    INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
    ;;
  esac

  if test "$APXS_MPM" != "prefork"; then

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi

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


  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS"


else

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

fi;



RESULT=no
echo "$as_me:$LINENO: checking for Caudium support" >&5
echo $ECHO_N "checking for Caudium support... $ECHO_C" >&6

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

    if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi
	if test ! -d $withval ; then
      if test "$prefix" = "NONE"; then
	     withval=/usr/local/caudium/server/
	  else
	     withval=$prefix/caudium/server/
      fi
	fi
	if test -f $withval/bin/caudium; then
		PIKE=$withval/bin/caudium
	elif test -f $withval/bin/pike; then
		PIKE=$withval/bin/pike
	else
		{ { echo "$as_me:$LINENO: error: Couldn't find a pike in $withval/bin/" >&5
echo "$as_me: error: Couldn't find a pike in $withval/bin/" >&2;}
   { (exit 1); exit 1; }; }
	fi
    if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0268) exit(1); exit(0);'; then
		PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'`
	    PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,' `
		if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then
			{ { echo "$as_me:$LINENO: error: Failed to figure out Pike module and include directories" >&5
echo "$as_me: error: Failed to figure out Pike module and include directories" >&2;}
   { (exit 1); exit 1; }; }
		fi
		echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
        PIKE=`echo $PIKE | pike -e 'int tries=100;
		   string orig,pike=Stdio.File("stdin")->read()-"\n";
		   orig=pike;
		   if(search(orig, "/"))
		     orig = combine_path(getcwd(), orig);
		   while(!catch(pike=readlink(pike)) && tries--)
		     ;
		   write(combine_path(dirname(orig), pike)); '`

  if test "$PIKE_INCLUDE_DIR" != "/usr/include"; then

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

    ep_dir="`echo $PIKE_INCLUDE_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PIKE_INCLUDE_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

		if test "$prefix" != "NONE"; then
		   PIKE_C_INCLUDE=$prefix/include/`basename $PIKE`
		else
		   PIKE_C_INCLUDE=/usr/local/include/`basename $PIKE`
		fi
		echo "$as_me:$LINENO: checking for C includes in $PIKE_C_INCLUDE" >&5
echo $ECHO_N "checking for C includes in $PIKE_C_INCLUDE... $ECHO_C" >&6
		if test -f $PIKE_C_INCLUDE/version.h; then
		  PIKE_TEST_VER=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'`
		      ###### VERSION MATCH CHECK #######
		      PMAJOR="^#define PIKE_MAJOR_VERSION"
		      PMINOR="^#define PIKE_MINOR_VERSION"
		      PBUILD="^#define PIKE_BUILD_VERSION"

		      PIKE_CMAJOR_VERSION=0
		      PIKE_CMINOR_VERSION=0
		      PIKE_CBUILD_VERSION=0

		      PIKE_CMAJOR_VERSION=`grep "$PMAJOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'`
    		      if test -z "$PIKE_CMAJOR_VERSION"; then
			if test -n "`grep f_version $PIKE_C_INCLUDE/version.h`"; then
			   PIKE_CMAJOR_VERSION=6
			fi
		      else
		        PIKE_CMINOR_VERSION=`grep "$PMINOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'`
			PIKE_CBUILD_VERSION=`grep "$PBUILD" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/'`
                      fi

		      if test "$PIKE_TEST_VER" = "${PIKE_CMAJOR_VERSION}.${PIKE_CMINOR_VERSION}.${PIKE_CBUILD_VERSION}"; then

  if test "$PIKE_C_INCLUDE" != "/usr/include"; then

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

    ep_dir="`echo $PIKE_C_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PIKE_C_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

				 PIKE_INCLUDE_DIR="$PIKE_INCLUDE_DIR, $PIKE_C_INCLUDE"
		         echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
		      else
		         echo "$as_me:$LINENO: result: version mismatch" >&5
echo "${ECHO_T}version mismatch" >&6
		      fi
		   else
			echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
		   fi
	else
		{ { echo "$as_me:$LINENO: error: Caudium PHP4 requires Pike 7.0 or newer" >&5
echo "$as_me: error: Caudium PHP4 requires Pike 7.0 or newer" >&2;}
   { (exit 1); exit 1; }; }
	fi
    PIKE_VERSION=`$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);'`

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


  PHP_SAPI=caudium

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/caudium in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/caudium"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/caudium/"; ac_bdir="sapi/caudium/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in caudium.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



	INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP4.so"
	RESULT="	*** Pike binary used:         $PIKE
	*** Pike include dir(s) used: $PIKE_INCLUDE_DIR
	*** Pike version:             $PIKE_VERSION"

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi



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




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

# Check whether --enable-cli or --disable-cli was given.
if test "${enable_cli+set}" = set; then
  enableval="$enable_cli"

  PHP_SAPI_CLI=$enableval

else

  PHP_SAPI_CLI=yes

fi;

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

  src=$abs_srcdir/sapi/cli/Makefile.frag
  ac_srcdir=$abs_srcdir/sapi/cli
  ac_builddir=sapi/cli
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

  SAPI_CLI_PATH=sapi/cli/php

  PHP_VAR_SUBST="$PHP_VAR_SUBST SAPI_CLI_PATH"


  case $host_alias in
  *darwin*)
    BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
    ;;
  *netware*)
    BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp4lib -o \$(SAPI_CLI_PATH)"
    ;;
  *cygwin*)
    SAPI_CLI_PATH=sapi/cli/php.exe
    BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
    ;;
  *)
    BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
    ;;
  esac
  INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)"


  PHP_VAR_SUBST="$PHP_VAR_SUBST BUILD_CLI"


  PHP_VAR_SUBST="$PHP_VAR_SUBST INSTALL_CLI"


  PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES sapi/cli/php.1"

else

  disable_cli=1

fi

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


echo "$as_me:$LINENO: checking for embedded SAPI library support" >&5
echo $ECHO_N "checking for embedded SAPI library support... $ECHO_C" >&6

# Check whether --enable-embed or --disable-embed was given.
if test "${enable_embed+set}" = set; then
  enableval="$enable_embed"

  case $enableval in
    yes|shared)
      PHP_EMBED_TYPE=shared
      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
      ;;
    static)
      PHP_EMBED_TYPE=static
      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib"
      ;;
    *)
      PHP_EMBED_TYPE=no
      ;;
  esac

else

  PHP_EMBED_TYPE=no

fi;

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

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

  PHP_SAPI=embed

  case "$PHP_EMBED_TYPE" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/embed in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/embed"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/embed/"; ac_bdir="sapi/embed/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_embed.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



fi


RESULT=no
echo "$as_me:$LINENO: checking for Zeus ISAPI support" >&5
echo $ECHO_N "checking for Zeus ISAPI support... $ECHO_C" >&6

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

	if test "$withval" = "yes"; then
		ZEUSPATH=/usr/local/zeus # the default
	else
		ZEUSPATH=$withval
	fi
	test -f "$ZEUSPATH/web/include/httpext.h" || { { echo "$as_me:$LINENO: error: Unable to find httpext.h in $ZEUSPATH/web/include" >&5
echo "$as_me: error: Unable to find httpext.h in $ZEUSPATH/web/include" >&2;}
   { (exit 1); exit 1; }; }

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi


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


  if test "$ZEUSPATH/web/include" != "/usr/include"; then

  if test -z "$ZEUSPATH/web/include" || echo "$ZEUSPATH/web/include" | grep '^/' >/dev/null ; then
    ai_p=$ZEUSPATH/web/include
  else

    ep_dir="`echo $ZEUSPATH/web/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZEUSPATH/web/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_SAPI=isapi

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/isapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/isapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/isapi/"; ac_bdir="sapi/isapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php4isapi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



	INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/"
	RESULT=yes

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



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

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

  PHP_NSAPI=$withval

else

  PHP_NSAPI=no

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

if test "$PHP_NSAPI" != "no"; then
  if test ! -d $PHP_NSAPI/bin ; then
    { { echo "$as_me:$LINENO: error: Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR" >&5
echo "$as_me: error: Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi
  echo "$as_me:$LINENO: checking for NSAPI include files" >&5
echo $ECHO_N "checking for NSAPI include files... $ECHO_C" >&6
  if test -d $PHP_NSAPI/include ; then
    NSAPI_INCLUDE=$PHP_NSAPI/include
    echo "$as_me:$LINENO: result: Netscape-Enterprise 3.x style" >&5
echo "${ECHO_T}Netscape-Enterprise 3.x style" >&6
    echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>

int
main ()
{

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

ac_cv_header_stdc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

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

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

fi

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

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

fi

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

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

( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then

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

fi

# On IRIX 5.3, sys/types and inttypes.h are conflicting.









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

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

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

fi

done



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

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

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

fi

done

  fi
  if test -d $PHP_NSAPI/plugins/include ; then
    test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
    NSAPI_INCLUDE="$PHP_NSAPI/plugins/include"
    echo "$as_me:$LINENO: result: iPlanet 4.x / SunONE 6.x style" >&5
echo "${ECHO_T}iPlanet 4.x / SunONE 6.x style" >&6

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

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

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

fi

done

    NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
  fi
  if test "$NSAPI_INCLUDE" = ""; then
    { { echo "$as_me:$LINENO: error: Please check you have nsapi.h in either $PHP_NSAPI/include or $PHP_NSAPI/plugins/include" >&5
echo "$as_me: error: Please check you have nsapi.h in either $PHP_NSAPI/include or $PHP_NSAPI/plugins/include" >&2;}
   { (exit 1); exit 1; }; }
  fi


  for ac_i in $NSAPI_INCLUDE; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done


  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi


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


  PHP_SAPI=nsapi

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/nsapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/nsapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/nsapi/"; ac_bdir="sapi/nsapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in nsapi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHP_NSAPI/bin/"
fi




RESULT=no
echo "$as_me:$LINENO: checking for PHTTPD support" >&5
echo $ECHO_N "checking for PHTTPD support... $ECHO_C" >&6

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

	if test ! -d $withval ; then
		{ { echo "$as_me:$LINENO: error: You did not specify a directory" >&5
echo "$as_me: error: You did not specify a directory" >&2;}
   { (exit 1); exit 1; }; }
	fi

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi

	PHTTPD_DIR=$withval

  if test "$PHTTPD_DIR/include" != "/usr/include"; then

  if test -z "$PHTTPD_DIR/include" || echo "$PHTTPD_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$PHTTPD_DIR/include
  else

    ep_dir="`echo $PHTTPD_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHTTPD_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


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


  PHP_SAPI=phttpd

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/phttpd in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/phttpd"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/phttpd/"; ac_bdir="sapi/phttpd/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in phttpd.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



	INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHTTPD_DIR/modules/"
	RESULT=yes

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



RESULT=no
echo "$as_me:$LINENO: checking for Pi3Web support" >&5
echo $ECHO_N "checking for Pi3Web support... $ECHO_C" >&6


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

if test "$withval" != "no"; then
	if test "$withval" = "yes"; then
		PI3PATH=../.. # the default
	else
		PI3PATH=$withval
	fi
	test -f "$PI3PATH/PiAPI/PiAPI.h" || { { echo "$as_me:$LINENO: error: Unable to find PiAPI.h in $PI3PATH/PiAPI" >&5
echo "$as_me: error: Unable to find PiAPI.h in $PI3PATH/PiAPI" >&2;}
   { (exit 1); exit 1; }; }

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi


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


  if test "$PI3PATH/PiAPI" != "/usr/include"; then

  if test -z "$PI3PATH/PiAPI" || echo "$PI3PATH/PiAPI" | grep '^/' >/dev/null ; then
    ai_p=$PI3PATH/PiAPI
  else

    ep_dir="`echo $PI3PATH/PiAPI|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PI3PATH/PiAPI\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$PI3PATH/Pi2API" != "/usr/include"; then

  if test -z "$PI3PATH/Pi2API" || echo "$PI3PATH/Pi2API" | grep '^/' >/dev/null ; then
    ai_p=$PI3PATH/Pi2API
  else

    ep_dir="`echo $PI3PATH/Pi2API|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PI3PATH/Pi2API\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$PI3PATH/Pi3API" != "/usr/include"; then

  if test -z "$PI3PATH/Pi3API" || echo "$PI3PATH/Pi3API" | grep '^/' >/dev/null ; then
    ai_p=$PI3PATH/Pi3API
  else

    ep_dir="`echo $PI3PATH/Pi3API|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PI3PATH/Pi3API\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$PI3PATH/PHP4" != "/usr/include"; then

  if test -z "$PI3PATH/PHP4" || echo "$PI3PATH/PHP4" | grep '^/' >/dev/null ; then
    ai_p=$PI3PATH/PHP4
  else

    ep_dir="`echo $PI3PATH/PHP4|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PI3PATH/PHP4\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_SAPI=pi3web

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/pi3web in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/pi3web"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/pi3web/"; ac_bdir="sapi/pi3web/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pi3web_sapi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



	INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/"
	RESULT=yes
else
	RESULT=no
fi

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



RESULT=no
echo "$as_me:$LINENO: checking for Roxen/Pike support" >&5
echo $ECHO_N "checking for Roxen/Pike support... $ECHO_C" >&6

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

	if test ! -d $withval ; then
		{ { echo "$as_me:$LINENO: error: You did not specify a directory" >&5
echo "$as_me: error: You did not specify a directory" >&2;}
   { (exit 1); exit 1; }; }
	fi
	if test -f $withval/bin/roxen; then
		PIKE=$withval/bin/roxen
	elif test -f $withval/bin/pike; then
		PIKE=$withval/bin/pike
	else
		{ { echo "$as_me:$LINENO: error: Couldn't find a pike in $withval/bin/" >&5
echo "$as_me: error: Couldn't find a pike in $withval/bin/" >&2;}
   { (exit 1); exit 1; }; }
	fi
    if $PIKE -e 'float v; catch(v = __VERSION__ + (__BUILD__/10000.0)); if(v < 0.7079) exit(1); exit(0);'; then
		PIKE_MODULE_DIR=`$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'`
	    PIKE_INCLUDE_DIR=`echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'`
		if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then
			{ { echo "$as_me:$LINENO: error: Failed to figure out Pike module and include directories" >&5
echo "$as_me: error: Failed to figure out Pike module and include directories" >&2;}
   { (exit 1); exit 1; }; }
		fi
	else
		{ { echo "$as_me:$LINENO: error: Roxen/PHP requires Pike 0.7.79 or newer" >&5
echo "$as_me: error: Roxen/PHP requires Pike 0.7.79 or newer" >&2;}
   { (exit 1); exit 1; }; }
	fi


  if test "$PIKE_INCLUDE_DIR" != "/usr/include"; then

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

    ep_dir="`echo $PIKE_INCLUDE_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PIKE_INCLUDE_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


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


  PHP_SAPI=roxen

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/roxen in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/roxen"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/roxen/"; ac_bdir="sapi/roxen/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in roxen.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



	INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $PIKE_MODULE_DIR/PHP4.so"
	RESULT="yes
	Pike binary used:      $PIKE
	Pike include dir:      $PIKE_INCLUDE_DIR
	Pike module directory: $PIKE_MODULE_DIR"
	PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR "

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

if test "$RESULT" != "no" ; then
 RESULT=no
 echo "$as_me:$LINENO: checking if Roxen should use ZTS" >&5
echo $ECHO_N "checking if Roxen should use ZTS... $ECHO_C" >&6
 # Check whether --enable-roxen-zts or --disable-roxen-zts was given.
if test "${enable_roxen_zts+set}" = set; then
  enableval="$enable_roxen_zts"


  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi


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

	RESULT=yes


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




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

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

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

    if test "$withval" = "yes"; then
      SERVLET_CLASSPATH=.
    else
      if test -f $withval/lib/servlet.jar; then
        SERVLET_CLASSPATH=$withval/lib/servlet.jar
      fi

      if test -f $withval/lib/jsdk.jar; then
        SERVLET_CLASSPATH=$withval/lib/jsdk.jar
      fi

      if test -d $withval/javax; then
        SERVLET_CLASSPATH=$withval
      fi

      if test -z "$SERVLET_CLASSPATH"; then
        echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
        { { echo "$as_me:$LINENO: error: unable to find servlet libraries" >&5
echo "$as_me: error: unable to find servlet libraries" >&2;}
   { (exit 1); exit 1; }; }
      fi
    fi


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


    INSTALL_IT="\$(mkinstalldirs) \$(libdir)"
    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(top_srcdir)/sapi/servlet/phpsrvlt.jar \$(libdir)"
    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 $SAPI_SHARED \$(libdir)"
    PHP_SAPI=servlet

  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&5
echo "$as_me: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." >&2;}
   { (exit 1); exit 1; }; }
  fi

    EXTRA_INCLUDES="$EXTRA_INCLUDES \$(JAVA_INCLUDE)"

  PHP_SAPI=servlet

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/servlet in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/servlet"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/servlet/"; ac_bdir="sapi/servlet/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in servlet.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done





  case /sapi/servlet in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "/sapi/servlet"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir//sapi/servlet/"; ac_bdir="/sapi/servlet/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in java.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



  src=sapi/servlet/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments


    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

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

fi;


  PHP_VAR_SUBST="$PHP_VAR_SUBST SERVLET_CLASSPATH"




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

  if test ! -d $withval; then
    echo "$as_me:$LINENO: result: thttpd directory does not exist ($withval)" >&5
echo "${ECHO_T}thttpd directory does not exist ($withval)" >&6
  fi


  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    THTTPD=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    THTTPD="$ep_realdir/`basename \"$withval\"`"
  fi


  if grep thttpd.2.21b $withval/version.h >/dev/null; then
    patch="test -f $THTTPD/php_patched || \
    (cd $THTTPD && patch -p1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)"

  elif grep Premium $withval/version.h >/dev/null; then
    patch=
  else
    { { echo "$as_me:$LINENO: error: This version only supports thttpd-2.21b and Premium thttpd" >&5
echo "$as_me: error: This version only supports thttpd-2.21b and Premium thttpd" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -n "$GCC"; then

  gcc_arg_name=ac_cv_gcc_arg_rdynamic
  echo "$as_me:$LINENO: checking whether $CC supports -rdynamic" >&5
echo $ECHO_N "checking whether $CC supports -rdynamic... $ECHO_C" >&6
if test "${ac_cv_gcc_arg_rdynamic+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  echo 'void somefunc() { };' > conftest.c
  cmd='$CC -rdynamic -c conftest.c'
  if eval $cmd 2>&1 | egrep -e -rdynamic >/dev/null ; then
    ac_result=no
  else
    ac_result=yes
  fi
  eval $gcc_arg_name=$ac_result
  rm -f conftest.*

fi
echo "$as_me:$LINENO: result: $ac_cv_gcc_arg_rdynamic" >&5
echo "${ECHO_T}$ac_cv_gcc_arg_rdynamic" >&6
  if eval test "\$$gcc_arg_name" = "yes"; then
    gcc_rdynamic=yes
  else
    :

  fi

    if test "$gcc_rdynamic" = "yes"; then
      PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic"
    fi
  fi

  INSTALL_IT="\
    echo 'PHP_LIBS = -L. -lphp4 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \
    echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $THTTPD/php_makefile; \
    echo 'PHP_CFLAGS = \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \
    rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp4.a; \
    \$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \
    \$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\
    $patch"
  PHP_THTTPD="yes, using $THTTPD"

  if test "$THTTPD" != "/usr/include"; then

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

    ep_dir="`echo $THTTPD|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THTTPD\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_SAPI=thttpd

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac




else

  PHP_THTTPD=no

fi;

echo "$as_me:$LINENO: checking for thttpd" >&5
echo $ECHO_N "checking for thttpd... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $PHP_THTTPD" >&5
echo "${ECHO_T}$PHP_THTTPD" >&6


PHP_TUX=no


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

  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/php4.tux.so"

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

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
 :
else
  { { echo "$as_me:$LINENO: error: Cannot find tuxmodule.h" >&5
echo "$as_me: error: Cannot find tuxmodule.h" >&2;}
   { (exit 1); exit 1; }; }
fi

done


  PHP_SAPI=tux

  case "shared" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/tux in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/tux"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/tux/"; ac_bdir="sapi/tux/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_tux.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



  PHP_TUX=yes

fi;

echo "$as_me:$LINENO: checking for TUX" >&5
echo $ECHO_N "checking for TUX... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $PHP_TUX" >&5
echo "${ECHO_T}$PHP_TUX" >&6

unset PHP_TUX



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


  if test -z "$withval" || echo "$withval" | grep '^/' >/dev/null ; then
    WEBJAMES=$withval
  else

    ep_dir="`echo $withval|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    WEBJAMES="$ep_realdir/`basename \"$withval\"`"
  fi

  INSTALL_IT="\
    echo 'PHP_LIBS = -l$abs_srcdir/$SAPI_STATIC \$(PHP_LIBS) \$(EXTRA_LIBS)' > $WEBJAMES/build/php; \
    echo 'PHP_LDFLAGS = \$(NATIVE_RPATHS) \$(PHP_LDFLAGS)' >> $WEBJAMES/build/php; \
    echo 'PHP_CFLAGS = -DPHP \$(COMMON_FLAGS) \$(EXTRA_CFLAGS) -I$abs_srcdir/sapi/webjames' >> $WEBJAMES/build/php;"
  PHP_WEBJAMES="yes, using $WEBJAMES"

  if test "$WEBJAMES" != "/usr/include"; then

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

    ep_dir="`echo $WEBJAMES|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WEBJAMES\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_SAPI=webjames

  case "static" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/webjames in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/webjames"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/webjames/"; ac_bdir="sapi/webjames/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in webjames.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done




else

  PHP_WEBJAMES="no"

fi;

echo "$as_me:$LINENO: checking for webjames" >&5
echo $ECHO_N "checking for webjames... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $PHP_WEBJAMES" >&5
echo "${ECHO_T}$PHP_WEBJAMES" >&6


# Check whether --enable-cgi or --disable-cgi was given.
if test "${enable_cgi+set}" = set; then
  enableval="$enable_cgi"

  PHP_SAPI_CGI=$enableval

else

  PHP_SAPI_CGI=yes

fi;

# Check whether --enable-force-cgi-redirect or --disable-force-cgi-redirect was given.
if test "${enable_force_cgi_redirect+set}" = set; then
  enableval="$enable_force_cgi_redirect"

  PHP_FORCE_CGI_REDIRECT=$enableval

else

  PHP_FORCE_CGI_REDIRECT=no

fi;

# Check whether --enable-discard-path or --disable-discard-path was given.
if test "${enable_discard_path+set}" = set; then
  enableval="$enable_discard_path"

  PHP_DISCARD_PATH=$enableval

else

  PHP_DISCARD_PATH=no

fi;

# Check whether --enable-fastcgi or --disable-fastcgi was given.
if test "${enable_fastcgi+set}" = set; then
  enableval="$enable_fastcgi"

  PHP_ENABLE_FASTCGI=$enableval

else

  PHP_ENABLE_FASTCGI=no

fi;

# Check whether --enable-path-info-check or --disable-path-info-check was given.
if test "${enable_path_info_check+set}" = set; then
  enableval="$enable_path_info_check"

  PHP_ENABLE_PATHINFO_CHECK=$enableval

else

  PHP_ENABLE_PATHINFO_CHECK=yes

fi;




if test "$PHP_SAPI" = "default"; then
  echo "$as_me:$LINENO: checking for CGI build" >&5
echo $ECHO_N "checking for CGI build... $ECHO_C" >&6
  if test "$PHP_SAPI_CGI" != "no"; then
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6


  src=$abs_srcdir/sapi/cgi/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

    case $host_alias in
      *cygwin* )
        SAPI_CGI_PATH=sapi/cgi/php.exe
        ;;
      * )
        SAPI_CGI_PATH=sapi/cgi/php
        ;;
    esac

  PHP_VAR_SUBST="$PHP_VAR_SUBST SAPI_CGI_PATH"



  echo "$as_me:$LINENO: checking whether writing to stdout works" >&5
echo $ECHO_N "checking whether writing to stdout works... $ECHO_C" >&6
if test "${ac_cv_write_stdout+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

    if test "$cross_compiling" = yes; then

      ac_cv_write_stdout=no

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

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

#define TEXT "This is the test message -- "

main()
{
  int n;

  n = write(1, TEXT, sizeof(TEXT)-1);
  return (!(n == sizeof(TEXT)-1));
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_write_stdout=yes

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

( exit $ac_status )

      ac_cv_write_stdout=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

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

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

  fi


    echo "$as_me:$LINENO: checking whether to force Apache CGI redirect" >&5
echo $ECHO_N "checking whether to force Apache CGI redirect... $ECHO_C" >&6
    if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
      REDIRECT=1
    else
      REDIRECT=0
    fi

cat >>confdefs.h <<_ACEOF
#define FORCE_CGI_REDIRECT $REDIRECT
_ACEOF

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


    echo "$as_me:$LINENO: checking whether to discard path_info + path_translated" >&5
echo $ECHO_N "checking whether to discard path_info + path_translated... $ECHO_C" >&6
    if test "$PHP_DISCARD_PATH" = "yes"; then
      DISCARD_PATH=1
    else
      DISCARD_PATH=0
    fi

cat >>confdefs.h <<_ACEOF
#define DISCARD_PATH $DISCARD_PATH
_ACEOF

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

    echo "$as_me:$LINENO: checking whether to enable path info checking" >&5
echo $ECHO_N "checking whether to enable path info checking... $ECHO_C" >&6
    if test "$PHP_ENABLE_PATHINFO_CHECK" = "yes"; then
      ENABLE_PATHINFO_CHECK=1
    else
      ENABLE_PATHINFO_CHECK=0
    fi

cat >>confdefs.h <<_ACEOF
#define ENABLE_PATHINFO_CHECK $ENABLE_PATHINFO_CHECK
_ACEOF

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

    echo "$as_me:$LINENO: checking whether to enable fastcgi support" >&5
echo $ECHO_N "checking whether to enable fastcgi support... $ECHO_C" >&6
    PHP_LIBFCGI_DIR="$abs_srcdir/sapi/cgi/libfcgi"
    if test -z $PHP_LIBFCGI_DIR; then
      echo "$PHP_LIBFCGI_DIR does not exist"
      exit 1
    fi
    if test "$PHP_ENABLE_FASTCGI" = "yes"; then

  BUILD_DIR="$BUILD_DIR $abs_builddir/sapi/cgi/libfcgi"

      PHP_FASTCGI=1
      PHP_FCGI_FILES="libfcgi/fcgi_stdio.c libfcgi/fcgiapp.c libfcgi/os_unix.c"
      PHP_FCGI_INCLUDE="-I$PHP_LIBFCGI_DIR/include"
      PHP_FCGI_STATIC=1
    else
      PHP_FASTCGI=0
      PHP_FCGI_FILES=""
      PHP_FCGI_INCLUDE=""
      PHP_FCGI_STATIC=0
    fi

cat >>confdefs.h <<_ACEOF
#define PHP_FASTCGI $PHP_FASTCGI
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PHP_FCGI_STATIC $PHP_FCGI_STATIC
_ACEOF

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

    INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)"

  PHP_SAPI=cgi

  case "program" in
  static)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=static
;;
  shared)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libphp4.la
  php_build_target=shared

  php_c_pre=$shared_c_pre
  php_c_meta=$shared_c_meta
  php_c_post=$shared_c_post
  php_cxx_pre=$shared_cxx_pre
  php_cxx_meta=$shared_cxx_meta
  php_cxx_post=$shared_cxx_post
  php_lo=$shared_lo
;;
  bundle)

  OVERALL_TARGET=php
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program

  OVERALL_TARGET=libs/libphp4.bundle
  php_build_target=static
;;
  program)
  OVERALL_TARGET='$(SAPI_CGI_PATH)'
  php_c_pre='$(CC)'
  php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)'
  php_c_post=' && echo > $@'
  php_cxx_pre='$(CXX)'
  php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)'
  php_cxx_post=' && echo > $@'
  php_lo=o

  case $with_pic in
    yes) pic_setting='-prefer-pic';;
    no)  pic_setting='-prefer-non-pic';;
  esac

  shared_c_pre='$(LIBTOOL) --mode=compile $(CC)'
  shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) '$pic_setting
  shared_c_post=
  shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)'
  shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting
  shared_cxx_post=
  shared_lo=lo

  php_build_target=program
;;
  esac



  case sapi/cgi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/cgi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/cgi/"; ac_bdir="sapi/cgi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $PHP_FCGI_FILES cgi_main.c getopt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $PHP_FCGI_INCLUDE $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $PHP_FCGI_INCLUDE $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done




    case $host_alias in
      *darwin*)
        BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
      ;;
      *)
        BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
      ;;
    esac


  PHP_VAR_SUBST="$PHP_VAR_SUBST BUILD_CGI"


  elif test "$PHP_SAPI_CLI" != "no"; then
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    OVERALL_TARGET=
    PHP_SAPI=cli
  else
    { { echo "$as_me:$LINENO: error: No SAPIs selected." >&5
echo "$as_me: error: No SAPIs selected." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi



echo "$as_me:$LINENO: checking for chosen SAPI module" >&5
echo $ECHO_N "checking for chosen SAPI module... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $PHP_SAPI" >&5
echo "${ECHO_T}$PHP_SAPI" >&6

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

if test -n "$ac_cv_pthreads_lib"; then
  LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi

if test -n "$ac_cv_pthreads_cflags"; then
  CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi


  if test -z "$host_alias" && test -n "$host"; then
    host_alias=$host
  fi
  if test -z "$host_alias"; then
    { { echo "$as_me:$LINENO: error: host_alias is not set. Make sure to run config.guess" >&5
echo "$as_me: error: host_alias is not set. Make sure to run config.guess" >&2;}
   { (exit 1); exit 1; }; }
  fi
  case $host_alias in
  *solaris*)
    PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
  *freebsd*)
    PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";;
  *linux*)
    PTHREAD_FLAGS=-D_REENTRANT;;
  *aix*)
    PTHREAD_FLAGS=-D_THREAD_SAFE;;
  *irix*)
    PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;;
  *hpux*)
    PTHREAD_FLAGS=-D_REENTRANT;;
  *sco*)
    PTHREAD_FLAGS=-D_REENTRANT;;
  esac

  if test -n "$PTHREAD_FLAGS"; then
    CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS"
  fi

fi

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

  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Running FastCGI checks${T_ME}" >&5
echo "${ECHO_T}${T_MD}Running FastCGI checks${T_ME}" >&6














#AC_INIT
#AM_INIT_AUTOMAKE(fcgi, 2.2.3-SNAP-0203171857)

#AM_CONFIG_HEADER(include/fcgi_config.h)

#AC_PROG_CC
#AC_PROG_CPP
#AC_PROG_INSTALL
#AC_PROG_LIBTOOL

#AC_PROG_CXX

#AC_LANG([C++])

#dnl autoconf defaults CXX to 'g++', so its unclear whether it exists/works
#AC_MSG_CHECKING([whether $CXX works])
#AC_TRY_COMPILE([#include <iostream>],
#               [std::cout << "ok";],
#               [AC_MSG_RESULT(yes)
#                LIBFCGIXX=libfcgi++.la
#                ECHO_CPP=echo-cpp${EXEEXT}
#                AC_MSG_CHECKING([whether cin has a streambuf assignment operator])
#                AC_TRY_COMPILE([#include <iostream>],
#                               [cin = static_cast<streambuf *>(0);],
#                               [AC_MSG_RESULT(yes)
#                                AC_DEFINE([HAVE_IOSTREAM_WITHASSIGN_STREAMBUF],  [1],
#                                          [Define if cin/cout/cerr has a streambuf assignment operator])],
#                               [AC_MSG_RESULT(no)])
#                AC_MSG_CHECKING([whether char_type is defined in the context of streambuf])
#                AC_TRY_COMPILE([#include <iostream>],
#                               [class fcgi_streambuf : public std::streambuf { char_type ct; }],
#                               [AC_MSG_RESULT(yes)
#                                AC_DEFINE([HAVE_STREAMBUF_CHAR_TYPE], [1],
#                                          [Define if char_type is defined in the context of streambuf])],
#                               [AC_MSG_RESULT(no)])],
#               [AC_MSG_RESULT(no)])
#AC_SUBST(LIBFCGIXX)
#AC_SUBST(ECHO_CPP)

#AC_LANG([C])


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

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

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

  LIBS="-lnsl $LIBS"

fi


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

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

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

  LIBS="-lsocket $LIBS"

fi




acx_pthread_ok=no

# First, check if the POSIX threads header, pthread.h, is available.
# If it isn't, don't bother looking for the threads libraries.
if test "${ac_cv_header_pthread_h+set}" = set; then
  echo "$as_me:$LINENO: checking for pthread.h" >&5
echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
if test "${ac_cv_header_pthread_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking pthread.h usability" >&5
echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <pthread.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for pthread.h" >&5
echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
if test "${ac_cv_header_pthread_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_pthread_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
echo "${ECHO_T}$ac_cv_header_pthread_h" >&6

fi
if test $ac_cv_header_pthread_h = yes; then
  :
else
  acx_pthread_ok=noheader
fi



# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).

# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
        save_CFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
        save_LIBS="$LIBS"
        LIBS="$PTHREAD_LIBS $LIBS"
        echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
        echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
echo "${ECHO_T}$acx_pthread_ok" >&6
        if test x"$acx_pthread_ok" = xno; then
                PTHREAD_LIBS=""
                PTHREAD_CFLAGS=""
        fi
        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"
fi

# Create a list of thread flags to try.  Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all.

acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"

# The ordering *is* (sometimes) important.  Some notes on the
# individual items follow:

# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
#       other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
#      doesn't hurt to check since this sometimes defines pthreads too;
#      also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++

case "${host_cpu}-${host_os}" in
        *solaris*)

        # On Solaris (at least, for some versions), libc contains stubbed
        # (non-functional) versions of the pthreads routines, so link-based
        # tests will erroneously succeed.  (We need to link with -pthread or
        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
        # a function called by this macro, so we could check for that, but
        # who knows whether they'll stub that too in a future libc.)  So,
        # we'll just look for -pthreads and -lpthread first:

        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
        ;;
esac

if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do

        case $flag in
                none)
                echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6
                ;;

                -*)
                echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6
                PTHREAD_CFLAGS="$flag"
                ;;

                *)
                echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6
                PTHREAD_LIBS="-l$flag"
                ;;
        esac

        save_LIBS="$LIBS"
        save_CFLAGS="$CFLAGS"
        LIBS="$PTHREAD_LIBS $LIBS"
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"

        # Check for various functions.  We must include pthread.h,
        # since some functions may be macros.  (On the Sequent, we
        # need a special flag -Kthread to make this header compile.)
        # We check for pthread_join because it is in -lpthread on IRIX
        # while pthread_create is in libc.  We check for pthread_attr_init
        # due to DEC craziness with -lpthreads.  We check for
        # pthread_cleanup_push because it is one of the few pthread
        # functions on Solaris that doesn't have a non-functional libc stub.
        # We try pthread_create on general principles.
        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <pthread.h>
int
main ()
{
pthread_t th; pthread_join(th, 0);
                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
                     pthread_create(0,0,0,0); pthread_cleanup_pop(0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  acx_pthread_ok=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext

        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"

        echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
echo "${ECHO_T}$acx_pthread_ok" >&6
        if test "x$acx_pthread_ok" = xyes; then
                break;
        fi

        PTHREAD_LIBS=""
        PTHREAD_CFLAGS=""
done
fi

# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
        save_LIBS="$LIBS"
        LIBS="$PTHREAD_LIBS $LIBS"
        save_CFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"

        # Detect AIX lossage: threads are created detached by default
        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
        echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <pthread.h>
int
main ()
{
int attr=PTHREAD_CREATE_JOINABLE;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ok=PTHREAD_CREATE_JOINABLE
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ok=unknown
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
        if test x"$ok" = xunknown; then
                cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <pthread.h>
int
main ()
{
int attr=PTHREAD_CREATE_UNDETACHED;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ok=PTHREAD_CREATE_UNDETACHED
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ok=unknown
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
        fi
        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then

cat >>confdefs.h <<\_ACEOF
#define PTHREAD_CREATE_JOINABLE $ok
_ACEOF

        fi
        echo "$as_me:$LINENO: result: ${ok}" >&5
echo "${ECHO_T}${ok}" >&6
        if test x"$ok" = xunknown; then
                { echo "$as_me:$LINENO: WARNING: we do not know how to create joinable pthreads" >&5
echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;}
        fi

        echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
        flag=no
        case "${host_cpu}-${host_os}" in
                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
                *solaris* | alpha*-osf*) flag="-D_REENTRANT";;
        esac
        echo "$as_me:$LINENO: result: ${flag}" >&5
echo "${ECHO_T}${flag}" >&6
        if test "x$flag" != xno; then
                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
        fi

        LIBS="$save_LIBS"
        CFLAGS="$save_CFLAGS"

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

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

else
        PTHREAD_CC="$CC"
fi





# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
        THREADED=threaded${EXEEXT}
        :
else
        acx_pthread_ok=no

fi





    echo "$as_me:$LINENO: checking for sun_len in sys/un.h" >&5
echo $ECHO_N "checking for sun_len in sys/un.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/un.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "sun_len" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

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

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*


    echo "$as_me:$LINENO: checking for fpos_t in stdio.h" >&5
echo $ECHO_N "checking for fpos_t in stdio.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "fpos_t" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

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

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*






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

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

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

fi

done





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

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

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

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

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

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

fi

done


    echo "$as_me:$LINENO: checking for a fileno() prototype in stdio.h" >&5
echo $ECHO_N "checking for a fileno() prototype in stdio.h... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "fileno" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

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

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*


    if test "$HAVE_SYS_SOCKET_H"; then
	echo "$as_me:$LINENO: checking for socklen_t in sys/socket.h" >&5
echo $ECHO_N "checking for socklen_t in sys/socket.h... $ECHO_C" >&6
	cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/socket.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "socklen_t" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

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

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*

    fi

    #--------------------------------------------------------------------
    #  Do we need cross-process locking on this platform?
    #--------------------------------------------------------------------
    echo "$as_me:$LINENO: checking whether cross-process locking is required by accept()" >&5
echo $ECHO_N "checking whether cross-process locking is required by accept()... $ECHO_C" >&6
    case "`uname -sr`" in
	IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
		    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

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

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

    #--------------------------------------------------------------------
    #  Does va_arg(arg, long double) crash the compiler?
    #  hpux 9.04 compiler does and so does Stratus FTX (uses HP's compiler)
    #--------------------------------------------------------------------
    echo "$as_me:$LINENO: checking whether va_arg(arg, long double) crashes the compiler" >&5
echo $ECHO_N "checking whether va_arg(arg, long double) crashes the compiler... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdarg.h>
int
main ()
{
long double lDblArg; va_list arg; lDblArg = va_arg(arg, long double);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

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

    echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
if test "${ac_cv_c_const+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
/* FIXME: Include the comments suggested by Paul. */
#ifndef __cplusplus
  /* Ultrix mips cc rejects this.  */
  typedef int charset[2];
  const charset x;
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
  char **p;
  /* NEC SVR4.0.2 mips cc rejects this.  */
  struct point {int x, y;};
  static struct point const zero = {0,0};
  /* AIX XL C 1.02.0.0 rejects this.
     It does not let you subtract one const X* pointer from another in
     an arm of an if-expression whose if-part is not a constant
     expression */
  const char *g = "string";
  ccp = &g + (g ? g-g : 0);
  /* HPUX 7.0 cc rejects these. */
  ++ccp;
  p = (char**) ccp;
  ccp = (char const *const *) p;
  { /* SCO 3.2v4 cc rejects this.  */
    char *t;
    char const *s = 0 ? (char *) 0 : (char const *) 0;

    *t++ = 0;
  }
  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    int x[] = {25, 17};
    const int *foo = &x[0];
    ++foo;
  }
  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    typedef const int *iptr;
    iptr p = 0;
    ++p;
  }
  { /* AIX XL C 1.02.0.0 rejects this saying
       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    struct s { int j; const int *ap[3]; };
    struct s *b; b->j = 5;
  }
  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
    const int foo = 10;
  }
#endif

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

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

cat >>confdefs.h <<\_ACEOF
#define const
_ACEOF

fi




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

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

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

#undef $ac_func

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

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

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

else
  case $LIBOBJS in
    "$ac_func.$ac_objext"   | \
  *" $ac_func.$ac_objext"   | \
    "$ac_func.$ac_objext "* | \
  *" $ac_func.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
esac

fi
done



#AC_C_INLINE

#--------------------------------------------------------------------
#  This is a little hokie in that it avoids including config.guess
#  and config.sub in the distribution, but its been working so far.
#  Windows builds don't run configure so we should be safe fixing
#  this to 'unix' (at least for now).
#--------------------------------------------------------------------
#SYSTEM=unix
#AC_SUBST([SYSTEM])

#AC_PROG_CC_WARNINGS

#AC_CONFIG_FILES([Makefile
#                 cgi-fcgi/Makefile
#                 include/Makefile
#                 libfcgi/Makefile
#                 examples/Makefile])

#AC_OUTPUT

fi


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Running system checks${T_ME}" >&5
echo "${ECHO_T}${T_MD}Running system checks${T_ME}" >&6



  echo "$as_me:$LINENO: checking for missing declarations of reentrant functions" >&5
echo $ECHO_N "checking for missing declarations of reentrant functions... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <time.h>
int
main ()
{
struct tm *(*func)() = localtime_r
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    :

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



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


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <time.h>
int
main ()
{
struct tm *(*func)() = gmtime_r
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    :

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



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


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <time.h>
int
main ()
{
char *(*func)() = asctime_r
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    :

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



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


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <time.h>
int
main ()
{
char *(*func)() = ctime_r
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    :

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



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


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <string.h>
int
main ()
{
char *(*func)() = strtok_r
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    :

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



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


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


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

  ;;
esac
fi
PROG_SENDMAIL=$ac_cv_path_PROG_SENDMAIL

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

if test -n "$PROG_SENDMAIL"; then

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

fi


  echo "$as_me:$LINENO: checking whether system uses EBCDIC" >&5
echo $ECHO_N "checking whether system uses EBCDIC... $ECHO_C" >&6
if test "${ac_cv_ebcdic+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

  ac_cv_ebcdic=no

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

int main(void) {
  return (unsigned char)'A' != (unsigned char)0xC1;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  ac_cv_ebcdic=yes

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

( exit $ac_status )

  ac_cv_ebcdic=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_ebcdic" >&5
echo "${ECHO_T}$ac_cv_ebcdic" >&6
  if test "$ac_cv_ebcdic" = "yes"; then

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

  fi

if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
       CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
       LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
test -d /usr/ucblib &&
  if test "/usr/ucblib" != "/usr/lib"; then

  if test -z "/usr/ucblib" || echo "/usr/ucblib" | grep '^/' >/dev/null ; then
    ai_p=/usr/ucblib
  else

    ep_dir="`echo /usr/ucblib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"/usr/ucblib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi






  unset ac_cv_func_socket
  unset ac_cv_func___socket
  unset found

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

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

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

#undef socket

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

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

ac_cv_func_socket=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
echo "${ECHO_T}$ac_cv_func_socket" >&6
if test $ac_cv_func_socket = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __socket" >&5
echo $ECHO_N "checking for __socket... $ECHO_C" >&6
if test "${ac_cv_func___socket+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __socket to an innocuous variant, in case <limits.h> declares __socket.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __socket innocuous___socket

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

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

#undef __socket

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_socket=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lsocket"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case socket in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsocket $LIBS"
   ;;
  esac



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


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

    ac_cv_func_socket=yes
  else

  :

  fi

 ;;

  esac


  unset ac_cv_func_htonl
  unset ac_cv_func___htonl
  unset found

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

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

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

#undef htonl

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

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

ac_cv_func_htonl=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_htonl" >&5
echo "${ECHO_T}$ac_cv_func_htonl" >&6
if test $ac_cv_func_htonl = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __htonl" >&5
echo $ECHO_N "checking for __htonl... $ECHO_C" >&6
if test "${ac_cv_func___htonl+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __htonl to an innocuous variant, in case <limits.h> declares __htonl.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __htonl innocuous___htonl

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

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

#undef __htonl

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_htonl=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lsocket"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case socket in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsocket $LIBS"
   ;;
  esac



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


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

    ac_cv_func_htonl=yes
  else

  :

  fi

 ;;

  esac


  unset ac_cv_func_gethostname
  unset ac_cv_func___gethostname
  unset found

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

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

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

#undef gethostname

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

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

ac_cv_func_gethostname=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gethostname" >&5
echo "${ECHO_T}$ac_cv_func_gethostname" >&6
if test $ac_cv_func_gethostname = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __gethostname" >&5
echo $ECHO_N "checking for __gethostname... $ECHO_C" >&6
if test "${ac_cv_func___gethostname+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __gethostname to an innocuous variant, in case <limits.h> declares __gethostname.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __gethostname innocuous___gethostname

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

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

#undef __gethostname

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_gethostname=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lnsl"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case nsl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnsl $LIBS"
   ;;
  esac



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


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

    ac_cv_func_gethostname=yes
  else

  :

  fi

 ;;

  esac


  unset ac_cv_func_gethostbyaddr
  unset ac_cv_func___gethostbyaddr
  unset found

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

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

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

#undef gethostbyaddr

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

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

ac_cv_func_gethostbyaddr=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyaddr" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyaddr" >&6
if test $ac_cv_func_gethostbyaddr = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __gethostbyaddr" >&5
echo $ECHO_N "checking for __gethostbyaddr... $ECHO_C" >&6
if test "${ac_cv_func___gethostbyaddr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __gethostbyaddr to an innocuous variant, in case <limits.h> declares __gethostbyaddr.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __gethostbyaddr innocuous___gethostbyaddr

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

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

#undef __gethostbyaddr

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_gethostbyaddr=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lnsl"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case nsl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnsl $LIBS"
   ;;
  esac



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


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

    ac_cv_func_gethostbyaddr=yes
  else

  :

  fi

 ;;

  esac


  unset ac_cv_func_yp_get_default_domain
  unset ac_cv_func___yp_get_default_domain
  unset found

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

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

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

#undef yp_get_default_domain

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

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

ac_cv_func_yp_get_default_domain=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_yp_get_default_domain" >&5
echo "${ECHO_T}$ac_cv_func_yp_get_default_domain" >&6
if test $ac_cv_func_yp_get_default_domain = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __yp_get_default_domain" >&5
echo $ECHO_N "checking for __yp_get_default_domain... $ECHO_C" >&6
if test "${ac_cv_func___yp_get_default_domain+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __yp_get_default_domain to an innocuous variant, in case <limits.h> declares __yp_get_default_domain.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __yp_get_default_domain innocuous___yp_get_default_domain

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

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

#undef __yp_get_default_domain

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_yp_get_default_domain=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lnsl"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case nsl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnsl $LIBS"
   ;;
  esac



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


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

    ac_cv_func_yp_get_default_domain=yes
  else

  :

  fi

 ;;

  esac



  unset ac_cv_func_dlopen
  unset ac_cv_func___dlopen
  unset found

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

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

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

#undef dlopen

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

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

ac_cv_func_dlopen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
echo "${ECHO_T}$ac_cv_func_dlopen" >&6
if test $ac_cv_func_dlopen = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __dlopen" >&5
echo $ECHO_N "checking for __dlopen... $ECHO_C" >&6
if test "${ac_cv_func___dlopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __dlopen to an innocuous variant, in case <limits.h> declares __dlopen.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __dlopen innocuous___dlopen

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

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

#undef __dlopen

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_dlopen=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -ldl"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case dl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ldl $LIBS"
   ;;
  esac



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


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

    ac_cv_func_dlopen=yes
  else

  :

  fi

 ;;

  esac

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

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

fi

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

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

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

  LIBS="-lm $LIBS"

fi



  unset ac_cv_func_res_search
  unset ac_cv_func___res_search
  unset found

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

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

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

#undef res_search

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

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

ac_cv_func_res_search=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_res_search" >&5
echo "${ECHO_T}$ac_cv_func_res_search" >&6
if test $ac_cv_func_res_search = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __res_search" >&5
echo $ECHO_N "checking for __res_search... $ECHO_C" >&6
if test "${ac_cv_func___res_search+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __res_search to an innocuous variant, in case <limits.h> declares __res_search.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __res_search innocuous___res_search

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

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

#undef __res_search

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_res_search=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lresolv"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case resolv in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lresolv $LIBS"
   ;;
  esac



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


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

    ac_cv_func_res_search=yes
  else


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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lbind"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case bind in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lbind $LIBS"
   ;;
  esac



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


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

    ac_cv_func_res_search=yes
  else


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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lsocket"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case socket in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsocket $LIBS"
   ;;
  esac



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


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

    ac_cv_func_res_search=yes
  else

  :

  fi


  fi


  fi

 ;;

  esac



  unset ac_cv_func_inet_aton
  unset ac_cv_func___inet_aton
  unset found

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

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

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

#undef inet_aton

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

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

ac_cv_func_inet_aton=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_inet_aton" >&5
echo "${ECHO_T}$ac_cv_func_inet_aton" >&6
if test $ac_cv_func_inet_aton = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __inet_aton" >&5
echo $ECHO_N "checking for __inet_aton... $ECHO_C" >&6
if test "${ac_cv_func___inet_aton+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __inet_aton to an innocuous variant, in case <limits.h> declares __inet_aton.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __inet_aton innocuous___inet_aton

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

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

#undef __inet_aton

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_inet_aton=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lresolv"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case resolv in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lresolv $LIBS"
   ;;
  esac



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


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

    ac_cv_func_inet_aton=yes
  else


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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lbind"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case bind in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lbind $LIBS"
   ;;
  esac



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


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

    ac_cv_func_inet_aton=yes
  else

  :

  fi


  fi

 ;;

  esac


  unset ac_cv_func_dn_skipname
  unset ac_cv_func___dn_skipname
  unset found

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

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

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

#undef dn_skipname

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

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

ac_cv_func_dn_skipname=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_dn_skipname" >&5
echo "${ECHO_T}$ac_cv_func_dn_skipname" >&6
if test $ac_cv_func_dn_skipname = yes; then
  found=yes
else
   echo "$as_me:$LINENO: checking for __dn_skipname" >&5
echo $ECHO_N "checking for __dn_skipname... $ECHO_C" >&6
if test "${ac_cv_func___dn_skipname+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define __dn_skipname to an innocuous variant, in case <limits.h> declares __dn_skipname.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define __dn_skipname innocuous___dn_skipname

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

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

#undef __dn_skipname

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

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

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

fi


  case $found in
  yes)

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

    ac_cv_func_dn_skipname=yes
  ;;

    *)

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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lresolv"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case resolv in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lresolv $LIBS"
   ;;
  esac



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


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

    ac_cv_func_dn_skipname=yes
  else


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

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

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

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

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

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


fi


  if test "$found" = "yes"; then
    ac_libs=$LIBS
    LIBS="$LIBS -lbind"
    if test "$cross_compiling" = yes; then
  found=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
main() { return (0); }
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  found=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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


  case bind in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lbind $LIBS"
   ;;
  esac



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


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

    ac_cv_func_dn_skipname=yes
  else

  :

  fi


  fi

 ;;

  esac




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

int
main ()
{

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

ac_cv_header_stdc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

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

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

fi

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

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

fi

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

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

( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then

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

fi






ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <$ac_hdr>

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

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

ac_header_dirent=$ac_hdr; break
fi

done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
  echo "$as_me:$LINENO: checking for library containing opendir" >&5
echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
if test "${ac_cv_search_opendir+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
  for ac_lib in dir; do
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
  done
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
echo "${ECHO_T}$ac_cv_search_opendir" >&6
if test "$ac_cv_search_opendir" != no; then
  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"

fi

else
  echo "$as_me:$LINENO: checking for library containing opendir" >&5
echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
if test "${ac_cv_search_opendir+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_func_search_save_LIBS=$LIBS
ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
if test "$ac_cv_search_opendir" = no; then
  for ac_lib in x; do
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

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

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
  done
fi
LIBS=$ac_func_search_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
echo "${ECHO_T}$ac_cv_search_opendir" >&6
if test "$ac_cv_search_opendir" != no; then
  test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"

fi

fi



  echo "$as_me:$LINENO: checking for fclose declaration" >&5
echo $ECHO_N "checking for fclose declaration... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
int
main ()
{
int (*func)() = fclose
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then


cat >>confdefs.h <<\_ACEOF
#define MISSING_FCLOSE_DECL 0
_ACEOF

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

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



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

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

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


















































for ac_header in  \
inttypes.h \
stdint.h \
dirent.h \
ApplicationServices/ApplicationServices.h \
sys/param.h \
sys/types.h \
sys/time.h \
netinet/in.h \
alloca.h \
arpa/inet.h \
arpa/nameser.h \
assert.h \
crypt.h \
fcntl.h \
grp.h \
ieeefp.h \
langinfo.h \
limits.h \
locale.h \
monetary.h \
mach-o/dyld.h \
netdb.h \
pwd.h \
resolv.h \
signal.h \
stdarg.h \
stdlib.h \
string.h \
syslog.h \
sysexits.h \
sys/file.h \
sys/mman.h \
sys/mount.h \
sys/poll.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/vfs.h \
sys/sysexits.h \
sys/varargs.h \
sys/wait.h \
unistd.h \
unix.h \
utime.h \
sys/utsname.h \
sys/ipc.h \
dlfcn.h

do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif


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

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

fi

done



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

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

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

#undef fopencookie

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

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

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


	if test "$have_glibc_fopencookie" = "yes" ; then
	  	            		  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
 #define _GNU_SOURCE
                       #include <stdio.h>

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


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

      if test "$have_cookie_io_functions_t" = "yes" ; then
        cookie_io_functions_t=cookie_io_functions_t
        have_fopen_cookie=yes


		if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#define _GNU_SOURCE
#include <stdio.h>

struct cookiedata {
	__off64_t pos;
};

__ssize_t reader(void *cookie, char *buffer, size_t size)
{ return size; }
__ssize_t writer(void *cookie, const char *buffer, size_t size)
{ return size; }
int closer(void *cookie)
{ return 0; }
int seeker(void *cookie, __off64_t *position, int whence)
{ ((struct cookiedata*)cookie)->pos = *position; return 0; }

cookie_io_functions_t funcs = {reader, writer, seeker, closer};

main() {
  struct cookiedata g = { 0 };
  FILE *fp = fopencookie(&g, "r", funcs);

  if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
	  exit(0);
  exit(1);
}


_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
   cookie_io_functions_use_off64_t=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

      else
  	            		    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
 #define _GNU_SOURCE
                       #include <stdio.h>

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


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
		    if test "$have_cookie_io_functions_t" = "yes" ; then
              cookie_io_functions_t=_IO_cookie_io_functions_t
              have_fopen_cookie=yes
		    fi
      fi

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

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


cat >>confdefs.h <<_ACEOF
#define COOKIE_IO_FUNCTIONS_T $cookie_io_functions_t
_ACEOF

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

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

		fi
      fi

  	fi


  echo "$as_me:$LINENO: checking for broken getcwd" >&5
echo $ECHO_N "checking for broken getcwd... $ECHO_C" >&6
  os=`uname -sr 2>/dev/null`
  case $os in
    SunOS*)

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

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


  echo "$as_me:$LINENO: checking for broken libc stdio" >&5
echo $ECHO_N "checking for broken libc stdio... $ECHO_C" >&6
  if test "${have_broken_glibc_fopen_append+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <features.h>

int
main ()
{

#if !__GLIBC_PREREQ(2,2)
choke me
#endif

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

have_broken_glibc_fopen_append=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

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

#include <stdio.h>
int main(int argc, char *argv[])
{
  FILE *fp;
  long position;
  char *filename = "/tmp/phpglibccheck";

  fp = fopen(filename, "w");
  if (fp == NULL) {
	  perror("fopen");
	  exit(2);
  }
  fputs("foobar", fp);
  fclose(fp);

  fp = fopen(filename, "a+");
  position = ftell(fp);
  fclose(fp);
  unlink(filename);
  if (position == 0)
	return 1;
  return 0;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  have_broken_glibc_fopen_append=no
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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


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

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

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



echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
if test "${ac_cv_struct_tm+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <time.h>

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

ac_cv_struct_tm=sys/time.h
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
echo "${ECHO_T}$ac_cv_struct_tm" >&6
if test $ac_cv_struct_tm = sys/time.h; then

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

fi

echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6
if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <$ac_cv_struct_tm>


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

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <$ac_cv_struct_tm>


int
main ()
{
static struct tm ac_aggr;
if (sizeof ac_aggr.tm_zone)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_tm_tm_zone=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_TM_TM_ZONE 1
_ACEOF


fi

if test "$ac_cv_member_struct_tm_tm_zone" = yes; then

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

else
  echo "$as_me:$LINENO: checking for tzname" >&5
echo $ECHO_N "checking for tzname... $ECHO_C" >&6
if test "${ac_cv_var_tzname+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <time.h>
#ifndef tzname /* For SGI.  */
extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
#endif

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

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

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

  fi
fi



echo "$as_me:$LINENO: checking for tm_gmtoff in struct tm" >&5
echo $ECHO_N "checking for tm_gmtoff in struct tm... $ECHO_C" >&6
if test "${ac_cv_struct_tm_gmtoff+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <$ac_cv_struct_tm>
int
main ()
{
struct tm tm; tm.tm_gmtoff;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_struct_tm_gmtoff=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_struct_tm_gmtoff=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_struct_tm_gmtoff" >&5
echo "${ECHO_T}$ac_cv_struct_tm_gmtoff" >&6

if test "$ac_cv_struct_tm_gmtoff" = yes; then

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

fi


echo "$as_me:$LINENO: checking for struct flock" >&5
echo $ECHO_N "checking for struct flock... $ECHO_C" >&6
if test "${ac_cv_struct_flock+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <unistd.h>
#include <fcntl.h>

int
main ()
{
struct flock x;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

          ac_cv_struct_flock=yes

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


          ac_cv_struct_flock=no

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

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

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

fi


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

#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{

socklen_t x;

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

  ac_cv_socklen_t=yes

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


  ac_cv_socklen_t=no

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

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

fi


echo "$as_me:$LINENO: checking for intmax_t" >&5
echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
if test "${ac_cv_type_intmax_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((intmax_t *) 0)
  return 0;
if (sizeof (intmax_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_intmax_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_intmax_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
echo "${ECHO_T}$ac_cv_type_intmax_t" >&6

echo "$as_me:$LINENO: checking size of intmax_t" >&5
echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6
if test "${ac_cv_sizeof_intmax_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_intmax_t" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (intmax_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_intmax_t=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (intmax_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (intmax_t)); }
unsigned long ulongval () { return (long) (sizeof (intmax_t)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (intmax_t))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (intmax_t))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (intmax_t))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_intmax_t=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (intmax_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_intmax_t=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5
echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
_ACEOF


echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_size_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6

echo "$as_me:$LINENO: checking size of size_t" >&5
echo $ECHO_N "checking size of size_t... $ECHO_C" >&6
if test "${ac_cv_sizeof_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_size_t" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (size_t))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (size_t))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (size_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_size_t=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (size_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (size_t)); }
unsigned long ulongval () { return (long) (sizeof (size_t)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (size_t))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (size_t))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (size_t))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_size_t=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (size_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_size_t=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
_ACEOF


echo "$as_me:$LINENO: checking for ssize_t" >&5
echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
if test "${ac_cv_type_ssize_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((ssize_t *) 0)
  return 0;
if (sizeof (ssize_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_ssize_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_ssize_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
echo "${ECHO_T}$ac_cv_type_ssize_t" >&6

echo "$as_me:$LINENO: checking size of ssize_t" >&5
echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6
if test "${ac_cv_sizeof_ssize_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_ssize_t" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ssize_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_ssize_t=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (ssize_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (ssize_t)); }
unsigned long ulongval () { return (long) (sizeof (ssize_t)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (ssize_t))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (ssize_t))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (ssize_t))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_ssize_t=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (ssize_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_ssize_t=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5
echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
_ACEOF


echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6
if test "${ac_cv_type_ptrdiff_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((ptrdiff_t *) 0)
  return 0;
if (sizeof (ptrdiff_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_ptrdiff_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_ptrdiff_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6

echo "$as_me:$LINENO: checking size of ptrdiff_t" >&5
echo $ECHO_N "checking size of ptrdiff_t... $ECHO_C" >&6
if test "${ac_cv_sizeof_ptrdiff_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_ptrdiff_t" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (ptrdiff_t))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_ptrdiff_t=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (ptrdiff_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (ptrdiff_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (ptrdiff_t)); }
unsigned long ulongval () { return (long) (sizeof (ptrdiff_t)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (ptrdiff_t))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (ptrdiff_t))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (ptrdiff_t))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_ptrdiff_t=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (ptrdiff_t), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (ptrdiff_t), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_ptrdiff_t=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_ptrdiff_t" >&5
echo "${ECHO_T}$ac_cv_sizeof_ptrdiff_t" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t
_ACEOF


echo "$as_me:$LINENO: checking for long long" >&5
echo $ECHO_N "checking for long long... $ECHO_C" >&6
if test "${ac_cv_type_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long long *) 0)
  return 0;
if (sizeof (long long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
echo "${ECHO_T}$ac_cv_type_long_long" >&6

echo "$as_me:$LINENO: checking size of long long" >&5
echo $ECHO_N "checking size of long long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long long)); }
unsigned long ulongval () { return (long) (sizeof (long long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
_ACEOF


echo "$as_me:$LINENO: checking for long long int" >&5
echo $ECHO_N "checking for long long int... $ECHO_C" >&6
if test "${ac_cv_type_long_long_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long long int *) 0)
  return 0;
if (sizeof (long long int))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long_long_int=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long_long_int=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
echo "${ECHO_T}$ac_cv_type_long_long_int" >&6

echo "$as_me:$LINENO: checking size of long long int" >&5
echo $ECHO_N "checking size of long long int... $ECHO_C" >&6
if test "${ac_cv_sizeof_long_long_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long_long_int" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long int))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long_int=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long long int)); }
unsigned long ulongval () { return (long) (sizeof (long long int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long long int))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long long int))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long long int))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long_long_int=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long_long_int=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long_int" >&5
echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
_ACEOF


echo "$as_me:$LINENO: checking for long" >&5
echo $ECHO_N "checking for long... $ECHO_C" >&6
if test "${ac_cv_type_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long *) 0)
  return 0;
if (sizeof (long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
echo "${ECHO_T}$ac_cv_type_long" >&6

echo "$as_me:$LINENO: checking size of long" >&5
echo $ECHO_N "checking size of long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long)); }
unsigned long ulongval () { return (long) (sizeof (long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


echo "$as_me:$LINENO: checking for int" >&5
echo $ECHO_N "checking for int... $ECHO_C" >&6
if test "${ac_cv_type_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((int *) 0)
  return 0;
if (sizeof (int))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_int=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_int=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
echo "${ECHO_T}$ac_cv_type_int" >&6

echo "$as_me:$LINENO: checking size of int" >&5
echo $ECHO_N "checking size of int... $ECHO_C" >&6
if test "${ac_cv_sizeof_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_int" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
test_array [0] = 0

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

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

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

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (int)); }
unsigned long ulongval () { return (long) (sizeof (int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (int))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_int=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_int=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
echo "${ECHO_T}$ac_cv_sizeof_int" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF




echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_blksize)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_blksize=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_blksize)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_blksize=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
_ACEOF


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

fi


if test "`uname -s 2>/dev/null`" != "QNX"; then
  echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5
echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6
if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_blocks)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_blocks=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_blocks)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_blocks=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
_ACEOF


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

else
  case $LIBOBJS in
    "fileblocks.$ac_objext"   | \
  *" fileblocks.$ac_objext"   | \
    "fileblocks.$ac_objext "* | \
  *" fileblocks.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;;
esac

fi


else
  { echo "$as_me:$LINENO: WARNING: warnings level for cc set to 0" >&5
echo "$as_me: WARNING: warnings level for cc set to 0" >&2;}
  WARNING_LEVEL=0
fi

echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6
if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (ac_aggr.st_rdev)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_rdev=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static struct stat ac_aggr;
if (sizeof ac_aggr.st_rdev)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_member_struct_stat_st_rdev=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STAT_ST_RDEV 1
_ACEOF


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

fi



echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

cat >>confdefs.h <<_ACEOF
#define size_t unsigned
_ACEOF

fi

echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
if test "${ac_cv_type_uid_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>

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

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

cat >>confdefs.h <<\_ACEOF
#define uid_t int
_ACEOF


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

fi


echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
if test "${ac_cv_sockaddr_storage+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
 #include <sys/types.h>
#include <sys/socket.h>
int
main ()
{
struct sockaddr_storage s; s
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sockaddr_storage=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

fi


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

#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
static struct sockaddr sa; int n = (int) sa.sa_len; return n
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

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

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

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

echo "$as_me:$LINENO: checking for IPv6 support" >&5
echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6
if test "${ac_cv_ipv6_support+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
 #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main ()
{
struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ipv6_support=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_ipv6_support=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_ipv6_support" >&5
echo "${ECHO_T}$ac_cv_ipv6_support" >&6





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

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

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

#undef $ac_func

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

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

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

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

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

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

#undef _doprnt

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

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

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

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

fi

fi
done



































































for ac_func in alphasort \
asctime_r \
chroot \
ctime_r \
cuserid \
crypt \
flock \
ftok \
funopen \
gai_strerror \
gcvt \
getlogin \
getprotobyname \
getprotobynumber \
getservbyname \
getservbyport \
getrusage \
gettimeofday \
gmtime_r \
isascii \
link \
localtime_r \
lockf \
lrand48 \
memcpy \
memmove \
mkstemp \
mmap \
nl_langinfo \
perror \
poll \
putenv \
realpath \
random \
rand_r \
regcomp \
res_search \
scandir \
setitimer \
setlocale \
localeconv \
setsockopt \
setvbuf \
shutdown \
sin \
snprintf \
srand48 \
srandom \
statfs \
statvfs \
std_syslog \
strcasecmp \
strcoll \
strdup \
strerror \
strftime \
strstr \
strtok_r \
symlink \
tempnam \
tzset \
unsetenv \
usleep \
utime \
vsnprintf \

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

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

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

#undef $ac_func

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

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

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

fi
done


echo "$as_me:$LINENO: checking for getaddrinfo" >&5
echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6
if test "${ac_cv_func_getaddrinfo+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <netdb.h>
int
main ()
{
struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <netdb.h>
#include <sys/types.h>
#ifndef AF_INET
# include <sys/socket.h>
#endif
int main(void) {
  struct addrinfo *ai, *pai, hints;

  memset(&hints, 0, sizeof(hints));
  hints.ai_flags = AI_NUMERICHOST;

  if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
    exit(1);
  }

  if (ai == 0) {
    exit(1);
  }

  pai = ai;

  while (pai) {
    if (pai->ai_family != AF_INET) {
      /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
      exit(1);
    }
    if (pai->ai_addr->sa_family != AF_INET) {
      /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
      exit(1);
    }
    pai = pai->ai_next;
  }
  freeaddrinfo(ai);
  exit(0);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_getaddrinfo=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_func_getaddrinfo=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

fi




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

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

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

#undef $ac_func

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

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

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

else
  case $LIBOBJS in
    "$ac_func.$ac_objext"   | \
  *" $ac_func.$ac_objext"   | \
    "$ac_func.$ac_objext "* | \
  *" $ac_func.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
esac

fi
done


echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5
echo $ECHO_N "checking whether utime accepts a null argument... $ECHO_C" >&6
if test "${ac_cv_func_utime_null+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  rm -f conftest.data; >conftest.data
# Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
if test "$cross_compiling" = yes; then
  ac_cv_func_utime_null=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
struct stat s, t;
  exit (!(stat ("conftest.data", &s) == 0
	  && utime ("conftest.data", (long *)0) == 0
	  && stat ("conftest.data", &t) == 0
	  && t.st_mtime >= s.st_mtime
	  && t.st_mtime - s.st_mtime < 120));
  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_utime_null=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_func_utime_null=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f core *.core
fi
echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5
echo "${ECHO_T}$ac_cv_func_utime_null" >&6
if test $ac_cv_func_utime_null = yes; then

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

fi
rm -f conftest.data

# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo "$as_me:$LINENO: checking for working alloca.h" >&5
echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
if test "${ac_cv_working_alloca_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <alloca.h>
int
main ()
{
char *p = (char *) alloca (2 * sizeof (int));
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_working_alloca_h=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

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

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

fi

echo "$as_me:$LINENO: checking for alloca" >&5
echo $ECHO_N "checking for alloca... $ECHO_C" >&6
if test "${ac_cv_func_alloca_works+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

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

ac_cv_func_alloca_works=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
echo "${ECHO_T}$ac_cv_func_alloca_works" >&6

if test $ac_cv_func_alloca_works = yes; then

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

else
  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble.  Some versions do not even contain alloca or
# contain a buggy version.  If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.

ALLOCA=alloca.$ac_objext

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


echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
if test "${ac_cv_os_cray+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

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

fi
echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
echo "${ECHO_T}$ac_cv_os_cray" >&6
if test $ac_cv_os_cray = yes; then
  for ac_func in _getb67 GETB67 getb67; do
    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

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

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

#undef $ac_func

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

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

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then

cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
_ACEOF

    break
fi

  done
fi

echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
if test "${ac_cv_c_stack_direction+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
int
find_stack_direction ()
{
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
    {
      addr = &dummy;
      return find_stack_direction ();
    }
  else
    return (&dummy > addr) ? 1 : -1;
}

int
main ()
{
  exit (find_stack_direction () < 0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_stack_direction=1
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_c_stack_direction=-1
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
echo "${ECHO_T}$ac_cv_c_stack_direction" >&6

cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
_ACEOF


fi


  echo "$as_me:$LINENO: checking for declared timezone" >&5
echo $ECHO_N "checking for declared timezone... $ECHO_C" >&6
if test "${ac_cv_declared_timezone+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

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

#include <sys/types.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif

int
main ()
{

    time_t foo = (time_t) timezone;

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

  ac_cv_declared_timezone=yes

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


  ac_cv_declared_timezone=no

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

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

  fi


echo "$as_me:$LINENO: checking for type of reentrant time-related functions" >&5
echo $ECHO_N "checking for type of reentrant time-related functions... $ECHO_C" >&6
if test "${ac_cv_time_r_type+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

if test "$cross_compiling" = yes; then

  ac_cv_time_r_type=POSIX

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

#include <time.h>

main() {
char buf[27];
struct tm t;
time_t old = 0;
int r, s;

s = gmtime_r(&old, &t);
r = (int) asctime_r(&t, buf, 26);
if (r == s && s == 0) return (0);
return (1);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  ac_cv_time_r_type=hpux

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

( exit $ac_status )

  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <time.h>
main() {
  struct tm t, *s;
  time_t old = 0;
  char buf[27], *p;

  s = gmtime_r(&old, &t);
  p = asctime_r(&t, buf, 26);
  if (p == buf && s == &t) return (0);
  return (1);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_time_r_type=irix

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

( exit $ac_status )

    ac_cv_time_r_type=POSIX

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_time_r_type" >&5
echo "${ECHO_T}$ac_cv_time_r_type" >&6
  case $ac_cv_time_r_type in
  hpux)
cat >>confdefs.h <<\_ACEOF
#define PHP_HPUX_TIME_R 1
_ACEOF
 ;;
  irix)
cat >>confdefs.h <<\_ACEOF
#define PHP_IRIX_TIME_R 1
_ACEOF
 ;;
  esac


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

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

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

#undef readdir_r

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

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

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

  if test "$ac_cv_func_readdir_r" = "yes"; then
  echo "$as_me:$LINENO: checking for type of readdir_r" >&5
echo $ECHO_N "checking for type of readdir_r... $ECHO_C" >&6
if test "${ac_cv_what_readdir_r+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

    if test "$cross_compiling" = yes; then

      ac_cv_what_readdir_r=none

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

#define _REENTRANT
#include <sys/types.h>
#include <dirent.h>

#ifndef PATH_MAX
#define PATH_MAX 1024
#endif

main() {
	DIR *dir;
	char entry[sizeof(struct dirent)+PATH_MAX];
	struct dirent *pentry = (struct dirent *) &entry;

	dir = opendir("/");
	if (!dir)
		exit(1);
	if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
		exit(0);
	exit(1);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_what_readdir_r=POSIX

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

( exit $ac_status )

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

#define _REENTRANT
#include <sys/types.h>
#include <dirent.h>
int readdir_r(DIR *, struct dirent *);

_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then

          ac_cv_what_readdir_r=old-style

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


          ac_cv_what_readdir_r=none

fi
rm -f conftest.err conftest.$ac_ext

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_what_readdir_r" >&5
echo "${ECHO_T}$ac_cv_what_readdir_r" >&6
    case $ac_cv_what_readdir_r in
    POSIX)

cat >>confdefs.h <<\_ACEOF
#define HAVE_POSIX_READDIR_R 1
_ACEOF
;;
    old-style)

cat >>confdefs.h <<\_ACEOF
#define HAVE_OLD_READDIR_R 1
_ACEOF
;;
    esac
  fi


if eval "test \"\${ac_cv_type_$1+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "in_addr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  ac_cv_type_in_addr_t=yes
else
  ac_cv_type_in_addr_t=no
fi
rm -f conftest*

fi

if test $ac_cv_type_in_addr_t = no; then

cat >>confdefs.h <<\_ACEOF
#define in_addr_t u_int
_ACEOF

fi




  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}General settings${T_ME}" >&5
echo "${ECHO_T}${T_MD}General settings${T_ME}" >&6



# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;




echo "$as_me:$LINENO: checking whether to include debugging symbols" >&5
echo $ECHO_N "checking whether to include debugging symbols... $ECHO_C" >&6
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  PHP_DEBUG=$enableval
else

  PHP_DEBUG=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_DEBUG=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_DEBUG
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DEBUG" = "yes"; then
  PHP_DEBUG=1
  ZEND_DEBUG=yes
else
  PHP_DEBUG=0
  ZEND_DEBUG=no
fi



echo "$as_me:$LINENO: checking layout of installed files" >&5
echo $ECHO_N "checking layout of installed files... $ECHO_C" >&6

# Check whether --with-layout or --without-layout was given.
if test "${with_layout+set}" = set; then
  withval="$with_layout"
  PHP_LAYOUT=$withval
else

  PHP_LAYOUT=PHP

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_LAYOUT=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_LAYOUT
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




case $PHP_LAYOUT in
  GNU)
    oldstyleextdir=no
    ;;
  *)
    oldstyleextdir=yes
    ;;
esac



echo "$as_me:$LINENO: checking path to configuration file" >&5
echo $ECHO_N "checking path to configuration file... $ECHO_C" >&6

# Check whether --with-config-file-path or --without-config-file-path was given.
if test "${with_config_file_path+set}" = set; then
  withval="$with_config_file_path"
  PHP_CONFIG_FILE_PATH=$withval
else

  PHP_CONFIG_FILE_PATH=DEFAULT

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_CONFIG_FILE_PATH=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_CONFIG_FILE_PATH
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
  case $PHP_LAYOUT in
    GNU)
      PHP_CONFIG_FILE_PATH=$sysconfdir
      ;;
    *)
      PHP_CONFIG_FILE_PATH=$libdir
      ;;
  esac
fi



echo "$as_me:$LINENO: checking directory to be scanned for configuration files" >&5
echo $ECHO_N "checking directory to be scanned for configuration files... $ECHO_C" >&6

# Check whether --with-config-file-scan-dir or --without-config-file-scan-dir was given.
if test "${with_config_file_scan_dir+set}" = set; then
  withval="$with_config_file_scan_dir"
  PHP_CONFIG_FILE_SCAN_DIR=$withval
else

  PHP_CONFIG_FILE_SCAN_DIR=DEFAULT

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_CONFIG_FILE_SCAN_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_CONFIG_FILE_SCAN_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
	PHP_CONFIG_FILE_SCAN_DIR=""
fi

test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"



echo "$as_me:$LINENO: checking whether to enable safe mode by default" >&5
echo $ECHO_N "checking whether to enable safe mode by default... $ECHO_C" >&6
# Check whether --enable-safe-mode or --disable-safe-mode was given.
if test "${enable_safe_mode+set}" = set; then
  enableval="$enable_safe_mode"
  PHP_SAFE_MODE=$enableval
else

  PHP_SAFE_MODE=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_SAFE_MODE=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_SAFE_MODE
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

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

else

cat >>confdefs.h <<\_ACEOF
#define PHP_SAFE_MODE 0
_ACEOF

fi

echo "$as_me:$LINENO: checking for safe mode exec dir" >&5
echo $ECHO_N "checking for safe mode exec dir... $ECHO_C" >&6

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

  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
_ACEOF

      echo "$as_me:$LINENO: result: /usr/local/php/bin" >&5
echo "${ECHO_T}/usr/local/php/bin" >&6
    else

cat >>confdefs.h <<_ACEOF
#define PHP_SAFE_MODE_EXEC_DIR "$withval"
_ACEOF

      echo "$as_me:$LINENO: result: $withval" >&5
echo "${ECHO_T}$withval" >&6
    fi
  else

cat >>confdefs.h <<\_ACEOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
_ACEOF

    echo "$as_me:$LINENO: result: /usr/local/php/bin" >&5
echo "${ECHO_T}/usr/local/php/bin" >&6
  fi

else


cat >>confdefs.h <<\_ACEOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
_ACEOF

  echo "$as_me:$LINENO: result: /usr/local/php/bin" >&5
echo "${ECHO_T}/usr/local/php/bin" >&6

fi;



echo "$as_me:$LINENO: checking whether to enable PHP's own SIGCHLD handler" >&5
echo $ECHO_N "checking whether to enable PHP's own SIGCHLD handler... $ECHO_C" >&6
# Check whether --enable-sigchild or --disable-sigchild was given.
if test "${enable_sigchild+set}" = set; then
  enableval="$enable_sigchild"
  PHP_SIGCHILD=$enableval
else

  PHP_SIGCHILD=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_SIGCHILD=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_SIGCHILD
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

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

else

cat >>confdefs.h <<\_ACEOF
#define PHP_SIGCHILD 0
_ACEOF

fi



echo "$as_me:$LINENO: checking whether to enable magic quotes by default" >&5
echo $ECHO_N "checking whether to enable magic quotes by default... $ECHO_C" >&6
# Check whether --enable-magic-quotes or --disable-magic-quotes was given.
if test "${enable_magic_quotes+set}" = set; then
  enableval="$enable_magic_quotes"
  PHP_MAGIC_QUOTES=$enableval
else

  PHP_MAGIC_QUOTES=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_MAGIC_QUOTES=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_MAGIC_QUOTES
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

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

else

cat >>confdefs.h <<\_ACEOF
#define MAGIC_QUOTES 0
_ACEOF

fi



echo "$as_me:$LINENO: checking whether to enable runpaths" >&5
echo $ECHO_N "checking whether to enable runpaths... $ECHO_C" >&6
# Check whether --enable-rpath or --disable-rpath was given.
if test "${enable_rpath+set}" = set; then
  enableval="$enable_rpath"
  PHP_RPATH=$enableval
else

  PHP_RPATH=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_RPATH=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_RPATH
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking whether to explicitly link against libgcc" >&5
echo $ECHO_N "checking whether to explicitly link against libgcc... $ECHO_C" >&6
# Check whether --enable-libgcc or --disable-libgcc was given.
if test "${enable_libgcc+set}" = set; then
  enableval="$enable_libgcc"
  PHP_LIBGCC=$enableval
else

  PHP_LIBGCC=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_LIBGCC=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_LIBGCC
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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


  libgcc_libpath=`gcc --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'`


  if test -z "$libgcc_libpath"; then
    { { echo "$as_me:$LINENO: error: Cannot locate libgcc. Make sure that gcc is in your path" >&5
echo "$as_me: error: Cannot locate libgcc. Make sure that gcc is in your path" >&2;}
   { (exit 1); exit 1; }; }
  fi

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

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

    ep_dir="`echo $libgcc_libpath|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$libgcc_libpath\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi



  case gcc in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lgcc"
   ;;
  esac


fi



echo "$as_me:$LINENO: checking whether to enable short tags by default" >&5
echo $ECHO_N "checking whether to enable short tags by default... $ECHO_C" >&6
# Check whether --enable-short-tags or --disable-short-tags was given.
if test "${enable_short_tags+set}" = set; then
  enableval="$enable_short_tags"
  PHP_SHORT_TAGS=$enableval
else

  PHP_SHORT_TAGS=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_SHORT_TAGS=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_SHORT_TAGS
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

cat >>confdefs.h <<\_ACEOF
#define DEFAULT_SHORT_OPEN_TAG "1"
_ACEOF

else

cat >>confdefs.h <<\_ACEOF
#define DEFAULT_SHORT_OPEN_TAG "0"
_ACEOF

fi



echo "$as_me:$LINENO: checking whether to enable dmalloc" >&5
echo $ECHO_N "checking whether to enable dmalloc... $ECHO_C" >&6
# Check whether --enable-dmalloc or --disable-dmalloc was given.
if test "${enable_dmalloc+set}" = set; then
  enableval="$enable_dmalloc"
  PHP_DMALLOC=$enableval
else

  PHP_DMALLOC=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_DMALLOC=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_DMALLOC
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

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

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

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



  case dmalloc in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ldmalloc $LIBS"
   ;;
  esac



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

    CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"

else

    { { echo "$as_me:$LINENO: error: Problem with enabling dmalloc. Please check config.log for details." >&5
echo "$as_me: error: Problem with enabling dmalloc. Please check config.log for details." >&2;}
   { (exit 1); exit 1; }; }

fi

fi



echo "$as_me:$LINENO: checking whether to enable IPv6 support" >&5
echo $ECHO_N "checking whether to enable IPv6 support... $ECHO_C" >&6
# Check whether --enable-ipv6 or --disable-ipv6 was given.
if test "${enable_ipv6+set}" = set; then
  enableval="$enable_ipv6"
  PHP_IPV6=$enableval
else

  PHP_IPV6=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_IPV6=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_IPV6
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then

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

fi

echo "$as_me:$LINENO: checking whether to enable versioning" >&5
echo $ECHO_N "checking whether to enable versioning... $ECHO_C" >&6
# Check whether --enable-versioning or --disable-versioning was given.
if test "${enable_versioning+set}" = set; then
  enableval="$enable_versioning"

  if test "x$APXS" != "x"; then
    PHP_VERSIONING=$enableval
  else
    PHP_VERSIONING=no
  fi

else

  PHP_VERSIONING=no

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


# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;



  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring extensions${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring extensions${T_ME}" >&6



# Check whether --enable-all or --disable-all was given.
if test "${enable_all+set}" = set; then
  enableval="$enable_all"

  PHP_ENABLE_ALL=$enableval

fi;

# reading config stubs



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

# Check whether --with-openssl or --without-openssl was given.
if test "${with_openssl+set}" = set; then
  withval="$with_openssl"
  PHP_OPENSSL=$withval
else

  PHP_OPENSSL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_OPENSSL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_OPENSSL in
shared,*)
  PHP_OPENSSL=`echo "$PHP_OPENSSL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_OPENSSL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



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






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

# Check whether --with-kerberos or --without-kerberos was given.
if test "${with_kerberos+set}" = set; then
  withval="$with_kerberos"
  PHP_KERBEROS=$withval
else

  PHP_KERBEROS=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_KERBEROS=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_KERBEROS
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




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

  ext_builddir=ext/openssl
  ext_srcdir=$abs_srcdir/ext/openssl

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/openssl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/openssl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/openssl/"; ac_bdir="ext/openssl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in openssl.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC openssl"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC openssl"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/openssl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/openssl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/openssl/"; ac_bdir="ext/openssl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in openssl.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_openssl="$shared_objects_openssl $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_openssl) $(PHPOPENSSL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_openssl) -L$(top_builddir)/netware -lphp4lib $(OPENSSL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_openssl) $(PHPOPENSSL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpopenssl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_openssl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpopenssl.$suffix: $ext_builddir/phpopenssl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpopenssl.$suffix \$(phplibdir)

$ext_builddir/phpopenssl.$suffix: \$(shared_objects_openssl) \$(PHPOPENSSL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_openssl) $(OPENSSL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_openssl) -L$(top_builddir)/netware -lphp4lib $(NSSL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_openssl) $(OPENSSL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/openssl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_openssl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/openssl.$suffix: $ext_builddir/openssl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/openssl.$suffix \$(phplibdir)

$ext_builddir/openssl.$suffix: \$(shared_objects_openssl) \$(OPENSSL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_OPENSSL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/openssl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/openssl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/openssl/"; ac_bdir="ext/openssl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in openssl.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC openssl"
    else


  case ext/openssl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/openssl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/openssl/"; ac_bdir="ext/openssl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in openssl.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC openssl"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST OPENSSL_SHARED_LIBADD"


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

  found_kerberos=no
  unset KERBEROS_CFLAGS
  unset KERBEROS_LIBS

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

  test -z "$ac_cv_path_KRB5_CONFIG" && ac_cv_path_KRB5_CONFIG="no"
  ;;
esac
fi
KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG

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

  fi

    if test "$PHP_KERBEROS" = "yes" && test -x "$KRB5_CONFIG"; then
    KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
    KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`

    if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then
      found_kerberos=yes

  for ac_i in $KERBEROS_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

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

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OPENSSL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $KERBEROS_CFLAGS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_kerberos" = "no"; then

    if test "$PHP_KERBEROS" = "yes"; then
      PHP_KERBEROS="/usr/kerberos /usr/local /usr"
    fi

    for i in $PHP_KERBEROS; do
      if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
        PHP_KERBEROS_DIR=$i
        break
      fi
    done

    if test "$PHP_KERBEROS_DIR"; then
      found_kerberos=yes

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

  if test -z "$PHP_KERBEROS_DIR/lib" || echo "$PHP_KERBEROS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_KERBEROS_DIR/lib
  else

    ep_dir="`echo $PHP_KERBEROS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_KERBEROS_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OPENSSL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi



  case gssapi_krb5 in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -lgssapi_krb5"
    else


  case gssapi_krb5 in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lgssapi_krb5"
   ;;
  esac


    fi
   ;;
  esac




  case krb5 in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -lkrb5"
    else


  case krb5 in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lkrb5"
   ;;
  esac


    fi
   ;;
  esac




  case k5crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -lk5crypto"
    else


  case k5crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lk5crypto"
   ;;
  esac


    fi
   ;;
  esac




  case com_err in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -lcom_err"
    else


  case com_err in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lcom_err"
   ;;
  esac


    fi
   ;;
  esac



  if test "$PHP_KERBEROS_DIR/include" != "/usr/include"; then

  if test -z "$PHP_KERBEROS_DIR/include" || echo "$PHP_KERBEROS_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$PHP_KERBEROS_DIR/include
  else

    ep_dir="`echo $PHP_KERBEROS_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_KERBEROS_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi
  fi

  if test "$found_kerberos" = "yes"; then
:

  fi

  fi


  found_openssl=no
  unset OPENSSL_INCDIR
  unset OPENSSL_LIBDIR

    test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
  test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no

    if test "$PHP_OPENSSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_OPENSSL
  elif test "$PHP_IMAP_SSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_IMAP_SSL
  fi

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

  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG

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

  fi

    if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
    if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
      found_openssl=yes
      OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
      OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
      OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
    else
      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then

  for ac_i in $OPENSSL_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$OPENSSL_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

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

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OPENSSL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $OPENSSL_INCS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_openssl" = "no"; then

    if test "$PHP_OPENSSL_DIR" = "yes"; then
      PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
    fi

    for i in $PHP_OPENSSL_DIR; do
      if test -r $i/include/openssl/evp.h; then
        OPENSSL_INCDIR=$i/include
      fi
      if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
        OPENSSL_LIBDIR=$i/lib
      fi
      test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
    done

    if test -z "$OPENSSL_INCDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's <evp.h>" >&5
echo "$as_me: error: Cannot find OpenSSL's <evp.h>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -z "$OPENSSL_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's libraries" >&5
echo "$as_me: error: Cannot find OpenSSL's libraries" >&2;}
   { (exit 1); exit 1; }; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$OPENSSL_INCDIR
    echo "$as_me:$LINENO: checking for OpenSSL version" >&5
echo $ECHO_N "checking for OpenSSL version... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: >= 0.9.6" >&5
echo "${ECHO_T}>= 0.9.6" >&6

else

      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS


  if test "$OPENSSL_INCDIR" != "/usr/include"; then

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

    ep_dir="`echo $OPENSSL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

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

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

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

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

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

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="-lcrypto $OPENSSL_SHARED_LIBADD"
    else


  case crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypto $LIBS"
   ;;
  esac


    fi
   ;;
  esac




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_crypto_CRYPTO_free

      { { echo "$as_me:$LINENO: error: libcrypto not found!" >&5
echo "$as_me: error: libcrypto not found!" >&2;}
   { (exit 1); exit 1; }; }


fi


    old_LIBS=$LIBS
    LIBS="$LIBS -lcrypto"

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

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

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

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

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

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

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

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      found_openssl=yes


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version

      { { echo "$as_me:$LINENO: error: libssl not found!" >&5
echo "$as_me: error: libssl not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

    LIBS=$old_LIBS


  case ssl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="-lssl $OPENSSL_SHARED_LIBADD"
    else


  case ssl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




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

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

    ep_dir="`echo $OPENSSL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OPENSSL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OPENSSL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  fi

  if test "$found_openssl" = "yes"; then
    OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR



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

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

    else

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

    fi

else
    { { echo "$as_me:$LINENO: error: OpenSSL check failed. Please check config.log for more information." >&5
echo "$as_me: error: OpenSSL check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }

  fi

fi





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

# Check whether --with-pcre-regex or --without-pcre-regex was given.
if test "${with_pcre_regex+set}" = set; then
  withval="$with_pcre_regex"
  PHP_PCRE_REGEX=$withval
else

  PHP_PCRE_REGEX=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PCRE_REGEX=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PCRE_REGEX in
shared,*)
  PHP_PCRE_REGEX=`echo "$PHP_PCRE_REGEX"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PCRE_REGEX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



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




if test "$PHP_PCRE_REGEX" != "no"; then
  if test "$PHP_PCRE_REGEX" = "yes"; then
    pcrelib_sources="pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c \
                     pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c \
                     pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c \
                     pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_newline.c \
                     pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c \
                     pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c \
                     pcrelib/pcre_version.c pcrelib/pcre_xclass.c"

  ext_builddir=ext/pcre
  ext_srcdir=$abs_srcdir/ext/pcre

  ac_extra=`echo "-I@ext_srcdir@/pcrelib"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $pcrelib_sources php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pcre"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pcre"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in $pcrelib_sources php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pcre="$shared_objects_pcre $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PHPPCRE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) -L$(top_builddir)/netware -lphp4lib $(PCRE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PHPPCRE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppcre.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcre"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppcre.$suffix: $ext_builddir/phppcre.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppcre.$suffix \$(phplibdir)

$ext_builddir/phppcre.$suffix: \$(shared_objects_pcre) \$(PHPPCRE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PCRE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) -L$(top_builddir)/netware -lphp4lib $(E_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PCRE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pcre.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcre"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pcre.$suffix: $ext_builddir/pcre.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pcre.$suffix \$(phplibdir)

$ext_builddir/pcre.$suffix: \$(shared_objects_pcre) \$(PCRE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PCRE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $pcrelib_sources php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pcre"
    else


  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $pcrelib_sources php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pcre"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  BUILD_DIR="$BUILD_DIR $ext_builddir/pcrelib"


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

  else
    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do
      test -f $i/pcre.h && PCRE_INCDIR=$i
    done

    if test -z "$PCRE_INCDIR"; then
      { { echo "$as_me:$LINENO: error: Could not find pcre.h in $PHP_PCRE_REGEX" >&5
echo "$as_me: error: Could not find pcre.h in $PHP_PCRE_REGEX" >&2;}
   { (exit 1); exit 1; }; }
    fi

    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
      test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
    done

    if test -z "$PCRE_LIBDIR" ; then
      { { echo "$as_me:$LINENO: error: Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX" >&5
echo "$as_me: error: Could not find libpcre.(a|$SHLIB_SUFFIX_NAME) in $PHP_PCRE_REGEX" >&2;}
   { (exit 1); exit 1; }; }
    fi


    pcre_major=`grep PCRE_MAJOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`
    pcre_minor=`grep PCRE_MINOR $PCRE_INCDIR/pcre.h | sed -e 's/[^0-9]//g'`

    pcre_minor_length=`echo "$pcre_minor" | wc -c | sed -e 's/^0-9//g'`
    if test "$pcre_minor_length" -eq 2 ; then
      pcre_minor="$pcre_minor"0
    fi
    pcre_version=$pcre_major$pcre_minor
    if test "$pcre_version" -lt 208; then
      { { echo "$as_me:$LINENO: error: The PCRE extension requires PCRE library version >= 2.08" >&5
echo "$as_me: error: The PCRE extension requires PCRE library version >= 2.08" >&2;}
   { (exit 1); exit 1; }; }
    fi



  if test "$ext_shared" = "yes"; then
    PCRE_SHARED_LIBADD="-lpcre $PCRE_SHARED_LIBADD"
    if test -n "$PCRE_LIBDIR"; then

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

  if test -z "$PCRE_LIBDIR" || echo "$PCRE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PCRE_LIBDIR
  else

    ep_dir="`echo $PCRE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PCRE_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PCRE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PCRE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PCRE_LIBDIR"; then

  if test "$PCRE_LIBDIR" != "/usr/lib"; then

  if test -z "$PCRE_LIBDIR" || echo "$PCRE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PCRE_LIBDIR
  else

    ep_dir="`echo $PCRE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PCRE_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case pcre in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpcre $LIBS"
   ;;
  esac




  fi




cat >>confdefs.h <<\_ACEOF
#define HAVE_PCRE 1
_ACEOF


  if test "$PCRE_INCDIR" != "/usr/include"; then

  if test -z "$PCRE_INCDIR" || echo "$PCRE_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$PCRE_INCDIR
  else

    ep_dir="`echo $PCRE_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PCRE_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  ext_builddir=ext/pcre
  ext_srcdir=$abs_srcdir/ext/pcre

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pcre"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pcre"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pcre="$shared_objects_pcre $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PHPPCRE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) -L$(top_builddir)/netware -lphp4lib $(PCRE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PHPPCRE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppcre.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcre"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppcre.$suffix: $ext_builddir/phppcre.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppcre.$suffix \$(phplibdir)

$ext_builddir/phppcre.$suffix: \$(shared_objects_pcre) \$(PHPPCRE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PCRE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) -L$(top_builddir)/netware -lphp4lib $(E_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcre) $(PCRE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pcre.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcre"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pcre.$suffix: $ext_builddir/pcre.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pcre.$suffix \$(phplibdir)

$ext_builddir/pcre.$suffix: \$(shared_objects_pcre) \$(PCRE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PCRE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pcre"
    else


  case ext/pcre in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcre"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcre/"; ac_bdir="ext/pcre/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_pcre.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pcre"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


  fi

  PHP_VAR_SUBST="$PHP_VAR_SUBST PCRE_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for ZLIB support" >&5
echo $ECHO_N "checking for ZLIB support... $ECHO_C" >&6

# Check whether --with-zlib or --without-zlib was given.
if test "${with_zlib+set}" = set; then
  withval="$with_zlib"
  PHP_ZLIB=$withval
else

  PHP_ZLIB=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_ZLIB=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_ZLIB in
shared,*)
  PHP_ZLIB=`echo "$PHP_ZLIB"|sed 's/^shared,//'`
  ;;
shared)
  PHP_ZLIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking if the location of ZLIB install directory is defined" >&5
echo $ECHO_N "checking if the location of ZLIB install directory is defined... $ECHO_C" >&6

# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
  withval="$with_zlib_dir"
  PHP_ZLIB_DIR=$withval
else

  PHP_ZLIB_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ZLIB_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ZLIB_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then

  ext_builddir=ext/zlib
  ext_srcdir=$abs_srcdir/ext/zlib

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/zlib in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zlib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zlib/"; ac_bdir="ext/zlib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zlib.c zlib_fopen_wrapper.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC zlib"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC zlib"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/zlib in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zlib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zlib/"; ac_bdir="ext/zlib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in zlib.c zlib_fopen_wrapper.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_zlib="$shared_objects_zlib $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_zlib) $(PHPZLIB_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zlib) -L$(top_builddir)/netware -lphp4lib $(ZLIB_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zlib) $(PHPZLIB_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpzlib.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zlib"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpzlib.$suffix: $ext_builddir/phpzlib.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpzlib.$suffix \$(phplibdir)

$ext_builddir/phpzlib.$suffix: \$(shared_objects_zlib) \$(PHPZLIB_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_zlib) $(ZLIB_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zlib) -L$(top_builddir)/netware -lphp4lib $(B_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zlib) $(ZLIB_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/zlib.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zlib"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/zlib.$suffix: $ext_builddir/zlib.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/zlib.$suffix \$(phplibdir)

$ext_builddir/zlib.$suffix: \$(shared_objects_zlib) \$(ZLIB_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_ZLIB 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/zlib in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zlib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zlib/"; ac_bdir="ext/zlib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zlib.c zlib_fopen_wrapper.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC zlib"
    else


  case ext/zlib in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zlib"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zlib/"; ac_bdir="ext/zlib/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zlib.c zlib_fopen_wrapper.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC zlib"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST ZLIB_SHARED_LIBADD"


  if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then
    if test -f $PHP_ZLIB/include/zlib/zlib.h; then
      ZLIB_DIR=$PHP_ZLIB
      ZLIB_INCDIR=$ZLIB_DIR/include/zlib
    elif test -f $PHP_ZLIB/include/zlib.h; then
      ZLIB_DIR=$PHP_ZLIB
      ZLIB_INCDIR=$ZLIB_DIR/include
    fi
  else
    for i in /usr/local /usr $PHP_ZLIB_DIR; do
      if test -f $i/include/zlib/zlib.h; then
        ZLIB_DIR=$i
        ZLIB_INCDIR=$i/include/zlib
      elif test -f $i/include/zlib.h; then
        ZLIB_DIR=$i
        ZLIB_INCDIR=$i/include
      fi
    done
  fi

  if test -z "$ZLIB_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find libz" >&5
echo "$as_me: error: Cannot find libz" >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$ZLIB_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gzgets in -lz" >&5
echo $ECHO_N "checking for gzgets in -lz... $ECHO_C" >&6
if test "${ac_cv_lib_z_gzgets+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lz  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gzgets ();
int
main ()
{
gzgets ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_z_gzgets=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_z_gzgets=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzgets" >&5
echo "${ECHO_T}$ac_cv_lib_z_gzgets" >&6
if test $ac_cv_lib_z_gzgets = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_ZLIB 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_z_gzgets

    { { echo "$as_me:$LINENO: error: ZLIB extension requires zlib >= 1.0.9" >&5
echo "$as_me: error: ZLIB extension requires zlib >= 1.0.9" >&2;}
   { (exit 1); exit 1; }; }


fi



  if test "$ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$ZLIB_DIR/lib" || echo "$ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ZLIB_DIR/lib
  else

    ep_dir="`echo $ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZLIB_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ZLIB_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ZLIB_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


  PHP_ZLIB_DIR=$ZLIB_DIR


  case z in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        ZLIB_SHARED_LIBADD="-lz $ZLIB_SHARED_LIBADD"
    else


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac


    fi
   ;;
  esac



  if test "$ZLIB_INCDIR" != "/usr/include"; then

  if test -z "$ZLIB_INCDIR" || echo "$ZLIB_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$ZLIB_INCDIR
  else

    ep_dir="`echo $ZLIB_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZLIB_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


fi




echo "$as_me:$LINENO: checking whether to enable bc style precision math functions" >&5
echo $ECHO_N "checking whether to enable bc style precision math functions... $ECHO_C" >&6
# Check whether --enable-bcmath or --disable-bcmath was given.
if test "${enable_bcmath+set}" = set; then
  enableval="$enable_bcmath"
  PHP_BCMATH=$enableval
else

  PHP_BCMATH=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_BCMATH=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_BCMATH in
shared,*)
  PHP_BCMATH=`echo "$PHP_BCMATH"|sed 's/^shared,//'`
  ;;
shared)
  PHP_BCMATH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_BCMATH" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_BCMATH 1
_ACEOF


  ext_builddir=ext/bcmath
  ext_srcdir=$abs_srcdir/ext/bcmath

  ac_extra=`echo "-I@ext_srcdir@/libbcmath/src"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/bcmath in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC bcmath"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC bcmath"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/bcmath in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_bcmath="$shared_objects_bcmath $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(PHPBCMATH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) -L$(top_builddir)/netware -lphp4lib $(BCMATH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(PHPBCMATH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpbcmath.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpbcmath.$suffix: $ext_builddir/phpbcmath.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpbcmath.$suffix \$(phplibdir)

$ext_builddir/phpbcmath.$suffix: \$(shared_objects_bcmath) \$(PHPBCMATH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) -L$(top_builddir)/netware -lphp4lib $(ATH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bcmath) $(BCMATH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/bcmath.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bcmath"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/bcmath.$suffix: $ext_builddir/bcmath.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/bcmath.$suffix \$(phplibdir)

$ext_builddir/bcmath.$suffix: \$(shared_objects_bcmath) \$(BCMATH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_BCMATH 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/bcmath in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC bcmath"
    else


  case ext/bcmath in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bcmath"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bcmath/"; ac_bdir="ext/bcmath/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC bcmath"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  BUILD_DIR="$BUILD_DIR $ext_builddir/libbcmath/src"

fi




echo "$as_me:$LINENO: checking for BZip2 support" >&5
echo $ECHO_N "checking for BZip2 support... $ECHO_C" >&6

# Check whether --with-bz2 or --without-bz2 was given.
if test "${with_bz2+set}" = set; then
  withval="$with_bz2"
  PHP_BZ2=$withval
else

  PHP_BZ2=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_BZ2=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_BZ2 in
shared,*)
  PHP_BZ2=`echo "$PHP_BZ2"|sed 's/^shared,//'`
  ;;
shared)
  PHP_BZ2=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_BZ2" != "no"; then
  if test -r $PHP_BZ2/include/bzlib.h; then
    BZIP_DIR=$PHP_BZ2
  else
    echo "$as_me:$LINENO: checking for BZip2 in default path" >&5
echo $ECHO_N "checking for BZip2 in default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      if test -r $i/include/bzlib.h; then
        BZIP_DIR=$i
        echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
        break
      fi
    done
  fi

  if test -z "$BZIP_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the BZip2 distribution" >&5
echo "$as_me: error: Please reinstall the BZip2 distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$BZIP_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for BZ2_bzerror in -lbz2" >&5
echo $ECHO_N "checking for BZ2_bzerror in -lbz2... $ECHO_C" >&6
if test "${ac_cv_lib_bz2_BZ2_bzerror+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lbz2  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char BZ2_bzerror ();
int
main ()
{
BZ2_bzerror ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_bz2_BZ2_bzerror=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_bz2_BZ2_bzerror=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_bz2_BZ2_bzerror" >&5
echo "${ECHO_T}$ac_cv_lib_bz2_BZ2_bzerror" >&6
if test $ac_cv_lib_bz2_BZ2_bzerror = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$BZIP_DIR/include" != "/usr/include"; then

  if test -z "$BZIP_DIR/include" || echo "$BZIP_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$BZIP_DIR/include
  else

    ep_dir="`echo $BZIP_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$BZIP_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    BZ2_SHARED_LIBADD="-lbz2 $BZ2_SHARED_LIBADD"
    if test -n "$BZIP_DIR/lib"; then

  if test "$BZIP_DIR/lib" != "/usr/lib"; then

  if test -z "$BZIP_DIR/lib" || echo "$BZIP_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$BZIP_DIR/lib
  else

    ep_dir="`echo $BZIP_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$BZIP_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        BZ2_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $BZ2_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$BZIP_DIR/lib"; then

  if test "$BZIP_DIR/lib" != "/usr/lib"; then

  if test -z "$BZIP_DIR/lib" || echo "$BZIP_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$BZIP_DIR/lib
  else

    ep_dir="`echo $BZIP_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$BZIP_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case bz2 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lbz2 $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_BZ2 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_bz2_BZ2_bzerror

    { { echo "$as_me:$LINENO: error: bz2 module requires libbz2 >= 1.0.0" >&5
echo "$as_me: error: bz2 module requires libbz2 >= 1.0.0" >&2;}
   { (exit 1); exit 1; }; }


fi



  ext_builddir=ext/bz2
  ext_srcdir=$abs_srcdir/ext/bz2

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/bz2 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bz2.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC bz2"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC bz2"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/bz2 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in bz2.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_bz2="$shared_objects_bz2 $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(PHPBZ2_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) -L$(top_builddir)/netware -lphp4lib $(BZ2_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(PHPBZ2_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpbz2.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bz2"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpbz2.$suffix: $ext_builddir/phpbz2.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpbz2.$suffix \$(phplibdir)

$ext_builddir/phpbz2.$suffix: \$(shared_objects_bz2) \$(PHPBZ2_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(BZ2_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_bz2) $(BZ2_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/bz2.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_bz2"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/bz2.$suffix: $ext_builddir/bz2.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/bz2.$suffix \$(phplibdir)

$ext_builddir/bz2.$suffix: \$(shared_objects_bz2) \$(BZ2_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_BZ2 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/bz2 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bz2.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC bz2"
    else


  case ext/bz2 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/bz2"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/bz2/"; ac_bdir="ext/bz2/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in bz2.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC bz2"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST BZ2_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking whether to enable calendar conversion support" >&5
echo $ECHO_N "checking whether to enable calendar conversion support... $ECHO_C" >&6
# Check whether --enable-calendar or --disable-calendar was given.
if test "${enable_calendar+set}" = set; then
  enableval="$enable_calendar"
  PHP_CALENDAR=$enableval
else

  PHP_CALENDAR=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CALENDAR=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CALENDAR in
shared,*)
  PHP_CALENDAR=`echo "$PHP_CALENDAR"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CALENDAR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CALENDAR" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_CALENDAR 1
_ACEOF


  ext_builddir=ext/calendar
  ext_srcdir=$abs_srcdir/ext/calendar

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/calendar in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC calendar"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC calendar"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/calendar in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_calendar="$shared_objects_calendar $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(PHPCALENDAR_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) -L$(top_builddir)/netware -lphp4lib $(CALENDAR_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(PHPCALENDAR_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpcalendar.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_calendar"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpcalendar.$suffix: $ext_builddir/phpcalendar.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpcalendar.$suffix \$(phplibdir)

$ext_builddir/phpcalendar.$suffix: \$(shared_objects_calendar) \$(PHPCALENDAR_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(CALENDAR_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) -L$(top_builddir)/netware -lphp4lib $(ENDAR_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_calendar) $(CALENDAR_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/calendar.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_calendar"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/calendar.$suffix: $ext_builddir/calendar.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/calendar.$suffix \$(phplibdir)

$ext_builddir/calendar.$suffix: \$(shared_objects_calendar) \$(CALENDAR_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CALENDAR 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/calendar in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC calendar"
    else


  case ext/calendar in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/calendar"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/calendar/"; ac_bdir="ext/calendar/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC calendar"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi








echo "$as_me:$LINENO: checking for cpdflib support" >&5
echo $ECHO_N "checking for cpdflib support... $ECHO_C" >&6

# Check whether --with-cpdflib or --without-cpdflib was given.
if test "${with_cpdflib+set}" = set; then
  withval="$with_cpdflib"
  PHP_CPDFLIB=$withval
else

  PHP_CPDFLIB=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CPDFLIB=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CPDFLIB in
shared,*)
  PHP_CPDFLIB=`echo "$PHP_CPDFLIB"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CPDFLIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CPDFLIB" != "no"; then

  ext_builddir=ext/cpdf
  ext_srcdir=$abs_srcdir/ext/cpdf

  ac_extra=`echo "\\$(GDLIB_CFLAGS)"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/cpdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cpdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cpdf/"; ac_bdir="ext/cpdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cpdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC cpdf"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC cpdf"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/cpdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cpdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cpdf/"; ac_bdir="ext/cpdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in cpdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_cpdf="$shared_objects_cpdf $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_cpdf) $(PHPCPDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cpdf) -L$(top_builddir)/netware -lphp4lib $(CPDF_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cpdf) $(PHPCPDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpcpdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_cpdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpcpdf.$suffix: $ext_builddir/phpcpdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpcpdf.$suffix \$(phplibdir)

$ext_builddir/phpcpdf.$suffix: \$(shared_objects_cpdf) \$(PHPCPDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_cpdf) $(CPDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cpdf) -L$(top_builddir)/netware -lphp4lib $(F_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cpdf) $(CPDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/cpdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_cpdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/cpdf.$suffix: $ext_builddir/cpdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/cpdf.$suffix \$(phplibdir)

$ext_builddir/cpdf.$suffix: \$(shared_objects_cpdf) \$(CPDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CPDF 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/cpdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cpdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cpdf/"; ac_bdir="ext/cpdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cpdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC cpdf"
    else


  case ext/cpdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cpdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cpdf/"; ac_bdir="ext/cpdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cpdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC cpdf"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST CPDF_SHARED_LIBADD"



# Check whether --with-jpeg-dir or --without-jpeg-dir was given.
if test "${with_jpeg_dir+set}" = set; then
  withval="$with_jpeg_dir"

    for i in $withval /usr/local /usr; do
      if test -f "$i/lib/libjpeg.$SHLIB_SUFFIX_NAME" -o -f "$i/lib/libjpeg.a"; then
        CPDF_JPEG_DIR=$i
        break;
      fi
    done
    if test -z "$CPDF_JPEG_DIR"; then
      { { echo "$as_me:$LINENO: error: libjpeg.(a|so) not found." >&5
echo "$as_me: error: libjpeg.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$CPDF_JPEG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_jpeg_jpeg_read_header=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    CPDF_SHARED_LIBADD="-ljpeg $CPDF_SHARED_LIBADD"
    if test -n "$CPDF_JPEG_DIR/lib"; then

  if test "$CPDF_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$CPDF_JPEG_DIR/lib" || echo "$CPDF_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CPDF_JPEG_DIR/lib
  else

    ep_dir="`echo $CPDF_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CPDF_JPEG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CPDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CPDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$CPDF_JPEG_DIR/lib"; then

  if test "$CPDF_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$CPDF_JPEG_DIR/lib" || echo "$CPDF_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CPDF_JPEG_DIR/lib
  else

    ep_dir="`echo $CPDF_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CPDF_JPEG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case jpeg in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ljpeg $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_jpeg_jpeg_read_header

      { { echo "$as_me:$LINENO: error: CPDF: Problem with libjpeg.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: CPDF: Problem with libjpeg.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi


fi;



# Check whether --with-tiff-dir or --without-tiff-dir was given.
if test "${with_tiff_dir+set}" = set; then
  withval="$with_tiff_dir"

    for i in $withval /usr/local /usr; do
      if test -f "$i/lib/libtiff.$SHLIB_SUFFIX_NAME" -o -f "$i/lib/libtiff.a"; then
        CPDF_TIFF_DIR=$i
        break;
      fi
    done
    if test -z "$CPDF_TIFF_DIR"; then
      { { echo "$as_me:$LINENO: error: libtiff.(a|so) not found." >&5
echo "$as_me: error: libtiff.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$CPDF_TIFF_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for TIFFOpen in -ltiff" >&5
echo $ECHO_N "checking for TIFFOpen in -ltiff... $ECHO_C" >&6
if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltiff  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char TIFFOpen ();
int
main ()
{
TIFFOpen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_tiff_TIFFOpen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_tiff_TIFFOpen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFOpen" >&5
echo "${ECHO_T}$ac_cv_lib_tiff_TIFFOpen" >&6
if test $ac_cv_lib_tiff_TIFFOpen = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    CPDF_SHARED_LIBADD="-ltiff $CPDF_SHARED_LIBADD"
    if test -n "$CPDF_TIFF_DIR/lib"; then

  if test "$CPDF_TIFF_DIR/lib" != "/usr/lib"; then

  if test -z "$CPDF_TIFF_DIR/lib" || echo "$CPDF_TIFF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CPDF_TIFF_DIR/lib
  else

    ep_dir="`echo $CPDF_TIFF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CPDF_TIFF_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CPDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CPDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$CPDF_TIFF_DIR/lib"; then

  if test "$CPDF_TIFF_DIR/lib" != "/usr/lib"; then

  if test -z "$CPDF_TIFF_DIR/lib" || echo "$CPDF_TIFF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CPDF_TIFF_DIR/lib
  else

    ep_dir="`echo $CPDF_TIFF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CPDF_TIFF_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case tiff in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ltiff $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_tiff_TIFFOpen

      { { echo "$as_me:$LINENO: error: CPDF: Problem with libtiff.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: CPDF: Problem with libtiff.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi


fi;


  for i in $PHP_CPDFLIB /usr/local /usr; do
    if test -f "$i/include/cpdflib.h"; then
      CPDFLIB_INCLUDE=$i/include


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$i/lib $CPDF_SHARED_LIBADD
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for cpdf_open in -lcpdf" >&5
echo $ECHO_N "checking for cpdf_open in -lcpdf... $ECHO_C" >&6
if test "${ac_cv_lib_cpdf_cpdf_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char cpdf_open ();
int
main ()
{
cpdf_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_cpdf_cpdf_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_cpdf_cpdf_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_cpdf_cpdf_open" >&5
echo "${ECHO_T}$ac_cv_lib_cpdf_cpdf_open" >&6
if test $ac_cv_lib_cpdf_cpdf_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

        cpdf_libname=cpdf


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_cpdf_cpdf_open


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$i/lib $CPDF_SHARED_LIBADD
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for cpdf_open in -lcpdfm" >&5
echo $ECHO_N "checking for cpdf_open in -lcpdfm... $ECHO_C" >&6
if test "${ac_cv_lib_cpdfm_cpdf_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcpdfm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char cpdf_open ();
int
main ()
{
cpdf_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_cpdfm_cpdf_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_cpdfm_cpdf_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_cpdfm_cpdf_open" >&5
echo "${ECHO_T}$ac_cv_lib_cpdfm_cpdf_open" >&6
if test $ac_cv_lib_cpdfm_cpdf_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

          cpdf_libname=cpdfm


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_cpdfm_cpdf_open

          { { echo "$as_me:$LINENO: error: Cpdflib module requires cpdflib >= 2." >&5
echo "$as_me: error: Cpdflib module requires cpdflib >= 2." >&2;}
   { (exit 1); exit 1; }; }


fi



fi




  if test "$ext_shared" = "yes"; then
    CPDF_SHARED_LIBADD="-l$cpdf_libname $CPDF_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CPDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CPDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $cpdf_libname in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$cpdf_libname $LIBS"
   ;;
  esac




  fi



  if test "$CPDFLIB_INCLUDE" != "/usr/include"; then

  if test -z "$CPDFLIB_INCLUDE" || echo "$CPDFLIB_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$CPDFLIB_INCLUDE
  else

    ep_dir="`echo $CPDFLIB_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CPDFLIB_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_CPDFLIB 1
_ACEOF

      break
    fi
  done

  if test -z "$CPDFLIB_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: cpdflib.h not found" >&5
echo "$as_me: error: cpdflib.h not found" >&2;}
   { (exit 1); exit 1; }; }
  fi
fi




echo "$as_me:$LINENO: checking for CRACKlib support" >&5
echo $ECHO_N "checking for CRACKlib support... $ECHO_C" >&6

# Check whether --with-crack or --without-crack was given.
if test "${with_crack+set}" = set; then
  withval="$with_crack"
  PHP_CRACK=$withval
else

  PHP_CRACK=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CRACK=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CRACK in
shared,*)
  PHP_CRACK=`echo "$PHP_CRACK"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CRACK=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CRACK" != "no"; then

  for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do
    test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i && break
    test -f $i/libcrack_krb5.$SHLIB_SUFFIX_NAME -o -f $i/libcrack_krb5.a && CRACK_LIBDIR=$i && break
  done

  if test -z "$CRACK_LIBDIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find the cracklib library file" >&5
echo "$as_me: error: Cannot find the cracklib library file" >&2;}
   { (exit 1); exit 1; }; }
  fi

  for i in $PHP_CRACK/include $PHP_CRACK/cracklib /usr/local/include /usr/include; do
    test -f $i/packer.h && CRACK_INCLUDEDIR=$i && break
  done

  if test -z "$CRACK_INCLUDEDIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find a cracklib header file" >&5
echo "$as_me: error: Cannot find a cracklib header file" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$CRACK_INCLUDEDIR" != "/usr/include"; then

  if test -z "$CRACK_INCLUDEDIR" || echo "$CRACK_INCLUDEDIR" | grep '^/' >/dev/null ; then
    ai_p=$CRACK_INCLUDEDIR
  else

    ep_dir="`echo $CRACK_INCLUDEDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CRACK_INCLUDEDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    CRACK_SHARED_LIBADD="-lcrack $CRACK_SHARED_LIBADD"
    if test -n "$CRACK_LIBDIR"; then

  if test "$CRACK_LIBDIR" != "/usr/lib"; then

  if test -z "$CRACK_LIBDIR" || echo "$CRACK_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$CRACK_LIBDIR
  else

    ep_dir="`echo $CRACK_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CRACK_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CRACK_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CRACK_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$CRACK_LIBDIR"; then

  if test "$CRACK_LIBDIR" != "/usr/lib"; then

  if test -z "$CRACK_LIBDIR" || echo "$CRACK_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$CRACK_LIBDIR
  else

    ep_dir="`echo $CRACK_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CRACK_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case crack in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrack $LIBS"
   ;;
  esac




  fi




  ext_builddir=ext/crack
  ext_srcdir=$abs_srcdir/ext/crack

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/crack in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/crack"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/crack/"; ac_bdir="ext/crack/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in crack.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC crack"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC crack"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/crack in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/crack"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/crack/"; ac_bdir="ext/crack/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in crack.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_crack="$shared_objects_crack $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_crack) $(PHPCRACK_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_crack) -L$(top_builddir)/netware -lphp4lib $(CRACK_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_crack) $(PHPCRACK_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpcrack.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_crack"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpcrack.$suffix: $ext_builddir/phpcrack.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpcrack.$suffix \$(phplibdir)

$ext_builddir/phpcrack.$suffix: \$(shared_objects_crack) \$(PHPCRACK_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_crack) $(CRACK_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_crack) -L$(top_builddir)/netware -lphp4lib $(CK_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_crack) $(CRACK_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/crack.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_crack"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/crack.$suffix: $ext_builddir/crack.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/crack.$suffix \$(phplibdir)

$ext_builddir/crack.$suffix: \$(shared_objects_crack) \$(CRACK_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CRACK 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/crack in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/crack"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/crack/"; ac_bdir="ext/crack/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in crack.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC crack"
    else


  case ext/crack in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/crack"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/crack/"; ac_bdir="ext/crack/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in crack.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC crack"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST CRACK_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_CRACK 1
_ACEOF

fi




echo "$as_me:$LINENO: checking whether to enable ctype functions" >&5
echo $ECHO_N "checking whether to enable ctype functions... $ECHO_C" >&6
# Check whether --enable-ctype or --disable-ctype was given.
if test "${enable_ctype+set}" = set; then
  enableval="$enable_ctype"
  PHP_CTYPE=$enableval
else

  PHP_CTYPE=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CTYPE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CTYPE in
shared,*)
  PHP_CTYPE=`echo "$PHP_CTYPE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CTYPE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CTYPE" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_CTYPE 1
_ACEOF


  ext_builddir=ext/ctype
  ext_srcdir=$abs_srcdir/ext/ctype

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/ctype in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ctype.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ctype"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ctype"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ctype in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ctype.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ctype="$shared_objects_ctype $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(PHPCTYPE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) -L$(top_builddir)/netware -lphp4lib $(CTYPE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(PHPCTYPE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpctype.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpctype.$suffix: $ext_builddir/phpctype.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpctype.$suffix \$(phplibdir)

$ext_builddir/phpctype.$suffix: \$(shared_objects_ctype) \$(PHPCTYPE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) -L$(top_builddir)/netware -lphp4lib $(PE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ctype) $(CTYPE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ctype.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ctype"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ctype.$suffix: $ext_builddir/ctype.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ctype.$suffix \$(phplibdir)

$ext_builddir/ctype.$suffix: \$(shared_objects_ctype) \$(CTYPE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CTYPE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ctype in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ctype.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ctype"
    else


  case ext/ctype in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ctype"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ctype/"; ac_bdir="ext/ctype/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ctype.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ctype"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for CURL support" >&5
echo $ECHO_N "checking for CURL support... $ECHO_C" >&6

# Check whether --with-curl or --without-curl was given.
if test "${with_curl+set}" = set; then
  withval="$with_curl"
  PHP_CURL=$withval
else

  PHP_CURL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CURL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CURL in
shared,*)
  PHP_CURL=`echo "$PHP_CURL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CURL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_CURL" != "no"; then
  if test -r $PHP_CURL/include/curl/easy.h; then
    CURL_DIR=$PHP_CURL
  else
    echo "$as_me:$LINENO: checking for CURL in default path" >&5
echo $ECHO_N "checking for CURL in default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      if test -r $i/include/curl/easy.h; then
        CURL_DIR=$i
        echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
        break
      fi
    done
  fi

  if test -z "$CURL_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/" >&5
echo "$as_me: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/" >&2;}
   { (exit 1); exit 1; }; }
  fi

  CURL_CONFIG="curl-config"
  echo "$as_me:$LINENO: checking for cURL 7.9.8 or greater" >&5
echo $ECHO_N "checking for cURL 7.9.8 or greater... $ECHO_C" >&6

  if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then
    CURL_CONFIG=${CURL_DIR}/bin/curl-config
  else
    if ${CURL_DIR}/curl-config --libs > /dev/null 2>&1; then
       CURL_CONFIG=${CURL_DIR}/curl-config
    fi
  fi

  curl_version_full=`$CURL_CONFIG --version`
  curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test "$curl_version" -ge 7009008; then
    echo "$as_me:$LINENO: result: $curl_version_full" >&5
echo "${ECHO_T}$curl_version_full" >&6
    CURL_LIBS=`$CURL_CONFIG --libs`
  else
    { { echo "$as_me:$LINENO: error: cURL version 7.9.8 or later is required to compile php with cURL support" >&5
echo "$as_me: error: cURL version 7.9.8 or later is required to compile php with cURL support" >&2;}
   { (exit 1); exit 1; }; }
  fi

  echo "$as_me:$LINENO: checking for SSL support in libcurl" >&5
echo $ECHO_N "checking for SSL support in libcurl... $ECHO_C" >&6
  CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
  if test "$CURL_SSL" = "SSL"; then
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

cat >>confdefs.h <<\_ACEOF
#define HAVE_CURL_SSL 1
_ACEOF


    echo "$as_me:$LINENO: checking for SSL library used" >&5
echo $ECHO_N "checking for SSL library used... $ECHO_C" >&6
    CURL_SSL_FLAVOUR=
    for i in $CURL_LIBS; do
      if test "$i" = "-lssl"; then
        CURL_SSL_FLAVOUR="openssl"
        echo "$as_me:$LINENO: result: openssl" >&5
echo "${ECHO_T}openssl" >&6

cat >>confdefs.h <<\_ACEOF
#define HAVE_CURL_OPENSSL 1
_ACEOF


for ac_header in openssl/crypto.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

        break
      elif test "$i" = "-lgnutls"; then
        CURL_SSL_FLAVOUR="gnutls"
        echo "$as_me:$LINENO: result: gnutls" >&5
echo "${ECHO_T}gnutls" >&6

cat >>confdefs.h <<\_ACEOF
#define HAVE_CURL_GNUTLS 1
_ACEOF


for ac_header in gcrypt.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

        break
      fi
    done
    if test -z "$CURL_SSL_FLAVOUR"; then
      echo "$as_me:$LINENO: result: unknown!" >&5
echo "${ECHO_T}unknown!" >&6
      { echo "$as_me:$LINENO: WARNING: Could not determine the type of SSL library used!" >&5
echo "$as_me: WARNING: Could not determine the type of SSL library used!" >&2;}
      { echo "$as_me:$LINENO: WARNING: Building will fail in ZTS mode!" >&5
echo "$as_me: WARNING: Building will fail in ZTS mode!" >&2;}
    fi
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi


  if test "$CURL_DIR/include" != "/usr/include"; then

  if test -z "$CURL_DIR/include" || echo "$CURL_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$CURL_DIR/include
  else

    ep_dir="`echo $CURL_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CURL_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  for ac_i in $CURL_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        CURL_SHARED_LIBADD="$CURL_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CURL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done



  if test "$ext_shared" = "yes"; then
    CURL_SHARED_LIBADD="-lcurl $CURL_SHARED_LIBADD"
    if test -n "$CURL_DIR/lib"; then

  if test "$CURL_DIR/lib" != "/usr/lib"; then

  if test -z "$CURL_DIR/lib" || echo "$CURL_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CURL_DIR/lib
  else

    ep_dir="`echo $CURL_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CURL_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CURL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CURL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$CURL_DIR/lib"; then

  if test "$CURL_DIR/lib" != "/usr/lib"; then

  if test -z "$CURL_DIR/lib" || echo "$CURL_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CURL_DIR/lib
  else

    ep_dir="`echo $CURL_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CURL_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case curl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcurl $LIBS"
   ;;
  esac




  fi




  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    $CURL_LIBS -L$CURL_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for curl_easy_perform in -lcurl" >&5
echo $ECHO_N "checking for curl_easy_perform in -lcurl... $ECHO_C" >&6
if test "${ac_cv_lib_curl_curl_easy_perform+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char curl_easy_perform ();
int
main ()
{
curl_easy_perform ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_curl_curl_easy_perform=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_curl_curl_easy_perform=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_easy_perform" >&5
echo "${ECHO_T}$ac_cv_lib_curl_curl_easy_perform" >&6
if test $ac_cv_lib_curl_curl_easy_perform = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_CURL 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_curl_curl_easy_perform

    { { echo "$as_me:$LINENO: error: There is something wrong. Please check config.log for more information." >&5
echo "$as_me: error: There is something wrong. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    $CURL_LIBS -L$CURL_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for curl_version_info in -lcurl" >&5
echo $ECHO_N "checking for curl_version_info in -lcurl... $ECHO_C" >&6
if test "${ac_cv_lib_curl_curl_version_info+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char curl_version_info ();
int
main ()
{
curl_version_info ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_curl_curl_version_info=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_curl_curl_version_info=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_curl_curl_version_info" >&5
echo "${ECHO_T}$ac_cv_lib_curl_curl_version_info" >&6
if test $ac_cv_lib_curl_curl_version_info = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_CURL_VERSION_INFO 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_curl_curl_version_info


fi




  ext_builddir=ext/curl
  ext_srcdir=$abs_srcdir/ext/curl

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/curl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/curl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/curl/"; ac_bdir="ext/curl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in curl.c curlstreams.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC curl"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC curl"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/curl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/curl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/curl/"; ac_bdir="ext/curl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in curl.c curlstreams.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_curl="$shared_objects_curl $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_curl) $(PHPCURL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_curl) -L$(top_builddir)/netware -lphp4lib $(CURL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_curl) $(PHPCURL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpcurl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_curl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpcurl.$suffix: $ext_builddir/phpcurl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpcurl.$suffix \$(phplibdir)

$ext_builddir/phpcurl.$suffix: \$(shared_objects_curl) \$(PHPCURL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_curl) $(CURL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_curl) -L$(top_builddir)/netware -lphp4lib $(L_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_curl) $(CURL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/curl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_curl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/curl.$suffix: $ext_builddir/curl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/curl.$suffix \$(phplibdir)

$ext_builddir/curl.$suffix: \$(shared_objects_curl) \$(CURL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CURL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/curl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/curl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/curl/"; ac_bdir="ext/curl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in curl.c curlstreams.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC curl"
    else


  case ext/curl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/curl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/curl/"; ac_bdir="ext/curl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in curl.c curlstreams.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC curl"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST CURL_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for cyrus imap support" >&5
echo $ECHO_N "checking for cyrus imap support... $ECHO_C" >&6

# Check whether --with-cyrus or --without-cyrus was given.
if test "${with_cyrus+set}" = set; then
  withval="$with_cyrus"
  PHP_CYRUS=$withval
else

  PHP_CYRUS=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_CYRUS=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_CYRUS in
shared,*)
  PHP_CYRUS=`echo "$PHP_CYRUS"|sed 's/^shared,//'`
  ;;
shared)
  PHP_CYRUS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_CYRUS" != "no"; then
  found_cyrus=no
  found_sasl=no
  found_openssl=no

        for i in $PHP_CYRUS /usr/local /usr; do
    if test -r $i/include/cyrus/imclient.h && test "$found_cyrus" = "no"; then

  if test "$i/include" != "/usr/include"; then

  if test -z "$i/include" || echo "$i/include" | grep '^/' >/dev/null ; then
    ai_p=$i/include
  else

    ep_dir="`echo $i/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    CYRUS_SHARED_LIBADD="-lcyrus $CYRUS_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CYRUS_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CYRUS_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case cyrus in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcyrus $LIBS"
   ;;
  esac




  fi


      found_cyrus=yes
      CYRUS_INCPATH=$i/include
      break 2
    fi
  done

    old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$CYRUS_INCPATH
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <cyrus/imclient.h>
int
main ()
{
imclient_connect(0,0,0,0)
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


    { { echo "$as_me:$LINENO: error: cyrus-imap version 2.0.8 or greater required" >&5
echo "$as_me: error: cyrus-imap version 2.0.8 or greater required" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  CPPFLAGS=$old_CPPFLAGS

  if test "$found_cyrus" = "no"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please Re-install the cyrus distribution" >&5
echo "$as_me: error: Please Re-install the cyrus distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi

        for i in $PHP_CYRUS /usr/local /usr; do
    if test -r $i/include/sasl.h && test "$found_sasl" = "no"; then

  if test "$i/include" != "/usr/include"; then

  if test -z "$i/include" || echo "$i/include" | grep '^/' >/dev/null ; then
    ai_p=$i/include
  else

    ep_dir="`echo $i/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

      found_sasl=yes
    elif test -r $i/include/sasl/sasl.h && test "$found_sasl" = "no"; then

  if test "$i/include/sasl" != "/usr/include"; then

  if test -z "$i/include/sasl" || echo "$i/include/sasl" | grep '^/' >/dev/null ; then
    ai_p=$i/include/sasl
  else

    ep_dir="`echo $i/include/sasl|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/include/sasl\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

      found_sasl=yes
    fi

    if test "$found_sasl" = "yes"; then
      if test -f $i/lib/libsasl2.a || test -f $i/lib/libsasl2.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    CYRUS_SHARED_LIBADD="-lsasl2 $CYRUS_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CYRUS_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CYRUS_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sasl2 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsasl2 $LIBS"
   ;;
  esac




  fi


      else


  if test "$ext_shared" = "yes"; then
    CYRUS_SHARED_LIBADD="-lsasl $CYRUS_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CYRUS_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CYRUS_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sasl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsasl $LIBS"
   ;;
  esac




  fi


      fi
      break 2
    fi
  done

  if test "$found_sasl" = "no"; then
    echo "$as_me:$LINENO: result: sasl not found" >&5
echo "${ECHO_T}sasl not found" >&6
    { { echo "$as_me:$LINENO: error: Please Re-install the cyrus distribution" >&5
echo "$as_me: error: Please Re-install the cyrus distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi

        if test "$PHP_OPENSSL" = "no"; then
    for i in $PHP_CYRUS /usr/local /usr; do
      if test -r $i/include/openssl/ssl.h; then


  if test "$ext_shared" = "yes"; then
    CYRUS_SHARED_LIBADD="-lssl $CYRUS_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CYRUS_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CYRUS_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ssl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    CYRUS_SHARED_LIBADD="-lcrypto $CYRUS_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        CYRUS_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $CYRUS_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypto $LIBS"
   ;;
  esac




  fi


        break 2
      fi
    done
  fi


  ext_builddir=ext/cyrus
  ext_srcdir=$abs_srcdir/ext/cyrus

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/cyrus in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cyrus"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cyrus/"; ac_bdir="ext/cyrus/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cyrus.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC cyrus"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC cyrus"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/cyrus in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cyrus"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cyrus/"; ac_bdir="ext/cyrus/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in cyrus.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_cyrus="$shared_objects_cyrus $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_cyrus) $(PHPCYRUS_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cyrus) -L$(top_builddir)/netware -lphp4lib $(CYRUS_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cyrus) $(PHPCYRUS_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpcyrus.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_cyrus"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpcyrus.$suffix: $ext_builddir/phpcyrus.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpcyrus.$suffix \$(phplibdir)

$ext_builddir/phpcyrus.$suffix: \$(shared_objects_cyrus) \$(PHPCYRUS_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_cyrus) $(CYRUS_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cyrus) -L$(top_builddir)/netware -lphp4lib $(US_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_cyrus) $(CYRUS_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/cyrus.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_cyrus"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/cyrus.$suffix: $ext_builddir/cyrus.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/cyrus.$suffix \$(phplibdir)

$ext_builddir/cyrus.$suffix: \$(shared_objects_cyrus) \$(CYRUS_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_CYRUS 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/cyrus in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cyrus"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cyrus/"; ac_bdir="ext/cyrus/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cyrus.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC cyrus"
    else


  case ext/cyrus in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/cyrus"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/cyrus/"; ac_bdir="ext/cyrus/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in cyrus.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC cyrus"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST CYRUS_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_CYRUS 1
_ACEOF

fi


# Checks for libraries.
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order





echo "$as_me:$LINENO: checking for xDBM support" >&5
echo $ECHO_N "checking for xDBM support... $ECHO_C" >&6

# Check whether --with-db or --without-db was given.
if test "${with_db+set}" = set; then
  withval="$with_db"
  PHP_DB=$withval
else

  PHP_DB=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DB=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DB in
shared,*)
  PHP_DB=`echo "$PHP_DB"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DB" != "no"; then


  echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6
if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgdbm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdbm_open ();
int
main ()
{
gdbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gdbm_gdbm_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gdbm_gdbm_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5
echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6
if test $ac_cv_lib_gdbm_gdbm_open = yes; then

cat >>confdefs.h <<\_ACEOF
#define GDBM 1
_ACEOF
 DBM_TYPE=gdbm; DBM_LIB=-lgdbm
else
  echo "$as_me:$LINENO: checking for dbm_open in -lc" >&5
echo $ECHO_N "checking for dbm_open in -lc... $ECHO_C" >&6
if test "${ac_cv_lib_c_dbm_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dbm_open ();
int
main ()
{
dbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_c_dbm_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_c_dbm_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_c_dbm_open" >&5
echo "${ECHO_T}$ac_cv_lib_c_dbm_open" >&6
if test $ac_cv_lib_c_dbm_open = yes; then

cat >>confdefs.h <<\_ACEOF
#define NDBM 1
_ACEOF
 DBM_TYPE=ndbm; DBM_LIB=
else
  echo "$as_me:$LINENO: checking for dbm_open in -ldbm" >&5
echo $ECHO_N "checking for dbm_open in -ldbm... $ECHO_C" >&6
if test "${ac_cv_lib_dbm_dbm_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldbm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dbm_open ();
int
main ()
{
dbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dbm_dbm_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dbm_dbm_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dbm_dbm_open" >&5
echo "${ECHO_T}$ac_cv_lib_dbm_dbm_open" >&6
if test $ac_cv_lib_dbm_dbm_open = yes; then

cat >>confdefs.h <<\_ACEOF
#define NDBM 1
_ACEOF
 DBM_TYPE=ndbm; DBM_LIB=-ldbm
else
  echo "$as_me:$LINENO: checking for dbm_open in -ldb" >&5
echo $ECHO_N "checking for dbm_open in -ldb... $ECHO_C" >&6
if test "${ac_cv_lib_db_dbm_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldb  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dbm_open ();
int
main ()
{
dbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_db_dbm_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_db_dbm_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_db_dbm_open" >&5
echo "${ECHO_T}$ac_cv_lib_db_dbm_open" >&6
if test $ac_cv_lib_db_dbm_open = yes; then

cat >>confdefs.h <<\_ACEOF
#define NDBM 1
_ACEOF
 DBM_TYPE=ndbm; DBM_LIB=-ldb
else
  DBM_TYPE=""
fi


fi


fi


fi

  echo "$as_me:$LINENO: checking preferred dbm library" >&5
echo $ECHO_N "checking preferred dbm library... $ECHO_C" >&6
  if test "a$DBM_TYPE" = a; then
    echo "$as_me:$LINENO: result: none found" >&5
echo "${ECHO_T}none found" >&6
    { echo "$as_me:$LINENO: WARNING: No dbm library found - using built-in flatfile support" >&5
echo "$as_me: WARNING: No dbm library found - using built-in flatfile support" >&2;}
  else
    echo "$as_me:$LINENO: result: $DBM_TYPE chosen" >&5
echo "${ECHO_T}$DBM_TYPE chosen" >&6
  fi

  PHP_VAR_SUBST="$PHP_VAR_SUBST DBM_LIB"


  PHP_VAR_SUBST="$PHP_VAR_SUBST DBM_TYPE"



  if test "$DBM_LIB" = "-lgdbm"; then
    if test "${ac_cv_header_gdbm_h+set}" = set; then
  echo "$as_me:$LINENO: checking for gdbm.h" >&5
echo $ECHO_N "checking for gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header_gdbm_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking gdbm.h usability" >&5
echo $ECHO_N "checking gdbm.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <gdbm.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking gdbm.h presence" >&5
echo $ECHO_N "checking gdbm.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <gdbm.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: gdbm.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: gdbm.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: gdbm.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: gdbm.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: gdbm.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: gdbm.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: gdbm.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: gdbm.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for gdbm.h" >&5
echo $ECHO_N "checking for gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header_gdbm_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header_gdbm_h" >&6

fi
if test $ac_cv_header_gdbm_h = yes; then
   GDBM_INCLUDE=""
else

      echo "$as_me:$LINENO: result: \"Try /usr/local/include/gdbm.h\"" >&5
echo "${ECHO_T}\"Try /usr/local/include/gdbm.h\"" >&6;
      if test "${ac_cv_header__usr_local_include_gdbm_h+set}" = set; then
  echo "$as_me:$LINENO: checking for /usr/local/include/gdbm.h" >&5
echo $ECHO_N "checking for /usr/local/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__usr_local_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__usr_local_include_gdbm_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking /usr/local/include/gdbm.h usability" >&5
echo $ECHO_N "checking /usr/local/include/gdbm.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include </usr/local/include/gdbm.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking /usr/local/include/gdbm.h presence" >&5
echo $ECHO_N "checking /usr/local/include/gdbm.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include </usr/local/include/gdbm.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/local/include/gdbm.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: /usr/local/include/gdbm.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for /usr/local/include/gdbm.h" >&5
echo $ECHO_N "checking for /usr/local/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__usr_local_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header__usr_local_include_gdbm_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header__usr_local_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__usr_local_include_gdbm_h" >&6

fi
if test $ac_cv_header__usr_local_include_gdbm_h = yes; then
   GDBM_INCLUDE=-I/usr/local/include
else

        echo "$as_me:$LINENO: result: \"Try /opt/local/include/gdbm.h\"" >&5
echo "${ECHO_T}\"Try /opt/local/include/gdbm.h\"" >&6;
        if test "${ac_cv_header__opt_local_include_gdbm_h+set}" = set; then
  echo "$as_me:$LINENO: checking for /opt/local/include/gdbm.h" >&5
echo $ECHO_N "checking for /opt/local/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__opt_local_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header__opt_local_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__opt_local_include_gdbm_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking /opt/local/include/gdbm.h usability" >&5
echo $ECHO_N "checking /opt/local/include/gdbm.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include </opt/local/include/gdbm.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking /opt/local/include/gdbm.h presence" >&5
echo $ECHO_N "checking /opt/local/include/gdbm.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include </opt/local/include/gdbm.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: /opt/local/include/gdbm.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: /opt/local/include/gdbm.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for /opt/local/include/gdbm.h" >&5
echo $ECHO_N "checking for /opt/local/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__opt_local_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header__opt_local_include_gdbm_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header__opt_local_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__opt_local_include_gdbm_h" >&6

fi
if test $ac_cv_header__opt_local_include_gdbm_h = yes; then
   GDBM_INCLUDE=-I/opt/local/include
else

                    echo "$as_me:$LINENO: result: \"Try /usr/pkg/include/gdbm.h\"" >&5
echo "${ECHO_T}\"Try /usr/pkg/include/gdbm.h\"" >&6;
          if test "${ac_cv_header__usr_pkg_include_gdbm_h+set}" = set; then
  echo "$as_me:$LINENO: checking for /usr/pkg/include/gdbm.h" >&5
echo $ECHO_N "checking for /usr/pkg/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__usr_pkg_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header__usr_pkg_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__usr_pkg_include_gdbm_h" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking /usr/pkg/include/gdbm.h usability" >&5
echo $ECHO_N "checking /usr/pkg/include/gdbm.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include </usr/pkg/include/gdbm.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking /usr/pkg/include/gdbm.h presence" >&5
echo $ECHO_N "checking /usr/pkg/include/gdbm.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include </usr/pkg/include/gdbm.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: /usr/pkg/include/gdbm.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: /usr/pkg/include/gdbm.h: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for /usr/pkg/include/gdbm.h" >&5
echo $ECHO_N "checking for /usr/pkg/include/gdbm.h... $ECHO_C" >&6
if test "${ac_cv_header__usr_pkg_include_gdbm_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_header__usr_pkg_include_gdbm_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header__usr_pkg_include_gdbm_h" >&5
echo "${ECHO_T}$ac_cv_header__usr_pkg_include_gdbm_h" >&6

fi
if test $ac_cv_header__usr_pkg_include_gdbm_h = yes; then
   GDBM_INCLUDE=""
else

            echo "$as_me:$LINENO: result: \"Giving up - You need to install gdbm.h somewhere\"" >&5
echo "${ECHO_T}\"Giving up - You need to install gdbm.h somewhere\"" >&6;
            exit

fi



fi



fi



fi


  fi

  if test -n "$DBM_LIB"; then
    INCLUDES="$INCLUDES $GDBM_INCLUDE"
    EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
  fi


  ext_builddir=ext/db
  ext_srcdir=$abs_srcdir/ext/db

  ac_extra=

  if test "" != "shared" && test "" != "yes" && test "" != "cli"; then



  case ext/db in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/db"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/db/"; ac_bdir="ext/db/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC db"
    if test "" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC db"
    fi
  else
    if test "" = "shared" || test "" = "yes"; then

  case ext/db in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/db"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/db/"; ac_bdir="ext/db/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_db="$shared_objects_db $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_db) $(PHPDB_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_db) -L$(top_builddir)/netware -lphp4lib $(DB_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_db) $(PHPDB_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdb.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_db"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdb.$suffix: $ext_builddir/phpdb.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdb.$suffix \$(phplibdir)

$ext_builddir/phpdb.$suffix: \$(shared_objects_db) \$(PHPDB_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_db) $(DB_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_db) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_db) $(DB_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/db.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_db"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/db.$suffix: $ext_builddir/db.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/db.$suffix \$(phplibdir)

$ext_builddir/db.$suffix: \$(shared_objects_db) \$(DB_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DB 1
_ACEOF

    fi
  fi

  if test "" != "shared" && test "" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/db in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/db"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/db/"; ac_bdir="ext/db/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC db"
    else


  case ext/db in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/db"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/db/"; ac_bdir="ext/db/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC db"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi

















echo "$as_me:$LINENO: checking whether to enable DBA" >&5
echo $ECHO_N "checking whether to enable DBA... $ECHO_C" >&6
# Check whether --enable-dba or --disable-dba was given.
if test "${enable_dba+set}" = set; then
  enableval="$enable_dba"
  PHP_DBA=$enableval
else

  PHP_DBA=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DBA=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DBA in
shared,*)
  PHP_DBA=`echo "$PHP_DBA"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DBA=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





# Check whether --with-gdbm or --without-gdbm was given.
if test "${with_gdbm+set}" = set; then
  withval="$with_gdbm"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    for i in $withval /usr/local /usr; do
      if test -f "$i/include/gdbm.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/gdbm.h
        break
      fi
    done

    if test -n "$THIS_INCLUDE"; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$THIS_PREFIX/lib"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6
if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgdbm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdbm_open ();
int
main ()
{
gdbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gdbm_gdbm_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gdbm_gdbm_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gdbm_gdbm_open" >&5
echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6
if test $ac_cv_lib_gdbm_gdbm_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<_ACEOF
#define GDBM_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_GDBM 1
_ACEOF

        THIS_LIBS=gdbm


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gdbm_gdbm_open


fi

    fi


  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX

  fi

fi;

  THIS_NAME=GDBM
  if test -n ""; then
    THIS_FULL_NAME=""
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME



# Check whether --with-ndbm or --without-ndbm was given.
if test "${with_ndbm+set}" = set; then
  withval="$with_ndbm"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    for i in $withval /usr/local /usr; do
      if test -f "$i/include/ndbm.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/ndbm.h
        break
      elif test -f "$i/include/db1/ndbm.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db1/ndbm.h
        break
      fi
    done

    if test -n "$THIS_INCLUDE"; then
      for LIB in ndbm db1 c; do

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$THIS_PREFIX/lib"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$LIB''_dbm_open" | $as_tr_sh`
echo "$as_me:$LINENO: checking for dbm_open in -l$LIB" >&5
echo $ECHO_N "checking for dbm_open in -l$LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dbm_open ();
int
main ()
{
dbm_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<_ACEOF
#define NDBM_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_NDBM 1
_ACEOF

          THIS_LIBS=$LIB


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$LIB_dbm_open


fi

        if test -n "$THIS_LIBS"; then
          break
        fi
      done
    fi


  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX

  fi

fi;

  THIS_NAME=NDBM
  if test -n ""; then
    THIS_FULL_NAME=""
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME





# Check whether --with-db4 or --without-db4 was given.
if test "${with_db4+set}" = set; then
  withval="$with_db4"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
      if test -f "$i/db4/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/db4/db.h
        break
      elif test -f "$i/include/db4/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db4/db.h
        break
      elif test -f "$i/include/db/db4.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db/db4.h
        break
      elif test -f "$i/include/db4.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db4.h
        break
      elif test -f "$i/include/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db.h
        break
      fi
    done

  for LIB in db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do
    if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then

  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  old_LIBS=$LIBS
  LIBS="-l$LIB $LIBS"

        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"

int
main ()
{

          (void)db_create((DB**)0, (DB_ENV*)0, 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

          cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR == 4
            yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

            THIS_LIBS=$LIB
            break

fi
rm -f conftest*


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext

  LDFLAGS=$old_LDFLAGS
  LIBS=$old_LIBS

    fi
  done
  if test -z "$THIS_LIBS"; then
	echo "$as_me:$LINENO: checking for db4 major version" >&5
echo $ECHO_N "checking for db4 major version... $ECHO_C" >&6
    { { echo "$as_me:$LINENO: error: Header contains different version" >&5
echo "$as_me: error: Header contains different version" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "4" = "4"; then
    echo "$as_me:$LINENO: checking for db4 minor version and patch level" >&5
echo $ECHO_N "checking for db4 minor version and patch level... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6

else

      { { echo "$as_me:$LINENO: error: Version 4.1 requires patch level 25" >&5
echo "$as_me: error: Version 4.1 requires patch level 25" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test "$ext_shared" = "yes"; then
    echo "$as_me:$LINENO: checking if dba can be used as shared extension" >&5
echo $ECHO_N "checking if dba can be used as shared extension... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else

      { { echo "$as_me:$LINENO: error: At least version 3.3 is required" >&5
echo "$as_me: error: At least version 3.3 is required" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test -n "$THIS_LIBS"; then

cat >>confdefs.h <<\_ACEOF
#define DBA_DB4 1
_ACEOF

    if test -n "$THIS_INCLUDE"; then

cat >>confdefs.h <<_ACEOF
#define DB4_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF

    fi
  fi

  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX


  fi

fi;

  THIS_NAME=DB4
  if test -n "Berkeley DB4"; then
    THIS_FULL_NAME="Berkeley DB4"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME



# Check whether --with-db3 or --without-db3 was given.
if test "${with_db3+set}" = set; then
  withval="$with_db3"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    if test "$HAVE_DB4" = "1"; then

  THIS_NAME=DB3
  if test -n "Berkeley DB3"; then
    THIS_FULL_NAME="Berkeley DB3"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n "You cannot combine --with-db3 with --with-db4"; then
    { { echo "$as_me:$LINENO: error: You cannot combine --with-db3 with --with-db4" >&5
echo "$as_me: error: You cannot combine --with-db3 with --with-db4" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME

    fi
    for i in $withval /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do
      if test -f "$i/db3/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db3/db.h
        break
      elif test -f "$i/include/db3/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db3/db.h
        break
      elif test -f "$i/include/db/db3.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db/db3.h
        break
      elif test -f "$i/include/db3.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db3.h
        break
      elif test -f "$i/include/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db.h
        break
      fi
    done

  for LIB in db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db; do
    if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then

  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  old_LIBS=$LIBS
  LIBS="-l$LIB $LIBS"

        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"

int
main ()
{

          (void)db_create((DB**)0, (DB_ENV*)0, 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

          cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR == 3
            yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

            THIS_LIBS=$LIB
            break

fi
rm -f conftest*


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext

  LDFLAGS=$old_LDFLAGS
  LIBS=$old_LIBS

    fi
  done
  if test -z "$THIS_LIBS"; then
	echo "$as_me:$LINENO: checking for db3 major version" >&5
echo $ECHO_N "checking for db3 major version... $ECHO_C" >&6
    { { echo "$as_me:$LINENO: error: Header contains different version" >&5
echo "$as_me: error: Header contains different version" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "3" = "4"; then
    echo "$as_me:$LINENO: checking for db4 minor version and patch level" >&5
echo $ECHO_N "checking for db4 minor version and patch level... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6

else

      { { echo "$as_me:$LINENO: error: Version 4.1 requires patch level 25" >&5
echo "$as_me: error: Version 4.1 requires patch level 25" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test "$ext_shared" = "yes"; then
    echo "$as_me:$LINENO: checking if dba can be used as shared extension" >&5
echo $ECHO_N "checking if dba can be used as shared extension... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else

      { { echo "$as_me:$LINENO: error: At least version 3.3 is required" >&5
echo "$as_me: error: At least version 3.3 is required" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test -n "$THIS_LIBS"; then

cat >>confdefs.h <<\_ACEOF
#define DBA_DB3 1
_ACEOF

    if test -n "$THIS_INCLUDE"; then

cat >>confdefs.h <<_ACEOF
#define DB3_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF

    fi
  fi

  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX


  fi

fi;

  THIS_NAME=DB3
  if test -n "Berkeley DB3"; then
    THIS_FULL_NAME="Berkeley DB3"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME



# Check whether --with-db2 or --without-db2 was given.
if test "${with_db2+set}" = set; then
  withval="$with_db2"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    if test "$HAVE_DB3" = "1" -o "$HAVE_DB4" = "1"; then

  THIS_NAME=DB2
  if test -n "Berkeley DB2"; then
    THIS_FULL_NAME="Berkeley DB2"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n "You cannot combine --with-db2 with --with-db3 or --with-db4"; then
    { { echo "$as_me:$LINENO: error: You cannot combine --with-db2 with --with-db3 or --with-db4" >&5
echo "$as_me: error: You cannot combine --with-db2 with --with-db3 or --with-db4" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME

    fi
    for i in $withval $withval/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do
      if test -f "$i/db2/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/db2/db.h
        break
      elif test -f "$i/include/db2/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db2/db.h
        break
      elif test -f "$i/include/db/db2.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db/db2.h
        break
      elif test -f "$i/include/db2.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db2.h
        break
      elif test -f "$i/include/db.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/db.h
        break
      fi
    done

  for LIB in db-2 db2 db; do
    if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then

  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  old_LIBS=$LIBS
  LIBS="-l$LIB $LIBS"

        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"

int
main ()
{

          (void)db_appinit("", NULL, (DB_ENV*)0, 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

          cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR == 2
            yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

            THIS_LIBS=$LIB
            break

fi
rm -f conftest*


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext

  LDFLAGS=$old_LDFLAGS
  LIBS=$old_LIBS

    fi
  done
  if test -z "$THIS_LIBS"; then
	echo "$as_me:$LINENO: checking for db2 major version" >&5
echo $ECHO_N "checking for db2 major version... $ECHO_C" >&6
    { { echo "$as_me:$LINENO: error: Header contains different version" >&5
echo "$as_me: error: Header contains different version" >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "2" = "4"; then
    echo "$as_me:$LINENO: checking for db4 minor version and patch level" >&5
echo $ECHO_N "checking for db4 minor version and patch level... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6

else

      { { echo "$as_me:$LINENO: error: Version 4.1 requires patch level 25" >&5
echo "$as_me: error: Version 4.1 requires patch level 25" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test "$ext_shared" = "yes"; then
    echo "$as_me:$LINENO: checking if dba can be used as shared extension" >&5
echo $ECHO_N "checking if dba can be used as shared extension... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$THIS_INCLUDE"
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
      yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else

      { { echo "$as_me:$LINENO: error: At least version 3.3 is required" >&5
echo "$as_me: error: At least version 3.3 is required" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi
  if test -n "$THIS_LIBS"; then

cat >>confdefs.h <<\_ACEOF
#define DBA_DB2 1
_ACEOF

    if test -n "$THIS_INCLUDE"; then

cat >>confdefs.h <<_ACEOF
#define DB2_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF

    fi
  fi

  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX


  fi

fi;

  THIS_NAME=DB2
  if test -n "Berkeley DB2"; then
    THIS_FULL_NAME="Berkeley DB2"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME



# Check whether --with-dbm or --without-dbm was given.
if test "${with_dbm+set}" = set; then
  withval="$with_dbm"

  if test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    for i in $withval /usr/local /usr; do
      if test -f "$i/include/dbm.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/dbm.h
        break
      elif test -f "$i/include/gdbm/dbm.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/gdbm/dbm.h
        break
      fi
    done

    if test -n "$THIS_INCLUDE"; then
      for LIB in dbm c gdbm; do

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$THIS_PREFIX/lib"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$LIB''_dbminit" | $as_tr_sh`
echo "$as_me:$LINENO: checking for dbminit in -l$LIB" >&5
echo $ECHO_N "checking for dbminit in -l$LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dbminit ();
int
main ()
{
dbminit ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

          echo "$as_me:$LINENO: checking for DBM using GDBM" >&5
echo $ECHO_N "checking for DBM using GDBM... $ECHO_C" >&6

cat >>confdefs.h <<_ACEOF
#define DBM_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF

          if test "$LIB" = "gdbm"; then

cat >>confdefs.h <<_ACEOF
#define DBM_VERSION "GDBM"
_ACEOF

            echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
          else

cat >>confdefs.h <<_ACEOF
#define DBM_VERSION "DBM"
_ACEOF

            echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
          fi

cat >>confdefs.h <<\_ACEOF
#define DBA_DBM 1
_ACEOF

          THIS_LIBS=$LIB


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$LIB_dbminit


fi

        if test -n "$THIS_LIBS"; then
          break
        fi
      done
    fi


  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX

  fi

fi;

  THIS_NAME=DBM
  if test -n ""; then
    THIS_FULL_NAME=""
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME





# Check whether --with-cdb or --without-cdb was given.
if test "${with_cdb+set}" = set; then
  withval="$with_cdb"

  if test "$withval" = "yes" -o "$HAVE_DBA" = "1"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB_BUILTIN 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB_MAKE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB 1
_ACEOF

  cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c"
  THIS_RESULT="builtin"

  elif test "$withval" != "no"; then

  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT

    for i in $withval /usr/local /usr; do
      if test -f "$i/include/cdb.h"; then
        THIS_PREFIX=$i
        THIS_INCLUDE=$i/include/cdb.h
        break
      fi
    done

    if test -n "$THIS_INCLUDE"; then
      for LIB in cdb c; do

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$THIS_PREFIX/lib"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$LIB''_cdb_read" | $as_tr_sh`
echo "$as_me:$LINENO: checking for cdb_read in -l$LIB" >&5
echo $ECHO_N "checking for cdb_read in -l$LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char cdb_read ();
int
main ()
{
cdb_read ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<_ACEOF
#define CDB_INCLUDE_FILE "$THIS_INCLUDE"
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB 1
_ACEOF

          THIS_LIBS=$LIB


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$LIB_cdb_read


fi

        if test -n "$THIS_LIBS"; then
          break
        fi
      done
    fi


  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi


  THIS_RESULT="yes"
  if test -z "$THIS_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary header file(s)." >&5
echo "$as_me: error: DBA: Could not find necessary header file(s)." >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test -z "$THIS_LIBS"; then
    { { echo "$as_me:$LINENO: error: DBA: Could not find necessary library." >&5
echo "$as_me: error: DBA: Could not find necessary library." >&2;}
   { (exit 1); exit 1; }; }
  fi




  if test "$ext_shared" = "yes"; then
    DBA_SHARED_LIBADD="-l$THIS_LIBS $DBA_SHARED_LIBADD"
    if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DBA_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DBA_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$THIS_LFLAGS"; then

  if test "$THIS_LFLAGS" != "/usr/lib"; then

  if test -z "$THIS_LFLAGS" || echo "$THIS_LFLAGS" | grep '^/' >/dev/null ; then
    ai_p=$THIS_LFLAGS
  else

    ep_dir="`echo $THIS_LFLAGS|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_LFLAGS\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $THIS_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$THIS_LIBS $LIBS"
   ;;
  esac




  fi


  unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX

  fi

else

  if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB_BUILTIN 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB_MAKE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBA_CDB 1
_ACEOF

  cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c"
  THIS_RESULT="builtin"

  fi

fi;

  THIS_NAME=CDB
  if test -n ""; then
    THIS_FULL_NAME=""
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME





# Check whether --with-inifile or --without-inifile was given.
if test "${with_inifile+set}" = set; then
  withval="$with_inifile"

  if test "$withval" != "no"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_INIFILE 1
_ACEOF

  ini_sources="libinifile/inifile.c"
  THIS_RESULT="builtin"

  fi

else

  if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_INIFILE 1
_ACEOF

  ini_sources="libinifile/inifile.c"
  THIS_RESULT="builtin"

  fi

fi;

  THIS_NAME=INIFILE
  if test -n "INI File"; then
    THIS_FULL_NAME="INI File"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME





# Check whether --with-flatfile or --without-flatfile was given.
if test "${with_flatfile+set}" = set; then
  withval="$with_flatfile"

  if test "$withval" != "no"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_FLATFILE 1
_ACEOF

  flat_sources="libflatfile/flatfile.c"
  THIS_RESULT="builtin"

  fi

else

  if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then


cat >>confdefs.h <<\_ACEOF
#define DBA_FLATFILE 1
_ACEOF

  flat_sources="libflatfile/flatfile.c"
  THIS_RESULT="builtin"

  fi

fi;

  THIS_NAME=FLATFILE
  if test -n "FlatFile"; then
    THIS_FULL_NAME="FlatFile"
  else
    THIS_FULL_NAME="$THIS_NAME"
  fi
  echo "$as_me:$LINENO: checking for $THIS_FULL_NAME support" >&5
echo $ECHO_N "checking for $THIS_FULL_NAME support... $ECHO_C" >&6
  if test -n ""; then
    { { echo "$as_me:$LINENO: error: " >&5
echo "$as_me: error: " >&2;}
   { (exit 1); exit 1; }; }
  fi
  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
    HAVE_DBA=1
    eval HAVE_$THIS_NAME=1
    echo "$as_me:$LINENO: result: $THIS_RESULT" >&5
echo "${ECHO_T}$THIS_RESULT" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
  unset THIS_RESULT THIS_NAME THIS_FULL_NAME


echo "$as_me:$LINENO: checking whether to enable DBA interface" >&5
echo $ECHO_N "checking whether to enable DBA interface... $ECHO_C" >&6
if test "$HAVE_DBA" = "1"; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

cat >>confdefs.h <<\_ACEOF
#define HAVE_DBA 1
_ACEOF


  ext_builddir=ext/dba
  ext_srcdir=$abs_srcdir/ext/dba

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/dba in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources $ini_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC dba"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC dba"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/dba in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources $ini_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_dba="$shared_objects_dba $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dba) $(PHPDBA_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) -L$(top_builddir)/netware -lphp4lib $(DBA_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(PHPDBA_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdba.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dba"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdba.$suffix: $ext_builddir/phpdba.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdba.$suffix \$(phplibdir)

$ext_builddir/phpdba.$suffix: \$(shared_objects_dba) \$(PHPDBA_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dba) $(DBA_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dba) $(DBA_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/dba.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dba"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/dba.$suffix: $ext_builddir/dba.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/dba.$suffix \$(phplibdir)

$ext_builddir/dba.$suffix: \$(shared_objects_dba) \$(DBA_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DBA 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/dba in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources $ini_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC dba"
    else


  case ext/dba in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dba"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dba/"; ac_bdir="ext/dba/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c $cdb_sources $flat_sources $ini_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC dba"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  BUILD_DIR="$BUILD_DIR $ext_builddir/libinifile"


  BUILD_DIR="$BUILD_DIR $ext_builddir/libcdb"


  BUILD_DIR="$BUILD_DIR $ext_builddir/libflatfile"


  PHP_VAR_SUBST="$PHP_VAR_SUBST DBA_SHARED_LIBADD"

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi



# Check whether --with-dbase or --without-dbase was given.
if test "${with_dbase+set}" = set; then
  withval="$with_dbase"
  enable_dbase=$withval
fi;



echo "$as_me:$LINENO: checking whether to enable dbase support" >&5
echo $ECHO_N "checking whether to enable dbase support... $ECHO_C" >&6
# Check whether --enable-dbase or --disable-dbase was given.
if test "${enable_dbase+set}" = set; then
  enableval="$enable_dbase"
  PHP_DBASE=$enableval
else

  PHP_DBASE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DBASE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DBASE in
shared,*)
  PHP_DBASE=`echo "$PHP_DBASE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DBASE" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define DBASE 1
_ACEOF


  ext_builddir=ext/dbase
  ext_srcdir=$abs_srcdir/ext/dbase

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/dbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbase/"; ac_bdir="ext/dbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC dbase"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC dbase"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/dbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbase/"; ac_bdir="ext/dbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_dbase="$shared_objects_dbase $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dbase) $(PHPDBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbase) -L$(top_builddir)/netware -lphp4lib $(DBASE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbase) $(PHPDBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdbase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dbase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdbase.$suffix: $ext_builddir/phpdbase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdbase.$suffix \$(phplibdir)

$ext_builddir/phpdbase.$suffix: \$(shared_objects_dbase) \$(PHPDBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dbase) $(DBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbase) -L$(top_builddir)/netware -lphp4lib $(SE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbase) $(DBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/dbase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dbase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/dbase.$suffix: $ext_builddir/dbase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/dbase.$suffix \$(phplibdir)

$ext_builddir/dbase.$suffix: \$(shared_objects_dbase) \$(DBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DBASE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/dbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbase/"; ac_bdir="ext/dbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC dbase"
    else


  case ext/dbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbase/"; ac_bdir="ext/dbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbf_head.c dbf_rec.c dbf_misc.c dbf_ndx.c dbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC dbase"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking whether to enable dbx support" >&5
echo $ECHO_N "checking whether to enable dbx support... $ECHO_C" >&6
# Check whether --enable-dbx or --disable-dbx was given.
if test "${enable_dbx+set}" = set; then
  enableval="$enable_dbx"
  PHP_DBX=$enableval
else

  PHP_DBX=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DBX=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DBX in
shared,*)
  PHP_DBX=`echo "$PHP_DBX"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DBX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DBX" != "no"; then

  ext_builddir=ext/dbx
  ext_srcdir=$abs_srcdir/ext/dbx

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/dbx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbx/"; ac_bdir="ext/dbx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC dbx"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC dbx"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/dbx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbx/"; ac_bdir="ext/dbx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_dbx="$shared_objects_dbx $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dbx) $(PHPDBX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbx) -L$(top_builddir)/netware -lphp4lib $(DBX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbx) $(PHPDBX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdbx.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dbx"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdbx.$suffix: $ext_builddir/phpdbx.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdbx.$suffix \$(phplibdir)

$ext_builddir/phpdbx.$suffix: \$(shared_objects_dbx) \$(PHPDBX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dbx) $(DBX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbx) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dbx) $(DBX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/dbx.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dbx"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/dbx.$suffix: $ext_builddir/dbx.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/dbx.$suffix \$(phplibdir)

$ext_builddir/dbx.$suffix: \$(shared_objects_dbx) \$(DBX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DBX 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/dbx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbx/"; ac_bdir="ext/dbx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC dbx"
    else


  case ext/dbx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dbx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dbx/"; ac_bdir="ext/dbx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC dbx"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking whether to enable direct I/O support" >&5
echo $ECHO_N "checking whether to enable direct I/O support... $ECHO_C" >&6
# Check whether --enable-dio or --disable-dio was given.
if test "${enable_dio+set}" = set; then
  enableval="$enable_dio"
  PHP_DIO=$enableval
else

  PHP_DIO=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DIO=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DIO in
shared,*)
  PHP_DIO=`echo "$PHP_DIO"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DIO=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DIO" != "no"; then

  ext_builddir=ext/dio
  ext_srcdir=$abs_srcdir/ext/dio

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/dio in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dio.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC dio"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC dio"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/dio in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in dio.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_dio="$shared_objects_dio $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dio) $(PHPDIO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) -L$(top_builddir)/netware -lphp4lib $(DIO_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) $(PHPDIO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdio.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dio"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdio.$suffix: $ext_builddir/phpdio.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdio.$suffix \$(phplibdir)

$ext_builddir/phpdio.$suffix: \$(shared_objects_dio) \$(PHPDIO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_dio) $(DIO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_dio) $(DIO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/dio.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_dio"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/dio.$suffix: $ext_builddir/dio.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/dio.$suffix \$(phplibdir)

$ext_builddir/dio.$suffix: \$(shared_objects_dio) \$(DIO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DIO 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/dio in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dio.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC dio"
    else


  case ext/dio in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/dio"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/dio/"; ac_bdir="ext/dio/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in dio.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC dio"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi






echo "$as_me:$LINENO: checking for DOM support" >&5
echo $ECHO_N "checking for DOM support... $ECHO_C" >&6

# Check whether --with-dom or --without-dom was given.
if test "${with_dom+set}" = set; then
  withval="$with_dom"
  PHP_DOM=$withval
else

  PHP_DOM=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_DOM=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_DOM in
shared,*)
  PHP_DOM=`echo "$PHP_DOM"|sed 's/^shared,//'`
  ;;
shared)
  PHP_DOM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test -z "$PHP_ZLIB_DIR"; then


echo "$as_me:$LINENO: checking for the location of libz" >&5
echo $ECHO_N "checking for the location of libz... $ECHO_C" >&6

# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
  withval="$with_zlib_dir"
  PHP_ZLIB_DIR=$withval
else

  PHP_ZLIB_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ZLIB_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ZLIB_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test "$PHP_DOM" != "no"; then

  DOMXML_DIR_ADD=""
  if test -r $PHP_DOM/include/libxml2/libxml/tree.h; then
    DOMXML_DIR=$PHP_DOM
    DOMXML_DIR_ADD="/libxml2"
  elif test -r $PHP_DOM/include/libxml/tree.h; then
    DOMXML_DIR=$PHP_DOM
  else
    for i in /usr/local /usr; do
      test -r $i/include/libxml/tree.h && DOMXML_DIR=$i
      test -r $i/include/libxml2/libxml/tree.h && DOMXML_DIR=$i && DOMXML_DIR_ADD="/libxml2"
    done
  fi

  if test -z "$DOMXML_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the libxml >= 2.4.14 distribution" >&5
echo "$as_me: error: Please reinstall the libxml >= 2.4.14 distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$DOMXML_DIR/include$DOMXML_DIR_ADD
  echo "$as_me:$LINENO: checking for libxml version" >&5
echo $ECHO_N "checking for libxml version... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <libxml/xmlversion.h>
#if LIBXML_VERSION >= 20414
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    echo "$as_me:$LINENO: result: >= 2.4.14" >&5
echo "${ECHO_T}>= 2.4.14" >&6

else

    { { echo "$as_me:$LINENO: error: libxml version 2.4.14 or greater required." >&5
echo "$as_me: error: libxml version 2.4.14 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  CPPFLAGS=$old_CPPFLAGS


  if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
    DOM_LIBNAME=xml2
  else
    DOM_LIBNAME=xml
  fi

  XML2_CONFIG=$DOMXML_DIR/bin/xml2-config

  if test -x $XML2_CONFIG; then
    DOM_LIBS=`$XML2_CONFIG --libs`

  for ac_i in $DOM_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$DOMXML_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  else


  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-l$DOM_LIBNAME $DOMXML_SHARED_LIBADD"
    if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $DOM_LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$DOM_LIBNAME $LIBS"
   ;;
  esac




  fi


  fi


  if test "$DOMXML_DIR/include$DOMXML_DIR_ADD" != "/usr/include"; then

  if test -z "$DOMXML_DIR/include$DOMXML_DIR_ADD" || echo "$DOMXML_DIR/include$DOMXML_DIR_ADD" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/include$DOMXML_DIR_ADD
  else

    ep_dir="`echo $DOMXML_DIR/include$DOMXML_DIR_ADD|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/include$DOMXML_DIR_ADD\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$PHP_ZLIB_DIR" = "no"; then
    { { echo "$as_me:$LINENO: error: DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>" >&5
echo "$as_me: error: DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
  else


  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-lz $DOMXML_SHARED_LIBADD"
    if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac




  fi


  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_DOMXML 1
_ACEOF


  ext_builddir=ext/domxml
  ext_srcdir=$abs_srcdir/ext/domxml

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/domxml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/domxml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/domxml/"; ac_bdir="ext/domxml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_domxml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC domxml"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC domxml"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/domxml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/domxml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/domxml/"; ac_bdir="ext/domxml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_domxml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_domxml="$shared_objects_domxml $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_domxml) $(PHPDOMXML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_domxml) -L$(top_builddir)/netware -lphp4lib $(DOMXML_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_domxml) $(PHPDOMXML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpdomxml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_domxml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpdomxml.$suffix: $ext_builddir/phpdomxml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpdomxml.$suffix \$(phplibdir)

$ext_builddir/phpdomxml.$suffix: \$(shared_objects_domxml) \$(PHPDOMXML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_domxml) $(DOMXML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_domxml) -L$(top_builddir)/netware -lphp4lib $(XML_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_domxml) $(DOMXML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/domxml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_domxml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/domxml.$suffix: $ext_builddir/domxml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/domxml.$suffix \$(phplibdir)

$ext_builddir/domxml.$suffix: \$(shared_objects_domxml) \$(DOMXML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_DOMXML 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/domxml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/domxml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/domxml/"; ac_bdir="ext/domxml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_domxml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC domxml"
    else


  case ext/domxml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/domxml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/domxml/"; ac_bdir="ext/domxml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_domxml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC domxml"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST DOMXML_SHARED_LIBADD"

fi







echo "$as_me:$LINENO: checking for DOM XSLT support" >&5
echo $ECHO_N "checking for DOM XSLT support... $ECHO_C" >&6

# Check whether --with-dom-xslt or --without-dom-xslt was given.
if test "${with_dom_xslt+set}" = set; then
  withval="$with_dom_xslt"
  PHP_DOM_XSLT=$withval
else

  PHP_DOM_XSLT=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_DOM_XSLT=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_DOM_XSLT
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for DOM EXSLT support" >&5
echo $ECHO_N "checking for DOM EXSLT support... $ECHO_C" >&6

# Check whether --with-dom-exslt or --without-dom-exslt was given.
if test "${with_dom_exslt+set}" = set; then
  withval="$with_dom_exslt"
  PHP_DOM_EXSLT=$withval
else

  PHP_DOM_EXSLT=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_DOM_EXSLT=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_DOM_EXSLT
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_DOM_XSLT" != "no"; then

  if test -r $PHP_DOM_XSLT/include/libxslt/transform.h; then
    DOMXSLT_DIR=$PHP_DOM_XSLT
  else
    for i in /usr/local /usr; do
      test -r $i/include/libxslt/transform.h && DOMXSLT_DIR=$i
    done
  fi

  if test -z "$DOMXSLT_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the libxslt >= 1.0.3 distribution" >&5
echo "$as_me: error: Please reinstall the libxslt >= 1.0.3 distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$DOMXSLT_DIR/include
  echo "$as_me:$LINENO: checking for libxslt version" >&5
echo $ECHO_N "checking for libxslt version... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <libxslt/xsltconfig.h>
#if LIBXSLT_VERSION >= 10018
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    echo "$as_me:$LINENO: result: >= 1.0.18" >&5
echo "${ECHO_T}>= 1.0.18" >&6

else

    { { echo "$as_me:$LINENO: error: libxslt version 1.0.18 or greater required." >&5
echo "$as_me: error: libxslt version 1.0.18 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  CPPFLAGS=$old_CPPFLAGS




  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-lxslt $DOMXML_SHARED_LIBADD"
    if test -n "$DOMXSLT_DIR/lib"; then

  if test "$DOMXSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXSLT_DIR/lib" || echo "$DOMXSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXSLT_DIR/lib
  else

    ep_dir="`echo $DOMXSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXSLT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$DOMXSLT_DIR/lib"; then

  if test "$DOMXSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXSLT_DIR/lib" || echo "$DOMXSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXSLT_DIR/lib
  else

    ep_dir="`echo $DOMXSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXSLT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case xslt in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lxslt $LIBS"
   ;;
  esac




  fi




  if test "$DOMXSLT_DIR/include" != "/usr/include"; then

  if test -z "$DOMXSLT_DIR/include" || echo "$DOMXSLT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$DOMXSLT_DIR/include
  else

    ep_dir="`echo $DOMXSLT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXSLT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$PHP_DOM" = "no"; then
    { { echo "$as_me:$LINENO: error: DOMXSLT requires DOMXML. Use --with-dom=<DIR>" >&5
echo "$as_me: error: DOMXSLT requires DOMXML. Use --with-dom=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
    DOM_LIBNAME=xml2
  else
    DOM_LIBNAME=xml
  fi



  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-l$DOM_LIBNAME $DOMXML_SHARED_LIBADD"
    if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $DOM_LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$DOM_LIBNAME $LIBS"
   ;;
  esac




  fi



  if test "$DOMXML_DIR/include$DOMXML_DIR_ADD" != "/usr/include"; then

  if test -z "$DOMXML_DIR/include$DOMXML_DIR_ADD" || echo "$DOMXML_DIR/include$DOMXML_DIR_ADD" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/include$DOMXML_DIR_ADD
  else

    ep_dir="`echo $DOMXML_DIR/include$DOMXML_DIR_ADD|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/include$DOMXML_DIR_ADD\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test -f $DOMXML_DIR/lib/libxsltbreakpoint.a -o -f $DOMXML_DIR/lib/libxsltbreakpoint.$SHLIB_SUFFIX_NAME ; then


  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-lxsltbreakpoint $DOMXML_SHARED_LIBADD"
    if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$DOMXML_DIR/lib"; then

  if test "$DOMXML_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMXML_DIR/lib" || echo "$DOMXML_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMXML_DIR/lib
  else

    ep_dir="`echo $DOMXML_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMXML_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case xsltbreakpoint in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lxsltbreakpoint $LIBS"
   ;;
  esac




  fi


  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_DOMXSLT 1
_ACEOF



  PHP_VAR_SUBST="$PHP_VAR_SUBST DOMXML_SHARED_LIBADD"

fi

if test "$PHP_DOM_EXSLT" != "no"; then
  if test "$PHP_DOM" = "no"; then
    { { echo "$as_me:$LINENO: error: DOMEXSLT requires DOMXML. Use --with-dom=<DIR>" >&5
echo "$as_me: error: DOMEXSLT requires DOMXML. Use --with-dom=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test "$PHP_DOM_XSLT" = "no"; then
    { { echo "$as_me:$LINENO: error: DOMEXSLT requires DOMXSLT. Use --with-dom-xslt=<DIR>" >&5
echo "$as_me: error: DOMEXSLT requires DOMXSLT. Use --with-dom-xslt=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -r $PHP_DOM_EXSLT/include/libexslt/exslt.h; then
    DOMEXSLT_DIR=$PHP_DOM_EXSLT
  else
    for i in /usr/local /usr; do
      test -r $i/include/libexslt/exslt.h && DOMEXSLT_DIR=$i
    done
  fi

  if test -z "$DOMEXSLT_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the libxslt >= 1.0.3 distribution" >&5
echo "$as_me: error: Please reinstall the libxslt >= 1.0.3 distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$DOMEXSLT_DIR/include
  echo "$as_me:$LINENO: checking for libexslt version" >&5
echo $ECHO_N "checking for libexslt version... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <libexslt/exsltconfig.h>
#if LIBEXSLT_VERSION >= 600
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    echo "$as_me:$LINENO: result: >= 1.0.3" >&5
echo "${ECHO_T}>= 1.0.3" >&6

else

    { { echo "$as_me:$LINENO: error: libxslt version 1.0.3 or greater required." >&5
echo "$as_me: error: libxslt version 1.0.3 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  CPPFLAGS=$old_CPPFLAGS




  if test "$ext_shared" = "yes"; then
    DOMXML_SHARED_LIBADD="-lexslt $DOMXML_SHARED_LIBADD"
    if test -n "$DOMEXSLT_DIR/lib"; then

  if test "$DOMEXSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMEXSLT_DIR/lib" || echo "$DOMEXSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMEXSLT_DIR/lib
  else

    ep_dir="`echo $DOMEXSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMEXSLT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        DOMXML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $DOMXML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$DOMEXSLT_DIR/lib"; then

  if test "$DOMEXSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$DOMEXSLT_DIR/lib" || echo "$DOMEXSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DOMEXSLT_DIR/lib
  else

    ep_dir="`echo $DOMEXSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMEXSLT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case exslt in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lexslt $LIBS"
   ;;
  esac




  fi




  if test "$DOMEXSLT_DIR/include" != "/usr/include"; then

  if test -z "$DOMEXSLT_DIR/include" || echo "$DOMEXSLT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$DOMEXSLT_DIR/include
  else

    ep_dir="`echo $DOMEXSLT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DOMEXSLT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_DOMEXSLT 1
_ACEOF



  PHP_VAR_SUBST="$PHP_VAR_SUBST DOMXML_SHARED_LIBADD"


fi




# Check whether --with-eaccelerator or --without-eaccelerator was given.
if test "${with_eaccelerator+set}" = set; then
  withval="$with_eaccelerator"
  enable_eaccelerator=$withval
fi;



echo "$as_me:$LINENO: checking whether to enable eaccelerator support" >&5
echo $ECHO_N "checking whether to enable eaccelerator support... $ECHO_C" >&6
# Check whether --enable-eaccelerator or --disable-eaccelerator was given.
if test "${enable_eaccelerator+set}" = set; then
  enableval="$enable_eaccelerator"
  PHP_EACCELERATOR=$enableval
else

  PHP_EACCELERATOR=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_EACCELERATOR=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_EACCELERATOR in
shared,*)
  PHP_EACCELERATOR=`echo "$PHP_EACCELERATOR"|sed 's/^shared,//'`
  ;;
shared)
  PHP_EACCELERATOR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





# Check whether --with-eaccelerator-crash-detection or --without-eaccelerator-crash-detection was given.
if test "${with_eaccelerator_crash_detection+set}" = set; then
  withval="$with_eaccelerator_crash_detection"

  eaccelerator_crash_detection=$withval

else

  eaccelerator_crash_detection=yes

fi;


# Check whether --with-eaccelerator-optimizer or --without-eaccelerator-optimizer was given.
if test "${with_eaccelerator_optimizer+set}" = set; then
  withval="$with_eaccelerator_optimizer"

  eaccelerator_optimizer=$withval

else

  eaccelerator_optimizer=yes

fi;


# Check whether --with-eaccelerator-encoder or --without-eaccelerator-encoder was given.
if test "${with_eaccelerator_encoder+set}" = set; then
  withval="$with_eaccelerator_encoder"

  eaccelerator_encoder=$withval

else

  eaccelerator_encoder=yes

fi;


# Check whether --with-eaccelerator-loader or --without-eaccelerator-loader was given.
if test "${with_eaccelerator_loader+set}" = set; then
  withval="$with_eaccelerator_loader"

  eaccelerator_loader=$withval

else

  eaccelerator_loader=yes

fi;


# Check whether --with-eaccelerator-shared-memory or --without-eaccelerator-shared-memory was given.
if test "${with_eaccelerator_shared_memory+set}" = set; then
  withval="$with_eaccelerator_shared_memory"

  eaccelerator_shm=$withval

else

  eaccelerator_shm=no

fi;


# Check whether --with-eaccelerator-sessions or --without-eaccelerator-sessions was given.
if test "${with_eaccelerator_sessions+set}" = set; then
  withval="$with_eaccelerator_sessions"

  eaccelerator_sessions=$withval

else

  eaccelerator_sessions=no

fi;


# Check whether --with-eaccelerator-content-caching or --without-eaccelerator-content-caching was given.
if test "${with_eaccelerator_content_caching+set}" = set; then
  withval="$with_eaccelerator_content_caching"

  eaccelerator_content_caching=$withval

else

  eaccelerator_content_caching=no

fi;


# Check whether --with-eaccelerator-info or --without-eaccelerator-info was given.
if test "${with_eaccelerator_info+set}" = set; then
  withval="$with_eaccelerator_info"

  eaccelerator_info=$withval

else

  eaccelerator_info=yes

fi;


# Check whether --with-eaccelerator-disassembler or --without-eaccelerator-disassembler was given.
if test "${with_eaccelerator_disassembler+set}" = set; then
  withval="$with_eaccelerator_disassembler"

  eaccelerator_disassembler=$withval

else

  eaccelerator_disassemmbler=no

fi;


# Check whether --with-eaccelerator-use-inode or --without-eaccelerator-use-inode was given.
if test "${with_eaccelerator_use_inode+set}" = set; then
  withval="$with_eaccelerator_use_inode"

  eaccelerator_inode=$withval

else

  eaccelerator_inode=yes

fi;


# Check whether --with-eaccelerator-debug or --without-eaccelerator-debug was given.
if test "${with_eaccelerator_debug+set}" = set; then
  withval="$with_eaccelerator_debug"

  eaccelerator_debug=$withval

else

  eaccelerator_debug=no

fi;


# Check whether --with-eaccelerator-userid or --without-eaccelerator-userid was given.
if test "${with_eaccelerator_userid+set}" = set; then
  withval="$with_eaccelerator_userid"

  ea_userid=$withval

else

  ea_userid=0

fi;


# Check whether --with-eaccelerator-doc-comment-inclusion or --without-eaccelerator-doc-comment-inclusion was given.
if test "${with_eaccelerator_doc_comment_inclusion+set}" = set; then
  withval="$with_eaccelerator_doc_comment_inclusion"

    enable_doc_comment_inclusion=$withval

else

    enable_doc_comment_inclusion=no

fi;

if test "$PHP_EACCELERATOR" != "no"; then

  sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < $abs_srcdir/ext/eaccelerator/Makefile.in`


  ext_builddir=ext/eaccelerator
  ext_srcdir=$abs_srcdir/ext/eaccelerator

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/eaccelerator in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/eaccelerator"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/eaccelerator/"; ac_bdir="ext/eaccelerator/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC eaccelerator"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC eaccelerator"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/eaccelerator in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/eaccelerator"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/eaccelerator/"; ac_bdir="ext/eaccelerator/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_eaccelerator="$shared_objects_eaccelerator $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) $(PHPEACCELERATOR_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) -L$(top_builddir)/netware -lphp4lib $(EACCELERATOR_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) $(PHPEACCELERATOR_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpeaccelerator.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_eaccelerator"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpeaccelerator.$suffix: $ext_builddir/phpeaccelerator.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpeaccelerator.$suffix \$(phplibdir)

$ext_builddir/phpeaccelerator.$suffix: \$(shared_objects_eaccelerator) \$(PHPEACCELERATOR_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) $(EACCELERATOR_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) -L$(top_builddir)/netware -lphp4lib $(CELERATOR_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_eaccelerator) $(EACCELERATOR_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/eaccelerator.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_eaccelerator"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/eaccelerator.$suffix: $ext_builddir/eaccelerator.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/eaccelerator.$suffix \$(phplibdir)

$ext_builddir/eaccelerator.$suffix: \$(shared_objects_eaccelerator) \$(EACCELERATOR_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_EACCELERATOR 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/eaccelerator in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/eaccelerator"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/eaccelerator/"; ac_bdir="ext/eaccelerator/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC eaccelerator"
    else


  case ext/eaccelerator in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/eaccelerator"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/eaccelerator/"; ac_bdir="ext/eaccelerator/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC eaccelerator"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  if test -r "$ext_srcdir/Makefile.frag"; then

  src=$ext_srcdir/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_EACCELERATOR 1
_ACEOF



cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_INFO 1
_ACEOF



cat >>confdefs.h <<_ACEOF
#define EA_USERID $ea_userid
_ACEOF


  if test "$enable_doc_comment_inclusion" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define INCLUDE_DOC_COMMENTS 1
_ACEOF

  fi
  if test "$eaccelerator_crash_detection" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_CRASH_DETECTION 1
_ACEOF

  fi
  if test "$eaccelerator_optimizer" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_OPTIMIZER 1
_ACEOF

  fi
  if test "$eaccelerator_encoder" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_ENCODER 1
_ACEOF

  fi
  if test "$eaccelerator_loader" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_LOADER 1
_ACEOF

  fi
  if test "$eaccelerator_shm" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_SHM 1
_ACEOF

  fi
  if test "$eaccelerator_info" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_INFO 1
_ACEOF

  fi
  if test "$eaccelerator_sessions" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_SESSIONS 1
_ACEOF

  fi
  if test "$eaccelerator_content_caching" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_CONTENT_CACHING 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_SHM 1
_ACEOF

  fi
  if test "$eaccelerator_disassembler" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_DISASSEMBLER 1
_ACEOF

  fi
  if test "$eaccelerator_inode" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define WITH_EACCELERATOR_USE_INODE 1
_ACEOF

  fi
  if test "$eaccelerator_debug" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define DEBUG 1
_ACEOF

  fi







for ac_header in unistd.h limits.h sys/param.h sched.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  echo "$as_me:$LINENO: checking mandatory system headers" >&5
echo $ECHO_N "checking mandatory system headers... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  msg=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  msg=no
fi
rm -f conftest.err conftest.$ac_ext
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking whether union semun is defined in sys/sem.h" >&5
echo $ECHO_N "checking whether union semun is defined in sys/sem.h... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

  #include <sys/types.h>
  #include <sys/ipc.h>
  #include <sys/sem.h>

int
main ()
{

  union semun arg;
  semctl(0, 0, 0, arg);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_UNION_SEMUN 1
_ACEOF

  msg=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

msg=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  mm_shm_ipc=no
  mm_shm_mmap_anon=no
  mm_shm_mmap_zero=no
  mm_shm_mmap_file=no
  mm_shm_mmap_posix=no

  echo "$as_me:$LINENO: checking for sysvipc shared memory support" >&5
echo $ECHO_N "checking for sysvipc shared memory support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_NONE
#define MM_SHM_IPC
#define MM_TEST_SHM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_shm_ipc=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  # for cygwin ipc error
  if test -f conftest* ; then
    echo $ECHO_N "Wait for conftest* to exit$ECHO_C"
    while ! rm -f conftest* 2>/dev/null ; do
      echo $ECHO_N ".$ECHO_C"
      sleep 1
    done
    echo
  fi


  echo "$as_me:$LINENO: checking for mmap shared memory support" >&5
echo $ECHO_N "checking for mmap shared memory support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_NONE
#define MM_SHM_MMAP_FILE
#define MM_TEST_SHM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_shm_mmap_file=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for mmap on /dev/zero shared memory support" >&5
echo $ECHO_N "checking for mmap on /dev/zero shared memory support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_NONE
#define MM_SHM_MMAP_ZERO
#define MM_TEST_SHM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_shm_mmap_zero=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for anonymous mmap shared memory support" >&5
echo $ECHO_N "checking for anonymous mmap shared memory support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_NONE
#define MM_SHM_MMAP_ANON
#define MM_TEST_SHM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_shm_mmap_anon=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for posix mmap shared memory support" >&5
echo $ECHO_N "checking for posix mmap shared memory support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_NONE
#define MM_SHM_MMAP_POSIX
#define MM_TEST_SHM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_shm_mmap_posix=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for best shared memory type" >&5
echo $ECHO_N "checking for best shared memory type... $ECHO_C" >&6
  if test "$mm_shm_mmap_anon" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SHM_MMAP_ANON 1
_ACEOF

    msg="anonymous mmap"
  elif test "$mm_shm_ipc" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SHM_IPC 1
_ACEOF

    msg="sysvipc"
  elif test "$mm_shm_mmap_zero" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SHM_MMAP_ZERO 1
_ACEOF

    msg="mmap on /dev/zero"
  elif test "$mm_shm_mmap_posix" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SHM_MMAP_POSIX 1
_ACEOF

    msg="posix mmap"
  elif test "$mm_shm_mmap_file" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SHM_MMAP_FILE 1
_ACEOF

    msg="mmap"
  else
    msg="no"
  fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6
  if test "$msg" = "no" ; then
    { echo "$as_me:$LINENO: WARNING: eaccelerator cannot detect shared memory type, which is required" >&5
echo "$as_me: WARNING: eaccelerator cannot detect shared memory type, which is required" >&2;}
  fi

  echo "$as_me:$LINENO: checking for spinlock semaphores support" >&5
echo $ECHO_N "checking for spinlock semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_SPINLOCK
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_spinlock=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for pthread semaphores support" >&5
echo $ECHO_N "checking for pthread semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_PTHREAD
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_pthread=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for posix semaphores support" >&5
echo $ECHO_N "checking for posix semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_POSIX
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_posix=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for sysvipc semaphores support" >&5
echo $ECHO_N "checking for sysvipc semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_IPC
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_ipc=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  # for cygwin ipc error
  if test -f conftest* ; then
    echo $ECHO_N "Wait for conftest* to exit$ECHO_C"
    while ! rm -f conftest* 2>/dev/null ; do
      echo $ECHO_N ".$ECHO_C"
      sleep 1
    done
    echo
  fi


  echo "$as_me:$LINENO: checking for fcntl semaphores support" >&5
echo $ECHO_N "checking for fcntl semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_FCNTL
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_fcntl=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for flock semaphores support" >&5
echo $ECHO_N "checking for flock semaphores support... $ECHO_C" >&6
  if test "$cross_compiling" = yes; then
  msg=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#define MM_SEM_FLOCK
#define MM_TEST_SEM
#include "$ext_srcdir/mm.c"

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      mm_sem_flock=yes
    msg=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
msg=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6

  echo "$as_me:$LINENO: checking for best semaphores type" >&5
echo $ECHO_N "checking for best semaphores type... $ECHO_C" >&6
  if test "$mm_sem_spinlock" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_SPINLOCK 1
_ACEOF

    msg="spinlock"
  elif test "$mm_sem_ipc" = "yes"; then
    if test $ea_userid = 0; then
        { { echo "$as_me:$LINENO: error: \"You need to pass the user id eaccelerator will be running under when using sysvipc semaphores\"" >&5
echo "$as_me: error: \"You need to pass the user id eaccelerator will be running under when using sysvipc semaphores\"" >&2;}
   { (exit 1); exit 1; }; }
    else

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_IPC 1
_ACEOF

        msg="sysvipc"
    fi
  elif test "$mm_sem_fcntl" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_FCNTL 1
_ACEOF

    msg="fcntl"
  elif test "$mm_sem_flock" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_FLOCK 1
_ACEOF

    msg="flock"
  elif test "$mm_sem_pthread" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_PTHREAD 1
_ACEOF

    msg="pthread"
  elif test "$mm_sem_posix" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MM_SEM_POSIX 1
_ACEOF

    msg="posix"
  else
    msg="no"
  fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6
  if test "$msg" = "no" ; then
    { echo "$as_me:$LINENO: WARNING: eaccelerator cannot semaphores type, which is required" >&5
echo "$as_me: WARNING: eaccelerator cannot semaphores type, which is required" >&2;}
  fi

  echo "$as_me:$LINENO: checking for sched_yield" >&5
echo $ECHO_N "checking for sched_yield... $ECHO_C" >&6
if test "${ac_cv_func_sched_yield+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define sched_yield to an innocuous variant, in case <limits.h> declares sched_yield.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define sched_yield innocuous_sched_yield

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char sched_yield (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef sched_yield

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char sched_yield ();
/* 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_sched_yield) || defined (__stub___sched_yield)
choke me
#else
char (*f) () = sched_yield;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != sched_yield;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_sched_yield=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_sched_yield=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_sched_yield" >&5
echo "${ECHO_T}$ac_cv_func_sched_yield" >&6
if test $ac_cv_func_sched_yield = yes; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_SCHED_YIELD 1
_ACEOF


fi


  echo "$as_me:$LINENO: checking for mprotect" >&5
echo $ECHO_N "checking for mprotect... $ECHO_C" >&6
if test "${ac_cv_func_mprotect+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define mprotect to an innocuous variant, in case <limits.h> declares mprotect.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define mprotect innocuous_mprotect

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char mprotect (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef mprotect

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mprotect ();
/* 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_mprotect) || defined (__stub___mprotect)
choke me
#else
char (*f) () = mprotect;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != mprotect;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_mprotect=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_mprotect=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_mprotect" >&5
echo "${ECHO_T}$ac_cv_func_mprotect" >&6
if test $ac_cv_func_mprotect = yes; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_MPROTECT 1
_ACEOF


fi


  old_cppflags="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $INCLUDES -I$abs_srcdir"
  echo "$as_me:$LINENO: checking for ext/session/php_session.h" >&5
echo $ECHO_N "checking for ext/session/php_session.h... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include "ext/session/php_session.h"
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  msg="yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  msg="no"
fi
rm -f conftest.err conftest.$ac_ext
  if test "$msg" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_EXT_SESSION_PHP_SESSION_H 1
_ACEOF

  fi
  echo "$as_me:$LINENO: result: $msg" >&5
echo "${ECHO_T}$msg" >&6
  CPPFLAGS="$old_cppflags"

fi




echo "$as_me:$LINENO: checking whether to enable EXIF (metadata from images) support" >&5
echo $ECHO_N "checking whether to enable EXIF (metadata from images) support... $ECHO_C" >&6
# Check whether --enable-exif or --disable-exif was given.
if test "${enable_exif+set}" = set; then
  enableval="$enable_exif"
  PHP_EXIF=$enableval
else

  PHP_EXIF=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_EXIF=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_EXIF in
shared,*)
  PHP_EXIF=`echo "$PHP_EXIF"|sed 's/^shared,//'`
  ;;
shared)
  PHP_EXIF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_EXIF" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_EXIF 1
_ACEOF


  ext_builddir=ext/exif
  ext_srcdir=$abs_srcdir/ext/exif

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/exif in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/exif"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/exif/"; ac_bdir="ext/exif/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in exif.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC exif"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC exif"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/exif in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/exif"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/exif/"; ac_bdir="ext/exif/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in exif.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_exif="$shared_objects_exif $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_exif) $(PHPEXIF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_exif) -L$(top_builddir)/netware -lphp4lib $(EXIF_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_exif) $(PHPEXIF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpexif.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_exif"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpexif.$suffix: $ext_builddir/phpexif.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpexif.$suffix \$(phplibdir)

$ext_builddir/phpexif.$suffix: \$(shared_objects_exif) \$(PHPEXIF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_exif) $(EXIF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_exif) -L$(top_builddir)/netware -lphp4lib $(F_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_exif) $(EXIF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/exif.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_exif"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/exif.$suffix: $ext_builddir/exif.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/exif.$suffix \$(phplibdir)

$ext_builddir/exif.$suffix: \$(shared_objects_exif) \$(EXIF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_EXIF 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/exif in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/exif"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/exif/"; ac_bdir="ext/exif/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in exif.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC exif"
    else


  case ext/exif in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/exif"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/exif/"; ac_bdir="ext/exif/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in exif.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC exif"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for FrontBase SQL92 (fbsql) support" >&5
echo $ECHO_N "checking for FrontBase SQL92 (fbsql) support... $ECHO_C" >&6

# Check whether --with-fbsql or --without-fbsql was given.
if test "${with_fbsql+set}" = set; then
  withval="$with_fbsql"
  PHP_FBSQL=$withval
else

  PHP_FBSQL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_FBSQL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_FBSQL in
shared,*)
  PHP_FBSQL=`echo "$PHP_FBSQL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_FBSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_FBSQL" != "no"; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_FBSQL 1
_ACEOF


  ext_builddir=ext/fbsql
  ext_srcdir=$abs_srcdir/ext/fbsql

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/fbsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fbsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fbsql/"; ac_bdir="ext/fbsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_fbsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC fbsql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC fbsql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/fbsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fbsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fbsql/"; ac_bdir="ext/fbsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_fbsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_fbsql="$shared_objects_fbsql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fbsql) $(PHPFBSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fbsql) -L$(top_builddir)/netware -lphp4lib $(FBSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fbsql) $(PHPFBSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfbsql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fbsql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpfbsql.$suffix: $ext_builddir/phpfbsql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpfbsql.$suffix \$(phplibdir)

$ext_builddir/phpfbsql.$suffix: \$(shared_objects_fbsql) \$(PHPFBSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fbsql) $(FBSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fbsql) -L$(top_builddir)/netware -lphp4lib $(QL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fbsql) $(FBSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/fbsql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fbsql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/fbsql.$suffix: $ext_builddir/fbsql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/fbsql.$suffix \$(phplibdir)

$ext_builddir/fbsql.$suffix: \$(shared_objects_fbsql) \$(FBSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_FBSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/fbsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fbsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fbsql/"; ac_bdir="ext/fbsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_fbsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC fbsql"
    else


  case ext/fbsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fbsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fbsql/"; ac_bdir="ext/fbsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_fbsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC fbsql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  FBSQL_INSTALLATION_DIR=""
  if test "$PHP_FBSQL" = "yes"; then

    for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do
      if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then
        FBSQL_INSTALLATION_DIR=$i/FrontBase
        break
      fi
    done

    if test -z "$FBSQL_INSTALLATION_DIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find FrontBase in known installation directories" >&5
echo "$as_me: error: Cannot find FrontBase in known installation directories" >&2;}
   { (exit 1); exit 1; }; }
    fi

  elif test "$PHP_FBSQL" != "no"; then

    if test -f $PHP_FBSQL/include/FBCAccess/FBCAccess.h; then
      FBSQL_INSTALLATION_DIR=$PHP_FBSQL
    else
      { { echo "$as_me:$LINENO: error: Directory $PHP_FBSQL is not a FrontBase installation directory" >&5
echo "$as_me: error: Directory $PHP_FBSQL is not a FrontBase installation directory" >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi

  if test ! -r "$FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a"; then
     { { echo "$as_me:$LINENO: error: Could not find $FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a" >&5
echo "$as_me: error: Could not find $FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a" >&2;}
   { (exit 1); exit 1; }; }
  fi



  if test "$ext_shared" = "yes"; then
    FBSQL_SHARED_LIBADD="-lFBCAccess $FBSQL_SHARED_LIBADD"
    if test -n "$FBSQL_INSTALLATION_DIR/lib"; then

  if test "$FBSQL_INSTALLATION_DIR/lib" != "/usr/lib"; then

  if test -z "$FBSQL_INSTALLATION_DIR/lib" || echo "$FBSQL_INSTALLATION_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FBSQL_INSTALLATION_DIR/lib
  else

    ep_dir="`echo $FBSQL_INSTALLATION_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FBSQL_INSTALLATION_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        FBSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $FBSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$FBSQL_INSTALLATION_DIR/lib"; then

  if test "$FBSQL_INSTALLATION_DIR/lib" != "/usr/lib"; then

  if test -z "$FBSQL_INSTALLATION_DIR/lib" || echo "$FBSQL_INSTALLATION_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FBSQL_INSTALLATION_DIR/lib
  else

    ep_dir="`echo $FBSQL_INSTALLATION_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FBSQL_INSTALLATION_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case FBCAccess in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lFBCAccess $LIBS"
   ;;
  esac




  fi



  if test "$FBSQL_INSTALLATION_DIR/include" != "/usr/include"; then

  if test -z "$FBSQL_INSTALLATION_DIR/include" || echo "$FBSQL_INSTALLATION_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$FBSQL_INSTALLATION_DIR/include
  else

    ep_dir="`echo $FBSQL_INSTALLATION_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FBSQL_INSTALLATION_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST FBSQL_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for FDF support" >&5
echo $ECHO_N "checking for FDF support... $ECHO_C" >&6

# Check whether --with-fdftk or --without-fdftk was given.
if test "${with_fdftk+set}" = set; then
  withval="$with_fdftk"
  PHP_FDFTK=$withval
else

  PHP_FDFTK=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_FDFTK=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_FDFTK in
shared,*)
  PHP_FDFTK=`echo "$PHP_FDFTK"|sed 's/^shared,//'`
  ;;
shared)
  PHP_FDFTK=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_FDFTK" != "no"; then

  case $host_os in
    aix*)
      libtype=aix
    ;;
    solaris*)
      libtype=solaris
    ;;
    linux*)
      libtype=linux
    ;;
    *)
      { { echo "$as_me:$LINENO: error: The fdf toolkit is not available for $host_os." >&5
echo "$as_me: error: The fdf toolkit is not available for $host_os." >&2;}
   { (exit 1); exit 1; }; }
    ;;
  esac

  if test "$PHP_FDFTK" = "yes"; then
    PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk"
  fi

  for dir in $PHP_FDFTK; do
    for subdir in include HeadersAndLibraries/headers; do
      if test -r $dir/$subdir/FdfTk.h; then
        FDFTK_DIR=$dir
        FDFTK_H_DIR=$dir/$subdir
        break 2
      elif test -r $dir/$subdir/fdftk.h; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FDFTK_H_LOWER 1
_ACEOF

        FDFTK_DIR=$dir
        FDFTK_H_DIR=$dir/$subdir
        break 2
      fi
    done
  done

  if test -z "$FDFTK_DIR"; then
    { { echo "$as_me:$LINENO: error: FdfTk.h or fdftk.h not found. Please reinstall the fdf toolkit." >&5
echo "$as_me: error: FdfTk.h or fdftk.h not found. Please reinstall the fdf toolkit." >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$FDFTK_H_DIR" != "/usr/include"; then

  if test -z "$FDFTK_H_DIR" || echo "$FDFTK_H_DIR" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_H_DIR
  else

    ep_dir="`echo $FDFTK_H_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_H_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  FDFLIBRARY=""
  for file in fdftk FdfTk; do
    for dir in $FDFTK_DIR/lib $FDFTK_DIR/HeadersAndLibraries/$libtype/C; do
      if test -r $dir/lib$file.so; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$dir -lm"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$file''_FDFOpen" | $as_tr_sh`
echo "$as_me:$LINENO: checking for FDFOpen in -l$file" >&5
echo $ECHO_N "checking for FDFOpen in -l$file... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$file  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char FDFOpen ();
int
main ()
{
FDFOpen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    FDFLIBRARY=$file

else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$file_FDFOpen


fi

        if test "$FDFLIBRARY"; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$dir -lm"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$file''_FDFGetFDFVersion" | $as_tr_sh`
echo "$as_me:$LINENO: checking for FDFGetFDFVersion in -l$file" >&5
echo $ECHO_N "checking for FDFGetFDFVersion in -l$file... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$file  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char FDFGetFDFVersion ();
int
main ()
{
FDFGetFDFVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_FDFTK_5 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$file_FDFGetFDFVersion


fi

          FDFTK_LIB_DIR=$dir
          break 2
        fi
      fi
    done
  done

  if test -z "$FDFLIBRARY"; then
    { { echo "$as_me:$LINENO: error: no usable fdf library found" >&5
echo "$as_me: error: no usable fdf library found" >&2;}
   { (exit 1); exit 1; }; }
  fi



  if test "$ext_shared" = "yes"; then
    FDF_SHARED_LIBADD="-l$FDFLIBRARY $FDF_SHARED_LIBADD"
    if test -n "$FDFTK_LIB_DIR"; then

  if test "$FDFTK_LIB_DIR" != "/usr/lib"; then

  if test -z "$FDFTK_LIB_DIR" || echo "$FDFTK_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_LIB_DIR
  else

    ep_dir="`echo $FDFTK_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        FDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $FDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$FDFTK_LIB_DIR"; then

  if test "$FDFTK_LIB_DIR" != "/usr/lib"; then

  if test -z "$FDFTK_LIB_DIR" || echo "$FDFTK_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_LIB_DIR
  else

    ep_dir="`echo $FDFTK_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $FDFLIBRARY in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$FDFLIBRARY $LIBS"
   ;;
  esac




  fi




  ext_builddir=ext/fdf
  ext_srcdir=$abs_srcdir/ext/fdf

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/fdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fdf/"; ac_bdir="ext/fdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC fdf"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC fdf"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/fdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fdf/"; ac_bdir="ext/fdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in fdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_fdf="$shared_objects_fdf $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fdf) $(PHPFDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fdf) -L$(top_builddir)/netware -lphp4lib $(FDF_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fdf) $(PHPFDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpfdf.$suffix: $ext_builddir/phpfdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpfdf.$suffix \$(phplibdir)

$ext_builddir/phpfdf.$suffix: \$(shared_objects_fdf) \$(PHPFDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fdf) $(FDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fdf) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fdf) $(FDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/fdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/fdf.$suffix: $ext_builddir/fdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/fdf.$suffix \$(phplibdir)

$ext_builddir/fdf.$suffix: \$(shared_objects_fdf) \$(FDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_FDF 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/fdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fdf/"; ac_bdir="ext/fdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC fdf"
    else


  case ext/fdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fdf/"; ac_bdir="ext/fdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC fdf"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST FDF_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_FDFLIB 1
_ACEOF

fi




echo "$as_me:$LINENO: checking whether to enable the bundled filePro support" >&5
echo $ECHO_N "checking whether to enable the bundled filePro support... $ECHO_C" >&6
# Check whether --enable-filepro or --disable-filepro was given.
if test "${enable_filepro+set}" = set; then
  enableval="$enable_filepro"
  PHP_FILEPRO=$enableval
else

  PHP_FILEPRO=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_FILEPRO=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_FILEPRO in
shared,*)
  PHP_FILEPRO=`echo "$PHP_FILEPRO"|sed 's/^shared,//'`
  ;;
shared)
  PHP_FILEPRO=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_FILEPRO" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FILEPRO 1
_ACEOF


  ext_builddir=ext/filepro
  ext_srcdir=$abs_srcdir/ext/filepro

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/filepro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in filepro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC filepro"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC filepro"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/filepro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in filepro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_filepro="$shared_objects_filepro $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(PHPFILEPRO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) -L$(top_builddir)/netware -lphp4lib $(FILEPRO_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(PHPFILEPRO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfilepro.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filepro"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpfilepro.$suffix: $ext_builddir/phpfilepro.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpfilepro.$suffix \$(phplibdir)

$ext_builddir/phpfilepro.$suffix: \$(shared_objects_filepro) \$(PHPFILEPRO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(FILEPRO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) -L$(top_builddir)/netware -lphp4lib $(EPRO_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_filepro) $(FILEPRO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/filepro.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_filepro"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/filepro.$suffix: $ext_builddir/filepro.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/filepro.$suffix \$(phplibdir)

$ext_builddir/filepro.$suffix: \$(shared_objects_filepro) \$(FILEPRO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_FILEPRO 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/filepro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in filepro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC filepro"
    else


  case ext/filepro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/filepro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/filepro/"; ac_bdir="ext/filepro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in filepro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC filepro"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for FriBidi support" >&5
echo $ECHO_N "checking for FriBidi support... $ECHO_C" >&6

# Check whether --with-fribidi or --without-fribidi was given.
if test "${with_fribidi+set}" = set; then
  withval="$with_fribidi"
  PHP_FRIBIDI=$withval
else

  PHP_FRIBIDI=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_FRIBIDI=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_FRIBIDI in
shared,*)
  PHP_FRIBIDI=`echo "$PHP_FRIBIDI"|sed 's/^shared,//'`
  ;;
shared)
  PHP_FRIBIDI=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_FRIBIDI" != "no"; then

  if test "$PHP_FRIBIDI" = "yes"; then
    # Extract the first word of "fribidi-config", so it can be a program name with args.
set dummy fribidi-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_FRIBIDI_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $FRIBIDI_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_FRIBIDI_CONFIG="$FRIBIDI_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy="/usr/local/bin:$PATH"
for as_dir in $as_dummy
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_FRIBIDI_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  ;;
esac
fi
FRIBIDI_CONFIG=$ac_cv_path_FRIBIDI_CONFIG

if test -n "$FRIBIDI_CONFIG"; then
  echo "$as_me:$LINENO: result: $FRIBIDI_CONFIG" >&5
echo "${ECHO_T}$FRIBIDI_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  else
    FRIBIDI_CONFIG="$PHP_FRIBIDI/bin/fribidi-config"
  fi

    echo "$as_me:$LINENO: checking for FriBidi version" >&5
echo $ECHO_N "checking for FriBidi version... $ECHO_C" >&6

  if test ! -x "$FRIBIDI_CONFIG"; then
    { { echo "$as_me:$LINENO: error: fribidi-config not found." >&5
echo "$as_me: error: fribidi-config not found." >&2;}
   { (exit 1); exit 1; }; }
  fi

  fribidi_version_full=`$FRIBIDI_CONFIG --version`
  fribidi_version=`echo ${fribidi_version_full} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`

  if test "$fribidi_version" -ge 10004; then
    echo "$as_me:$LINENO: result: $fribidi_version_full" >&5
echo "${ECHO_T}$fribidi_version_full" >&6
  else
    { { echo "$as_me:$LINENO: error: FriBidi version 0.10.4 or later required." >&5
echo "$as_me: error: FriBidi version 0.10.4 or later required." >&2;}
   { (exit 1); exit 1; }; }
  fi

    FRIBIDI_LIBS=`$FRIBIDI_CONFIG --libs`
  FRIBIDI_INCS=`$FRIBIDI_CONFIG --cflags`

  if  test -n "$FRIBIDI_INCS" && test -n "$FRIBIDI_LIBS"; then

  for ac_i in $FRIBIDI_INCS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done


  for ac_i in $FRIBIDI_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        FRIBIDI_SHARED_LIBADD="$FRIBIDI_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        FRIBIDI_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $FRIBIDI_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done



  ext_builddir=ext/fribidi
  ext_srcdir=$abs_srcdir/ext/fribidi

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/fribidi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fribidi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fribidi/"; ac_bdir="ext/fribidi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fribidi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC fribidi"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC fribidi"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/fribidi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fribidi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fribidi/"; ac_bdir="ext/fribidi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in fribidi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_fribidi="$shared_objects_fribidi $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fribidi) $(PHPFRIBIDI_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fribidi) -L$(top_builddir)/netware -lphp4lib $(FRIBIDI_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fribidi) $(PHPFRIBIDI_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpfribidi.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fribidi"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpfribidi.$suffix: $ext_builddir/phpfribidi.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpfribidi.$suffix \$(phplibdir)

$ext_builddir/phpfribidi.$suffix: \$(shared_objects_fribidi) \$(PHPFRIBIDI_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_fribidi) $(FRIBIDI_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fribidi) -L$(top_builddir)/netware -lphp4lib $(BIDI_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_fribidi) $(FRIBIDI_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/fribidi.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_fribidi"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/fribidi.$suffix: $ext_builddir/fribidi.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/fribidi.$suffix \$(phplibdir)

$ext_builddir/fribidi.$suffix: \$(shared_objects_fribidi) \$(FRIBIDI_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_FRIBIDI 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/fribidi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fribidi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fribidi/"; ac_bdir="ext/fribidi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fribidi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC fribidi"
    else


  case ext/fribidi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/fribidi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/fribidi/"; ac_bdir="ext/fribidi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in fribidi.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC fribidi"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST FRIBIDI_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_FRIBIDI 1
_ACEOF

  else
    { { echo "$as_me:$LINENO: error: Could not find the required paths. Please check your FriBidi installation." >&5
echo "$as_me: error: Could not find the required paths. Please check your FriBidi installation." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi




echo "$as_me:$LINENO: checking whether to enable FTP support" >&5
echo $ECHO_N "checking whether to enable FTP support... $ECHO_C" >&6
# Check whether --enable-ftp or --disable-ftp was given.
if test "${enable_ftp+set}" = set; then
  enableval="$enable_ftp"
  PHP_FTP=$enableval
else

  PHP_FTP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_FTP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_FTP in
shared,*)
  PHP_FTP=`echo "$PHP_FTP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_FTP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_FTP" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FTP 1
_ACEOF


  ext_builddir=ext/ftp
  ext_srcdir=$abs_srcdir/ext/ftp

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/ftp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ftp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ftp/"; ac_bdir="ext/ftp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_ftp.c ftp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ftp"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ftp"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ftp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ftp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ftp/"; ac_bdir="ext/ftp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_ftp.c ftp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ftp="$shared_objects_ftp $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ftp) $(PHPFTP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ftp) -L$(top_builddir)/netware -lphp4lib $(FTP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ftp) $(PHPFTP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpftp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ftp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpftp.$suffix: $ext_builddir/phpftp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpftp.$suffix \$(phplibdir)

$ext_builddir/phpftp.$suffix: \$(shared_objects_ftp) \$(PHPFTP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ftp) $(FTP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ftp) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ftp) $(FTP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ftp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ftp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ftp.$suffix: $ext_builddir/ftp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ftp.$suffix \$(phplibdir)

$ext_builddir/ftp.$suffix: \$(shared_objects_ftp) \$(FTP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_FTP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ftp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ftp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ftp/"; ac_bdir="ext/ftp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_ftp.c ftp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ftp"
    else


  case ext/ftp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ftp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ftp/"; ac_bdir="ext/ftp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_ftp.c ftp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ftp"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi





echo "$as_me:$LINENO: checking for GD support" >&5
echo $ECHO_N "checking for GD support... $ECHO_C" >&6

# Check whether --with-gd or --without-gd was given.
if test "${with_gd+set}" = set; then
  withval="$with_gd"
  PHP_GD=$withval
else

  PHP_GD=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_GD=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_GD in
shared,*)
  PHP_GD=`echo "$PHP_GD"|sed 's/^shared,//'`
  ;;
shared)
  PHP_GD=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test -z "$PHP_JPEG_DIR"; then


echo "$as_me:$LINENO: checking for the location of libjpeg" >&5
echo $ECHO_N "checking for the location of libjpeg... $ECHO_C" >&6

# Check whether --with-jpeg-dir or --without-jpeg-dir was given.
if test "${with_jpeg_dir+set}" = set; then
  withval="$with_jpeg_dir"
  PHP_JPEG_DIR=$withval
else

  PHP_JPEG_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_JPEG_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_JPEG_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test -z "$PHP_PNG_DIR"; then


echo "$as_me:$LINENO: checking for the location of libpng" >&5
echo $ECHO_N "checking for the location of libpng... $ECHO_C" >&6

# Check whether --with-png-dir or --without-png-dir was given.
if test "${with_png_dir+set}" = set; then
  withval="$with_png_dir"
  PHP_PNG_DIR=$withval
else

  PHP_PNG_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_PNG_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_PNG_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test -z "$PHP_ZLIB_DIR"; then


echo "$as_me:$LINENO: checking for the location of libz" >&5
echo $ECHO_N "checking for the location of libz... $ECHO_C" >&6

# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
  withval="$with_zlib_dir"
  PHP_ZLIB_DIR=$withval
else

  PHP_ZLIB_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ZLIB_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ZLIB_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi



echo "$as_me:$LINENO: checking for the location of libXpm" >&5
echo $ECHO_N "checking for the location of libXpm... $ECHO_C" >&6

# Check whether --with-xpm-dir or --without-xpm-dir was given.
if test "${with_xpm_dir+set}" = set; then
  withval="$with_xpm_dir"
  PHP_XPM_DIR=$withval
else

  PHP_XPM_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_XPM_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_XPM_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for FreeType 1.x support" >&5
echo $ECHO_N "checking for FreeType 1.x support... $ECHO_C" >&6

# Check whether --with-ttf or --without-ttf was given.
if test "${with_ttf+set}" = set; then
  withval="$with_ttf"
  PHP_TTF=$withval
else

  PHP_TTF=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_TTF=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_TTF
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for FreeType 2" >&5
echo $ECHO_N "checking for FreeType 2... $ECHO_C" >&6

# Check whether --with-freetype-dir or --without-freetype-dir was given.
if test "${with_freetype_dir+set}" = set; then
  withval="$with_freetype_dir"
  PHP_FREETYPE_DIR=$withval
else

  PHP_FREETYPE_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_FREETYPE_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_FREETYPE_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for T1lib support" >&5
echo $ECHO_N "checking for T1lib support... $ECHO_C" >&6

# Check whether --with-t1lib or --without-t1lib was given.
if test "${with_t1lib+set}" = set; then
  withval="$with_t1lib"
  PHP_T1LIB=$withval
else

  PHP_T1LIB=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_T1LIB=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_T1LIB
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking whether to enable truetype string function in GD" >&5
echo $ECHO_N "checking whether to enable truetype string function in GD... $ECHO_C" >&6
# Check whether --enable-gd-native-ttf or --disable-gd-native-ttf was given.
if test "${enable_gd_native_ttf+set}" = set; then
  enableval="$enable_gd_native_ttf"
  PHP_GD_NATIVE_TTF=$enableval
else

  PHP_GD_NATIVE_TTF=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_GD_NATIVE_TTF=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_GD_NATIVE_TTF
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking whether to enable JIS-mapped Japanese font support in GD" >&5
echo $ECHO_N "checking whether to enable JIS-mapped Japanese font support in GD... $ECHO_C" >&6
# Check whether --enable-gd-jis-conv or --disable-gd-jis-conv was given.
if test "${enable_gd_jis_conv+set}" = set; then
  enableval="$enable_gd_jis_conv"
  PHP_GD_JIS_CONV=$enableval
else

  PHP_GD_JIS_CONV=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_GD_JIS_CONV=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_GD_JIS_CONV
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6
























if test "$PHP_GD" = "yes"; then
  GD_MODULE_TYPE=builtin
  extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \
                 libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_png.c libgd/gd_jpeg.c \
                 libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \
                 libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \
                 libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \
                 libgd/xbm.c libgd/gd_gif_out.c libgd/gd_security.c"



for ac_func in fabsf floorf
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done


  test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes


  if test "$PHP_GD_NATIVE_TTF" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define USE_GD_IMGSTRTTF 1
_ACEOF

  fi


  if test "$PHP_GD_JIS_CONV" = "yes"; then
    USE_GD_JIS_CONV=1
  fi


  if test "$PHP_JPEG_DIR" != "no"; then

    for i in $PHP_JPEG_DIR /usr/local /usr; do
      test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
    done

    if test -z "$GD_JPEG_DIR"; then
      { { echo "$as_me:$LINENO: error: libjpeg.(a|so) not found." >&5
echo "$as_me: error: libjpeg.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_JPEG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_jpeg_jpeg_read_header=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_JPEG_DIR/include" != "/usr/include"; then

  if test -z "$GD_JPEG_DIR/include" || echo "$GD_JPEG_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/include
  else

    ep_dir="`echo $GD_JPEG_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-ljpeg $GD_SHARED_LIBADD"
    if test -n "$GD_JPEG_DIR/lib"; then

  if test "$GD_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_JPEG_DIR/lib" || echo "$GD_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/lib
  else

    ep_dir="`echo $GD_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_JPEG_DIR/lib"; then

  if test "$GD_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_JPEG_DIR/lib" || echo "$GD_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/lib
  else

    ep_dir="`echo $GD_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case jpeg in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ljpeg $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_jpeg_jpeg_read_header

      { { echo "$as_me:$LINENO: error: Problem with libjpeg.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libjpeg.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    echo "$as_me:$LINENO: result: If configure fails try --with-jpeg-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-jpeg-dir=<DIR>" >&6
  fi


  if test "$PHP_PNG_DIR" != "no"; then

    for i in $PHP_PNG_DIR /usr/local /usr; do
      test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
    done

    if test -z "$GD_PNG_DIR"; then
      { { echo "$as_me:$LINENO: error: libpng.(a|so) not found." >&5
echo "$as_me: error: libpng.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test "$PHP_ZLIB_DIR" = "no"; then
      { { echo "$as_me:$LINENO: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>" >&5
echo "$as_me: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test ! -f $GD_PNG_DIR/include/png.h; then
      { { echo "$as_me:$LINENO: error: png.h not found." >&5
echo "$as_me: error: png.h not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for png_write_image in -lpng" >&5
echo $ECHO_N "checking for png_write_image in -lpng... $ECHO_C" >&6
if test "${ac_cv_lib_png_png_write_image+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char png_write_image ();
int
main ()
{
png_write_image ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_png_png_write_image=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_png_png_write_image=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_write_image" >&5
echo "${ECHO_T}$ac_cv_lib_png_png_write_image" >&6
if test $ac_cv_lib_png_png_write_image = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_PNG_DIR/include" != "/usr/include"; then

  if test -z "$GD_PNG_DIR/include" || echo "$GD_PNG_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/include
  else

    ep_dir="`echo $GD_PNG_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lz $GD_SHARED_LIBADD"
    if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lpng $GD_SHARED_LIBADD"
    if test -n "$GD_PNG_DIR/lib"; then

  if test "$GD_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_PNG_DIR/lib" || echo "$GD_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/lib
  else

    ep_dir="`echo $GD_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_PNG_DIR/lib"; then

  if test "$GD_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_PNG_DIR/lib" || echo "$GD_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/lib
  else

    ep_dir="`echo $GD_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case png in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpng $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_png_png_write_image

      { { echo "$as_me:$LINENO: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi


  else
    echo "$as_me:$LINENO: result: If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>" >&6
  fi


  if test "$PHP_XPM_DIR" != "no"; then

    for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
      test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
    done

    if test -z "$GD_XPM_DIR"; then
      { { echo "$as_me:$LINENO: error: libXpm.(a|so) not found." >&5
echo "$as_me: error: libXpm.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

    for i in include include/X11; do
      test -f $GD_XPM_DIR/$i/xpm.h && GD_XPM_INC=$GD_XPM_DIR/include
    done

    if test -z "$GD_XPM_INC"; then
      { { echo "$as_me:$LINENO: error: xpm.h not found." >&5
echo "$as_me: error: xpm.h not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_XPM_DIR/lib -lX11
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for XpmFreeXpmImage in -lXpm" >&5
echo $ECHO_N "checking for XpmFreeXpmImage in -lXpm... $ECHO_C" >&6
if test "${ac_cv_lib_Xpm_XpmFreeXpmImage+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lXpm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XpmFreeXpmImage ();
int
main ()
{
XpmFreeXpmImage ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_Xpm_XpmFreeXpmImage=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_Xpm_XpmFreeXpmImage=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmFreeXpmImage" >&5
echo "${ECHO_T}$ac_cv_lib_Xpm_XpmFreeXpmImage" >&6
if test $ac_cv_lib_Xpm_XpmFreeXpmImage = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_XPM_INC" != "/usr/include"; then

  if test -z "$GD_XPM_INC" || echo "$GD_XPM_INC" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_INC
  else

    ep_dir="`echo $GD_XPM_INC|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_INC\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lXpm $GD_SHARED_LIBADD"
    if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case Xpm in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lXpm $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lX11 $GD_SHARED_LIBADD"
    if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case X11 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lX11 $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_Xpm_XpmFreeXpmImage

      { { echo "$as_me:$LINENO: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    echo "$as_me:$LINENO: result: If configure fails try --with-xpm-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-xpm-dir=<DIR>" >&6
  fi


  if test "$PHP_FREETYPE_DIR" != "no"; then

    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
      if test -f "$i/include/freetype2/freetype/freetype.h"; then
        FREETYPE2_DIR=$i
        FREETYPE2_INC_DIR=$i/include/freetype2
        break
      fi
    done

    if test -n "$FREETYPE2_DIR" ; then


  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lfreetype $GD_SHARED_LIBADD"
    if test -n "$FREETYPE2_DIR/lib"; then

  if test "$FREETYPE2_DIR/lib" != "/usr/lib"; then

  if test -z "$FREETYPE2_DIR/lib" || echo "$FREETYPE2_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/lib
  else

    ep_dir="`echo $FREETYPE2_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$FREETYPE2_DIR/lib"; then

  if test "$FREETYPE2_DIR/lib" != "/usr/lib"; then

  if test -z "$FREETYPE2_DIR/lib" || echo "$FREETYPE2_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/lib
  else

    ep_dir="`echo $FREETYPE2_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case freetype in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lfreetype $LIBS"
   ;;
  esac




  fi



  if test "$FREETYPE2_DIR/include" != "/usr/include"; then

  if test -z "$FREETYPE2_DIR/include" || echo "$FREETYPE2_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/include
  else

    ep_dir="`echo $FREETYPE2_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$FREETYPE2_INC_DIR" != "/usr/include"; then

  if test -z "$FREETYPE2_INC_DIR" || echo "$FREETYPE2_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_INC_DIR
  else

    ep_dir="`echo $FREETYPE2_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define USE_GD_IMGSTRTTF 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBFREETYPE 1
_ACEOF

    else
      { { echo "$as_me:$LINENO: error: freetype2 not found!" >&5
echo "$as_me: error: freetype2 not found!" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    echo "$as_me:$LINENO: result: If configure fails try --with-freetype-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-freetype-dir=<DIR>" >&6
  fi


  if test "$PHP_TTF" != "no"; then
    if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
      if test -n "$PHP_TTF"; then
        for i in $PHP_TTF /usr/local /usr; do
          if test -f "$i/include/freetype.h"; then
            TTF_DIR=$i
            unset TTF_INC_DIR
          fi
          if test -f "$i/include/freetype/freetype.h"; then
            TTF_DIR=$i
            TTF_INC_DIR=$i/include/freetype
          fi
          if test -f "$i/include/freetype1/freetype/freetype.h"; then
            TTF_DIR=$i
            TTF_INC_DIR=$i/include/freetype1/freetype
          fi
          test -n "$TTF_DIR" && break
        done
      fi
      if test -n "$TTF_DIR" ; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBTTF 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lttf $GD_SHARED_LIBADD"
    if test -n "$TTF_DIR/lib"; then

  if test "$TTF_DIR/lib" != "/usr/lib"; then

  if test -z "$TTF_DIR/lib" || echo "$TTF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$TTF_DIR/lib
  else

    ep_dir="`echo $TTF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$TTF_DIR/lib"; then

  if test "$TTF_DIR/lib" != "/usr/lib"; then

  if test -z "$TTF_DIR/lib" || echo "$TTF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$TTF_DIR/lib
  else

    ep_dir="`echo $TTF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ttf in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lttf $LIBS"
   ;;
  esac




  fi


      fi
      if test -z "$TTF_INC_DIR"; then
        TTF_INC_DIR=$TTF_DIR/include
      fi

  if test "$TTF_INC_DIR" != "/usr/include"; then

  if test -z "$TTF_INC_DIR" || echo "$TTF_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$TTF_INC_DIR
  else

    ep_dir="`echo $TTF_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    else
      echo "$as_me:$LINENO: result: no - FreeType 2.x is to be used instead" >&5
echo "${ECHO_T}no - FreeType 2.x is to be used instead" >&6
    fi
  fi


  if test "$PHP_T1LIB" != "no"; then

    for i in $PHP_T1LIB /usr/local /usr; do
      test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
    done

    if test -z "$GD_T1_DIR"; then
      { { echo "$as_me:$LINENO: error: Your t1lib distribution is not installed correctly. Please reinstall it." >&5
echo "$as_me: error: Your t1lib distribution is not installed correctly. Please reinstall it." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_T1_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for T1_LoadFont in -lt1" >&5
echo $ECHO_N "checking for T1_LoadFont in -lt1... $ECHO_C" >&6
if test "${ac_cv_lib_t1_T1_LoadFont+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lt1  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char T1_LoadFont ();
int
main ()
{
T1_LoadFont ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_t1_T1_LoadFont=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_t1_T1_LoadFont=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_t1_T1_LoadFont" >&5
echo "${ECHO_T}$ac_cv_lib_t1_T1_LoadFont" >&6
if test $ac_cv_lib_t1_T1_LoadFont = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBT1 1
_ACEOF


  if test "$GD_T1_DIR/include" != "/usr/include"; then

  if test -z "$GD_T1_DIR/include" || echo "$GD_T1_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/include
  else

    ep_dir="`echo $GD_T1_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lt1 $GD_SHARED_LIBADD"
    if test -n "$GD_T1_DIR/lib"; then

  if test "$GD_T1_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_T1_DIR/lib" || echo "$GD_T1_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/lib
  else

    ep_dir="`echo $GD_T1_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_T1_DIR/lib"; then

  if test "$GD_T1_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_T1_DIR/lib" || echo "$GD_T1_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/lib
  else

    ep_dir="`echo $GD_T1_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case t1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lt1 $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_t1_T1_LoadFont

      { { echo "$as_me:$LINENO: error: Problem with libt1.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libt1.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD13 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD15 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD20 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD204 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGESETTILE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGESETBRUSH 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GDIMAGECOLORRESOLVE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_COLORCLOSESTHWB 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_WBMP 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GD2 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_PNG 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_XBM 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_BUNDLED 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_READ 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_CREATE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGEELLIPSE 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_FONTCACHESHUTDOWN 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_DYNAMIC_CTX_EX 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_CTX 1
_ACEOF


  GDLIB_CFLAGS="-DHAVE_LIBPNG"


  if test -n "$GD_JPEG_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_JPG 1
_ACEOF

    GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBJPEG"
  fi

  if test -n "$GD_XPM_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_XPM 1
_ACEOF

    GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM"
  fi

  if test -n "$FREETYPE2_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_STRINGFT 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_STRINGFTEX 1
_ACEOF

    GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE"
  fi

  if test -n "$TTF_DIR"; then
    GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBTTF"
  fi

  if test -n "$USE_GD_JIS_CONV"; then

cat >>confdefs.h <<\_ACEOF
#define USE_GD_JISX0208 1
_ACEOF

    GDLIB_CFLAGS="$GDLIB_CFLAGS -DJISX0208"
  fi

else

 if test "$PHP_GD" != "no"; then
  GD_MODULE_TYPE=external
  extra_sources="gdcache.c"


  if test "$PHP_GD_NATIVE_TTF" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define USE_GD_IMGSTRTTF 1
_ACEOF

  fi


  if test "$PHP_JPEG_DIR" != "no"; then

    for i in $PHP_JPEG_DIR /usr/local /usr; do
      test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
    done

    if test -z "$GD_JPEG_DIR"; then
      { { echo "$as_me:$LINENO: error: libjpeg.(a|so) not found." >&5
echo "$as_me: error: libjpeg.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_JPEG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_jpeg_jpeg_read_header=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_JPEG_DIR/include" != "/usr/include"; then

  if test -z "$GD_JPEG_DIR/include" || echo "$GD_JPEG_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/include
  else

    ep_dir="`echo $GD_JPEG_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-ljpeg $GD_SHARED_LIBADD"
    if test -n "$GD_JPEG_DIR/lib"; then

  if test "$GD_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_JPEG_DIR/lib" || echo "$GD_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/lib
  else

    ep_dir="`echo $GD_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_JPEG_DIR/lib"; then

  if test "$GD_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_JPEG_DIR/lib" || echo "$GD_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_JPEG_DIR/lib
  else

    ep_dir="`echo $GD_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_JPEG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case jpeg in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ljpeg $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_jpeg_jpeg_read_header

      { { echo "$as_me:$LINENO: error: Problem with libjpeg.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libjpeg.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    echo "$as_me:$LINENO: result: If configure fails try --with-jpeg-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-jpeg-dir=<DIR>" >&6
  fi


  if test "$PHP_PNG_DIR" != "no"; then

    for i in $PHP_PNG_DIR /usr/local /usr; do
      test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
    done

    if test -z "$GD_PNG_DIR"; then
      { { echo "$as_me:$LINENO: error: libpng.(a|so) not found." >&5
echo "$as_me: error: libpng.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test "$PHP_ZLIB_DIR" = "no"; then
      { { echo "$as_me:$LINENO: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>" >&5
echo "$as_me: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test ! -f $GD_PNG_DIR/include/png.h; then
      { { echo "$as_me:$LINENO: error: png.h not found." >&5
echo "$as_me: error: png.h not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for png_write_image in -lpng" >&5
echo $ECHO_N "checking for png_write_image in -lpng... $ECHO_C" >&6
if test "${ac_cv_lib_png_png_write_image+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char png_write_image ();
int
main ()
{
png_write_image ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_png_png_write_image=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_png_png_write_image=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_write_image" >&5
echo "${ECHO_T}$ac_cv_lib_png_png_write_image" >&6
if test $ac_cv_lib_png_png_write_image = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_PNG_DIR/include" != "/usr/include"; then

  if test -z "$GD_PNG_DIR/include" || echo "$GD_PNG_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/include
  else

    ep_dir="`echo $GD_PNG_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lz $GD_SHARED_LIBADD"
    if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lpng $GD_SHARED_LIBADD"
    if test -n "$GD_PNG_DIR/lib"; then

  if test "$GD_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_PNG_DIR/lib" || echo "$GD_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/lib
  else

    ep_dir="`echo $GD_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_PNG_DIR/lib"; then

  if test "$GD_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_PNG_DIR/lib" || echo "$GD_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_PNG_DIR/lib
  else

    ep_dir="`echo $GD_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_PNG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case png in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpng $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_png_png_write_image

      { { echo "$as_me:$LINENO: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi


  else
    echo "$as_me:$LINENO: result: If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>" >&6
  fi


  if test "$PHP_XPM_DIR" != "no"; then

    for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
      test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
    done

    if test -z "$GD_XPM_DIR"; then
      { { echo "$as_me:$LINENO: error: libXpm.(a|so) not found." >&5
echo "$as_me: error: libXpm.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
    fi

    for i in include include/X11; do
      test -f $GD_XPM_DIR/$i/xpm.h && GD_XPM_INC=$GD_XPM_DIR/include
    done

    if test -z "$GD_XPM_INC"; then
      { { echo "$as_me:$LINENO: error: xpm.h not found." >&5
echo "$as_me: error: xpm.h not found." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_XPM_DIR/lib -lX11
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for XpmFreeXpmImage in -lXpm" >&5
echo $ECHO_N "checking for XpmFreeXpmImage in -lXpm... $ECHO_C" >&6
if test "${ac_cv_lib_Xpm_XpmFreeXpmImage+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lXpm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char XpmFreeXpmImage ();
int
main ()
{
XpmFreeXpmImage ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_Xpm_XpmFreeXpmImage=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_Xpm_XpmFreeXpmImage=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmFreeXpmImage" >&5
echo "${ECHO_T}$ac_cv_lib_Xpm_XpmFreeXpmImage" >&6
if test $ac_cv_lib_Xpm_XpmFreeXpmImage = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  if test "$GD_XPM_INC" != "/usr/include"; then

  if test -z "$GD_XPM_INC" || echo "$GD_XPM_INC" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_INC
  else

    ep_dir="`echo $GD_XPM_INC|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_INC\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lXpm $GD_SHARED_LIBADD"
    if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case Xpm in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lXpm $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lX11 $GD_SHARED_LIBADD"
    if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_XPM_DIR/lib"; then

  if test "$GD_XPM_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_XPM_DIR/lib" || echo "$GD_XPM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_XPM_DIR/lib
  else

    ep_dir="`echo $GD_XPM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_XPM_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case X11 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lX11 $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_Xpm_XpmFreeXpmImage

      { { echo "$as_me:$LINENO: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    echo "$as_me:$LINENO: result: If configure fails try --with-xpm-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-xpm-dir=<DIR>" >&6
  fi


  if test "$PHP_FREETYPE_DIR" != "no"; then

    for i in $PHP_FREETYPE_DIR /usr/local /usr; do
      if test -f "$i/include/freetype2/freetype/freetype.h"; then
        FREETYPE2_DIR=$i
        FREETYPE2_INC_DIR=$i/include/freetype2
        break
      fi
    done

    if test -n "$FREETYPE2_DIR" ; then


  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lfreetype $GD_SHARED_LIBADD"
    if test -n "$FREETYPE2_DIR/lib"; then

  if test "$FREETYPE2_DIR/lib" != "/usr/lib"; then

  if test -z "$FREETYPE2_DIR/lib" || echo "$FREETYPE2_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/lib
  else

    ep_dir="`echo $FREETYPE2_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$FREETYPE2_DIR/lib"; then

  if test "$FREETYPE2_DIR/lib" != "/usr/lib"; then

  if test -z "$FREETYPE2_DIR/lib" || echo "$FREETYPE2_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/lib
  else

    ep_dir="`echo $FREETYPE2_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case freetype in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lfreetype $LIBS"
   ;;
  esac




  fi



  if test "$FREETYPE2_DIR/include" != "/usr/include"; then

  if test -z "$FREETYPE2_DIR/include" || echo "$FREETYPE2_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_DIR/include
  else

    ep_dir="`echo $FREETYPE2_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$FREETYPE2_INC_DIR" != "/usr/include"; then

  if test -z "$FREETYPE2_INC_DIR" || echo "$FREETYPE2_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$FREETYPE2_INC_DIR
  else

    ep_dir="`echo $FREETYPE2_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FREETYPE2_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define USE_GD_IMGSTRTTF 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBFREETYPE 1
_ACEOF

    else
      { { echo "$as_me:$LINENO: error: freetype2 not found!" >&5
echo "$as_me: error: freetype2 not found!" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    echo "$as_me:$LINENO: result: If configure fails try --with-freetype-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails try --with-freetype-dir=<DIR>" >&6
  fi


  if test "$PHP_TTF" != "no"; then
    if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
      if test -n "$PHP_TTF"; then
        for i in $PHP_TTF /usr/local /usr; do
          if test -f "$i/include/freetype.h"; then
            TTF_DIR=$i
            unset TTF_INC_DIR
          fi
          if test -f "$i/include/freetype/freetype.h"; then
            TTF_DIR=$i
            TTF_INC_DIR=$i/include/freetype
          fi
          if test -f "$i/include/freetype1/freetype/freetype.h"; then
            TTF_DIR=$i
            TTF_INC_DIR=$i/include/freetype1/freetype
          fi
          test -n "$TTF_DIR" && break
        done
      fi
      if test -n "$TTF_DIR" ; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBTTF 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lttf $GD_SHARED_LIBADD"
    if test -n "$TTF_DIR/lib"; then

  if test "$TTF_DIR/lib" != "/usr/lib"; then

  if test -z "$TTF_DIR/lib" || echo "$TTF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$TTF_DIR/lib
  else

    ep_dir="`echo $TTF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$TTF_DIR/lib"; then

  if test "$TTF_DIR/lib" != "/usr/lib"; then

  if test -z "$TTF_DIR/lib" || echo "$TTF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$TTF_DIR/lib
  else

    ep_dir="`echo $TTF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ttf in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lttf $LIBS"
   ;;
  esac




  fi


      fi
      if test -z "$TTF_INC_DIR"; then
        TTF_INC_DIR=$TTF_DIR/include
      fi

  if test "$TTF_INC_DIR" != "/usr/include"; then

  if test -z "$TTF_INC_DIR" || echo "$TTF_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$TTF_INC_DIR
  else

    ep_dir="`echo $TTF_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$TTF_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    else
      echo "$as_me:$LINENO: result: no - FreeType 2.x is to be used instead" >&5
echo "${ECHO_T}no - FreeType 2.x is to be used instead" >&6
    fi
  fi


  if test "$PHP_T1LIB" != "no"; then

    for i in $PHP_T1LIB /usr/local /usr; do
      test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
    done

    if test -z "$GD_T1_DIR"; then
      { { echo "$as_me:$LINENO: error: Your t1lib distribution is not installed correctly. Please reinstall it." >&5
echo "$as_me: error: Your t1lib distribution is not installed correctly. Please reinstall it." >&2;}
   { (exit 1); exit 1; }; }
    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GD_T1_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for T1_LoadFont in -lt1" >&5
echo $ECHO_N "checking for T1_LoadFont in -lt1... $ECHO_C" >&6
if test "${ac_cv_lib_t1_T1_LoadFont+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lt1  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char T1_LoadFont ();
int
main ()
{
T1_LoadFont ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_t1_T1_LoadFont=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_t1_T1_LoadFont=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_t1_T1_LoadFont" >&5
echo "${ECHO_T}$ac_cv_lib_t1_T1_LoadFont" >&6
if test $ac_cv_lib_t1_T1_LoadFont = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBT1 1
_ACEOF


  if test "$GD_T1_DIR/include" != "/usr/include"; then

  if test -z "$GD_T1_DIR/include" || echo "$GD_T1_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/include
  else

    ep_dir="`echo $GD_T1_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lt1 $GD_SHARED_LIBADD"
    if test -n "$GD_T1_DIR/lib"; then

  if test "$GD_T1_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_T1_DIR/lib" || echo "$GD_T1_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/lib
  else

    ep_dir="`echo $GD_T1_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_T1_DIR/lib"; then

  if test "$GD_T1_DIR/lib" != "/usr/lib"; then

  if test -z "$GD_T1_DIR/lib" || echo "$GD_T1_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GD_T1_DIR/lib
  else

    ep_dir="`echo $GD_T1_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_T1_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case t1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lt1 $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_t1_T1_LoadFont

      { { echo "$as_me:$LINENO: error: Problem with libt1.(a|so). Please check config.log for more information." >&5
echo "$as_me: error: Problem with libt1.(a|so). Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  fi


  for i in include/gd1.3 include/gd include gd1.3 gd ""; do
    test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i"
  done

  for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
    test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" -o -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i"
  done

  if test -n "$GD_INCLUDE" && test -n "$GD_LIB"; then


  if test "$ext_shared" = "yes"; then
    GD_SHARED_LIBADD="-lgd $GD_SHARED_LIBADD"
    if test -n "$GD_LIB"; then

  if test "$GD_LIB" != "/usr/lib"; then

  if test -z "$GD_LIB" || echo "$GD_LIB" | grep '^/' >/dev/null ; then
    ai_p=$GD_LIB
  else

    ep_dir="`echo $GD_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_LIB\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GD_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GD_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GD_LIB"; then

  if test "$GD_LIB" != "/usr/lib"; then

  if test -z "$GD_LIB" || echo "$GD_LIB" | grep '^/' >/dev/null ; then
    ai_p=$GD_LIB
  else

    ep_dir="`echo $GD_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_LIB\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case gd in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lgd $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD 1
_ACEOF



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageString16 in -lgd" >&5
echo $ECHO_N "checking for gdImageString16 in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageString16+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageString16 ();
int
main ()
{
gdImageString16 ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageString16=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageString16=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageString16" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageString16" >&6
if test $ac_cv_lib_gd_gdImageString16 = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD13 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageString16


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImagePaletteCopy in -lgd" >&5
echo $ECHO_N "checking for gdImagePaletteCopy in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImagePaletteCopy+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImagePaletteCopy ();
int
main ()
{
gdImagePaletteCopy ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImagePaletteCopy=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImagePaletteCopy=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImagePaletteCopy" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImagePaletteCopy" >&6
if test $ac_cv_lib_gd_gdImagePaletteCopy = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD15 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImagePaletteCopy


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateFromPng in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateFromPng in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateFromPng+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateFromPng ();
int
main ()
{
gdImageCreateFromPng ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateFromPng=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateFromPng=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateFromPng" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateFromPng" >&6
if test $ac_cv_lib_gd_gdImageCreateFromPng = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_PNG 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateFromPng


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateFromGif in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateFromGif in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateFromGif+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGif ();
int
main ()
{
gdImageCreateFromGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateFromGif=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateFromGif=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateFromGif" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateFromGif" >&6
if test $ac_cv_lib_gd_gdImageCreateFromGif = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_READ 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateFromGif


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageGif in -lgd" >&5
echo $ECHO_N "checking for gdImageGif in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageGif+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGif ();
int
main ()
{
gdImageGif ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageGif=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageGif=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGif" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageGif" >&6
if test $ac_cv_lib_gd_gdImageGif = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_CREATE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageGif


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageWBMP in -lgd" >&5
echo $ECHO_N "checking for gdImageWBMP in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageWBMP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageWBMP ();
int
main ()
{
gdImageWBMP ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageWBMP=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageWBMP=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageWBMP" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageWBMP" >&6
if test $ac_cv_lib_gd_gdImageWBMP = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_WBMP 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageWBMP


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateFromJpeg in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateFromJpeg in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateFromJpeg+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateFromJpeg ();
int
main ()
{
gdImageCreateFromJpeg ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateFromJpeg=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateFromJpeg=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateFromJpeg" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateFromJpeg" >&6
if test $ac_cv_lib_gd_gdImageCreateFromJpeg = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_JPG 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateFromJpeg


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateFromXpm in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateFromXpm in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateFromXpm+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateFromXpm ();
int
main ()
{
gdImageCreateFromXpm ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateFromXpm=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateFromXpm=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateFromXpm" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateFromXpm" >&6
if test $ac_cv_lib_gd_gdImageCreateFromXpm = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_XPM 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateFromXpm


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateFromGd2 in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateFromGd2 in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateFromGd2+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGd2 ();
int
main ()
{
gdImageCreateFromGd2 ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateFromGd2=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateFromGd2=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateFromGd2" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateFromGd2" >&6
if test $ac_cv_lib_gd_gdImageCreateFromGd2 = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GD2 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateFromGd2


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreateTrueColor in -lgd" >&5
echo $ECHO_N "checking for gdImageCreateTrueColor in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreateTrueColor+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreateTrueColor ();
int
main ()
{
gdImageCreateTrueColor ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreateTrueColor=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreateTrueColor=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreateTrueColor" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreateTrueColor" >&6
if test $ac_cv_lib_gd_gdImageCreateTrueColor = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD20 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreateTrueColor


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageSetTile in -lgd" >&5
echo $ECHO_N "checking for gdImageSetTile in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageSetTile+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageSetTile ();
int
main ()
{
gdImageSetTile ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageSetTile=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageSetTile=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageSetTile" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageSetTile" >&6
if test $ac_cv_lib_gd_gdImageSetTile = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGESETTILE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageSetTile


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageEllipse in -lgd" >&5
echo $ECHO_N "checking for gdImageEllipse in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageEllipse+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageEllipse ();
int
main ()
{
gdImageEllipse ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageEllipse=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageEllipse=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageEllipse" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageEllipse" >&6
if test $ac_cv_lib_gd_gdImageEllipse = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGEELLIPSE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageEllipse


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageSetBrush in -lgd" >&5
echo $ECHO_N "checking for gdImageSetBrush in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageSetBrush+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageSetBrush ();
int
main ()
{
gdImageSetBrush ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageSetBrush=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageSetBrush=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageSetBrush" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageSetBrush" >&6
if test $ac_cv_lib_gd_gdImageSetBrush = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_IMAGESETBRUSH 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageSetBrush


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageStringTTF in -lgd" >&5
echo $ECHO_N "checking for gdImageStringTTF in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageStringTTF+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringTTF ();
int
main ()
{
gdImageStringTTF ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageStringTTF=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageStringTTF=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageStringTTF" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageStringTTF" >&6
if test $ac_cv_lib_gd_gdImageStringTTF = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_STRINGTTF 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageStringTTF


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageStringFT in -lgd" >&5
echo $ECHO_N "checking for gdImageStringFT in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageStringFT+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringFT ();
int
main ()
{
gdImageStringFT ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageStringFT=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageStringFT=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageStringFT" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageStringFT" >&6
if test $ac_cv_lib_gd_gdImageStringFT = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_STRINGFT 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageStringFT


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageStringFTEx in -lgd" >&5
echo $ECHO_N "checking for gdImageStringFTEx in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageStringFTEx+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageStringFTEx ();
int
main ()
{
gdImageStringFTEx ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageStringFTEx=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageStringFTEx=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageStringFTEx" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageStringFTEx" >&6
if test $ac_cv_lib_gd_gdImageStringFTEx = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_STRINGFTEX 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageStringFTEx


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageColorClosestHWB in -lgd" >&5
echo $ECHO_N "checking for gdImageColorClosestHWB in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageColorClosestHWB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageColorClosestHWB ();
int
main ()
{
gdImageColorClosestHWB ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageColorClosestHWB=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageColorClosestHWB=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageColorClosestHWB" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageColorClosestHWB" >&6
if test $ac_cv_lib_gd_gdImageColorClosestHWB = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_COLORCLOSESTHWB 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageColorClosestHWB


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageColorResolve in -lgd" >&5
echo $ECHO_N "checking for gdImageColorResolve in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageColorResolve+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageColorResolve ();
int
main ()
{
gdImageColorResolve ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageColorResolve=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageColorResolve=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageColorResolve" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageColorResolve" >&6
if test $ac_cv_lib_gd_gdImageColorResolve = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GDIMAGECOLORRESOLVE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageColorResolve


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageGifCtx in -lgd" >&5
echo $ECHO_N "checking for gdImageGifCtx in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageGifCtx+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageGifCtx ();
int
main ()
{
gdImageGifCtx ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageGifCtx=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageGifCtx=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageGifCtx" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageGifCtx" >&6
if test $ac_cv_lib_gd_gdImageGifCtx = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_GIF_CTX 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageGifCtx


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdCacheCreate in -lgd" >&5
echo $ECHO_N "checking for gdCacheCreate in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdCacheCreate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdCacheCreate ();
int
main ()
{
gdCacheCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdCacheCreate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdCacheCreate=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdCacheCreate" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdCacheCreate" >&6
if test $ac_cv_lib_gd_gdCacheCreate = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_CACHE_CREATE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdCacheCreate


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdFontCacheShutdown in -lgd" >&5
echo $ECHO_N "checking for gdFontCacheShutdown in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdFontCacheShutdown+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdFontCacheShutdown ();
int
main ()
{
gdFontCacheShutdown ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdFontCacheShutdown=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdFontCacheShutdown=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFontCacheShutdown" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFontCacheShutdown" >&6
if test $ac_cv_lib_gd_gdFontCacheShutdown = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_FONTCACHESHUTDOWN 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdFontCacheShutdown


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdFreeFontCache in -lgd" >&5
echo $ECHO_N "checking for gdFreeFontCache in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdFreeFontCache+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdFreeFontCache ();
int
main ()
{
gdFreeFontCache ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdFreeFontCache=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdFreeFontCache=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdFreeFontCache" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdFreeFontCache" >&6
if test $ac_cv_lib_gd_gdFreeFontCache = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_FREEFONTCACHE 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdFreeFontCache


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdNewDynamicCtxEx in -lgd" >&5
echo $ECHO_N "checking for gdNewDynamicCtxEx in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdNewDynamicCtxEx+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdNewDynamicCtxEx ();
int
main ()
{
gdNewDynamicCtxEx ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdNewDynamicCtxEx=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdNewDynamicCtxEx=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdNewDynamicCtxEx" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdNewDynamicCtxEx" >&6
if test $ac_cv_lib_gd_gdNewDynamicCtxEx = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

cat >>confdefs.h <<\_ACEOF
#define HAVE_GD_DYNAMIC_CTX_EX 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdNewDynamicCtxEx


fi


  elif test -z "$GD_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: Unable to find gd.h anywhere under $PHP_GD" >&5
echo "$as_me: error: Unable to find gd.h anywhere under $PHP_GD" >&2;}
   { (exit 1); exit 1; }; }
  else
    { { echo "$as_me:$LINENO: error: Unable to find libgd.(a|so) anywhere under $PHP_GD" >&5
echo "$as_me: error: Unable to find libgd.(a|so) anywhere under $PHP_GD" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test -z "$GD_INCLUDE" || echo "$GD_INCLUDE" | grep '^/' >/dev/null ; then
    GD_INCLUDE=$GD_INCLUDE
  else

    ep_dir="`echo $GD_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    GD_INCLUDE="$ep_realdir/`basename \"$GD_INCLUDE\"`"
  fi


        old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$GD_INCLUDE
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <gd.h>
#include <stdlib.h>

int
main ()
{

gdIOCtx *ctx;
ctx = malloc(sizeof(gdIOCtx));
ctx->gd_free = 1;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBGD204 1
_ACEOF


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  CPPFLAGS=$old_CPPFLAGS

 fi
fi

if test "$PHP_GD" != "no"; then

  ext_builddir=ext/gd
  ext_srcdir=$abs_srcdir/ext/gd

  ac_extra=`echo "\\$(GDLIB_CFLAGS)"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/gd in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gd"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gd/"; ac_bdir="ext/gd/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gd.c gdttf.c $extra_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC gd"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC gd"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/gd in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gd"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gd/"; ac_bdir="ext/gd/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in gd.c gdttf.c $extra_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_gd="$shared_objects_gd $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gd) $(PHPGD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gd) -L$(top_builddir)/netware -lphp4lib $(GD_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gd) $(PHPGD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpgd.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gd"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpgd.$suffix: $ext_builddir/phpgd.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpgd.$suffix \$(phplibdir)

$ext_builddir/phpgd.$suffix: \$(shared_objects_gd) \$(PHPGD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gd) $(GD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gd) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gd) $(GD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/gd.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gd"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/gd.$suffix: $ext_builddir/gd.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/gd.$suffix \$(phplibdir)

$ext_builddir/gd.$suffix: \$(shared_objects_gd) \$(GD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_GD 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/gd in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gd"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gd/"; ac_bdir="ext/gd/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gd.c gdttf.c $extra_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC gd"
    else


  case ext/gd in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gd"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gd/"; ac_bdir="ext/gd/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gd.c gdttf.c $extra_sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC gd"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  if test "$GD_MODULE_TYPE" = "builtin"; then
    GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS"

  BUILD_DIR="$BUILD_DIR $ext_builddir/libgd"

  else
    GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS"

  if test "$GD_INCLUDE" != "/usr/include"; then

  if test -z "$GD_INCLUDE" || echo "$GD_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$GD_INCLUDE
  else

    ep_dir="`echo $GD_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GD_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=" -L$GD_LIB $GD_SHARED_LIBADD "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gdImageCreate in -lgd" >&5
echo $ECHO_N "checking for gdImageCreate in -lgd... $ECHO_C" >&6
if test "${ac_cv_lib_gd_gdImageCreate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgd  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gdImageCreate ();
int
main ()
{
gdImageCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gd_gdImageCreate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gd_gdImageCreate=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreate" >&5
echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreate" >&6
if test $ac_cv_lib_gd_gdImageCreate = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gd_gdImageCreate

      { { echo "$as_me:$LINENO: error: GD build test failed. Please check the config.log for details." >&5
echo "$as_me: error: GD build test failed. Please check the config.log for details." >&2;}
   { (exit 1); exit 1; }; }


fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST GDLIB_CFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST GD_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for GNU gettext support" >&5
echo $ECHO_N "checking for GNU gettext support... $ECHO_C" >&6

# Check whether --with-gettext or --without-gettext was given.
if test "${with_gettext+set}" = set; then
  withval="$with_gettext"
  PHP_GETTEXT=$withval
else

  PHP_GETTEXT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_GETTEXT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_GETTEXT in
shared,*)
  PHP_GETTEXT=`echo "$PHP_GETTEXT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_GETTEXT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_GETTEXT" != "no"; then
  for i in $PHP_GETTEXT /usr/local /usr; do
    test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
  done

  if test -z "$GETTEXT_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot locate header file libintl.h" >&5
echo "$as_me: error: Cannot locate header file libintl.h" >&2;}
   { (exit 1); exit 1; }; }
  fi

  GETTEXT_LIBDIR=$GETTEXT_DIR/lib
  GETTEXT_INCDIR=$GETTEXT_DIR/include

  O_LDFLAGS=$LDFLAGS
  LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
  echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6
if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char bindtextdomain ();
int
main ()
{
bindtextdomain ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_intl_bindtextdomain=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_intl_bindtextdomain=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
if test $ac_cv_lib_intl_bindtextdomain = yes; then

	GETTEXT_LIBS=intl
	GETTEXT_CHECK_IN_LIB=intl

else
  echo "$as_me:$LINENO: checking for bindtextdomain in -lc" >&5
echo $ECHO_N "checking for bindtextdomain in -lc... $ECHO_C" >&6
if test "${ac_cv_lib_c_bindtextdomain+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char bindtextdomain ();
int
main ()
{
bindtextdomain ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_c_bindtextdomain=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_c_bindtextdomain=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_c_bindtextdomain" >&5
echo "${ECHO_T}$ac_cv_lib_c_bindtextdomain" >&6
if test $ac_cv_lib_c_bindtextdomain = yes; then

		GETTEXT_LIBS=
		GETTEXT_CHECK_IN_LIB=c

else

		{ { echo "$as_me:$LINENO: error: Unable to find required gettext library" >&5
echo "$as_me: error: Unable to find required gettext library" >&2;}
   { (exit 1); exit 1; }; }

fi


fi

  LDFLAGS=$O_LDFLAGS


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBINTL 1
_ACEOF


  ext_builddir=ext/gettext
  ext_srcdir=$abs_srcdir/ext/gettext

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/gettext in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gettext"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gettext/"; ac_bdir="ext/gettext/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gettext.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC gettext"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC gettext"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/gettext in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gettext"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gettext/"; ac_bdir="ext/gettext/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in gettext.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_gettext="$shared_objects_gettext $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gettext) $(PHPGETTEXT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gettext) -L$(top_builddir)/netware -lphp4lib $(GETTEXT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gettext) $(PHPGETTEXT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpgettext.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gettext"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpgettext.$suffix: $ext_builddir/phpgettext.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpgettext.$suffix \$(phplibdir)

$ext_builddir/phpgettext.$suffix: \$(shared_objects_gettext) \$(PHPGETTEXT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gettext) $(GETTEXT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gettext) -L$(top_builddir)/netware -lphp4lib $(TEXT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gettext) $(GETTEXT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/gettext.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gettext"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/gettext.$suffix: $ext_builddir/gettext.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/gettext.$suffix \$(phplibdir)

$ext_builddir/gettext.$suffix: \$(shared_objects_gettext) \$(GETTEXT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_GETTEXT 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/gettext in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gettext"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gettext/"; ac_bdir="ext/gettext/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gettext.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC gettext"
    else


  case ext/gettext in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gettext"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gettext/"; ac_bdir="ext/gettext/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gettext.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC gettext"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST GETTEXT_SHARED_LIBADD"


  if test -n "$GETTEXT_LIBS"; then


  if test "$ext_shared" = "yes"; then
    GETTEXT_SHARED_LIBADD="-l$GETTEXT_LIBS $GETTEXT_SHARED_LIBADD"
    if test -n "$GETTEXT_LIBDIR"; then

  if test "$GETTEXT_LIBDIR" != "/usr/lib"; then

  if test -z "$GETTEXT_LIBDIR" || echo "$GETTEXT_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$GETTEXT_LIBDIR
  else

    ep_dir="`echo $GETTEXT_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GETTEXT_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GETTEXT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GETTEXT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GETTEXT_LIBDIR"; then

  if test "$GETTEXT_LIBDIR" != "/usr/lib"; then

  if test -z "$GETTEXT_LIBDIR" || echo "$GETTEXT_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$GETTEXT_LIBDIR
  else

    ep_dir="`echo $GETTEXT_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GETTEXT_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $GETTEXT_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$GETTEXT_LIBS $LIBS"
   ;;
  esac




  fi


  fi


  if test "$GETTEXT_INCDIR" != "/usr/include"; then

  if test -z "$GETTEXT_INCDIR" || echo "$GETTEXT_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$GETTEXT_INCDIR
  else

    ep_dir="`echo $GETTEXT_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GETTEXT_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  as_ac_Lib=`echo "ac_cv_lib_$GETTEXT_CHECK_IN_LIB''_ngettext" | $as_tr_sh`
echo "$as_me:$LINENO: checking for ngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
echo $ECHO_N "checking for ngettext in -l$GETTEXT_CHECK_IN_LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GETTEXT_CHECK_IN_LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char ngettext ();
int
main ()
{
ngettext ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NGETTEXT 1
_ACEOF

fi

  as_ac_Lib=`echo "ac_cv_lib_$GETTEXT_CHECK_IN_LIB''_dngettext" | $as_tr_sh`
echo "$as_me:$LINENO: checking for dngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
echo $ECHO_N "checking for dngettext in -l$GETTEXT_CHECK_IN_LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GETTEXT_CHECK_IN_LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dngettext ();
int
main ()
{
dngettext ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_DNGETTEXT 1
_ACEOF

fi

  as_ac_Lib=`echo "ac_cv_lib_$GETTEXT_CHECK_IN_LIB''_dcngettext" | $as_tr_sh`
echo "$as_me:$LINENO: checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB" >&5
echo $ECHO_N "checking for dcngettext in -l$GETTEXT_CHECK_IN_LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GETTEXT_CHECK_IN_LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dcngettext ();
int
main ()
{
dcngettext ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_DCNGETTEXT 1
_ACEOF

fi

  as_ac_Lib=`echo "ac_cv_lib_$GETTEXT_CHECK_IN_LIB''_bind_textdomain_codeset" | $as_tr_sh`
echo "$as_me:$LINENO: checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB" >&5
echo $ECHO_N "checking for bind_textdomain_codeset in -l$GETTEXT_CHECK_IN_LIB... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$GETTEXT_CHECK_IN_LIB  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char bind_textdomain_codeset ();
int
main ()
{
bind_textdomain_codeset ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
_ACEOF

fi


fi




echo "$as_me:$LINENO: checking for GNU MP support" >&5
echo $ECHO_N "checking for GNU MP support... $ECHO_C" >&6

# Check whether --with-gmp or --without-gmp was given.
if test "${with_gmp+set}" = set; then
  withval="$with_gmp"
  PHP_GMP=$withval
else

  PHP_GMP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_GMP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_GMP in
shared,*)
  PHP_GMP=`echo "$PHP_GMP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_GMP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_GMP" != "no"; then

  for i in $PHP_GMP /usr/local /usr; do
    test -f $i/include/gmp.h && GMP_DIR=$i && break
  done

  if test -z "$GMP_DIR"; then
    { { echo "$as_me:$LINENO: error: Unable to locate gmp.h" >&5
echo "$as_me: error: Unable to locate gmp.h" >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$GMP_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for __gmp_randinit_lc_2exp_size in -lgmp" >&5
echo $ECHO_N "checking for __gmp_randinit_lc_2exp_size in -lgmp... $ECHO_C" >&6
if test "${ac_cv_lib_gmp___gmp_randinit_lc_2exp_size+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char __gmp_randinit_lc_2exp_size ();
int
main ()
{
__gmp_randinit_lc_2exp_size ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gmp___gmp_randinit_lc_2exp_size=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gmp___gmp_randinit_lc_2exp_size=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp___gmp_randinit_lc_2exp_size" >&5
echo "${ECHO_T}$ac_cv_lib_gmp___gmp_randinit_lc_2exp_size" >&6
if test $ac_cv_lib_gmp___gmp_randinit_lc_2exp_size = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gmp___gmp_randinit_lc_2exp_size


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$GMP_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for gmp_randinit_lc_2exp_size in -lgmp" >&5
echo $ECHO_N "checking for gmp_randinit_lc_2exp_size in -lgmp... $ECHO_C" >&6
if test "${ac_cv_lib_gmp_gmp_randinit_lc_2exp_size+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char gmp_randinit_lc_2exp_size ();
int
main ()
{
gmp_randinit_lc_2exp_size ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gmp_gmp_randinit_lc_2exp_size=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gmp_gmp_randinit_lc_2exp_size=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gmp_gmp_randinit_lc_2exp_size" >&5
echo "${ECHO_T}$ac_cv_lib_gmp_gmp_randinit_lc_2exp_size" >&6
if test $ac_cv_lib_gmp_gmp_randinit_lc_2exp_size = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gmp_gmp_randinit_lc_2exp_size

      { { echo "$as_me:$LINENO: error: GNU MP Library version 4.1.2 or greater required." >&5
echo "$as_me: error: GNU MP Library version 4.1.2 or greater required." >&2;}
   { (exit 1); exit 1; }; }


fi



fi




  if test "$ext_shared" = "yes"; then
    GMP_SHARED_LIBADD="-lgmp $GMP_SHARED_LIBADD"
    if test -n "$GMP_DIR/lib"; then

  if test "$GMP_DIR/lib" != "/usr/lib"; then

  if test -z "$GMP_DIR/lib" || echo "$GMP_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GMP_DIR/lib
  else

    ep_dir="`echo $GMP_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GMP_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        GMP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $GMP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$GMP_DIR/lib"; then

  if test "$GMP_DIR/lib" != "/usr/lib"; then

  if test -z "$GMP_DIR/lib" || echo "$GMP_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$GMP_DIR/lib
  else

    ep_dir="`echo $GMP_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GMP_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case gmp in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lgmp $LIBS"
   ;;
  esac




  fi



  if test "$GMP_DIR/include" != "/usr/include"; then

  if test -z "$GMP_DIR/include" || echo "$GMP_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$GMP_DIR/include
  else

    ep_dir="`echo $GMP_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$GMP_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  ext_builddir=ext/gmp
  ext_srcdir=$abs_srcdir/ext/gmp

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/gmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gmp/"; ac_bdir="ext/gmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC gmp"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC gmp"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/gmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gmp/"; ac_bdir="ext/gmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in gmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_gmp="$shared_objects_gmp $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gmp) $(PHPGMP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gmp) -L$(top_builddir)/netware -lphp4lib $(GMP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gmp) $(PHPGMP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpgmp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gmp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpgmp.$suffix: $ext_builddir/phpgmp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpgmp.$suffix \$(phplibdir)

$ext_builddir/phpgmp.$suffix: \$(shared_objects_gmp) \$(PHPGMP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_gmp) $(GMP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gmp) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_gmp) $(GMP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/gmp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_gmp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/gmp.$suffix: $ext_builddir/gmp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/gmp.$suffix \$(phplibdir)

$ext_builddir/gmp.$suffix: \$(shared_objects_gmp) \$(GMP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_GMP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/gmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gmp/"; ac_bdir="ext/gmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC gmp"
    else


  case ext/gmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/gmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/gmp/"; ac_bdir="ext/gmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in gmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC gmp"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST GMP_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_GMP 1
_ACEOF

fi




echo "$as_me:$LINENO: checking whether to enable htscanner support" >&5
echo $ECHO_N "checking whether to enable htscanner support... $ECHO_C" >&6
# Check whether --enable-htscanner or --disable-htscanner was given.
if test "${enable_htscanner+set}" = set; then
  enableval="$enable_htscanner"
  PHP_HTSCANNER=$enableval
else

  PHP_HTSCANNER=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_HTSCANNER=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_HTSCANNER in
shared,*)
  PHP_HTSCANNER=`echo "$PHP_HTSCANNER"|sed 's/^shared,//'`
  ;;
shared)
  PHP_HTSCANNER=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_HTSCANNER" != "no"; then

  ext_builddir=ext/htscanner
  ext_srcdir=$abs_srcdir/ext/htscanner

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/htscanner in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/htscanner"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/htscanner/"; ac_bdir="ext/htscanner/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in htscanner.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC htscanner"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC htscanner"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/htscanner in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/htscanner"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/htscanner/"; ac_bdir="ext/htscanner/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in htscanner.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_htscanner="$shared_objects_htscanner $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_htscanner) $(PHPHTSCANNER_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_htscanner) -L$(top_builddir)/netware -lphp4lib $(HTSCANNER_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_htscanner) $(PHPHTSCANNER_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phphtscanner.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_htscanner"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phphtscanner.$suffix: $ext_builddir/phphtscanner.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phphtscanner.$suffix \$(phplibdir)

$ext_builddir/phphtscanner.$suffix: \$(shared_objects_htscanner) \$(PHPHTSCANNER_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_htscanner) $(HTSCANNER_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_htscanner) -L$(top_builddir)/netware -lphp4lib $(CANNER_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_htscanner) $(HTSCANNER_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/htscanner.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_htscanner"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/htscanner.$suffix: $ext_builddir/htscanner.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/htscanner.$suffix \$(phplibdir)

$ext_builddir/htscanner.$suffix: \$(shared_objects_htscanner) \$(HTSCANNER_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_HTSCANNER 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/htscanner in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/htscanner"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/htscanner/"; ac_bdir="ext/htscanner/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in htscanner.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC htscanner"
    else


  case ext/htscanner in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/htscanner"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/htscanner/"; ac_bdir="ext/htscanner/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in htscanner.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC htscanner"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for hwapi support" >&5
echo $ECHO_N "checking for hwapi support... $ECHO_C" >&6

# Check whether --with-hwapi or --without-hwapi was given.
if test "${with_hwapi+set}" = set; then
  withval="$with_hwapi"
  PHP_HWAPI=$withval
else

  PHP_HWAPI=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_HWAPI=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_HWAPI in
shared,*)
  PHP_HWAPI=`echo "$PHP_HWAPI"|sed 's/^shared,//'`
  ;;
shared)
  PHP_HWAPI=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_HWAPI" != "no"; then
  if test -r $PHP_HWAPI/include/sdk/api/object.h; then
    HWAPI_DIR=$PHP_HWAPI
  else
    echo "$as_me:$LINENO: checking for HWAPI in default path" >&5
echo $ECHO_N "checking for HWAPI in default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      if test -r $i/include/hwapi/sdk/api/object.h; then
        HWAPI_DIR=$i
        echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
      fi
    done
  fi

  if test -z "$HWAPI_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please install the hwapi >= 1.0.0 distribution" >&5
echo "$as_me: error: Please install the hwapi >= 1.0.0 distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$HWAPI_DIR/include/hwapi" != "/usr/include"; then

  if test -z "$HWAPI_DIR/include/hwapi" || echo "$HWAPI_DIR/include/hwapi" | grep '^/' >/dev/null ; then
    ai_p=$HWAPI_DIR/include/hwapi
  else

    ep_dir="`echo $HWAPI_DIR/include/hwapi|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$HWAPI_DIR/include/hwapi\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST HWAPI_SHARED_LIBADD"



  if test "$ext_shared" = "yes"; then
    HWAPI_SHARED_LIBADD="-lhwapi $HWAPI_SHARED_LIBADD"
    if test -n "$HWAPI_DIR/lib"; then

  if test "$HWAPI_DIR/lib" != "/usr/lib"; then

  if test -z "$HWAPI_DIR/lib" || echo "$HWAPI_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$HWAPI_DIR/lib
  else

    ep_dir="`echo $HWAPI_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$HWAPI_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        HWAPI_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $HWAPI_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$HWAPI_DIR/lib"; then

  if test "$HWAPI_DIR/lib" != "/usr/lib"; then

  if test -z "$HWAPI_DIR/lib" || echo "$HWAPI_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$HWAPI_DIR/lib
  else

    ep_dir="`echo $HWAPI_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$HWAPI_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case hwapi in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lhwapi $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_HWAPI 1
_ACEOF



  if test -z "$php_cxx_done"; then
    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$ac_tool_prefix"; then
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
  echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

    test -n "$CXX" && break
  done
fi
if test -z "$CXX"; then
  ac_ct_CXX=$CXX
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CXX"; then
  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CXX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
echo "${ECHO_T}$ac_ct_CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  test -n "$ac_ct_CXX" && break
done
test -n "$ac_ct_CXX" || ac_ct_CXX="g++"

  CXX=$ac_ct_CXX
fi


# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
     "checking for C++ compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_compiler_gnu=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_compiler_gnu=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu

fi
echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
GXX=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-g"
echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cxx_g+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_prog_cxx_g=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi
for ac_declaration in \
   '' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
#include <stdlib.h>
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

continue
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
if test -z "$CXXCPP"; then
  if test "${ac_cv_prog_CXXCPP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      # Double quotes because CXXCPP needs to be expanded
    for CXXCPP in "$CXX -E" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  break
fi

    done
    ac_cv_prog_CXXCPP=$CXXCPP

fi
  CXXCPP=$ac_cv_prog_CXXCPP
else
  ac_cv_prog_CXXCPP=$CXXCPP
fi
echo "$as_me:$LINENO: result: $CXXCPP" >&5
echo "${ECHO_T}$CXXCPP" >&6
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  :
else
  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

    php_cxx_done=yes
  fi


  ext_builddir=ext/hwapi
  ext_srcdir=$abs_srcdir/ext/hwapi

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/hwapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hwapi.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC hwapi"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC hwapi"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/hwapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in hwapi.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_hwapi="$shared_objects_hwapi $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(PHPHWAPI_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) -L$(top_builddir)/netware -lphp4lib $(HWAPI_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(PHPHWAPI_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phphwapi.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hwapi"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phphwapi.$suffix: $ext_builddir/phphwapi.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phphwapi.$suffix \$(phplibdir)

$ext_builddir/phphwapi.$suffix: \$(shared_objects_hwapi) \$(PHPHWAPI_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(HWAPI_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) -L$(top_builddir)/netware -lphp4lib $(PI_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hwapi) $(HWAPI_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/hwapi.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hwapi"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/hwapi.$suffix: $ext_builddir/hwapi.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/hwapi.$suffix \$(phplibdir)

$ext_builddir/hwapi.$suffix: \$(shared_objects_hwapi) \$(HWAPI_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_HWAPI 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/hwapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hwapi.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC hwapi"
    else


  case ext/hwapi in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hwapi"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hwapi/"; ac_bdir="ext/hwapi/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hwapi.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC hwapi"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"




  case hwapi in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lhwapi $LIBS"
   ;;
  esac




  case pthread in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpthread $LIBS"
   ;;
  esac




  case stdc++ in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lstdc++ $LIBS"
   ;;
  esac



  if test "$HWAPI_DIR/include" != "/usr/include"; then

  if test -z "$HWAPI_DIR/include" || echo "$HWAPI_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$HWAPI_DIR/include
  else

    ep_dir="`echo $HWAPI_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$HWAPI_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

fi


echo "$as_me:$LINENO: checking for Hyperwave support" >&5
echo $ECHO_N "checking for Hyperwave support... $ECHO_C" >&6

# Check whether --with-hyperwave or --without-hyperwave was given.
if test "${with_hyperwave+set}" = set; then
  withval="$with_hyperwave"

  if test "$withval" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HYPERWAVE 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  ext_builddir=ext/hyperwave
  ext_srcdir=$abs_srcdir/ext/hyperwave

  ac_extra=

  if test "" != "shared" && test "" != "yes" && test "" != "cli"; then



  case ext/hyperwave in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hyperwave"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hyperwave/"; ac_bdir="ext/hyperwave/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hw.c hg_comm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC hyperwave"
    if test "" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC hyperwave"
    fi
  else
    if test "" = "shared" || test "" = "yes"; then

  case ext/hyperwave in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hyperwave"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hyperwave/"; ac_bdir="ext/hyperwave/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in hw.c hg_comm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_hyperwave="$shared_objects_hyperwave $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) $(PHPHYPERWAVE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) -L$(top_builddir)/netware -lphp4lib $(HYPERWAVE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) $(PHPHYPERWAVE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phphyperwave.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hyperwave"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phphyperwave.$suffix: $ext_builddir/phphyperwave.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phphyperwave.$suffix \$(phplibdir)

$ext_builddir/phphyperwave.$suffix: \$(shared_objects_hyperwave) \$(PHPHYPERWAVE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) $(HYPERWAVE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) -L$(top_builddir)/netware -lphp4lib $(ERWAVE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_hyperwave) $(HYPERWAVE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/hyperwave.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_hyperwave"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/hyperwave.$suffix: $ext_builddir/hyperwave.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/hyperwave.$suffix \$(phplibdir)

$ext_builddir/hyperwave.$suffix: \$(shared_objects_hyperwave) \$(HYPERWAVE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_HYPERWAVE 1
_ACEOF

    fi
  fi

  if test "" != "shared" && test "" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/hyperwave in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hyperwave"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hyperwave/"; ac_bdir="ext/hyperwave/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hw.c hg_comm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC hyperwave"
    else


  case ext/hyperwave in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/hyperwave"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/hyperwave/"; ac_bdir="ext/hyperwave/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in hw.c hg_comm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC hyperwave"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


  else

cat >>confdefs.h <<\_ACEOF
#define HYPERWAVE 0
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else


cat >>confdefs.h <<\_ACEOF
#define HYPERWAVE 0
_ACEOF

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;




echo "$as_me:$LINENO: checking for iconv support" >&5
echo $ECHO_N "checking for iconv support... $ECHO_C" >&6

# Check whether --with-iconv or --without-iconv was given.
if test "${with_iconv+set}" = set; then
  withval="$with_iconv"
  PHP_ICONV=$withval
else

  PHP_ICONV=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_ICONV=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_ICONV in
shared,*)
  PHP_ICONV=`echo "$PHP_ICONV"|sed 's/^shared,//'`
  ;;
shared)
  PHP_ICONV=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_ICONV" != "no"; then


  found_iconv=no
  unset ICONV_DIR

  # Create the directories for a VPATH build:
  test -d ext || mkdir ext
  test -d ext/iconv || mkdir ext/iconv

  echo > ext/iconv/php_have_bsd_iconv.h
  echo > ext/iconv/php_have_glibc_iconv.h
  echo > ext/iconv/php_have_libiconv.h
  echo > ext/iconv/php_have_iconv.h
  echo > ext/iconv/php_php_iconv_impl.h
  echo > ext/iconv/php_php_iconv_h_path.h
  echo > ext/iconv/php_iconv_supports_errno.h

        if test "$PHP_ICONV" = "yes"; then
    echo "$as_me:$LINENO: checking for iconv" >&5
echo $ECHO_N "checking for iconv... $ECHO_C" >&6
if test "${ac_cv_func_iconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define iconv to an innocuous variant, in case <limits.h> declares iconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define iconv innocuous_iconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char iconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef iconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
/* 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
char (*f) () = iconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != iconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_iconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_iconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5
echo "${ECHO_T}$ac_cv_func_iconv" >&6
if test $ac_cv_func_iconv = yes; then


  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h

      found_iconv=yes

else

      echo "$as_me:$LINENO: checking for libiconv" >&5
echo $ECHO_N "checking for libiconv... $ECHO_C" >&6
if test "${ac_cv_func_libiconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define libiconv to an innocuous variant, in case <limits.h> declares libiconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define libiconv innocuous_libiconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char libiconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef libiconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
/* 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
char (*f) () = libiconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != libiconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_libiconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_libiconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_libiconv" >&5
echo "${ECHO_T}$ac_cv_func_libiconv" >&6
if test $ac_cv_func_libiconv = yes; then


  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h

        found_iconv=yes

fi


fi

  fi

        if test "$found_iconv" = "no"; then

    for i in $PHP_ICONV /usr/local /usr; do
      if test -r $i/include/giconv.h; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GICONV_H 1
_ACEOF

        ICONV_DIR=$i
        iconv_lib_name=giconv
        break
      elif test -r $i/include/iconv.h; then
        ICONV_DIR=$i
        iconv_lib_name=iconv
        break
      fi
    done

    if test -z "$ICONV_DIR"; then
      { { echo "$as_me:$LINENO: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&5
echo "$as_me: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
       test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
    then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$ICONV_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_libiconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for libiconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for libiconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
int
main ()
{
libiconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

        found_iconv=yes

  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_libiconv


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$ICONV_DIR/lib
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_iconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for iconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for iconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
int
main ()
{
iconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

          found_iconv=yes

  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_iconv


fi



fi

    fi
  fi

  if test "$found_iconv" = "yes"; then
    if test -n "$ICONV_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ICONV 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    ICONV_SHARED_LIBADD="-l$iconv_lib_name $ICONV_SHARED_LIBADD"
    if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ICONV_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ICONV_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $iconv_lib_name in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$iconv_lib_name $LIBS"
   ;;
  esac




  fi



  if test "$ICONV_DIR/include" != "/usr/include"; then

  if test -z "$ICONV_DIR/include" || echo "$ICONV_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/include
  else

    ep_dir="`echo $ICONV_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi

    iconv_avail="yes";

else
    iconv_avail="no";

  fi


  if test "$iconv_avail" != "no"; then
    iconv_cflags_save="$CFLAGS"
    iconv_ldflags_save="$LDFLAGS"

    if test -z "$ICONV_DIR"; then
      PHP_ICONV_PREFIX="/usr"
    else
      PHP_ICONV_PREFIX="$ICONV_DIR"
    fi

    CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
    LDFLAGS="-L$PHP_ICONV_PREFIX/lib $LDFLAGS"

    if test -r $PHP_ICONV_PREFIX/include/giconv.h; then
      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
    else
      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
    fi

    if test -z "$iconv_lib_name"; then
      echo "$as_me:$LINENO: checking if iconv is glibc's" >&5
echo $ECHO_N "checking if iconv is glibc's... $ECHO_C" >&6
      cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <gnu/libc-version.h>
int
main ()
{
gnu_get_libc_version();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

        echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
        iconv_impl_name="glibc"

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


        echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
    else
      case "$iconv_lib_name" in
        iconv )
          echo "$as_me:$LINENO: checking if iconv is Konstantin Chuguev's" >&5
echo $ECHO_N "checking if iconv is Konstantin Chuguev's... $ECHO_C" >&6
          cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <iconv.h>
int
main ()
{
iconv_ccs_init(NULL, NULL);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

            echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
            iconv_impl_name="bsd"

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


            echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
            iconv_impl_name="gnu_libiconv"

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
          ;;

        giconv )
          iconv_impl_name="gnu_libiconv"
          ;;

        biconv )
          iconv_impl_name="bsd"
          ;;
      esac
    fi

    echo > ext/iconv/php_have_bsd_iconv.h
    echo > ext/iconv/php_have_glibc_iconv.h

    case "$iconv_impl_name" in
      gnu_libiconv )

  echo "#define PHP_ICONV_IMPL \"libiconv\"" > ext/iconv/php_php_iconv_impl.h


cat >>confdefs.h <<\_ACEOF
#define PHP_ICONV_IMPL "libiconv"
_ACEOF

        ;;

      bsd )

  echo "#define HAVE_BSD_ICONV 1" > ext/iconv/php_have_bsd_iconv.h


cat >>confdefs.h <<\_ACEOF
#define HAVE_BSD_ICONV 1
_ACEOF


  echo "#define PHP_ICONV_IMPL \"BSD iconv\"" > ext/iconv/php_php_iconv_impl.h


cat >>confdefs.h <<\_ACEOF
#define PHP_ICONV_IMPL "BSD iconv"
_ACEOF

        ;;

      glibc )

  echo "#define HAVE_GLIBC_ICONV 1" > ext/iconv/php_have_glibc_iconv.h


cat >>confdefs.h <<\_ACEOF
#define HAVE_GLIBC_ICONV 1
_ACEOF


  echo "#define PHP_ICONV_IMPL \"glibc\"" > ext/iconv/php_php_iconv_impl.h


cat >>confdefs.h <<\_ACEOF
#define PHP_ICONV_IMPL "glibc"
_ACEOF

        ;;
    esac

    echo "$as_me:$LINENO: checking if iconv supports errno" >&5
echo $ECHO_N "checking if iconv supports errno... $ECHO_C" >&6
    if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <$PHP_ICONV_H_PATH>
#include <errno.h>

int main() {
  iconv_t cd;
  cd = iconv_open( "*blahblah*", "*blahblah*" );
  if (cd == (iconv_t)(-1)) {
    if (errno == EINVAL) {
      return 0;
	} else {
      return 1;
    }
  }
  iconv_close( cd );
  return 2;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  echo "#define ICONV_SUPPORTS_ERRNO 1" > ext/iconv/php_iconv_supports_errno.h


cat >>confdefs.h <<\_ACEOF
#define ICONV_SUPPORTS_ERRNO 1
_ACEOF


else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

  echo "#define ICONV_SUPPORTS_ERRNO 0" > ext/iconv/php_iconv_supports_errno.h


cat >>confdefs.h <<\_ACEOF
#define ICONV_SUPPORTS_ERRNO 0
_ACEOF


fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

    echo "$as_me:$LINENO: checking if your cpp allows macro usage in include lines" >&5
echo $ECHO_N "checking if your cpp allows macro usage in include lines... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#define FOO <$PHP_ICONV_H_PATH>
#include FOO

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  echo "#define PHP_ICONV_H_PATH <$PHP_ICONV_H_PATH>" > ext/iconv/php_php_iconv_h_path.h


cat >>confdefs.h <<_ACEOF
#define PHP_ICONV_H_PATH <$PHP_ICONV_H_PATH>
_ACEOF


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


      echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

    CFLAGS="$iconv_cflags_save"
    LDFLAGS="$iconv_ldflags_save"


  ext_builddir=ext/iconv
  ext_srcdir=$abs_srcdir/ext/iconv

  ac_extra=`echo "-I\"$PHP_ICONV_PREFIX/include\""|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/iconv in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/iconv"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/iconv/"; ac_bdir="ext/iconv/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in iconv.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC iconv"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC iconv"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/iconv in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/iconv"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/iconv/"; ac_bdir="ext/iconv/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in iconv.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_iconv="$shared_objects_iconv $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_iconv) $(PHPICONV_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_iconv) -L$(top_builddir)/netware -lphp4lib $(ICONV_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_iconv) $(PHPICONV_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpiconv.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_iconv"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpiconv.$suffix: $ext_builddir/phpiconv.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpiconv.$suffix \$(phplibdir)

$ext_builddir/phpiconv.$suffix: \$(shared_objects_iconv) \$(PHPICONV_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_iconv) $(ICONV_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_iconv) -L$(top_builddir)/netware -lphp4lib $(NV_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_iconv) $(ICONV_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/iconv.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_iconv"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/iconv.$suffix: $ext_builddir/iconv.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/iconv.$suffix \$(phplibdir)

$ext_builddir/iconv.$suffix: \$(shared_objects_iconv) \$(ICONV_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_ICONV 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/iconv in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/iconv"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/iconv/"; ac_bdir="ext/iconv/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in iconv.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC iconv"
    else


  case ext/iconv in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/iconv"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/iconv/"; ac_bdir="ext/iconv/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in iconv.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC iconv"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST ICONV_SHARED_LIBADD"

  else
    { { echo "$as_me:$LINENO: error: Please reinstall the iconv library." >&5
echo "$as_me: error: Please reinstall the iconv library." >&2;}
   { (exit 1); exit 1; }; }
  fi
fi















echo "$as_me:$LINENO: checking for IMAP support" >&5
echo $ECHO_N "checking for IMAP support... $ECHO_C" >&6

# Check whether --with-imap or --without-imap was given.
if test "${with_imap+set}" = set; then
  withval="$with_imap"
  PHP_IMAP=$withval
else

  PHP_IMAP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_IMAP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_IMAP in
shared,*)
  PHP_IMAP=`echo "$PHP_IMAP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_IMAP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for IMAP Kerberos support" >&5
echo $ECHO_N "checking for IMAP Kerberos support... $ECHO_C" >&6

# Check whether --with-kerberos or --without-kerberos was given.
if test "${with_kerberos+set}" = set; then
  withval="$with_kerberos"
  PHP_KERBEROS=$withval
else

  PHP_KERBEROS=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_KERBEROS=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_KERBEROS
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for IMAP SSL support" >&5
echo $ECHO_N "checking for IMAP SSL support... $ECHO_C" >&6

# Check whether --with-imap-ssl or --without-imap-ssl was given.
if test "${with_imap_ssl+set}" = set; then
  withval="$with_imap_ssl"
  PHP_IMAP_SSL=$withval
else

  PHP_IMAP_SSL=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_IMAP_SSL=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_IMAP_SSL
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_IMAP" != "no"; then

  PHP_VAR_SUBST="$PHP_VAR_SUBST IMAP_SHARED_LIBADD"


  ext_builddir=ext/imap
  ext_srcdir=$abs_srcdir/ext/imap

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/imap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/imap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/imap/"; ac_bdir="ext/imap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_imap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC imap"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC imap"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/imap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/imap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/imap/"; ac_bdir="ext/imap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_imap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_imap="$shared_objects_imap $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_imap) $(PHPIMAP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_imap) -L$(top_builddir)/netware -lphp4lib $(IMAP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_imap) $(PHPIMAP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpimap.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_imap"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpimap.$suffix: $ext_builddir/phpimap.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpimap.$suffix \$(phplibdir)

$ext_builddir/phpimap.$suffix: \$(shared_objects_imap) \$(PHPIMAP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_imap) $(IMAP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_imap) -L$(top_builddir)/netware -lphp4lib $(P_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_imap) $(IMAP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/imap.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_imap"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/imap.$suffix: $ext_builddir/imap.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/imap.$suffix \$(phplibdir)

$ext_builddir/imap.$suffix: \$(shared_objects_imap) \$(IMAP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_IMAP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/imap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/imap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/imap/"; ac_bdir="ext/imap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_imap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC imap"
    else


  case ext/imap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/imap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/imap/"; ac_bdir="ext/imap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_imap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC imap"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP 1
_ACEOF


    for i in $PHP_IMAP /usr/local /usr; do
      if test -r "$i/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i
    break
  elif test -r "$i/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i
	break

      elif test -r "$i/include/c-client/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include/c-client
    break
  elif test -r "$i/include/c-client/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i/include/c-client
	break

      elif test -r "$i/include/imap/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include/imap
    break
  elif test -r "$i/include/imap/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i/include/imap
	break

      elif test -r "$i/include/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include
    break
  elif test -r "$i/include/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i/include
	break

      elif test -r "$i/imap/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/imap
    break
  elif test -r "$i/imap/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i/imap
	break

      elif test -r "$i/c-client/c-client.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2000 1
_ACEOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/c-client
    break
  elif test -r "$i/c-client/rfc822.h"; then
    IMAP_DIR=$i;
    IMAP_INC_DIR=$i/c-client
	break

      fi
    done

        cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$IMAP_INC_DIR/mail.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "mail_fetch_overview_sequence" >/dev/null 2>&1; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2004 1
_ACEOF


fi
rm -f conftest*


        old_CFLAGS=$CFLAGS
    CFLAGS="-I$IMAP_INC_DIR"
    echo "$as_me:$LINENO: checking for utf8_mime2text signature" >&5
echo $ECHO_N "checking for utf8_mime2text signature... $ECHO_C" >&6
if test "${ac_cv_utf8_mime2text+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <stdio.h>
#include <c-client.h>

int
main ()
{

        SIZEDTEXT *src, *dst;
        utf8_mime2text(src, dst);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

        ac_cv_utf8_mime2text=old

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


        ac_cv_utf8_mime2text=new

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

fi
echo "$as_me:$LINENO: result: $ac_cv_utf8_mime2text" >&5
echo "${ECHO_T}$ac_cv_utf8_mime2text" >&6
    if test "$ac_cv_utf8_mime2text" = "new"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NEW_MIME2TEXT 1
_ACEOF

    fi
    CFLAGS=$old_CFLAGS

    old_CFLAGS=$CFLAGS
    CFLAGS="-I$IMAP_INC_DIR"
    echo "$as_me:$LINENO: checking for U8T_CANONICAL" >&5
echo $ECHO_N "checking for U8T_CANONICAL... $ECHO_C" >&6
if test "${ac_cv_u8t_canonical+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <c-client.h>

int
main ()
{

         int i = U8T_CANONICAL;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

         ac_cv_u8t_canonical=yes

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


         ac_cv_u8t_canonical=no

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

fi
echo "$as_me:$LINENO: result: $ac_cv_u8t_canonical" >&5
echo "${ECHO_T}$ac_cv_u8t_canonical" >&6
    CFLAGS=$old_CFLAGS

    if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then
        { { echo "$as_me:$LINENO: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information." >&5
echo "$as_me: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information." >&2;}
   { (exit 1); exit 1; }; }
    fi
    if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then
        { { echo "$as_me:$LINENO: error: utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information." >&5
echo "$as_me: error: utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information." >&2;}
   { (exit 1); exit 1; }; }
    fi

        old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$IMAP_INC_DIR
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "imap4r1.h"
#if defined(IMAPSSLPORT)
      this_is_true
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "this_is_true" >/dev/null 2>&1; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP2001 1
_ACEOF


fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=""

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5
echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6
if test "${ac_cv_lib_pam_pam_start+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpam  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pam_start ();
int
main ()
{
pam_start ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pam_pam_start=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pam_pam_start=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5
echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6
if test $ac_cv_lib_pam_pam_start = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case pam in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="-lpam $IMAP_SHARED_LIBADD"
    else


  case pam in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpam $LIBS"
   ;;
  esac


    fi
   ;;
  esac



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBPAM 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_pam_pam_start


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff=""

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_crypt_crypt+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char crypt ();
int
main ()
{
crypt ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_crypt_crypt=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_crypt_crypt=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
if test $ac_cv_lib_crypt_crypt = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case crypt in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="-lcrypt $IMAP_SHARED_LIBADD"
    else


  case crypt in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypt $LIBS"
   ;;
  esac


    fi
   ;;
  esac



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBCRYPT 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_crypt_crypt


fi



  if test -z "$IMAP_DIR" || echo "$IMAP_DIR" | grep '^/' >/dev/null ; then
    IMAP_DIR=$IMAP_DIR
  else

    ep_dir="`echo $IMAP_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    IMAP_DIR="$ep_realdir/`basename \"$IMAP_DIR\"`"
  fi


    if test -z "$IMAP_DIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find rfc822.h. Please check your c-client installation." >&5
echo "$as_me: error: Cannot find rfc822.h. Please check your c-client installation." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -r "$IMAP_DIR/c-client/c-client.a"; then
      ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
    elif test -r "$IMAP_DIR/lib/c-client.a"; then
      ln -s "$IMAP_DIR/lib/c-client.a" "$IMAP_DIR/lib/libc-client.a" >/dev/null 2>&1
    fi

    for lib in c-client4 c-client imap; do
      IMAP_LIB=$lib

  str="$IMAP_DIR/lib/lib$lib.*"
  for i in `echo $str`; do
    test -r $i && IMAP_LIBDIR=$IMAP_DIR/lib && break 2
  done


  str="$IMAP_DIR/c-client/lib$lib.*"
  for i in `echo $str`; do
    test -r $i && IMAP_LIBDIR=$IMAP_DIR/c-client && break 2
  done

    done

    if test -z "$IMAP_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find imap library (libc-client.a). Please check your c-client installation." >&5
echo "$as_me: error: Cannot find imap library (libc-client.a). Please check your c-client installation." >&2;}
   { (exit 1); exit 1; }; }
    fi


  if test "$IMAP_INC_DIR" != "/usr/include"; then

  if test -z "$IMAP_INC_DIR" || echo "$IMAP_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$IMAP_INC_DIR
  else

    ep_dir="`echo $IMAP_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$IMAP_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  case $IMAP_LIB in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="-l$IMAP_LIB $IMAP_SHARED_LIBADD"
    else


  case $IMAP_LIB in
  c|c_r|pthread*) ;;
  *)
      DLIBS="-l$IMAP_LIB $DLIBS"
   ;;
  esac


    fi
   ;;
  esac



  if test "$IMAP_LIBDIR" != "/usr/lib"; then

  if test -z "$IMAP_LIBDIR" || echo "$IMAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$IMAP_LIBDIR
  else

    ep_dir="`echo $IMAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$IMAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $IMAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


  if test "$PHP_KERBEROS" != "no"; then

  found_kerberos=no
  unset KERBEROS_CFLAGS
  unset KERBEROS_LIBS

    if test -z "$KRB5_CONFIG"; then
    # Extract the first word of "krb5-config", so it can be a program name with args.
set dummy krb5-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $KRB5_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy="$PATH:/usr/kerberos/bin:/usr/local/bin"
for as_dir in $as_dummy
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_KRB5_CONFIG" && ac_cv_path_KRB5_CONFIG="no"
  ;;
esac
fi
KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG

if test -n "$KRB5_CONFIG"; then
  echo "$as_me:$LINENO: result: $KRB5_CONFIG" >&5
echo "${ECHO_T}$KRB5_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  fi

    if test "$PHP_KERBEROS" = "yes" && test -x "$KRB5_CONFIG"; then
    KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
    KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`

    if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then
      found_kerberos=yes

  for ac_i in $KERBEROS_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $IMAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $KERBEROS_CFLAGS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_kerberos" = "no"; then

    if test "$PHP_KERBEROS" = "yes"; then
      PHP_KERBEROS="/usr/kerberos /usr/local /usr"
    fi

    for i in $PHP_KERBEROS; do
      if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
        PHP_KERBEROS_DIR=$i
        break
      fi
    done

    if test "$PHP_KERBEROS_DIR"; then
      found_kerberos=yes

  if test "$PHP_KERBEROS_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_KERBEROS_DIR/lib" || echo "$PHP_KERBEROS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_KERBEROS_DIR/lib
  else

    ep_dir="`echo $PHP_KERBEROS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_KERBEROS_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $IMAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi



  case gssapi_krb5 in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -lgssapi_krb5"
    else


  case gssapi_krb5 in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lgssapi_krb5"
   ;;
  esac


    fi
   ;;
  esac




  case krb5 in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -lkrb5"
    else


  case krb5 in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lkrb5"
   ;;
  esac


    fi
   ;;
  esac




  case k5crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -lk5crypto"
    else


  case k5crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lk5crypto"
   ;;
  esac


    fi
   ;;
  esac




  case com_err in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -lcom_err"
    else


  case com_err in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lcom_err"
   ;;
  esac


    fi
   ;;
  esac



  if test "$PHP_KERBEROS_DIR/include" != "/usr/include"; then

  if test -z "$PHP_KERBEROS_DIR/include" || echo "$PHP_KERBEROS_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$PHP_KERBEROS_DIR/include
  else

    ep_dir="`echo $PHP_KERBEROS_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_KERBEROS_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi
  fi

  if test "$found_kerberos" = "yes"; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP_KRB 1
_ACEOF


else
      { { echo "$as_me:$LINENO: error: Kerberos libraries not found.

      Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
      " >&5
echo "$as_me: error: Kerberos libraries not found.

      Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
      " >&2;}
   { (exit 1); exit 1; }; }

  fi

  else
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$IMAP_INC_DIR/linkage.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "auth_gss" >/dev/null 2>&1; then

      { { echo "$as_me:$LINENO: error: This c-client library is built with Kerberos support.

      Add --with-kerberos to your configure line. Check config.log for details.
      " >&5
echo "$as_me: error: This c-client library is built with Kerberos support.

      Add --with-kerberos to your configure line. Check config.log for details.
      " >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi


  if test "$PHP_IMAP_SSL" != "no"; then

  found_openssl=no
  unset OPENSSL_INCDIR
  unset OPENSSL_LIBDIR

    test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
  test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no

    if test "$PHP_OPENSSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_OPENSSL
  elif test "$PHP_IMAP_SSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_IMAP_SSL
  fi

    if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG

if test -n "$PKG_CONFIG"; then
  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  fi

    if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
    if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
      found_openssl=yes
      OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
      OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
      OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
    else
      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then

  for ac_i in $OPENSSL_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$IMAP_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $IMAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $OPENSSL_INCS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_openssl" = "no"; then

    if test "$PHP_OPENSSL_DIR" = "yes"; then
      PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
    fi

    for i in $PHP_OPENSSL_DIR; do
      if test -r $i/include/openssl/evp.h; then
        OPENSSL_INCDIR=$i/include
      fi
      if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
        OPENSSL_LIBDIR=$i/lib
      fi
      test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
    done

    if test -z "$OPENSSL_INCDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's <evp.h>" >&5
echo "$as_me: error: Cannot find OpenSSL's <evp.h>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -z "$OPENSSL_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's libraries" >&5
echo "$as_me: error: Cannot find OpenSSL's libraries" >&2;}
   { (exit 1); exit 1; }; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$OPENSSL_INCDIR
    echo "$as_me:$LINENO: checking for OpenSSL version" >&5
echo $ECHO_N "checking for OpenSSL version... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: >= 0.9.6" >&5
echo "${ECHO_T}>= 0.9.6" >&6

else

      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS


  if test "$OPENSSL_INCDIR" != "/usr/include"; then

  if test -z "$OPENSSL_INCDIR" || echo "$OPENSSL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_INCDIR
  else

    ep_dir="`echo $OPENSSL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for CRYPTO_free in -lcrypto" >&5
echo $ECHO_N "checking for CRYPTO_free in -lcrypto... $ECHO_C" >&6
if test "${ac_cv_lib_crypto_CRYPTO_free+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char CRYPTO_free ();
int
main ()
{
CRYPTO_free ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_crypto_CRYPTO_free=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_crypto_CRYPTO_free=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_free" >&5
echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_free" >&6
if test $ac_cv_lib_crypto_CRYPTO_free = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="-lcrypto $IMAP_SHARED_LIBADD"
    else


  case crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypto $LIBS"
   ;;
  esac


    fi
   ;;
  esac




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_crypto_CRYPTO_free

      { { echo "$as_me:$LINENO: error: libcrypto not found!" >&5
echo "$as_me: error: libcrypto not found!" >&2;}
   { (exit 1); exit 1; }; }


fi


    old_LIBS=$LIBS
    LIBS="$LIBS -lcrypto"

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for SSL_CTX_set_ssl_version in -lssl" >&5
echo $ECHO_N "checking for SSL_CTX_set_ssl_version in -lssl... $ECHO_C" >&6
if test "${ac_cv_lib_ssl_SSL_CTX_set_ssl_version+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lssl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SSL_CTX_set_ssl_version ();
int
main ()
{
SSL_CTX_set_ssl_version ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ssl_SSL_CTX_set_ssl_version=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ssl_SSL_CTX_set_ssl_version=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&5
echo "${ECHO_T}$ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&6
if test $ac_cv_lib_ssl_SSL_CTX_set_ssl_version = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      found_openssl=yes


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version

      { { echo "$as_me:$LINENO: error: libssl not found!" >&5
echo "$as_me: error: libssl not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

    LIBS=$old_LIBS


  case ssl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="-lssl $IMAP_SHARED_LIBADD"
    else


  case ssl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  if test "$OPENSSL_LIBDIR" != "/usr/lib"; then

  if test -z "$OPENSSL_LIBDIR" || echo "$OPENSSL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_LIBDIR
  else

    ep_dir="`echo $OPENSSL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        IMAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $IMAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  fi

  if test "$found_openssl" = "yes"; then
    OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR




cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP_SSL 1
_ACEOF


else
      { { echo "$as_me:$LINENO: error: OpenSSL libraries not found.

      Check the path given to --with-openssl-dir and output in config.log)
      " >&5
echo "$as_me: error: OpenSSL libraries not found.

      Check the path given to --with-openssl-dir and output in config.log)
      " >&2;}
   { (exit 1); exit 1; }; }

  fi

  elif test -f "$IMAP_INC_DIR/linkage.c"; then
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$IMAP_INC_DIR/linkage.c>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "ssl_onceonlyinit" >/dev/null 2>&1; then

      { { echo "$as_me:$LINENO: error: This c-client library is built with SSL support.

      Add --with-imap-ssl to your configure line. Check config.log for details.
      " >&5
echo "$as_me: error: This c-client library is built with SSL support.

      Add --with-imap-ssl to your configure line. Check config.log for details.
      " >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

  fi


        TST_LIBS="$DLIBS $IMAP_SHARED_LIBADD"


  old_LIBS=$LIBS
  LIBS="$TST_LIBS $LIBS"
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

    void mm_log(void){}
    void mm_dlog(void){}
    void mm_flags(void){}
    void mm_fatal(void){}
    void mm_critical(void){}
    void mm_nocritical(void){}
    void mm_notify(void){}
    void mm_login(void){}
    void mm_diskerror(void){}
    void mm_status(void){}
    void mm_lsub(void){}
    void mm_list(void){}
    void mm_exists(void){}
    void mm_searched(void){}
    void mm_expunged(void){}
    char auth_gssapi_valid();
    int main() {
      auth_gssapi_valid();
      return 0;
    }

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    LIBS=$old_LIBS


cat >>confdefs.h <<\_ACEOF
#define HAVE_IMAP_AUTH_GSS 1
_ACEOF



else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    LIBS=$old_LIBS


fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi


    echo "$as_me:$LINENO: checking whether IMAP works" >&5
echo $ECHO_N "checking whether IMAP works... $ECHO_C" >&6

  old_LIBS=$LIBS
  LIBS="$TST_LIBS $LIBS"
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

    void mm_log(void){}
    void mm_dlog(void){}
    void mm_flags(void){}
    void mm_fatal(void){}
    void mm_critical(void){}
    void mm_nocritical(void){}
    void mm_notify(void){}
    void mm_login(void){}
    void mm_diskerror(void){}
    void mm_status(void){}
    void mm_lsub(void){}
    void mm_list(void){}
    void mm_exists(void){}
    void mm_searched(void){}
    void mm_expunged(void){}
    char mail_newbody();
    int main() {
      mail_newbody();
      return 0;
    }

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    LIBS=$old_LIBS

      echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6


else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    LIBS=$old_LIBS

      echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
      { { echo "$as_me:$LINENO: error: build test failed. Please check the config.log for details." >&5
echo "$as_me: error: build test failed. Please check the config.log for details." >&2;}
   { (exit 1); exit 1; }; }


fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi




echo "$as_me:$LINENO: checking for Informix support" >&5
echo $ECHO_N "checking for Informix support... $ECHO_C" >&6

# Check whether --with-informix or --without-informix was given.
if test "${with_informix+set}" = set; then
  withval="$with_informix"
  PHP_INFORMIX=$withval
else

  PHP_INFORMIX=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_INFORMIX=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_INFORMIX in
shared,*)
  PHP_INFORMIX=`echo "$PHP_INFORMIX"|sed 's/^shared,//'`
  ;;
shared)
  PHP_INFORMIX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_INFORMIX" != "no"; then

  if test "$INFORMIXDIR" = ""; then
    { { echo "$as_me:$LINENO: error: INFORMIXDIR environment variable is not set." >&5
echo "$as_me: error: INFORMIXDIR environment variable is not set." >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test "$PHP_INFORMIX" = "yes"; then
    IFX_INCLUDE=-I$INFORMIXDIR/incl/esql

  if test "$INFORMIXDIR/lib" != "/usr/lib"; then

  if test -z "$INFORMIXDIR/lib" || echo "$INFORMIXDIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$INFORMIXDIR/lib
  else

    ep_dir="`echo $INFORMIXDIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$INFORMIXDIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INFORMIX_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


  if test "$INFORMIXDIR/lib/esql" != "/usr/lib"; then

  if test -z "$INFORMIXDIR/lib/esql" || echo "$INFORMIXDIR/lib/esql" | grep '^/' >/dev/null ; then
    ai_p=$INFORMIXDIR/lib/esql
  else

    ep_dir="`echo $INFORMIXDIR/lib/esql|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$INFORMIXDIR/lib/esql\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INFORMIX_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  else
    if test "$PHP_INFORMIX" != "$INFORMIXDIR"; then
      { { echo "$as_me:$LINENO: error: Specified Informix base install directory is different than your INFORMIXDIR environment variable." >&5
echo "$as_me: error: Specified Informix base install directory is different than your INFORMIXDIR environment variable." >&2;}
   { (exit 1); exit 1; }; }
    fi
    IFX_INCLUDE=-I$PHP_INFORMIX/incl/esql

  if test "$PHP_INFORMIX/lib" != "/usr/lib"; then

  if test -z "$PHP_INFORMIX/lib" || echo "$PHP_INFORMIX/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_INFORMIX/lib
  else

    ep_dir="`echo $PHP_INFORMIX/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_INFORMIX/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INFORMIX_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


  if test "$PHP_INFORMIX/lib/esql" != "/usr/lib"; then

  if test -z "$PHP_INFORMIX/lib/esql" || echo "$PHP_INFORMIX/lib/esql" | grep '^/' >/dev/null ; then
    ai_p=$PHP_INFORMIX/lib/esql
  else

    ep_dir="`echo $PHP_INFORMIX/lib/esql|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_INFORMIX/lib/esql\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INFORMIX_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  fi

    if test "$enable_experimental_zts" = "yes"; then
    IFX_ESQL_FLAGS="-thread"
    CPPFLAGS="$CPPFLAGS -DIFX_THREAD"
  else
    IFX_ESQL_FLAGS=""
  fi

  IFX_LIBS=`THREADLIB=POSIX $INFORMIXDIR/bin/esql $IFX_ESQL_FLAGS -libs`
  IFX_LIBS=`echo $IFX_LIBS | sed -e 's/Libraries to be used://g' -e 's/esql: error -55923: No source or object file\.//g'`

  case "$host_alias" in
    *aix*)
      CPPFLAGS="$CPPFLAGS -D__H_LOCALEDEF";;
  esac

  echo "$as_me:$LINENO: checking Informix version" >&5
echo $ECHO_N "checking Informix version... $ECHO_C" >&6
  IFX_IBM_VERSION=`$INFORMIXDIR/bin/esql -V | grep "IBM Informix-ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`
  IFX_VERSION=`$INFORMIXDIR/bin/esql -V | grep "ESQL Version" | sed -ne '1 s/\(.*\)ESQL Version \([0-9]*\)\.\([0-9]*\).*/\2\3/p'`

  if test "$IFX_IBM_VERSION"; then
    if test $IFX_IBM_VERSION -ge "290" && test $IFX_IBM_VERSION -lt "300"; then
      IFX_VERSION=960
    else
      IFX_VERSION=$IFX_IBM_VERSION
    fi
    echo "$as_me:$LINENO: result: IBM: $IFX_VERSION" >&5
echo "${ECHO_T}IBM: $IFX_VERSION" >&6
  else
    echo "$as_me:$LINENO: result: $IFX_VERSION" >&5
echo "${ECHO_T}$IFX_VERSION" >&6
  fi


cat >>confdefs.h <<_ACEOF
#define IFX_VERSION $IFX_VERSION
_ACEOF


  if test $IFX_VERSION -ge "900"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_IFX_IUS 1
_ACEOF

    IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EDHAVE_IFX_IUS"
  else
    IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EUHAVE_IFX_IUS"
  fi


  ext_builddir=ext/informix
  ext_srcdir=$abs_srcdir/ext/informix

  ac_extra=`echo "$IFX_INCLUDE"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/informix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/informix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/informix/"; ac_bdir="ext/informix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ifx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC informix"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC informix"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/informix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/informix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/informix/"; ac_bdir="ext/informix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ifx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_informix="$shared_objects_informix $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_informix) $(PHPINFORMIX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_informix) -L$(top_builddir)/netware -lphp4lib $(INFORMIX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_informix) $(PHPINFORMIX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpinformix.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_informix"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpinformix.$suffix: $ext_builddir/phpinformix.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpinformix.$suffix \$(phplibdir)

$ext_builddir/phpinformix.$suffix: \$(shared_objects_informix) \$(PHPINFORMIX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_informix) $(INFORMIX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_informix) -L$(top_builddir)/netware -lphp4lib $(ORMIX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_informix) $(INFORMIX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/informix.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_informix"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/informix.$suffix: $ext_builddir/informix.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/informix.$suffix \$(phplibdir)

$ext_builddir/informix.$suffix: \$(shared_objects_informix) \$(INFORMIX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_INFORMIX 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/informix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/informix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/informix/"; ac_bdir="ext/informix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ifx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC informix"
    else


  case ext/informix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/informix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/informix/"; ac_bdir="ext/informix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ifx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC informix"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  src=$ext_srcdir/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments


  for i in $IFX_LIBS; do
    case "$i" in
      *.o)
        IFX_LIBOBJS="$IFX_LIBOBJS $i"

  if test "$ext_builddir" != "/usr/lib"; then

  if test -z "$ext_builddir" || echo "$ext_builddir" | grep '^/' >/dev/null ; then
    ai_p=$ext_builddir
  else

    ep_dir="`echo $ext_builddir|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ext_builddir\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INFORMIX_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi



  case phpifx in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$INFORMIX_SHARED_LIBADD -lphpifx"
    else


  case phpifx in
  c|c_r|pthread*) ;;
  *)
      DLIBS="$DLIBS -lphpifx"
   ;;
  esac


    fi
   ;;
  esac


        ;;
      -lm)
        ;;
      -lc)
        ;;
      -l*)
        lib=`echo $i | cut -c 3-`


  case $lib in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        INFORMIX_SHARED_LIBADD="$INFORMIX_SHARED_LIBADD -l$lib"
    else


  case $lib in
  c|c_r|pthread*) ;;
  *)
      DLIBS="$DLIBS -l$lib"
   ;;
  esac


    fi
   ;;
  esac


        ;;
      *.a)
        case "`uname -s 2>/dev/null`" in
          UnixWare | SCO_SV | UNIX_SV)
            DLIBS="$DLIBS $i"
            ;;
          *)
            ac_dir="`echo $i|sed 's#[^/]*$##;s#\/$##'`"
            ac_lib="`echo $i|sed 's#^/.*/lib##g;s#\.a##g'`"
            DLIBS="$DLIBS -L$ac_dir -l$ac_lib"
            ;;
        esac
        ;;
    esac
  done


  PHP_VAR_SUBST="$PHP_VAR_SUBST INFORMIX_SHARED_LIBADD"


  PHP_VAR_SUBST="$PHP_VAR_SUBST INFORMIXDIR"


  PHP_VAR_SUBST="$PHP_VAR_SUBST IFX_LIBOBJS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST IFX_ESQL_FLAGS"


cat >>confdefs.h <<\_ACEOF
#define HAVE_IFX 1
_ACEOF

fi




echo "$as_me:$LINENO: checking for Ingres II support" >&5
echo $ECHO_N "checking for Ingres II support... $ECHO_C" >&6

# Check whether --with-ingres or --without-ingres was given.
if test "${with_ingres+set}" = set; then
  withval="$with_ingres"
  PHP_INGRES=$withval
else

  PHP_INGRES=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_INGRES=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_INGRES in
shared,*)
  PHP_INGRES=`echo "$PHP_INGRES"|sed 's/^shared,//'`
  ;;
shared)
  PHP_INGRES=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_INGRES" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_II 1
_ACEOF


  ext_builddir=ext/ingres_ii
  ext_srcdir=$abs_srcdir/ext/ingres_ii

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/ingres_ii in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ingres_ii"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ingres_ii/"; ac_bdir="ext/ingres_ii/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ii.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ingres_ii"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ingres_ii"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ingres_ii in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ingres_ii"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ingres_ii/"; ac_bdir="ext/ingres_ii/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ii.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ingres_ii="$shared_objects_ingres_ii $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) $(PHPINGRES_II_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) -L$(top_builddir)/netware -lphp4lib $(INGRES_II_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) $(PHPINGRES_II_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpingres_ii.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ingres_ii"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpingres_ii.$suffix: $ext_builddir/phpingres_ii.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpingres_ii.$suffix \$(phplibdir)

$ext_builddir/phpingres_ii.$suffix: \$(shared_objects_ingres_ii) \$(PHPINGRES_II_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) $(INGRES_II_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) -L$(top_builddir)/netware -lphp4lib $(RES_II_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ingres_ii) $(INGRES_II_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ingres_ii.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ingres_ii"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ingres_ii.$suffix: $ext_builddir/ingres_ii.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ingres_ii.$suffix \$(phplibdir)

$ext_builddir/ingres_ii.$suffix: \$(shared_objects_ingres_ii) \$(INGRES_II_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_INGRES_II 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ingres_ii in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ingres_ii"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ingres_ii/"; ac_bdir="ext/ingres_ii/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ii.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ingres_ii"
    else


  case ext/ingres_ii in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ingres_ii"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ingres_ii/"; ac_bdir="ext/ingres_ii/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ii.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ingres_ii"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST II_SHARED_LIBADD"


  if test "$PHP_INGRES" = "yes"; then
    II_DIR=$II_SYSTEM/ingres
  else
    II_DIR=$PHP_INGRES
  fi

  if test -r $II_DIR/files/iiapi.h; then
    II_INC_DIR=$II_DIR/files
  else
    { { echo "$as_me:$LINENO: error: Cannot find iiapi.h under $II_DIR/files" >&5
echo "$as_me: error: Cannot find iiapi.h under $II_DIR/files" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -r $II_DIR/lib/libiiapi.a; then
    II_LIB_DIR=$II_DIR/lib
  else
    { { echo "$as_me:$LINENO: error: Cannot find libiiapi.a under $II_DIR/lib" >&5
echo "$as_me: error: Cannot find libiiapi.a under $II_DIR/lib" >&2;}
   { (exit 1); exit 1; }; }
  fi



  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-liiapi.1 $II_SHARED_LIBADD"
    if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        II_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $II_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case iiapi.1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-liiapi.1 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-lq.1 $II_SHARED_LIBADD"
    if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        II_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $II_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case q.1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lq.1 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-lframe.1 $II_SHARED_LIBADD"
    if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        II_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $II_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case frame.1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lframe.1 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-lcompat.1 $II_SHARED_LIBADD"
    if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        II_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $II_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$II_LIB_DIR"; then

  if test "$II_LIB_DIR" != "/usr/lib"; then

  if test -z "$II_LIB_DIR" || echo "$II_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_LIB_DIR
  else

    ep_dir="`echo $II_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case compat.1 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcompat.1 $LIBS"
   ;;
  esac




  fi



  if test "$II_INC_DIR" != "/usr/include"; then

  if test -z "$II_INC_DIR" || echo "$II_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$II_INC_DIR
  else

    ep_dir="`echo $II_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$II_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

fi




echo "$as_me:$LINENO: checking for InterBase support" >&5
echo $ECHO_N "checking for InterBase support... $ECHO_C" >&6

# Check whether --with-interbase or --without-interbase was given.
if test "${with_interbase+set}" = set; then
  withval="$with_interbase"
  PHP_INTERBASE=$withval
else

  PHP_INTERBASE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_INTERBASE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_INTERBASE in
shared,*)
  PHP_INTERBASE=`echo "$PHP_INTERBASE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_INTERBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_INTERBASE" != "no"; then
  if test "$PHP_INTERBASE" = "yes"; then
    IBASE_INCDIR=/usr/interbase/include
    IBASE_LIBDIR=/usr/interbase/lib
  else
    IBASE_INCDIR=$PHP_INTERBASE/include
    IBASE_LIBDIR=$PHP_INTERBASE/lib
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$IBASE_LIBDIR
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for isc_detach_database in -lgds" >&5
echo $ECHO_N "checking for isc_detach_database in -lgds... $ECHO_C" >&6
if test "${ac_cv_lib_gds_isc_detach_database+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lgds  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char isc_detach_database ();
int
main ()
{
isc_detach_database ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_gds_isc_detach_database=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_gds_isc_detach_database=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_gds_isc_detach_database" >&5
echo "${ECHO_T}$ac_cv_lib_gds_isc_detach_database" >&6
if test $ac_cv_lib_gds_isc_detach_database = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

    IBASE_LIBNAME=gds


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_gds_isc_detach_database


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$IBASE_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for isc_detach_database in -lib_util" >&5
echo $ECHO_N "checking for isc_detach_database in -lib_util... $ECHO_C" >&6
if test "${ac_cv_lib_ib_util_isc_detach_database+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lib_util  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char isc_detach_database ();
int
main ()
{
isc_detach_database ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ib_util_isc_detach_database=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ib_util_isc_detach_database=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ib_util_isc_detach_database" >&5
echo "${ECHO_T}$ac_cv_lib_ib_util_isc_detach_database" >&6
if test $ac_cv_lib_ib_util_isc_detach_database = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      IBASE_LIBNAME=ib_util


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ib_util_isc_detach_database

      { { echo "$as_me:$LINENO: error: libgds or libib_util not found! Check config.log for more information." >&5
echo "$as_me: error: libgds or libib_util not found! Check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi



fi




  if test "$ext_shared" = "yes"; then
    INTERBASE_SHARED_LIBADD="-l$IBASE_LIBNAME $INTERBASE_SHARED_LIBADD"
    if test -n "$IBASE_LIBDIR"; then

  if test "$IBASE_LIBDIR" != "/usr/lib"; then

  if test -z "$IBASE_LIBDIR" || echo "$IBASE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$IBASE_LIBDIR
  else

    ep_dir="`echo $IBASE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$IBASE_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        INTERBASE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $INTERBASE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$IBASE_LIBDIR"; then

  if test "$IBASE_LIBDIR" != "/usr/lib"; then

  if test -z "$IBASE_LIBDIR" || echo "$IBASE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$IBASE_LIBDIR
  else

    ep_dir="`echo $IBASE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$IBASE_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $IBASE_LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$IBASE_LIBNAME $LIBS"
   ;;
  esac




  fi



  if test "$IBASE_INCDIR" != "/usr/include"; then

  if test -z "$IBASE_INCDIR" || echo "$IBASE_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$IBASE_INCDIR
  else

    ep_dir="`echo $IBASE_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$IBASE_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_IBASE 1
_ACEOF


  ext_builddir=ext/interbase
  ext_srcdir=$abs_srcdir/ext/interbase

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/interbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/interbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/interbase/"; ac_bdir="ext/interbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in interbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC interbase"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC interbase"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/interbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/interbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/interbase/"; ac_bdir="ext/interbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in interbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_interbase="$shared_objects_interbase $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_interbase) $(PHPINTERBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_interbase) -L$(top_builddir)/netware -lphp4lib $(INTERBASE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_interbase) $(PHPINTERBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpinterbase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_interbase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpinterbase.$suffix: $ext_builddir/phpinterbase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpinterbase.$suffix \$(phplibdir)

$ext_builddir/phpinterbase.$suffix: \$(shared_objects_interbase) \$(PHPINTERBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_interbase) $(INTERBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_interbase) -L$(top_builddir)/netware -lphp4lib $(ERBASE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_interbase) $(INTERBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/interbase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_interbase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/interbase.$suffix: $ext_builddir/interbase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/interbase.$suffix \$(phplibdir)

$ext_builddir/interbase.$suffix: \$(shared_objects_interbase) \$(INTERBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_INTERBASE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/interbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/interbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/interbase/"; ac_bdir="ext/interbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in interbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC interbase"
    else


  case ext/interbase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/interbase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/interbase/"; ac_bdir="ext/interbase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in interbase.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC interbase"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST INTERBASE_SHARED_LIBADD"

fi










echo "$as_me:$LINENO: checking for Java support" >&5
echo $ECHO_N "checking for Java support... $ECHO_C" >&6

# Check whether --with-java or --without-java was given.
if test "${with_java+set}" = set; then
  withval="$with_java"
  PHP_JAVA=$withval
else

  PHP_JAVA=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_JAVA=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_JAVA in
shared,*)
  PHP_JAVA=`echo "$PHP_JAVA"|sed 's/^shared,//'`
  ;;
shared)
  PHP_JAVA=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_JAVA" != "no"; then
  platform=`uname -s 2>/dev/null`
  java_libext=libjava.so
  case $platform in
    AIX) java_libext=libjava.a ;;
    HP-UX) java_libext=libjava.sl ;;
    Darwin) java_libext=libjava.jnilib ;;
  esac

 echo "$as_me:$LINENO: checking Java Jar location" >&5
echo $ECHO_N "checking Java Jar location... $ECHO_C" >&6
  if test "$PHP_JAVA" = "yes"; then
    if JAVA_JAR=`which jar 2>/dev/null`; then
      JAVA_JAR="$JAVA_JAR cf"
    else
      JAVA_JAR=
    fi
    PHP_JAVA=`cd \`dirname \\\`which javac\\\`\`/..;pwd`

                if test -z "$JAVA_JAR"; then
      JAVA_JAR='zip -q0'
    fi
  else
                if test -x $PHP_JAVA/bin/jar; then
      JAVA_JAR="$PHP_JAVA/bin/jar cf"
    else
      { { echo "$as_me:$LINENO: error: Unable to locate $PHP_JAVA/bin" >&5
echo "$as_me: error: Unable to locate $PHP_JAVA/bin" >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi

  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_JAR"

  echo "$as_me:$LINENO: result: $JAVA_JAR" >&5
echo "${ECHO_T}$JAVA_JAR" >&6


 echo "$as_me:$LINENO: checking Java C location" >&5
echo $ECHO_N "checking Java C location... $ECHO_C" >&6
 if test "$PHP_JAVA" = "yes"; then
   JAVA_C=`which javac`
 else
            if test -x $PHP_JAVA/bin/javac; then
     JAVA_C=$PHP_JAVA/bin/javac
   else
     { { echo "$as_me:$LINENO: error: Unable to locate $PHP_JAVA/bin" >&5
echo "$as_me: error: Unable to locate $PHP_JAVA/bin" >&2;}
   { (exit 1); exit 1; }; }
   fi
 fi
 if test -z "$JAVA_C"; then
   { { echo "$as_me:$LINENO: error: Unable to locate the javac binary in your system path
Either adjust your Java installation or provide the Java installation path,
e.g. --with-java=/java expecting /java/bin/ to contain the binaries" >&5
echo "$as_me: error: Unable to locate the javac binary in your system path
Either adjust your Java installation or provide the Java installation path,
e.g. --with-java=/java expecting /java/bin/ to contain the binaries" >&2;}
   { (exit 1); exit 1; }; }
  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_C"

  echo "$as_me:$LINENO: result: $JAVA_C" >&5
echo "${ECHO_T}$JAVA_C" >&6


  if test "$platform" = "Darwin"; then

for ac_header in JavaVM/JavaVM.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


for ac_header in JavaVM/jni.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  save_old_LDFLAGS=$LDFLAGS
  LDFLAGS="-framework "JavaVM" $LDFLAGS"
        echo "$as_me:$LINENO: checking for JNI_CreateJavaVM in -lc" >&5
echo $ECHO_N "checking for JNI_CreateJavaVM in -lc... $ECHO_C" >&6
if test "${ac_cv_lib_c_JNI_CreateJavaVM+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char JNI_CreateJavaVM ();
int
main ()
{
JNI_CreateJavaVM ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_c_JNI_CreateJavaVM=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_c_JNI_CreateJavaVM=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_c_JNI_CreateJavaVM" >&5
echo "${ECHO_T}$ac_cv_lib_c_JNI_CreateJavaVM" >&6
if test $ac_cv_lib_c_JNI_CreateJavaVM = yes; then

    LDFLAGS=$save_old_LDFLAGS

cat >>confdefs.h <<\_ACEOF
#define HAVE_JAVA 1
_ACEOF


else

    LDFLAGS=$save_old_LDFLAGS


fi





  unique=`echo "JavaVM"|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$FRAMEWORKS$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "FRAMEWORKS$unique=set"

    if test ""; then
      PHP_FRAMEWORKS="-framework "JavaVM" $PHP_FRAMEWORKS"
    else
      PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework "JavaVM""
    fi

  fi


    JAVA_CFLAGS="-x objective-c"
  else

 echo "$as_me:$LINENO: checking Checking for libjava" >&5
echo $ECHO_N "checking Checking for libjava... $ECHO_C" >&6
 if test -d $PHP_JAVA/lib/kaffe; then

  if test "$PHP_JAVA/lib" != "/usr/lib"; then

  if test -z "$PHP_JAVA/lib" || echo "$PHP_JAVA/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_JAVA/lib
  else

    ep_dir="`echo $PHP_JAVA/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_JAVA/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

   JAVA_CFLAGS=-DKAFFE
   JAVA_INCLUDE=-I$PHP_JAVA/include/kaffe
   JAVA_CLASSPATH=$PHP_JAVA/share/kaffe/Klasses.jar
   JAVA_LIB=kaffevm
   JAVA_LIBPATH=$PHP_JAVA/lib/kaffe
   java_libext=kaffevm

   test -f $PHP_JAVA/lib/$JAVA_LIB       && JAVA_LIBPATH=$PHP_JAVA/lib
   test -f $PHP_JAVA/lib/kaffe/$JAVA_LIB && JAVA_LIBPATH=$PHP_JAVA/lib/kaffe

            if kaffe -version 2>&1 | grep 1.0b > /dev/null; then
     JAVA_JAR='zip -q0'
   fi
 elif test -f $PHP_JAVA/lib/$java_libext; then
   JAVA_LIB=java
   JAVA_LIBPATH=$PHP_JAVA/lib
   JAVA_INCLUDE=-I$PHP_JAVA/include

   test -f $PHP_JAVA/lib/classes.zip && JAVA_CFLAGS=-DJNI_11
   test -f $PHP_JAVA/lib/jvm.jar     && JAVA_CFLAGS=-DJNI_12
   test -f $PHP_JAVA/lib/classes.zip && JAVA_CLASSPATH=$PHP_JAVA/lib/classes.zip
   test -f $PHP_JAVA/lib/jvm.jar     && JAVA_CLASSPATH=$PHP_JAVA/lib/jvm.jar

   for i in $PHP_JAVA/include/*; do
     test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE $i"
   done
             else
            for i in `find $PHP_JAVA/include -type d`; do
     test -f $i/jni.h      && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
     test -f $i/jni_md.h   && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
   done

   for i in `find $PHP_JAVA/ -type d`; do
     test -f $i/classes.zip && JAVA_CFLAGS=-DJNI_11
     test -f $i/rt.jar      && JAVA_CFLAGS=-DJNI_12
     test -f $i/classes.zip && JAVA_CLASSPATH=$i/classes.zip
     test -f $i/rt.jar      && JAVA_CLASSPATH=$i/rt.jar

     if test -f $i/$java_libext; then
       JAVA_LIB=java
       JAVA_LIBPATH=$i

       test -d $i/hotspot &&
  if test "$i/hotspot" != "/usr/lib"; then

  if test -z "$i/hotspot" || echo "$i/hotspot" | grep '^/' >/dev/null ; then
    ai_p=$i/hotspot
  else

    ep_dir="`echo $i/hotspot|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/hotspot\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

       test -d $i/classic &&
  if test "$i/classic" != "/usr/lib"; then

  if test -z "$i/classic" || echo "$i/classic" | grep '^/' >/dev/null ; then
    ai_p=$i/classic
  else

    ep_dir="`echo $i/classic|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/classic\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

       test -d $i/server  &&
  if test "$i/server" != "/usr/lib"; then

  if test -z "$i/server" || echo "$i/server" | grep '^/' >/dev/null ; then
    ai_p=$i/server
  else

    ep_dir="`echo $i/server|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/server\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

       test -d $i/native_threads &&
  if test "$i/native_threads" != "/usr/lib"; then

  if test -z "$i/native_threads" || echo "$i/native_threads" | grep '^/' >/dev/null ; then
    ai_p=$i/native_threads
  else

    ep_dir="`echo $i/native_threads|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/native_threads\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

     fi
   done

   if test -z "$JAVA_INCLUDE"; then
     echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
     { { echo "$as_me:$LINENO: error: unable to find Java VM includes" >&5
echo "$as_me: error: unable to find Java VM includes" >&2;}
   { (exit 1); exit 1; }; }
   fi

   JAVA_CFLAGS="$JAVA_CFLAGS -D_REENTRANT"
 fi

 echo "$as_me:$LINENO: result: $JAVA_LIBPATH" >&5
echo "${ECHO_T}$JAVA_LIBPATH" >&6


cat >>confdefs.h <<\_ACEOF
#define HAVE_JAVA 1
_ACEOF


    if test -z "$JAVA_LIBPATH"; then
      { { echo "$as_me:$LINENO: error: unable to find Java VM libraries in $PHP_JAVA" >&5
echo "$as_me: error: unable to find Java VM libraries in $PHP_JAVA" >&2;}
   { (exit 1); exit 1; }; }
    fi


  if test "$JAVA_LIBPATH" != "/usr/lib"; then

  if test -z "$JAVA_LIBPATH" || echo "$JAVA_LIBPATH" | grep '^/' >/dev/null ; then
    ai_p=$JAVA_LIBPATH
  else

    ep_dir="`echo $JAVA_LIBPATH|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$JAVA_LIBPATH\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

    JAVA_CFLAGS="$JAVA_CFLAGS '-DJAVALIB=\"$JAVA_LIBPATH/$java_libext\"'"
  fi

  if test "$PHP_SAPI" != "servlet"; then

  ext_builddir=ext/java
  ext_srcdir=$abs_srcdir/ext/java

  ac_extra=`echo "$JAVA_CFLAGS $JAVA_INCLUDE"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "shared" != "shared" && test "shared" != "yes" && test "" != "cli"; then



  case ext/java in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/java"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/java/"; ac_bdir="ext/java/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in java.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC java"
    if test "shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC java"
    fi
  else
    if test "shared" = "shared" || test "shared" = "yes"; then

  case ext/java in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/java"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/java/"; ac_bdir="ext/java/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in java.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_java="$shared_objects_java $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_java) $(PHPJAVA_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_java) -L$(top_builddir)/netware -lphp4lib $(JAVA_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_java) $(PHPJAVA_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpjava.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_java"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpjava.$suffix: $ext_builddir/phpjava.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpjava.$suffix \$(phplibdir)

$ext_builddir/phpjava.$suffix: \$(shared_objects_java) \$(PHPJAVA_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_java) $(JAVA_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_java) -L$(top_builddir)/netware -lphp4lib $(A_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_java) $(JAVA_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/java.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_java"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/java.$suffix: $ext_builddir/java.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/java.$suffix \$(phplibdir)

$ext_builddir/java.$suffix: \$(shared_objects_java) \$(JAVA_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_JAVA 1
_ACEOF

    fi
  fi

  if test "shared" != "shared" && test "shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/java in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/java"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/java/"; ac_bdir="ext/java/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in java.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC java"
    else


  case ext/java in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/java"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/java/"; ac_bdir="ext/java/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in java.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC java"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



    if test "$PHP_SAPI" = "cgi"; then
      if test "$platform" != "Darwin"; then


  case $JAVA_LIB in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$JAVA_LIB $LIBS"
   ;;
  esac


      fi
    fi

    if test -n "$INSTALL_IT"; then
      INSTALL_IT="$INSTALL_IT ;"
    fi

    INSTALL_IT="$INSTALL_IT \$(srcdir)/build/shtool mkdir -p -f -m 0755 \$(INSTALL_ROOT)\$(libdir)"
    INSTALL_IT="$INSTALL_IT ; \$(INSTALL) -m 0755 \$(srcdir)/ext/java/php_java.jar \$(INSTALL_ROOT)\$(libdir)"
  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_CLASSPATH"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_INCLUDE"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_CFLAGS"



  src=$ext_srcdir/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

fi







echo "$as_me:$LINENO: checking for LDAP support" >&5
echo $ECHO_N "checking for LDAP support... $ECHO_C" >&6

# Check whether --with-ldap or --without-ldap was given.
if test "${with_ldap+set}" = set; then
  withval="$with_ldap"
  PHP_LDAP=$withval
else

  PHP_LDAP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_LDAP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_LDAP in
shared,*)
  PHP_LDAP=`echo "$PHP_LDAP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_LDAP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_LDAP" != "no"; then


  ext_builddir=ext/ldap
  ext_srcdir=$abs_srcdir/ext/ldap

  ac_extra=`echo "-DLDAP_DEPRECATED=1"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/ldap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ldap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ldap/"; ac_bdir="ext/ldap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ldap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ldap"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ldap"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ldap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ldap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ldap/"; ac_bdir="ext/ldap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ldap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ldap="$shared_objects_ldap $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ldap) $(PHPLDAP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ldap) -L$(top_builddir)/netware -lphp4lib $(LDAP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ldap) $(PHPLDAP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpldap.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ldap"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpldap.$suffix: $ext_builddir/phpldap.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpldap.$suffix \$(phplibdir)

$ext_builddir/phpldap.$suffix: \$(shared_objects_ldap) \$(PHPLDAP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ldap) $(LDAP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ldap) -L$(top_builddir)/netware -lphp4lib $(P_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ldap) $(LDAP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ldap.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ldap"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ldap.$suffix: $ext_builddir/ldap.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ldap.$suffix \$(phplibdir)

$ext_builddir/ldap.$suffix: \$(shared_objects_ldap) \$(LDAP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_LDAP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ldap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ldap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ldap/"; ac_bdir="ext/ldap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ldap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ldap"
    else


  case ext/ldap in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ldap"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ldap/"; ac_bdir="ext/ldap/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ldap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ldap"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  if test "$PHP_LDAP" = "yes"; then
    for i in /usr/local /usr; do

  if test -f $i/include/ldap.h; then
    LDAP_DIR=$i
    LDAP_INCDIR=$i/include
    LDAP_LIBDIR=$i/lib
  elif test -f $i/include/umich-ldap/ldap.h; then
    LDAP_DIR=$i
    LDAP_INCDIR=$i/include/umich-ldap
    LDAP_LIBDIR=$i/lib
  elif test -f $i/ldap/public/ldap.h; then
    LDAP_DIR=$i
    LDAP_INCDIR=$i/ldap/public
    LDAP_LIBDIR=$i/lib
  fi

    done
  else

  if test -f $PHP_LDAP/include/ldap.h; then
    LDAP_DIR=$PHP_LDAP
    LDAP_INCDIR=$PHP_LDAP/include
    LDAP_LIBDIR=$PHP_LDAP/lib
  elif test -f $PHP_LDAP/include/umich-ldap/ldap.h; then
    LDAP_DIR=$PHP_LDAP
    LDAP_INCDIR=$PHP_LDAP/include/umich-ldap
    LDAP_LIBDIR=$PHP_LDAP/lib
  elif test -f $PHP_LDAP/ldap/public/ldap.h; then
    LDAP_DIR=$PHP_LDAP
    LDAP_INCDIR=$PHP_LDAP/ldap/public
    LDAP_LIBDIR=$PHP_LDAP/lib
  fi

  fi

  if test -z "$LDAP_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find ldap.h" >&5
echo "$as_me: error: Cannot find ldap.h" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test `uname` = "Linux"; then
    LDAP_PTHREAD=pthread
  else
    LDAP_PTHREAD=
  fi

  if test -f $LDAP_LIBDIR/liblber.a -o -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-llber $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case lber in
  c|c_r|pthread*) ;;
  *)
      LIBS="-llber $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldap $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldap in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldap $LIBS"
   ;;
  esac




  fi



  elif test -f $LDAP_LIBDIR/libldap.$SHLIB_SUFFIX_NAME.3 -o -f $LDAP_LIBDIR/libldap.3.dylib; then


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldap $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldap in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldap $LIBS"
   ;;
  esac




  fi



  elif test -f $LDAP_LIBDIR/libssldap50.$SHLIB_SUFFIX_NAME; then
    if test -n "$LDAP_PTHREAD"; then


  case $LDAP_PTHREAD in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$LDAP_PTHREAD $LIBS"
   ;;
  esac


    fi


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lnspr4 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nspr4 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnspr4 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lplc4 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case plc4 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lplc4 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lplds4 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case plds4 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lplds4 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lssldap50 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ssldap50 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssldap50 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldap50 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldap50 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldap50 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lprldap50 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case prldap50 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lprldap50 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lssl3 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ssl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl3 $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_NSLDAP 1
_ACEOF


  elif test -f $LDAP_LIBDIR/libldapssl41.$SHLIB_SUFFIX_NAME; then
    if test -n "$LDAP_PTHREAD"; then


  case $LDAP_PTHREAD in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$LDAP_PTHREAD $LIBS"
   ;;
  esac


    fi


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lnspr3 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nspr3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnspr3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lplc3 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case plc3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lplc3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lplds3 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case plds3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lplds3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldapssl41 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldapssl41 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldapssl41 $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_NSLDAP 1
_ACEOF


  elif test -f $LDAP_LIBDIR/libldapssl30.$SHLIB_SUFFIX_NAME; then
    if test -n "$LDAP_PTHREAD"; then


  case $LDAP_PTHREAD in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$LDAP_PTHREAD $LIBS"
   ;;
  esac


    fi


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldapssl30 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldapssl30 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldapssl30 $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_NSLDAP 1
_ACEOF


  elif test -f $LDAP_LIBDIR/libldap30.$SHLIB_SUFFIX_NAME; then
    if test -n "$LDAP_PTHREAD"; then


  case $LDAP_PTHREAD in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$LDAP_PTHREAD $LIBS"
   ;;
  esac


    fi


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lldap30 $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ldap30 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lldap30 $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_NSLDAP 1
_ACEOF


  elif test -f $LDAP_LIBDIR/libumich_ldap.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lumich_lber $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case umich_lber in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lumich_lber $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lumich_ldap $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case umich_ldap in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lumich_ldap $LIBS"
   ;;
  esac




  fi



  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    LDAP_SHARED_LIBADD="-lclntsh $LDAP_SHARED_LIBADD"
    if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDAP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $LDAP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LDAP_LIBDIR"; then

  if test "$LDAP_LIBDIR" != "/usr/lib"; then

  if test -z "$LDAP_LIBDIR" || echo "$LDAP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_LIBDIR
  else

    ep_dir="`echo $LDAP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclntsh $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_ORALDAP 1
_ACEOF

    if test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ORALDAP_10 1
_ACEOF

    fi
  else
    { { echo "$as_me:$LINENO: error: Cannot find ldap libraries in $LDAP_LIBDIR." >&5
echo "$as_me: error: Cannot find ldap libraries in $LDAP_LIBDIR." >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$LDAP_INCDIR" != "/usr/include"; then

  if test -z "$LDAP_INCDIR" || echo "$LDAP_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$LDAP_INCDIR
  else

    ep_dir="`echo $LDAP_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LDAP_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST LDAP_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_LDAP 1
_ACEOF


    _SAVE_CPPFLAGS=$CPPFLAGS
  _SAVE_LDFLAGS=$LDFLAGS
  LDFLAGS="$LDFLAGS $LDAP_SHARED_LIBADD"
  CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"

    echo "$as_me:$LINENO: checking for 3 arg ldap_set_rebind_proc" >&5
echo $ECHO_N "checking for 3 arg ldap_set_rebind_proc... $ECHO_C" >&6
if test "${ac_cv_3arg_setrebindproc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ldap.h>
int
main ()
{
ldap_set_rebind_proc(0,0,0)
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_3arg_setrebindproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_3arg_setrebindproc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_3arg_setrebindproc" >&5
echo "${ECHO_T}$ac_cv_3arg_setrebindproc" >&6
  if test "$ac_cv_3arg_setrebindproc" = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_3ARG_SETREBINDPROC 1
_ACEOF

  fi




for ac_func in ldap_parse_result ldap_parse_reference ldap_start_tls_s
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done


        echo "$as_me:$LINENO: checking for ldap_bind_s" >&5
echo $ECHO_N "checking for ldap_bind_s... $ECHO_C" >&6
if test "${ac_cv_func_ldap_bind_s+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define ldap_bind_s to an innocuous variant, in case <limits.h> declares ldap_bind_s.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define ldap_bind_s innocuous_ldap_bind_s

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char ldap_bind_s (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef ldap_bind_s

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char ldap_bind_s ();
/* 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_ldap_bind_s) || defined (__stub___ldap_bind_s)
choke me
#else
char (*f) () = ldap_bind_s;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != ldap_bind_s;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_ldap_bind_s=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_ldap_bind_s=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_ldap_bind_s" >&5
echo "${ECHO_T}$ac_cv_func_ldap_bind_s" >&6
if test $ac_cv_func_ldap_bind_s = yes; then
  :
else

    { { echo "$as_me:$LINENO: error: LDAP build check failed. Please check config.log for more information." >&5
echo "$as_me: error: LDAP build check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }

fi


    CPPFLAGS=$_SAVE_CPPFLAGS
  LDFLAGS=$_SAVE_LDFLAGS
fi



echo "$as_me:$LINENO: checking whether to enable the magickwand extension" >&5
echo $ECHO_N "checking whether to enable the magickwand extension... $ECHO_C" >&6

# Check whether --with-magickwand or --without-magickwand was given.
if test "${with_magickwand+set}" = set; then
  withval="$with_magickwand"
  PHP_MAGICKWAND=$withval
else

  PHP_MAGICKWAND=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MAGICKWAND=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MAGICKWAND in
shared,*)
  PHP_MAGICKWAND=`echo "$PHP_MAGICKWAND"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MAGICKWAND=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test $PHP_MAGICKWAND != "no"; then

    if test -r $PHP_MAGICKWAND/bin/Wand-config; then
        WAND_CONFIG_PATH=$PHP_MAGICKWAND/bin
    else
        echo "$as_me:$LINENO: checking Wand-config in default path" >&5
echo $ECHO_N "checking Wand-config in default path... $ECHO_C" >&6

        for i in /usr/local /usr;
        do
            test -r $i/bin/Wand-config && WAND_CONFIG_PATH=$i/bin && break
        done

        if test -z "$WAND_CONFIG_PATH"; then
            for i in $PHP_MAGICKWAND /usr/local /usr;
            do
                test -r $i/Wand-config && WAND_CONFIG_PATH=$i && break
            done
        fi
        if test -z "$WAND_CONFIG_PATH"; then
            { { echo "$as_me:$LINENO: error: Cannot locate configuration program Wand-config" >&5
echo "$as_me: error: Cannot locate configuration program Wand-config" >&2;}
   { (exit 1); exit 1; }; }
        else
            echo "$as_me:$LINENO: result: found in $WAND_CONFIG_PATH" >&5
echo "${ECHO_T}found in $WAND_CONFIG_PATH" >&6
        fi
    fi

		WAND_DIR=`$WAND_CONFIG_PATH/Wand-config --prefix`
		echo "$as_me:$LINENO: checking for magick-wand.h header file" >&5
echo $ECHO_N "checking for magick-wand.h header file... $ECHO_C" >&6

		if test -r $WAND_DIR/include/wand/magick-wand.h; then
				echo "$as_me:$LINENO: result: found in $WAND_DIR/include/wand/magick-wand.h" >&5
echo "${ECHO_T}found in $WAND_DIR/include/wand/magick-wand.h" >&6
		else
				{ { echo "$as_me:$LINENO: error: Cannot locate header file magick-wand.h" >&5
echo "$as_me: error: Cannot locate header file magick-wand.h" >&2;}
   { (exit 1); exit 1; }; }
		fi


		IMAGEMAGICK_VERSION_ORIG=`$WAND_CONFIG_PATH/Wand-config --version`
		IMAGEMAGICK_VERSION_MASK=`echo ${IMAGEMAGICK_VERSION_ORIG} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`


		echo "$as_me:$LINENO: checking if ImageMagick version is at least 6.3.5" >&5
echo $ECHO_N "checking if ImageMagick version is at least 6.3.5... $ECHO_C" >&6
		if test "$IMAGEMAGICK_VERSION_MASK" -ge 6003005; then
				echo "$as_me:$LINENO: result: found version $IMAGEMAGICK_VERSION_ORIG" >&5
echo "${ECHO_T}found version $IMAGEMAGICK_VERSION_ORIG" >&6
		else
				{ { echo "$as_me:$LINENO: error: no. You need at least Imagemagick version 6.3.5 to use MagickWand for PHP." >&5
echo "$as_me: error: no. You need at least Imagemagick version 6.3.5 to use MagickWand for PHP." >&2;}
   { (exit 1); exit 1; }; }
		fi

		echo "$as_me:$LINENO: checking if PHP version is at least 4.1.3" >&5
echo $ECHO_N "checking if PHP version is at least 4.1.3... $ECHO_C" >&6

		tmp_version=$PHP_VERSION
		if test -z "$tmp_version"; then
  		if test -z "$PHP_CONFIG"; then
    			{ { echo "$as_me:$LINENO: error: php-config not found" >&5
echo "$as_me: error: php-config not found" >&2;}
   { (exit 1); exit 1; }; }
  		fi
   			MAGICKWAND_PHP_VERSION_ORIG=`$PHP_CONFIG --version`;
		else
			MAGICKWAND_PHP_VERSION_ORIG=$tmp_version
		fi

		if test -z $MAGICKWAND_PHP_VERSION_ORIG; then
			{ { echo "$as_me:$LINENO: error: failed to detect PHP version, please report" >&5
echo "$as_me: error: failed to detect PHP version, please report" >&2;}
   { (exit 1); exit 1; }; }
		fi

		MAGICKWAND_PHP_VERSION_MASK=`echo ${MAGICKWAND_PHP_VERSION_ORIG} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`

		if test $MAGICKWAND_PHP_VERSION_MASK -ge 4001003; then
				echo "$as_me:$LINENO: result: found version $MAGICKWAND_PHP_VERSION_ORIG" >&5
echo "${ECHO_T}found version $MAGICKWAND_PHP_VERSION_ORIG" >&6
		else
				{ { echo "$as_me:$LINENO: error: no. You need at least PHP version 4.1.3 to use MagickWand." >&5
echo "$as_me: error: no. You need at least PHP version 4.1.3 to use MagickWand." >&2;}
   { (exit 1); exit 1; }; }
		fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_MAGICKWAND 1
_ACEOF




  if test "$ext_shared" = "yes"; then
    MAGICKWAND_SHARED_LIBADD="-lMagick $MAGICKWAND_SHARED_LIBADD"
    if test -n "$WAND_DIR/lib"; then

  if test "$WAND_DIR/lib" != "/usr/lib"; then

  if test -z "$WAND_DIR/lib" || echo "$WAND_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$WAND_DIR/lib
  else

    ep_dir="`echo $WAND_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WAND_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MAGICKWAND_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MAGICKWAND_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$WAND_DIR/lib"; then

  if test "$WAND_DIR/lib" != "/usr/lib"; then

  if test -z "$WAND_DIR/lib" || echo "$WAND_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$WAND_DIR/lib
  else

    ep_dir="`echo $WAND_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WAND_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case Magick in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lMagick $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    MAGICKWAND_SHARED_LIBADD="-lWand $MAGICKWAND_SHARED_LIBADD"
    if test -n "$WAND_DIR/lib"; then

  if test "$WAND_DIR/lib" != "/usr/lib"; then

  if test -z "$WAND_DIR/lib" || echo "$WAND_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$WAND_DIR/lib
  else

    ep_dir="`echo $WAND_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WAND_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MAGICKWAND_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MAGICKWAND_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$WAND_DIR/lib"; then

  if test "$WAND_DIR/lib" != "/usr/lib"; then

  if test -z "$WAND_DIR/lib" || echo "$WAND_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$WAND_DIR/lib
  else

    ep_dir="`echo $WAND_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WAND_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case Wand in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lWand $LIBS"
   ;;
  esac




  fi



  if test "$WAND_DIR/include" != "/usr/include"; then

  if test -z "$WAND_DIR/include" || echo "$WAND_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$WAND_DIR/include
  else

    ep_dir="`echo $WAND_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$WAND_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST MAGICKWAND_SHARED_LIBADD"


  ext_builddir=ext/magickwand
  ext_srcdir=$abs_srcdir/ext/magickwand

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/magickwand in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/magickwand"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/magickwand/"; ac_bdir="ext/magickwand/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in magickwand.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC magickwand"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC magickwand"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/magickwand in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/magickwand"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/magickwand/"; ac_bdir="ext/magickwand/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in magickwand.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_magickwand="$shared_objects_magickwand $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_magickwand) $(PHPMAGICKWAND_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_magickwand) -L$(top_builddir)/netware -lphp4lib $(MAGICKWAND_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_magickwand) $(PHPMAGICKWAND_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmagickwand.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_magickwand"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmagickwand.$suffix: $ext_builddir/phpmagickwand.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmagickwand.$suffix \$(phplibdir)

$ext_builddir/phpmagickwand.$suffix: \$(shared_objects_magickwand) \$(PHPMAGICKWAND_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_magickwand) $(MAGICKWAND_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_magickwand) -L$(top_builddir)/netware -lphp4lib $(ICKWAND_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_magickwand) $(MAGICKWAND_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/magickwand.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_magickwand"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/magickwand.$suffix: $ext_builddir/magickwand.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/magickwand.$suffix \$(phplibdir)

$ext_builddir/magickwand.$suffix: \$(shared_objects_magickwand) \$(MAGICKWAND_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MAGICKWAND 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/magickwand in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/magickwand"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/magickwand/"; ac_bdir="ext/magickwand/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in magickwand.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC magickwand"
    else


  case ext/magickwand in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/magickwand"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/magickwand/"; ac_bdir="ext/magickwand/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in magickwand.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC magickwand"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



fi





















echo "$as_me:$LINENO: checking whether to enable multibyte string support" >&5
echo $ECHO_N "checking whether to enable multibyte string support... $ECHO_C" >&6
# Check whether --enable-mbstring or --disable-mbstring was given.
if test "${enable_mbstring+set}" = set; then
  enableval="$enable_mbstring"
  PHP_MBSTRING=$enableval
else

  PHP_MBSTRING=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MBSTRING=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MBSTRING in
shared,*)
  PHP_MBSTRING=`echo "$PHP_MBSTRING"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MBSTRING=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking whether to enable multibyte regex support" >&5
echo $ECHO_N "checking whether to enable multibyte regex support... $ECHO_C" >&6
# Check whether --enable-mbregex or --disable-mbregex was given.
if test "${enable_mbregex+set}" = set; then
  enableval="$enable_mbregex"
  PHP_MBREGEX=$enableval
else

  PHP_MBREGEX=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_MBREGEX=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_MBREGEX
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for external libmbfl" >&5
echo $ECHO_N "checking for external libmbfl... $ECHO_C" >&6

# Check whether --with-libmbfl or --without-libmbfl was given.
if test "${with_libmbfl+set}" = set; then
  withval="$with_libmbfl"
  PHP_LIBMBFL=$withval
else

  PHP_LIBMBFL=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_LIBMBFL=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_LIBMBFL
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MBSTRING" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_MBSTRING 1
_ACEOF



  PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES mbstring.c php_unicode.c"


  if test "$PHP_MBREGEX" != "no"; then

  if test "$PHP_MBREGEX" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_MBREGEX 1
_ACEOF



  PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES mbregex"


  PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS mbregex"



  PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES
      php_mbregex.c
      mbregex/mbregex.c
    "

  fi

  fi


    if test "$PHP_LIBMBFL" = "yes" || test "$PHP_LIBMBFL" = "no"; then

  PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl"


  PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/mbfl"


  PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/filters"


  PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS libmbfl/nls"


  PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl"


  PHP_MBSTRING_EXTRA_INCLUDES="$PHP_MBSTRING_EXTRA_INCLUDES libmbfl/mbfl"


  PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS libmbfl/config.h"



  PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES
     libmbfl/filters/html_entities.c
     libmbfl/filters/mbfilter_7bit.c
     libmbfl/filters/mbfilter_ascii.c
     libmbfl/filters/mbfilter_base64.c
     libmbfl/filters/mbfilter_big5.c
     libmbfl/filters/mbfilter_byte2.c
     libmbfl/filters/mbfilter_byte4.c
     libmbfl/filters/mbfilter_cp1251.c
     libmbfl/filters/mbfilter_cp1252.c
     libmbfl/filters/mbfilter_cp866.c
     libmbfl/filters/mbfilter_cp932.c
     libmbfl/filters/mbfilter_cp936.c
     libmbfl/filters/mbfilter_euc_cn.c
     libmbfl/filters/mbfilter_euc_jp.c
     libmbfl/filters/mbfilter_euc_jp_win.c
     libmbfl/filters/mbfilter_euc_kr.c
     libmbfl/filters/mbfilter_euc_tw.c
     libmbfl/filters/mbfilter_htmlent.c
     libmbfl/filters/mbfilter_hz.c
     libmbfl/filters/mbfilter_iso2022_kr.c
     libmbfl/filters/mbfilter_iso8859_1.c
     libmbfl/filters/mbfilter_iso8859_10.c
     libmbfl/filters/mbfilter_iso8859_13.c
     libmbfl/filters/mbfilter_iso8859_14.c
     libmbfl/filters/mbfilter_iso8859_15.c
     libmbfl/filters/mbfilter_iso8859_16.c
     libmbfl/filters/mbfilter_iso8859_2.c
     libmbfl/filters/mbfilter_iso8859_3.c
     libmbfl/filters/mbfilter_iso8859_4.c
     libmbfl/filters/mbfilter_iso8859_5.c
     libmbfl/filters/mbfilter_iso8859_6.c
     libmbfl/filters/mbfilter_iso8859_7.c
     libmbfl/filters/mbfilter_iso8859_8.c
     libmbfl/filters/mbfilter_iso8859_9.c
     libmbfl/filters/mbfilter_jis.c
     libmbfl/filters/mbfilter_koi8r.c
     libmbfl/filters/mbfilter_qprint.c
     libmbfl/filters/mbfilter_armscii8.c
     libmbfl/filters/mbfilter_sjis.c
     libmbfl/filters/mbfilter_ucs2.c
     libmbfl/filters/mbfilter_ucs4.c
     libmbfl/filters/mbfilter_uhc.c
     libmbfl/filters/mbfilter_utf16.c
     libmbfl/filters/mbfilter_utf32.c
     libmbfl/filters/mbfilter_utf7.c
     libmbfl/filters/mbfilter_utf7imap.c
     libmbfl/filters/mbfilter_utf8.c
     libmbfl/filters/mbfilter_uuencode.c
     libmbfl/mbfl/mbfilter.c
     libmbfl/mbfl/mbfilter_8bit.c
     libmbfl/mbfl/mbfilter_pass.c
     libmbfl/mbfl/mbfilter_wchar.c
     libmbfl/mbfl/mbfl_convert.c
     libmbfl/mbfl/mbfl_encoding.c
     libmbfl/mbfl/mbfl_filter_output.c
     libmbfl/mbfl/mbfl_ident.c
     libmbfl/mbfl/mbfl_language.c
     libmbfl/mbfl/mbfl_memory_device.c
     libmbfl/mbfl/mbfl_string.c
     libmbfl/mbfl/mbfl_allocators.c
     libmbfl/nls/nls_de.c
     libmbfl/nls/nls_en.c
     libmbfl/nls/nls_ja.c
     libmbfl/nls/nls_kr.c
     libmbfl/nls/nls_neutral.c
     libmbfl/nls/nls_ru.c
     libmbfl/nls/nls_uni.c
     libmbfl/nls/nls_zh.c
     libmbfl/nls/nls_hy.c
     libmbfl/nls/nls_tr.c
    "


  PHP_MBSTRING_CFLAGS="$PHP_MBSTRING_CFLAGS -DHAVE_CONFIG_H"

  else
                for inc in include include/mbfl-1.0 include/mbfl; do
      if test -f "$PHP_LIBMBFL/$inc/mbfilter.h"; then
        PHP_LIBMBFL_INCLUDE="$inc"
        break
      fi
    done

    if test -z "$PHP_LIBMBFL_INCLUDE"; then
      { { echo "$as_me:$LINENO: error: mbfilter.h not found. Please reinstall libmbfl library." >&5
echo "$as_me: error: mbfilter.h not found. Please reinstall libmbfl library." >&2;}
   { (exit 1); exit 1; }; }
    else

  if test "$PHP_LIBMBFL_INCLUDE" != "/usr/include"; then

  if test -z "$PHP_LIBMBFL_INCLUDE" || echo "$PHP_LIBMBFL_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$PHP_LIBMBFL_INCLUDE
  else

    ep_dir="`echo $PHP_LIBMBFL_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -LPHP_LIBMBFL/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for mbfl_buffer_converter_new in -lmbfl" >&5
echo $ECHO_N "checking for mbfl_buffer_converter_new in -lmbfl... $ECHO_C" >&6
if test "${ac_cv_lib_mbfl_mbfl_buffer_converter_new+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmbfl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mbfl_buffer_converter_new ();
int
main ()
{
mbfl_buffer_converter_new ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mbfl_mbfl_buffer_converter_new=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mbfl_mbfl_buffer_converter_new=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mbfl_mbfl_buffer_converter_new" >&5
echo "${ECHO_T}$ac_cv_lib_mbfl_mbfl_buffer_converter_new" >&6
if test $ac_cv_lib_mbfl_mbfl_buffer_converter_new = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    MBSTRING_SHARED_LIBADD="-lmbfl $MBSTRING_SHARED_LIBADD"
    if test -n "$PHP_LIBMBFL/lib"; then

  if test "$PHP_LIBMBFL/lib" != "/usr/lib"; then

  if test -z "$PHP_LIBMBFL/lib" || echo "$PHP_LIBMBFL/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_LIBMBFL/lib
  else

    ep_dir="`echo $PHP_LIBMBFL/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MBSTRING_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MBSTRING_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_LIBMBFL/lib"; then

  if test "$PHP_LIBMBFL/lib" != "/usr/lib"; then

  if test -z "$PHP_LIBMBFL/lib" || echo "$PHP_LIBMBFL/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_LIBMBFL/lib
  else

    ep_dir="`echo $PHP_LIBMBFL/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_LIBMBFL/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case mbfl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmbfl $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mbfl_mbfl_buffer_converter_new

      { { echo "$as_me:$LINENO: error: Problem with libmbfl. Please check config.log for more information." >&5
echo "$as_me: error: Problem with libmbfl. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

  fi



  ext_builddir=ext/mbstring
  ext_srcdir=$abs_srcdir/ext/mbstring

  ac_extra=`echo "$PHP_MBSTRING_CFLAGS"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mbstring in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $PHP_MBSTRING_SOURCES; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mbstring"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mbstring in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in $PHP_MBSTRING_SOURCES; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mbstring="$shared_objects_mbstring $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) -L$(top_builddir)/netware -lphp4lib $(MBSTRING_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(PHPMBSTRING_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmbstring.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mbstring"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmbstring.$suffix: $ext_builddir/phpmbstring.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmbstring.$suffix \$(phplibdir)

$ext_builddir/phpmbstring.$suffix: \$(shared_objects_mbstring) \$(PHPMBSTRING_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(MBSTRING_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) -L$(top_builddir)/netware -lphp4lib $(TRING_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mbstring) $(MBSTRING_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mbstring.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mbstring"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mbstring.$suffix: $ext_builddir/mbstring.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mbstring.$suffix \$(phplibdir)

$ext_builddir/mbstring.$suffix: \$(shared_objects_mbstring) \$(MBSTRING_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MBSTRING 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mbstring in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $PHP_MBSTRING_SOURCES; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mbstring"
    else


  case ext/mbstring in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mbstring"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mbstring/"; ac_bdir="ext/mbstring/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in $PHP_MBSTRING_SOURCES; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mbstring"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MBSTRING_SHARED_LIBADD"


  for dir in $PHP_MBSTRING_EXTRA_INCLUDES; do

  if test "$ext_srcdir/$dir" != "/usr/include"; then

  if test -z "$ext_srcdir/$dir" || echo "$ext_srcdir/$dir" | grep '^/' >/dev/null ; then
    ai_p=$ext_srcdir/$dir
  else

    ep_dir="`echo $ext_srcdir/$dir|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ext_srcdir/$dir\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  done

  for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do

  BUILD_DIR="$BUILD_DIR $ext_builddir/$dir"

  done

  if test "$ext_shared" = "no"; then
    out="php_config.h"
  else
    if test -f "$ext_builddir/config.h.in"; then
      out="$abs_builddir/config.h"
    else
      out="php_config.h"
    fi
  fi

  for cfg in $PHP_MBSTRING_EXTRA_CONFIG_HEADERS; do
    cat > $ext_srcdir/$cfg <<EOF
#include "$out"
EOF
  done


fi






echo "$as_me:$LINENO: checking for MCAL support" >&5
echo $ECHO_N "checking for MCAL support... $ECHO_C" >&6

# Check whether --with-mcal or --without-mcal was given.
if test "${with_mcal+set}" = set; then
  withval="$with_mcal"
  PHP_MCAL=$withval
else

  PHP_MCAL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MCAL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MCAL in
shared,*)
  PHP_MCAL=`echo "$PHP_MCAL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MCAL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MCAL" != "no"; then
  MCAL_DEFAULT_SEARCH=/usr/local
  if test "$PHP_MCAL" = "yes"; then
    MCAL_DIR=$MCAL_DEFAULT_SEARCH
  else

  if test -z "$PHP_MCAL" || echo "$PHP_MCAL" | grep '^/' >/dev/null ; then
    MCAL_DIR=$PHP_MCAL
  else

    ep_dir="`echo $PHP_MCAL|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    MCAL_DIR="$ep_realdir/`basename \"$PHP_MCAL\"`"
  fi

  fi

  for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/include $MCAL_DIR/include/mcal $MCAL_DIR/include; do
    if test -r "$i/mcal.h"; then
      MCAL_INCLUDE=$i
    fi
  done

  for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/lib $MCAL_DIR/lib/mcal $MCAL_DIR/lib; do
    if test -r "$i/libmcal.a"; then
      MCAL_LIBRARY=$i
    fi
  done

  for i in mcal cal_misc icalroutines; do
    if test ! -f "$MCAL_INCLUDE/$i.h"; then
      { { echo "$as_me:$LINENO: error: Unable to locate your libmcal header files - $i.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" >&5
echo "$as_me: error: Unable to locate your libmcal header files - $i.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" >&2;}
   { (exit 1); exit 1; }; }
    fi
  done

  if test ! -f "$MCAL_LIBRARY/libmcal.a"; then
    { { echo "$as_me:$LINENO: error: Unable to locate your libmcal library files - libmcal.a should be in the directory you specify or in the lib/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" >&5
echo "$as_me: error: Unable to locate your libmcal library files - libmcal.a should be in the directory you specify or in the lib/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$MCAL_INCLUDE" != "/usr/include"; then

  if test -z "$MCAL_INCLUDE" || echo "$MCAL_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$MCAL_INCLUDE
  else

    ep_dir="`echo $MCAL_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCAL_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$MCAL_LIBRARY" != "/usr/lib"; then

  if test -z "$MCAL_LIBRARY" || echo "$MCAL_LIBRARY" | grep '^/' >/dev/null ; then
    ai_p=$MCAL_LIBRARY
  else

    ep_dir="`echo $MCAL_LIBRARY|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCAL_LIBRARY\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MCAL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MCAL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi



  case mcal in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MCAL_SHARED_LIBADD="-lmcal $MCAL_SHARED_LIBADD"
    else


  case mcal in
  c|c_r|pthread*) ;;
  *)
      DLIBS="-lmcal $DLIBS"
   ;;
  esac


    fi
   ;;
  esac



  PHP_VAR_SUBST="$PHP_VAR_SUBST MCAL_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_MCAL 1
_ACEOF


  ext_builddir=ext/mcal
  ext_srcdir=$abs_srcdir/ext/mcal

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mcal in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcal"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcal/"; ac_bdir="ext/mcal/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mcal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mcal"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mcal"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mcal in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcal"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcal/"; ac_bdir="ext/mcal/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_mcal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mcal="$shared_objects_mcal $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcal) $(PHPMCAL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcal) -L$(top_builddir)/netware -lphp4lib $(MCAL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcal) $(PHPMCAL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmcal.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcal"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmcal.$suffix: $ext_builddir/phpmcal.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmcal.$suffix \$(phplibdir)

$ext_builddir/phpmcal.$suffix: \$(shared_objects_mcal) \$(PHPMCAL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcal) $(MCAL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcal) -L$(top_builddir)/netware -lphp4lib $(L_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcal) $(MCAL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mcal.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcal"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mcal.$suffix: $ext_builddir/mcal.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mcal.$suffix \$(phplibdir)

$ext_builddir/mcal.$suffix: \$(shared_objects_mcal) \$(MCAL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MCAL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mcal in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcal"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcal/"; ac_bdir="ext/mcal/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mcal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mcal"
    else


  case ext/mcal in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcal"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcal/"; ac_bdir="ext/mcal/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mcal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mcal"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi





echo "$as_me:$LINENO: checking for mcrypt support" >&5
echo $ECHO_N "checking for mcrypt support... $ECHO_C" >&6

# Check whether --with-mcrypt or --without-mcrypt was given.
if test "${with_mcrypt+set}" = set; then
  withval="$with_mcrypt"
  PHP_MCRYPT=$withval
else

  PHP_MCRYPT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MCRYPT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MCRYPT in
shared,*)
  PHP_MCRYPT=`echo "$PHP_MCRYPT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MCRYPT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MCRYPT" != "no"; then
  for i in $PHP_MCRYPT /usr/local /usr; do
    test -f $i/include/mcrypt.h && MCRYPT_DIR=$i && break
  done

  if test -z "$MCRYPT_DIR"; then
    { { echo "$as_me:$LINENO: error: mcrypt.h not found. Please reinstall libmcrypt." >&5
echo "$as_me: error: mcrypt.h not found. Please reinstall libmcrypt." >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$MCRYPT_DIR/lib -lltdl
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for mcrypt_module_open in -lmcrypt" >&5
echo $ECHO_N "checking for mcrypt_module_open in -lmcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_mcrypt_mcrypt_module_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mcrypt_module_open ();
int
main ()
{
mcrypt_module_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcrypt_mcrypt_module_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcrypt_mcrypt_module_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcrypt_mcrypt_module_open" >&5
echo "${ECHO_T}$ac_cv_lib_mcrypt_mcrypt_module_open" >&6
if test $ac_cv_lib_mcrypt_mcrypt_module_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case ltdl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MCRYPT_SHARED_LIBADD="-lltdl $MCRYPT_SHARED_LIBADD"
    else


  case ltdl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lltdl $LIBS"
   ;;
  esac


    fi
   ;;
  esac



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMCRYPT24 1
_ACEOF



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$MCRYPT_DIR/lib -lltdl
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for mcrypt_generic_deinit in -lmcrypt" >&5
echo $ECHO_N "checking for mcrypt_generic_deinit in -lmcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_mcrypt_mcrypt_generic_deinit+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mcrypt_generic_deinit ();
int
main ()
{
mcrypt_generic_deinit ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcrypt_mcrypt_generic_deinit=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcrypt_mcrypt_generic_deinit=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcrypt_mcrypt_generic_deinit" >&5
echo "${ECHO_T}$ac_cv_lib_mcrypt_mcrypt_generic_deinit" >&6
if test $ac_cv_lib_mcrypt_mcrypt_generic_deinit = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_MCRYPT_GENERIC_DEINIT 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcrypt_mcrypt_generic_deinit


fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcrypt_mcrypt_module_open


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$MCRYPT_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for mcrypt_module_open in -lmcrypt" >&5
echo $ECHO_N "checking for mcrypt_module_open in -lmcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_mcrypt_mcrypt_module_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mcrypt_module_open ();
int
main ()
{
mcrypt_module_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcrypt_mcrypt_module_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcrypt_mcrypt_module_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcrypt_mcrypt_module_open" >&5
echo "${ECHO_T}$ac_cv_lib_mcrypt_mcrypt_module_open" >&6
if test $ac_cv_lib_mcrypt_mcrypt_module_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMCRYPT24 1
_ACEOF



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$MCRYPT_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for mcrypt_generic_deinit in -lmcrypt" >&5
echo $ECHO_N "checking for mcrypt_generic_deinit in -lmcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_mcrypt_mcrypt_generic_deinit+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mcrypt_generic_deinit ();
int
main ()
{
mcrypt_generic_deinit ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcrypt_mcrypt_generic_deinit=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcrypt_mcrypt_generic_deinit=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcrypt_mcrypt_generic_deinit" >&5
echo "${ECHO_T}$ac_cv_lib_mcrypt_mcrypt_generic_deinit" >&6
if test $ac_cv_lib_mcrypt_mcrypt_generic_deinit = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_MCRYPT_GENERIC_DEINIT 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcrypt_mcrypt_generic_deinit


fi



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcrypt_mcrypt_module_open


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$MCRYPT_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for init_mcrypt in -lmcrypt" >&5
echo $ECHO_N "checking for init_mcrypt in -lmcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_mcrypt_init_mcrypt+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char init_mcrypt ();
int
main ()
{
init_mcrypt ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcrypt_init_mcrypt=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcrypt_init_mcrypt=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcrypt_init_mcrypt" >&5
echo "${ECHO_T}$ac_cv_lib_mcrypt_init_mcrypt" >&6
if test $ac_cv_lib_mcrypt_init_mcrypt = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMCRYPT22 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcrypt_init_mcrypt

        { { echo "$as_me:$LINENO: error: Sorry, I was not able to diagnose which libmcrypt version you have installed." >&5
echo "$as_me: error: Sorry, I was not able to diagnose which libmcrypt version you have installed." >&2;}
   { (exit 1); exit 1; }; }


fi



fi



fi




  if test "$ext_shared" = "yes"; then
    MCRYPT_SHARED_LIBADD="-lmcrypt $MCRYPT_SHARED_LIBADD"
    if test -n "$MCRYPT_DIR/lib"; then

  if test "$MCRYPT_DIR/lib" != "/usr/lib"; then

  if test -z "$MCRYPT_DIR/lib" || echo "$MCRYPT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MCRYPT_DIR/lib
  else

    ep_dir="`echo $MCRYPT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MCRYPT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MCRYPT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MCRYPT_DIR/lib"; then

  if test "$MCRYPT_DIR/lib" != "/usr/lib"; then

  if test -z "$MCRYPT_DIR/lib" || echo "$MCRYPT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MCRYPT_DIR/lib
  else

    ep_dir="`echo $MCRYPT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case mcrypt in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmcrypt $LIBS"
   ;;
  esac




  fi



  if test "$MCRYPT_DIR/include" != "/usr/include"; then

  if test -z "$MCRYPT_DIR/include" || echo "$MCRYPT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$MCRYPT_DIR/include
  else

    ep_dir="`echo $MCRYPT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCRYPT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  ext_builddir=ext/mcrypt
  ext_srcdir=$abs_srcdir/ext/mcrypt

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mcrypt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcrypt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mcrypt"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mcrypt"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mcrypt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in mcrypt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mcrypt="$shared_objects_mcrypt $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(PHPMCRYPT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) -L$(top_builddir)/netware -lphp4lib $(MCRYPT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(PHPMCRYPT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmcrypt.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcrypt"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmcrypt.$suffix: $ext_builddir/phpmcrypt.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmcrypt.$suffix \$(phplibdir)

$ext_builddir/phpmcrypt.$suffix: \$(shared_objects_mcrypt) \$(PHPMCRYPT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(MCRYPT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) -L$(top_builddir)/netware -lphp4lib $(YPT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcrypt) $(MCRYPT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mcrypt.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcrypt"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mcrypt.$suffix: $ext_builddir/mcrypt.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mcrypt.$suffix \$(phplibdir)

$ext_builddir/mcrypt.$suffix: \$(shared_objects_mcrypt) \$(MCRYPT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MCRYPT 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mcrypt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcrypt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mcrypt"
    else


  case ext/mcrypt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcrypt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcrypt/"; ac_bdir="ext/mcrypt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcrypt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mcrypt"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MCRYPT_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMCRYPT 1
_ACEOF

fi




echo "$as_me:$LINENO: checking for MCVE support" >&5
echo $ECHO_N "checking for MCVE support... $ECHO_C" >&6

# Check whether --with-mcve or --without-mcve was given.
if test "${with_mcve+set}" = set; then
  withval="$with_mcve"
  PHP_MCVE=$withval
else

  PHP_MCVE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MCVE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MCVE in
shared,*)
  PHP_MCVE=`echo "$PHP_MCVE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MCVE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking OpenSSL dir for MCVE" >&5
echo $ECHO_N "checking OpenSSL dir for MCVE... $ECHO_C" >&6

# Check whether --with-openssl-dir or --without-openssl-dir was given.
if test "${with_openssl_dir+set}" = set; then
  withval="$with_openssl_dir"
  PHP_OPENSSL_DIR=$withval
else

  PHP_OPENSSL_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_OPENSSL_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_OPENSSL_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MCVE" != "no"; then
  if test "$PHP_OPENSSL_DIR" != "no"; then
    PHP_OPENSSL=$PHP_OPENSSL_DIR

  found_openssl=no
  unset OPENSSL_INCDIR
  unset OPENSSL_LIBDIR

    test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
  test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no

    if test "$PHP_OPENSSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_OPENSSL
  elif test "$PHP_IMAP_SSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_IMAP_SSL
  fi

    if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG

if test -n "$PKG_CONFIG"; then
  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  fi

    if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
    if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
      found_openssl=yes
      OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
      OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
      OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
    else
      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then

  for ac_i in $OPENSSL_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="$MCVE_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MCVE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $OPENSSL_INCS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_openssl" = "no"; then

    if test "$PHP_OPENSSL_DIR" = "yes"; then
      PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
    fi

    for i in $PHP_OPENSSL_DIR; do
      if test -r $i/include/openssl/evp.h; then
        OPENSSL_INCDIR=$i/include
      fi
      if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
        OPENSSL_LIBDIR=$i/lib
      fi
      test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
    done

    if test -z "$OPENSSL_INCDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's <evp.h>" >&5
echo "$as_me: error: Cannot find OpenSSL's <evp.h>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -z "$OPENSSL_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's libraries" >&5
echo "$as_me: error: Cannot find OpenSSL's libraries" >&2;}
   { (exit 1); exit 1; }; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$OPENSSL_INCDIR
    echo "$as_me:$LINENO: checking for OpenSSL version" >&5
echo $ECHO_N "checking for OpenSSL version... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: >= 0.9.6" >&5
echo "${ECHO_T}>= 0.9.6" >&6

else

      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS


  if test "$OPENSSL_INCDIR" != "/usr/include"; then

  if test -z "$OPENSSL_INCDIR" || echo "$OPENSSL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_INCDIR
  else

    ep_dir="`echo $OPENSSL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for CRYPTO_free in -lcrypto" >&5
echo $ECHO_N "checking for CRYPTO_free in -lcrypto... $ECHO_C" >&6
if test "${ac_cv_lib_crypto_CRYPTO_free+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char CRYPTO_free ();
int
main ()
{
CRYPTO_free ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_crypto_CRYPTO_free=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_crypto_CRYPTO_free=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_free" >&5
echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_free" >&6
if test $ac_cv_lib_crypto_CRYPTO_free = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="-lcrypto $MCVE_SHARED_LIBADD"
    else


  case crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypto $LIBS"
   ;;
  esac


    fi
   ;;
  esac




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_crypto_CRYPTO_free

      { { echo "$as_me:$LINENO: error: libcrypto not found!" >&5
echo "$as_me: error: libcrypto not found!" >&2;}
   { (exit 1); exit 1; }; }


fi


    old_LIBS=$LIBS
    LIBS="$LIBS -lcrypto"

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for SSL_CTX_set_ssl_version in -lssl" >&5
echo $ECHO_N "checking for SSL_CTX_set_ssl_version in -lssl... $ECHO_C" >&6
if test "${ac_cv_lib_ssl_SSL_CTX_set_ssl_version+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lssl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SSL_CTX_set_ssl_version ();
int
main ()
{
SSL_CTX_set_ssl_version ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ssl_SSL_CTX_set_ssl_version=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ssl_SSL_CTX_set_ssl_version=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&5
echo "${ECHO_T}$ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&6
if test $ac_cv_lib_ssl_SSL_CTX_set_ssl_version = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      found_openssl=yes


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version

      { { echo "$as_me:$LINENO: error: libssl not found!" >&5
echo "$as_me: error: libssl not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

    LIBS=$old_LIBS


  case ssl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="-lssl $MCVE_SHARED_LIBADD"
    else


  case ssl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  if test "$OPENSSL_LIBDIR" != "/usr/lib"; then

  if test -z "$OPENSSL_LIBDIR" || echo "$OPENSSL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_LIBDIR
  else

    ep_dir="`echo $OPENSSL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MCVE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  fi

  if test "$found_openssl" = "yes"; then
    OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR


:
else
      { { echo "$as_me:$LINENO: error: MCVE: OpenSSL check failed. Please check config.log for more information." >&5
echo "$as_me: error: MCVE: OpenSSL check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }

  fi

  else
    echo "$as_me:$LINENO: result: If configure fails, try adding --with-openssl-dir=<DIR>" >&5
echo "${ECHO_T}If configure fails, try adding --with-openssl-dir=<DIR>" >&6
  fi

  case "$PHP_MCVE" in
    yes )
      for i in /usr/local/mcve /usr/local /usr; do
        if test -r $i/include/mcve.h; then
          MCVE_DIR=$i
          break
        fi
      done
      ;;
    * )
      test -r "$PHP_MCVE/include/mcve.h" && MCVE_DIR=$PHP_MCVE
      ;;
  esac

  if test -z "$MCVE_DIR"; then
    { { echo "$as_me:$LINENO: error: mcve.h NOT FOUND. Please check your MCVE installation." >&5
echo "$as_me: error: mcve.h NOT FOUND. Please check your MCVE installation." >&2;}
   { (exit 1); exit 1; }; }
  fi

    saved_CPPFLAGS=$CPPFLAGS
  echo "$as_me:$LINENO: checking for correct libmcve version" >&5
echo $ECHO_N "checking for correct libmcve version... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$MCVE_DIR/include/mcve.h"
#ifdef M_EXPORT
yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6

else

    { { echo "$as_me:$LINENO: error: libmcve 3.2.2 or greater required." >&5
echo "$as_me: error: libmcve 3.2.2 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*


  echo "$as_me:$LINENO: checking for correct libmonetra 4.2 or higher" >&5
echo $ECHO_N "checking for correct libmonetra 4.2 or higher... $ECHO_C" >&6
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "$MCVE_DIR/include/mcve.h"
#ifdef MCVE_SetSSL_CAfile
yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else


cat >>confdefs.h <<\_ACEOF
#define LIBMONETRA_BELOW_4_2 1
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f conftest*


  CPPFLAGS=$saved_CPPFLAGS


  if test "$MCVE_DIR/include" != "/usr/include"; then

  if test -z "$MCVE_DIR/include" || echo "$MCVE_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$MCVE_DIR/include
  else

    ep_dir="`echo $MCVE_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCVE_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    MCVE_SHARED_LIBADD="-lmcve $MCVE_SHARED_LIBADD"
    if test -n "$MCVE_DIR/lib"; then

  if test "$MCVE_DIR/lib" != "/usr/lib"; then

  if test -z "$MCVE_DIR/lib" || echo "$MCVE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MCVE_DIR/lib
  else

    ep_dir="`echo $MCVE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCVE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MCVE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MCVE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MCVE_DIR/lib"; then

  if test "$MCVE_DIR/lib" != "/usr/lib"; then

  if test -z "$MCVE_DIR/lib" || echo "$MCVE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MCVE_DIR/lib
  else

    ep_dir="`echo $MCVE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCVE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case mcve in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmcve $LIBS"
   ;;
  esac




  fi




  has_mcve=0

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    $MCVE_SHARED_LIBADD
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for MCVE_DestroyEngine in -lmcve" >&5
echo $ECHO_N "checking for MCVE_DestroyEngine in -lmcve... $ECHO_C" >&6
if test "${ac_cv_lib_mcve_MCVE_DestroyEngine+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcve  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char MCVE_DestroyEngine ();
int
main ()
{
MCVE_DestroyEngine ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcve_MCVE_DestroyEngine=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcve_MCVE_DestroyEngine=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcve_MCVE_DestroyEngine" >&5
echo "${ECHO_T}$ac_cv_lib_mcve_MCVE_DestroyEngine" >&6
if test $ac_cv_lib_mcve_MCVE_DestroyEngine = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

    has_mcve=1


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcve_MCVE_DestroyEngine

    has_mcve=0


fi


        if test "$has_mcve" = "0" ; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      $MCVE_SHARED_LIBADD
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for M_DestroyEngine in -lmcve" >&5
echo $ECHO_N "checking for M_DestroyEngine in -lmcve... $ECHO_C" >&6
if test "${ac_cv_lib_mcve_M_DestroyEngine+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lmcve  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char M_DestroyEngine ();
int
main ()
{
M_DestroyEngine ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_mcve_M_DestroyEngine=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_mcve_M_DestroyEngine=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_mcve_M_DestroyEngine" >&5
echo "${ECHO_T}$ac_cv_lib_mcve_M_DestroyEngine" >&6
if test $ac_cv_lib_mcve_M_DestroyEngine = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      has_mcve=1


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_mcve_M_DestroyEngine

      has_mcve=0


fi

  fi

  if test "$has_mcve" = "1" ; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_MCVE 1
_ACEOF

  else
    { { echo "$as_me:$LINENO: error: MCVE: Sanity check failed. Please check config.log for more information." >&5
echo "$as_me: error: MCVE: Sanity check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }
  fi


  ext_builddir=ext/mcve
  ext_srcdir=$abs_srcdir/ext/mcve

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mcve in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcve"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcve/"; ac_bdir="ext/mcve/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcve.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mcve"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mcve"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mcve in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcve"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcve/"; ac_bdir="ext/mcve/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in mcve.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mcve="$shared_objects_mcve $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcve) $(PHPMCVE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcve) -L$(top_builddir)/netware -lphp4lib $(MCVE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcve) $(PHPMCVE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmcve.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcve"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmcve.$suffix: $ext_builddir/phpmcve.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmcve.$suffix \$(phplibdir)

$ext_builddir/phpmcve.$suffix: \$(shared_objects_mcve) \$(PHPMCVE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mcve) $(MCVE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcve) -L$(top_builddir)/netware -lphp4lib $(E_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mcve) $(MCVE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mcve.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mcve"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mcve.$suffix: $ext_builddir/mcve.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mcve.$suffix \$(phplibdir)

$ext_builddir/mcve.$suffix: \$(shared_objects_mcve) \$(MCVE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MCVE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mcve in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcve"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcve/"; ac_bdir="ext/mcve/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcve.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mcve"
    else


  case ext/mcve in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mcve"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mcve/"; ac_bdir="ext/mcve/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mcve.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mcve"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MCVE_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for mhash support" >&5
echo $ECHO_N "checking for mhash support... $ECHO_C" >&6

# Check whether --with-mhash or --without-mhash was given.
if test "${with_mhash+set}" = set; then
  withval="$with_mhash"
  PHP_MHASH=$withval
else

  PHP_MHASH=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MHASH=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MHASH in
shared,*)
  PHP_MHASH=`echo "$PHP_MHASH"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MHASH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MHASH" != "no"; then
  for i in $PHP_MHASH /usr/local /usr /opt/mhash; do
    test -f $i/include/mhash.h && MHASH_DIR=$i && break
  done

  if test -z "$MHASH_DIR"; then
    { { echo "$as_me:$LINENO: error: Please reinstall libmhash - I cannot find mhash.h" >&5
echo "$as_me: error: Please reinstall libmhash - I cannot find mhash.h" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$MHASH_DIR/include" != "/usr/include"; then

  if test -z "$MHASH_DIR/include" || echo "$MHASH_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$MHASH_DIR/include
  else

    ep_dir="`echo $MHASH_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MHASH_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    MHASH_SHARED_LIBADD="-lmhash $MHASH_SHARED_LIBADD"
    if test -n "$MHASH_DIR/lib"; then

  if test "$MHASH_DIR/lib" != "/usr/lib"; then

  if test -z "$MHASH_DIR/lib" || echo "$MHASH_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MHASH_DIR/lib
  else

    ep_dir="`echo $MHASH_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MHASH_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MHASH_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MHASH_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MHASH_DIR/lib"; then

  if test "$MHASH_DIR/lib" != "/usr/lib"; then

  if test -z "$MHASH_DIR/lib" || echo "$MHASH_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MHASH_DIR/lib
  else

    ep_dir="`echo $MHASH_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MHASH_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case mhash in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmhash $LIBS"
   ;;
  esac




  fi




  ext_builddir=ext/mhash
  ext_srcdir=$abs_srcdir/ext/mhash

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mhash in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mhash"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mhash/"; ac_bdir="ext/mhash/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mhash.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mhash"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mhash"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mhash in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mhash"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mhash/"; ac_bdir="ext/mhash/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in mhash.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mhash="$shared_objects_mhash $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mhash) $(PHPMHASH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mhash) -L$(top_builddir)/netware -lphp4lib $(MHASH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mhash) $(PHPMHASH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmhash.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mhash"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmhash.$suffix: $ext_builddir/phpmhash.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmhash.$suffix \$(phplibdir)

$ext_builddir/phpmhash.$suffix: \$(shared_objects_mhash) \$(PHPMHASH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mhash) $(MHASH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mhash) -L$(top_builddir)/netware -lphp4lib $(SH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mhash) $(MHASH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mhash.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mhash"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mhash.$suffix: $ext_builddir/mhash.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mhash.$suffix \$(phplibdir)

$ext_builddir/mhash.$suffix: \$(shared_objects_mhash) \$(MHASH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MHASH 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mhash in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mhash"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mhash/"; ac_bdir="ext/mhash/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mhash.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mhash"
    else


  case ext/mhash in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mhash"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mhash/"; ac_bdir="ext/mhash/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mhash.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mhash"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MHASH_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMHASH 1
_ACEOF

fi




echo "$as_me:$LINENO: checking whether to include mime_magic support" >&5
echo $ECHO_N "checking whether to include mime_magic support... $ECHO_C" >&6

# Check whether --with-mime-magic or --without-mime-magic was given.
if test "${with_mime_magic+set}" = set; then
  withval="$with_mime_magic"
  PHP_MIME_MAGIC=$withval
else

  PHP_MIME_MAGIC=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MIME_MAGIC=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MIME_MAGIC in
shared,*)
  PHP_MIME_MAGIC=`echo "$PHP_MIME_MAGIC"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MIME_MAGIC=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MIME_MAGIC" != "no"; then


  ext_builddir=ext/mime_magic
  ext_srcdir=$abs_srcdir/ext/mime_magic

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mime_magic in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mime_magic"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mime_magic/"; ac_bdir="ext/mime_magic/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mime_magic.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mime_magic"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mime_magic"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mime_magic in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mime_magic"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mime_magic/"; ac_bdir="ext/mime_magic/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in mime_magic.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mime_magic="$shared_objects_mime_magic $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) $(PHPMIME_MAGIC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) -L$(top_builddir)/netware -lphp4lib $(MIME_MAGIC_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) $(PHPMIME_MAGIC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmime_magic.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mime_magic"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmime_magic.$suffix: $ext_builddir/phpmime_magic.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmime_magic.$suffix \$(phplibdir)

$ext_builddir/phpmime_magic.$suffix: \$(shared_objects_mime_magic) \$(PHPMIME_MAGIC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) $(MIME_MAGIC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) -L$(top_builddir)/netware -lphp4lib $(E_MAGIC_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mime_magic) $(MIME_MAGIC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mime_magic.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mime_magic"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mime_magic.$suffix: $ext_builddir/mime_magic.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mime_magic.$suffix \$(phplibdir)

$ext_builddir/mime_magic.$suffix: \$(shared_objects_mime_magic) \$(MIME_MAGIC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MIME_MAGIC 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mime_magic in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mime_magic"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mime_magic/"; ac_bdir="ext/mime_magic/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mime_magic.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mime_magic"
    else


  case ext/mime_magic in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mime_magic"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mime_magic/"; ac_bdir="ext/mime_magic/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in mime_magic.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mime_magic"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_MIME_MAGIC_FILE_PATH=

        if test "$PHP_MIME_MAGIC" != "yes"; then
    if test -f $PHP_MIME_MAGIC; then
      PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
    else
      { { echo "$as_me:$LINENO: error: File '$PHP_MIME_MAGIC' not found!" >&5
echo "$as_me: error: File '$PHP_MIME_MAGIC' not found!" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    MAGIC_MIME_LOCATIONS="/usr/local/apache/conf/magic /usr/local/etc/apache/conf/magic /etc/apache/magic /etc/httpd/conf/magic /usr/share/magic.mime /usr/share/misc/magic.mime /etc/magic.mime"

    for i in $MAGIC_MIME_LOCATIONS; do
      if test -f $i; then
        PHP_MIME_MAGIC_FILE_PATH=$i
        break
      fi
    done
  fi


cat >>confdefs.h <<_ACEOF
#define PHP_MIME_MAGIC_FILE_PATH "$PHP_MIME_MAGIC_FILE_PATH"
_ACEOF


fi




echo "$as_me:$LINENO: checking for MING support" >&5
echo $ECHO_N "checking for MING support... $ECHO_C" >&6

# Check whether --with-ming or --without-ming was given.
if test "${with_ming+set}" = set; then
  withval="$with_ming"
  PHP_MING=$withval
else

  PHP_MING=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MING=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MING in
shared,*)
  PHP_MING=`echo "$PHP_MING"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MING=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MING" != "no"; then

echo "$as_me:$LINENO: checking for sin in -lm" >&5
echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_sin+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lm  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char sin ();
int
main ()
{
sin ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_m_sin=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_m_sin=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5
echo "${ECHO_T}$ac_cv_lib_m_sin" >&6
if test $ac_cv_lib_m_sin = yes; then
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF

  LIBS="-lm $LIBS"

fi


  for i in $PHP_MING /usr/local /usr; do
    if test -f $i/lib/libming.$SHLIB_SUFFIX_NAME -o -f $i/lib/libming.a; then
      MING_DIR=$i
    fi
  done

  if test -z "$MING_DIR"; then
    { { echo "$as_me:$LINENO: error: Please reinstall ming distribution. libming.(a|so) not found." >&5
echo "$as_me: error: Please reinstall ming distribution. libming.(a|so) not found." >&2;}
   { (exit 1); exit 1; }; }
  fi

  for i in $MING_DIR/include $MING_DIR/include/ming $MING_DIR/ming/include; do
    if test -f $i/ming.h; then
      MING_INC_DIR=$i
    fi
  done

  if test -z "$MING_INC_DIR"; then
    { { echo "$as_me:$LINENO: error: Please reinstall ming distribution. ming.h not found." >&5
echo "$as_me: error: Please reinstall ming distribution. ming.h not found." >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$MING_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for Ming_useSWFVersion in -lming" >&5
echo $ECHO_N "checking for Ming_useSWFVersion in -lming... $ECHO_C" >&6
if test "${ac_cv_lib_ming_Ming_useSWFVersion+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lming  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char Ming_useSWFVersion ();
int
main ()
{
Ming_useSWFVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ming_Ming_useSWFVersion=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ming_Ming_useSWFVersion=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ming_Ming_useSWFVersion" >&5
echo "${ECHO_T}$ac_cv_lib_ming_Ming_useSWFVersion" >&6
if test $ac_cv_lib_ming_Ming_useSWFVersion = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_MING 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ming_Ming_useSWFVersion

    { { echo "$as_me:$LINENO: error: Ming library 0.2a or greater required." >&5
echo "$as_me: error: Ming library 0.2a or greater required." >&2;}
   { (exit 1); exit 1; }; }


fi



  if test "$MING_INC_DIR" != "/usr/include"; then

  if test -z "$MING_INC_DIR" || echo "$MING_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$MING_INC_DIR
  else

    ep_dir="`echo $MING_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MING_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    MING_SHARED_LIBADD="-lming $MING_SHARED_LIBADD"
    if test -n "$MING_DIR/lib"; then

  if test "$MING_DIR/lib" != "/usr/lib"; then

  if test -z "$MING_DIR/lib" || echo "$MING_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MING_DIR/lib
  else

    ep_dir="`echo $MING_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MING_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MING_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MING_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MING_DIR/lib"; then

  if test "$MING_DIR/lib" != "/usr/lib"; then

  if test -z "$MING_DIR/lib" || echo "$MING_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MING_DIR/lib
  else

    ep_dir="`echo $MING_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MING_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ming in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lming $LIBS"
   ;;
  esac




  fi



  echo "$as_me:$LINENO: checking for destroySWFBlock" >&5
echo $ECHO_N "checking for destroySWFBlock... $ECHO_C" >&6
  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$MING_INC_DIR
  if test "$cross_compiling" = yes; then

    echo "$as_me:$LINENO: result: unknown" >&5
echo "${ECHO_T}unknown" >&6

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include "ming.h"
int destroySWFBlock(int a, int b) {
	return a+b;
}
int main() {
	return destroySWFBlock(-1,1); /* returns 0 only if function is not yet defined */
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )


cat >>confdefs.h <<\_ACEOF
#define HAVE_DESTROY_SWF_BLOCK 1
_ACEOF

    echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <ming.h>
#ifdef SWF_SOUND_COMPRESSION
yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_NEW_MING 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_MING_ZLIB 1
_ACEOF


fi
rm -f conftest*

  CPPFLAGS=$old_CPPFLAGS


  ext_builddir=ext/ming
  ext_srcdir=$abs_srcdir/ext/ming

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/ming in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ming"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ming/"; ac_bdir="ext/ming/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ming.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ming"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ming"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ming in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ming"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ming/"; ac_bdir="ext/ming/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ming.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ming="$shared_objects_ming $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ming) $(PHPMING_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ming) -L$(top_builddir)/netware -lphp4lib $(MING_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ming) $(PHPMING_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpming.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ming"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpming.$suffix: $ext_builddir/phpming.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpming.$suffix \$(phplibdir)

$ext_builddir/phpming.$suffix: \$(shared_objects_ming) \$(PHPMING_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ming) $(MING_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ming) -L$(top_builddir)/netware -lphp4lib $(G_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ming) $(MING_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ming.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ming"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ming.$suffix: $ext_builddir/ming.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ming.$suffix \$(phplibdir)

$ext_builddir/ming.$suffix: \$(shared_objects_ming) \$(MING_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MING 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ming in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ming"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ming/"; ac_bdir="ext/ming/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ming.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ming"
    else


  case ext/ming in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ming"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ming/"; ac_bdir="ext/ming/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ming.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ming"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MING_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for mnoGoSearch support" >&5
echo $ECHO_N "checking for mnoGoSearch support... $ECHO_C" >&6

# Check whether --with-mnogosearch or --without-mnogosearch was given.
if test "${with_mnogosearch+set}" = set; then
  withval="$with_mnogosearch"
  PHP_MNOGOSEARCH=$withval
else

  PHP_MNOGOSEARCH=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MNOGOSEARCH=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MNOGOSEARCH in
shared,*)
  PHP_MNOGOSEARCH=`echo "$PHP_MNOGOSEARCH"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MNOGOSEARCH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




  if test "$PHP_MNOGOSEARCH" != "no"; then

    if test "$PHP_MNOGOSEARCH" = "yes"; then
      MNOGOSEARCH_BINDIR=/usr/local/mnogosearch/bin
      MNOGOSEARCH_INCDIR=/usr/local/mnogosearch/include
      MNOGOSEARCH_LIBDIR=/usr/local/mnogosearch/lib
    else
      MNOGOSEARCH_BINDIR=$PHP_MNOGOSEARCH/bin
      MNOGOSEARCH_INCDIR=$PHP_MNOGOSEARCH/include
      MNOGOSEARCH_LIBDIR=$PHP_MNOGOSEARCH/lib
    fi

    echo "$as_me:$LINENO: checking for mnoGoSearch version" >&5
echo $ECHO_N "checking for mnoGoSearch version... $ECHO_C" >&6

    if test -x "$MNOGOSEARCH_BINDIR/udm-config"; then
    	MNOGOSEARCH_VERSION=`$MNOGOSEARCH_BINDIR/udm-config --version`
    	MNOGOSEARCH_VERSION_ID=`$MNOGOSEARCH_BINDIR/udm-config --version-id`

	if test $? -ne 0; then
		echo "$as_me:$LINENO: result: <= 3.1.9" >&5
echo "${ECHO_T}<= 3.1.9" >&6
		{ { echo "$as_me:$LINENO: error: mnoGoSearch 3.1.10 at least required" >&5
echo "$as_me: error: mnoGoSearch 3.1.10 at least required" >&2;}
   { (exit 1); exit 1; }; }
	fi

	if test "$MNOGOSEARCH_VERSION_ID" -lt 30110; then
		echo "$as_me:$LINENO: result: <= 3.1.9" >&5
echo "${ECHO_T}<= 3.1.9" >&6
		{ { echo "$as_me:$LINENO: error: mnoGoSearch 3.1.10 at least required" >&5
echo "$as_me: error: mnoGoSearch 3.1.10 at least required" >&2;}
   { (exit 1); exit 1; }; }
	fi

	echo "$as_me:$LINENO: result: $MNOGOSEARCH_VERSION" >&5
echo "${ECHO_T}$MNOGOSEARCH_VERSION" >&6


  for ac_i in `$MNOGOSEARCH_BINDIR/udm-config --libs`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MNOGOSEARCH_SHARED_LIBADD="$MNOGOSEARCH_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MNOGOSEARCH_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MNOGOSEARCH_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

    else
	{ { echo "$as_me:$LINENO: error: udm-config script not found in $MNOGOSEARCH_BINDIR" >&5
echo "$as_me: error: udm-config script not found in $MNOGOSEARCH_BINDIR" >&2;}
   { (exit 1); exit 1; }; }
    fi


  if test "$MNOGOSEARCH_INCDIR" != "/usr/include"; then

  if test -z "$MNOGOSEARCH_INCDIR" || echo "$MNOGOSEARCH_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$MNOGOSEARCH_INCDIR
  else

    ep_dir="`echo $MNOGOSEARCH_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MNOGOSEARCH_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_MNOGOSEARCH 1
_ACEOF



  ext_builddir=ext/mnogosearch
  ext_srcdir=$abs_srcdir/ext/mnogosearch

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mnogosearch in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mnogosearch"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mnogosearch/"; ac_bdir="ext/mnogosearch/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mnogo.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mnogosearch"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mnogosearch"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mnogosearch in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mnogosearch"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mnogosearch/"; ac_bdir="ext/mnogosearch/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_mnogo.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mnogosearch="$shared_objects_mnogosearch $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) $(PHPMNOGOSEARCH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) -L$(top_builddir)/netware -lphp4lib $(MNOGOSEARCH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) $(PHPMNOGOSEARCH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmnogosearch.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mnogosearch"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmnogosearch.$suffix: $ext_builddir/phpmnogosearch.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmnogosearch.$suffix \$(phplibdir)

$ext_builddir/phpmnogosearch.$suffix: \$(shared_objects_mnogosearch) \$(PHPMNOGOSEARCH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) $(MNOGOSEARCH_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) -L$(top_builddir)/netware -lphp4lib $(GOSEARCH_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mnogosearch) $(MNOGOSEARCH_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mnogosearch.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mnogosearch"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mnogosearch.$suffix: $ext_builddir/mnogosearch.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mnogosearch.$suffix \$(phplibdir)

$ext_builddir/mnogosearch.$suffix: \$(shared_objects_mnogosearch) \$(MNOGOSEARCH_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MNOGOSEARCH 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mnogosearch in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mnogosearch"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mnogosearch/"; ac_bdir="ext/mnogosearch/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mnogo.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mnogosearch"
    else


  case ext/mnogosearch in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mnogosearch"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mnogosearch/"; ac_bdir="ext/mnogosearch/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mnogo.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mnogosearch"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MNOGOSEARCH_SHARED_LIBADD"


  fi




echo "$as_me:$LINENO: checking for msession support" >&5
echo $ECHO_N "checking for msession support... $ECHO_C" >&6

# Check whether --with-msession or --without-msession was given.
if test "${with_msession+set}" = set; then
  withval="$with_msession"
  PHP_MSESSION=$withval
else

  PHP_MSESSION=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MSESSION=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MSESSION in
shared,*)
  PHP_MSESSION=`echo "$PHP_MSESSION"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MSESSION=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_MSESSION" != "no"; then
	if test -r $PHP_MSESSION/lib/libphoenix.a; then
		PHOENIX_DIR=$PHP_MSESSION
	else
		echo "$as_me:$LINENO: checking for msession in default path" >&5
echo $ECHO_N "checking for msession in default path... $ECHO_C" >&6
		for i in /usr/local/phoenix /usr/local /usr; do
			if test -r $i/lib/libphoenix.a; then
				PHOENIX_DIR=$i
				echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
			fi
		done
	fi

	if test -z "$PHOENIX_DIR"; then
		echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
		{ { echo "$as_me:$LINENO: error: Please reinstall the Phoenix / msession distribution" >&5
echo "$as_me: error: Please reinstall the Phoenix / msession distribution" >&2;}
   { (exit 1); exit 1; }; }
	fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_MSESSION 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    PHOENIX_LIB="-lphoenix $PHOENIX_LIB"
    if test -n ""$PHOENIX_DIR/lib""; then

  if test ""$PHOENIX_DIR/lib"" != "/usr/lib"; then

  if test -z ""$PHOENIX_DIR/lib"" || echo ""$PHOENIX_DIR/lib"" | grep '^/' >/dev/null ; then
    ai_p="$PHOENIX_DIR/lib"
  else

    ep_dir="`echo "$PHOENIX_DIR/lib"|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$PHOENIX_DIR/lib"\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PHOENIX_LIB="$ld_runpath_switch$ai_p -L$ai_p $PHOENIX_LIB"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n ""$PHOENIX_DIR/lib""; then

  if test ""$PHOENIX_DIR/lib"" != "/usr/lib"; then

  if test -z ""$PHOENIX_DIR/lib"" || echo ""$PHOENIX_DIR/lib"" | grep '^/' >/dev/null ; then
    ai_p="$PHOENIX_DIR/lib"
  else

    ep_dir="`echo "$PHOENIX_DIR/lib"|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$PHOENIX_DIR/lib"\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case phoenix in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lphoenix $LIBS"
   ;;
  esac




  fi


	PHOENIX_INCLUDE="-I$PHOENIX_DIR"

  PHP_VAR_SUBST="$PHP_VAR_SUBST PHOENIX_LIB"



  ext_builddir=ext/msession
  ext_srcdir=$abs_srcdir/ext/msession

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/msession in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msession"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msession/"; ac_bdir="ext/msession/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in msession.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC msession"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC msession"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/msession in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msession"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msession/"; ac_bdir="ext/msession/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in msession.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_msession="$shared_objects_msession $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_msession) $(PHPMSESSION_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msession) -L$(top_builddir)/netware -lphp4lib $(MSESSION_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msession) $(PHPMSESSION_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmsession.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_msession"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmsession.$suffix: $ext_builddir/phpmsession.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmsession.$suffix \$(phplibdir)

$ext_builddir/phpmsession.$suffix: \$(shared_objects_msession) \$(PHPMSESSION_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_msession) $(MSESSION_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msession) -L$(top_builddir)/netware -lphp4lib $(SSION_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msession) $(MSESSION_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/msession.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_msession"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/msession.$suffix: $ext_builddir/msession.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/msession.$suffix \$(phplibdir)

$ext_builddir/msession.$suffix: \$(shared_objects_msession) \$(MSESSION_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MSESSION 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/msession in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msession"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msession/"; ac_bdir="ext/msession/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in msession.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC msession"
    else


  case ext/msession in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msession"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msession/"; ac_bdir="ext/msession/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in msession.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC msession"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi







echo "$as_me:$LINENO: checking for mSQL support" >&5
echo $ECHO_N "checking for mSQL support... $ECHO_C" >&6

# Check whether --with-msql or --without-msql was given.
if test "${with_msql+set}" = set; then
  withval="$with_msql"
  PHP_MSQL=$withval
else

  PHP_MSQL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MSQL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MSQL in
shared,*)
  PHP_MSQL=`echo "$PHP_MSQL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




  if test "$PHP_MSQL" != "no"; then
    if test "$PHP_MSQL" = "yes"; then
      MSQL_INCDIR=/usr/local/Hughes/include
      MSQL_LIBDIR=/usr/local/Hughes/lib
    else
      MSQL_INCDIR=$PHP_MSQL/include
      MSQL_LIBDIR=$PHP_MSQL/lib
    fi


  if test "$ext_shared" = "yes"; then
    MSQL_SHARED_LIBADD="-lmsql $MSQL_SHARED_LIBADD"
    if test -n "$MSQL_LIBDIR"; then

  if test "$MSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$MSQL_LIBDIR" || echo "$MSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSQL_LIBDIR
  else

    ep_dir="`echo $MSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSQL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MSQL_LIBDIR"; then

  if test "$MSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$MSQL_LIBDIR" || echo "$MSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSQL_LIBDIR
  else

    ep_dir="`echo $MSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSQL_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case msql in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmsql $LIBS"
   ;;
  esac




  fi



  if test "$MSQL_INCDIR" != "/usr/include"; then

  if test -z "$MSQL_INCDIR" || echo "$MSQL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSQL_INCDIR
  else

    ep_dir="`echo $MSQL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSQL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_MSQL 1
_ACEOF


  PHP_VAR_SUBST="$PHP_VAR_SUBST MSQL_SHARED_LIBADD"


  ext_builddir=ext/msql
  ext_srcdir=$abs_srcdir/ext/msql

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/msql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msql/"; ac_bdir="ext/msql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_msql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC msql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC msql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/msql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msql/"; ac_bdir="ext/msql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_msql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_msql="$shared_objects_msql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_msql) $(PHPMSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msql) -L$(top_builddir)/netware -lphp4lib $(MSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msql) $(PHPMSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmsql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_msql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmsql.$suffix: $ext_builddir/phpmsql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmsql.$suffix \$(phplibdir)

$ext_builddir/phpmsql.$suffix: \$(shared_objects_msql) \$(PHPMSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_msql) $(MSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msql) -L$(top_builddir)/netware -lphp4lib $(L_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_msql) $(MSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/msql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_msql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/msql.$suffix: $ext_builddir/msql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/msql.$suffix \$(phplibdir)

$ext_builddir/msql.$suffix: \$(shared_objects_msql) \$(MSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/msql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msql/"; ac_bdir="ext/msql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_msql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC msql"
    else


  case ext/msql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/msql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/msql/"; ac_bdir="ext/msql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_msql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC msql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  echo "$as_me:$LINENO: checking mSQL version" >&5
echo $ECHO_N "checking mSQL version... $ECHO_C" >&6
  ac_php_oldcppflags=$CPPFLAGS
  CPPFLAGS="$INCLUDES $CPPFLAGS"
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include "msql.h"
int
main ()
{
int i = IDX_TYPE
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then


cat >>confdefs.h <<\_ACEOF
#define MSQL1 0
_ACEOF

    MSQL_VERSION="2.0 or newer"

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5



cat >>confdefs.h <<\_ACEOF
#define MSQL1 1
_ACEOF

    MSQL_VERSION=1.0

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  CPPFLAGS=$ac_php_oldcppflags
  echo "$as_me:$LINENO: result: $MSQL_VERSION" >&5
echo "${ECHO_T}$MSQL_VERSION" >&6

  fi




echo "$as_me:$LINENO: checking for MSSQL support via FreeTDS" >&5
echo $ECHO_N "checking for MSSQL support via FreeTDS... $ECHO_C" >&6

# Check whether --with-mssql or --without-mssql was given.
if test "${with_mssql+set}" = set; then
  withval="$with_mssql"
  PHP_MSSQL=$withval
else

  PHP_MSSQL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MSSQL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MSSQL in
shared,*)
  PHP_MSSQL=`echo "$PHP_MSSQL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MSSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_MSSQL" != "no"; then

  FREETDS_INSTALLATION_DIR=""
  if test "$PHP_MSSQL" = "yes"; then

    for i in /usr/local /usr; do
      if test -f $i/include/tds.h; then
        FREETDS_INSTALLATION_DIR=$i
        break
      fi
    done

    if test -z "$FREETDS_INSTALLATION_DIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find FreeTDS in known installation directories" >&5
echo "$as_me: error: Cannot find FreeTDS in known installation directories" >&2;}
   { (exit 1); exit 1; }; }
    fi

  elif test "$PHP_MSSQL" != "no"; then

    if test -f $PHP_MSSQL/include/tds.h; then
      FREETDS_INSTALLATION_DIR=$PHP_MSSQL
    else
      { { echo "$as_me:$LINENO: error: Directory $PHP_MSSQL is not a FreeTDS installation directory" >&5
echo "$as_me: error: Directory $PHP_MSSQL is not a FreeTDS installation directory" >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi

  if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.so"; then
     { { echo "$as_me:$LINENO: error: Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.a|so" >&5
echo "$as_me: error: Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.a|so" >&2;}
   { (exit 1); exit 1; }; }
  fi

  MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
  MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR/lib


  if test "$MSSQL_INCDIR" != "/usr/include"; then

  if test -z "$MSSQL_INCDIR" || echo "$MSSQL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSSQL_INCDIR
  else

    ep_dir="`echo $MSSQL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSSQL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    MSSQL_SHARED_LIBADD="-lsybdb $MSSQL_SHARED_LIBADD"
    if test -n "$MSSQL_LIBDIR"; then

  if test "$MSSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$MSSQL_LIBDIR" || echo "$MSSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSSQL_LIBDIR
  else

    ep_dir="`echo $MSSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSSQL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MSSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MSSQL_LIBDIR"; then

  if test "$MSSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$MSSQL_LIBDIR" || echo "$MSSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MSSQL_LIBDIR
  else

    ep_dir="`echo $MSSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MSSQL_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sybdb in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsybdb $LIBS"
   ;;
  esac




  fi



  ext_builddir=ext/mssql
  ext_srcdir=$abs_srcdir/ext/mssql

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mssql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mssql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mssql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mssql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mssql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_mssql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mssql="$shared_objects_mssql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) -L$(top_builddir)/netware -lphp4lib $(MSSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(PHPMSSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmssql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mssql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmssql.$suffix: $ext_builddir/phpmssql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmssql.$suffix \$(phplibdir)

$ext_builddir/phpmssql.$suffix: \$(shared_objects_mssql) \$(PHPMSSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(MSSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) -L$(top_builddir)/netware -lphp4lib $(QL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mssql) $(MSSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mssql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mssql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mssql.$suffix: $ext_builddir/mssql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mssql.$suffix \$(phplibdir)

$ext_builddir/mssql.$suffix: \$(shared_objects_mssql) \$(MSSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MSSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mssql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mssql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mssql"
    else


  case ext/mssql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mssql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mssql/"; ac_bdir="ext/mssql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mssql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mssql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


  echo "$as_me:$LINENO: checking for dnet_addr in -ldnet_stub" >&5
echo $ECHO_N "checking for dnet_addr in -ldnet_stub... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_stub_dnet_addr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dnet_addr ();
int
main ()
{
dnet_addr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dnet_stub_dnet_addr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dnet_stub_dnet_addr=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_addr" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_addr" >&6
if test $ac_cv_lib_dnet_stub_dnet_addr = yes; then


  if test "$ext_shared" = "yes"; then
    MSSQL_SHARED_LIBADD="-ldnet_stub $MSSQL_SHARED_LIBADD"
    if test -n ""; then

  if test "" != "/usr/lib"; then

  if test -z "" || echo "" | grep '^/' >/dev/null ; then
    ai_p=
  else

    ep_dir="`echo |sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MSSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MSSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n ""; then

  if test "" != "/usr/lib"; then

  if test -z "" || echo "" | grep '^/' >/dev/null ; then
    ai_p=
  else

    ep_dir="`echo |sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case dnet_stub in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ldnet_stub $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBDNET_STUB 1
_ACEOF


fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_MSSQL 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_FREETDS 1
_ACEOF


  PHP_VAR_SUBST="$PHP_VAR_SUBST MSSQL_SHARED_LIBADD"

fi


# Local macros for automake & autoconf


















#---START: Used in for client configure



























echo "$as_me:$LINENO: checking for MySQL support" >&5
echo $ECHO_N "checking for MySQL support... $ECHO_C" >&6

# Check whether --with-mysql or --without-mysql was given.
if test "${with_mysql+set}" = set; then
  withval="$with_mysql"
  PHP_MYSQL=$withval
else

  PHP_MYSQL=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_MYSQL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_MYSQL in
shared,*)
  PHP_MYSQL=`echo "$PHP_MYSQL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_MYSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for specified location of the MySQL UNIX socket" >&5
echo $ECHO_N "checking for specified location of the MySQL UNIX socket... $ECHO_C" >&6

# Check whether --with-mysql-sock or --without-mysql-sock was given.
if test "${with_mysql_sock+set}" = set; then
  withval="$with_mysql_sock"
  PHP_MYSQL_SOCK=$withval
else

  PHP_MYSQL_SOCK=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_MYSQL_SOCK=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_MYSQL_SOCK
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test -z "$PHP_ZLIB_DIR"; then


echo "$as_me:$LINENO: checking for the location of libz" >&5
echo $ECHO_N "checking for the location of libz... $ECHO_C" >&6

# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
  withval="$with_zlib_dir"
  PHP_ZLIB_DIR=$withval
else

  PHP_ZLIB_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ZLIB_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ZLIB_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi


if test "$PHP_MYSQL" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_MYSQL 1
_ACEOF


  echo "$as_me:$LINENO: checking for MySQL UNIX socket location" >&5
echo $ECHO_N "checking for MySQL UNIX socket location... $ECHO_C" >&6
  if test "$PHP_MYSQL_SOCK" != "no" && test "$PHP_MYSQL_SOCK" != "yes"; then
    MYSQL_SOCK=$PHP_MYSQL_SOCK

cat >>confdefs.h <<_ACEOF
#define MYSQL_UNIX_ADDR "$MYSQL_SOCK"
_ACEOF

    echo "$as_me:$LINENO: result: $MYSQL_SOCK" >&5
echo "${ECHO_T}$MYSQL_SOCK" >&6
  elif test "$PHP_MYSQL" = "yes" || test "$PHP_MYSQL_SOCK" = "yes"; then

  for i in  \
    /var/run/mysqld/mysqld.sock \
    /var/tmp/mysql.sock \
    /var/run/mysql/mysql.sock \
    /var/lib/mysql/mysql.sock \
    /var/mysql/mysql.sock \
    /usr/local/mysql/var/mysql.sock \
    /Private/tmp/mysql.sock \
    /private/tmp/mysql.sock \
    /tmp/mysql.sock \
  ; do
    if test -r $i; then
      MYSQL_SOCK=$i
      break 2
    fi
  done

  if test -n "$MYSQL_SOCK"; then

cat >>confdefs.h <<_ACEOF
#define MYSQL_UNIX_ADDR "$MYSQL_SOCK"
_ACEOF

    echo "$as_me:$LINENO: result: $MYSQL_SOCK" >&5
echo "${ECHO_T}$MYSQL_SOCK" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi
fi

if test "$PHP_MYSQL" = "yes"; then
  MYSQL_MODULE_TYPE=builtin
  if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_RANLIB="ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  RANLIB=$ac_ct_RANLIB
else
  RANLIB="$ac_cv_prog_RANLIB"
fi

echo "$as_me:$LINENO: checking for inline" >&5
echo $ECHO_N "checking for inline... $ECHO_C" >&6
if test "${ac_cv_c_inline+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef __cplusplus
typedef int foo_t;
static $ac_kw foo_t static_foo () {return 0; }
$ac_kw foo_t foo () {return 0; }
#endif

_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_inline=$ac_kw; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done

fi
echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
echo "${ECHO_T}$ac_cv_c_inline" >&6


case $ac_cv_c_inline in
  inline | yes) ;;
  *)
    case $ac_cv_c_inline in
      no) ac_val=;;
      *) ac_val=$ac_cv_c_inline;;
    esac
    cat >>confdefs.h <<_ACEOF
#ifndef __cplusplus
#define inline $ac_val
#endif
_ACEOF
    ;;
esac


echo "$as_me:$LINENO: checking return type of signal handlers" >&5
echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
if test "${ac_cv_type_signal+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <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;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_signal=void
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_signal=int
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
echo "${ECHO_T}$ac_cv_type_signal" >&6

cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF









cat >>confdefs.h <<\_ACEOF
#define UNDEF_THREADS_HACK
_ACEOF



echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_stdc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_stdc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <string.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then
  :
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      exit(2);
  exit (0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then

cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF

fi
































for ac_header in sgtty.h sys/ioctl.h \
 fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
 memory.h pwd.h select.h \
 stdlib.h stddef.h \
 strings.h string.h synch.h sys/mman.h sys/socket.h \
 sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
 unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done






echo "$as_me:$LINENO: checking for char" >&5
echo $ECHO_N "checking for char... $ECHO_C" >&6
if test "${ac_cv_type_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((char *) 0)
  return 0;
if (sizeof (char))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_char=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_char=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
echo "${ECHO_T}$ac_cv_type_char" >&6

echo "$as_me:$LINENO: checking size of char" >&5
echo $ECHO_N "checking size of char... $ECHO_C" >&6
if test "${ac_cv_sizeof_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_char" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_char=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (char)); }
unsigned long ulongval () { return (long) (sizeof (char)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (char))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_char=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_char=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
echo "${ECHO_T}$ac_cv_sizeof_char" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
_ACEOF



echo "$as_me:$LINENO: checking for int" >&5
echo $ECHO_N "checking for int... $ECHO_C" >&6
if test "${ac_cv_type_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((int *) 0)
  return 0;
if (sizeof (int))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_int=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_int=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
echo "${ECHO_T}$ac_cv_type_int" >&6

echo "$as_me:$LINENO: checking size of int" >&5
echo $ECHO_N "checking size of int... $ECHO_C" >&6
if test "${ac_cv_sizeof_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_int" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (int)); }
unsigned long ulongval () { return (long) (sizeof (int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (int))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_int=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_int=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
echo "${ECHO_T}$ac_cv_sizeof_int" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


echo "$as_me:$LINENO: checking for long" >&5
echo $ECHO_N "checking for long... $ECHO_C" >&6
if test "${ac_cv_type_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long *) 0)
  return 0;
if (sizeof (long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
echo "${ECHO_T}$ac_cv_type_long" >&6

echo "$as_me:$LINENO: checking size of long" >&5
echo $ECHO_N "checking size of long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long)); }
unsigned long ulongval () { return (long) (sizeof (long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


echo "$as_me:$LINENO: checking for long long" >&5
echo $ECHO_N "checking for long long... $ECHO_C" >&6
if test "${ac_cv_type_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long long *) 0)
  return 0;
if (sizeof (long long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
echo "${ECHO_T}$ac_cv_type_long_long" >&6

echo "$as_me:$LINENO: checking size of long long" >&5
echo $ECHO_N "checking size of long long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long long)); }
unsigned long ulongval () { return (long) (sizeof (long long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
_ACEOF


echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_size_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6
if test $ac_cv_type_size_t = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned
_ACEOF

fi

echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>

int
main ()
{
if ((struct tm *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_time=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_time=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then

cat >>confdefs.h <<\_ACEOF
#define TIME_WITH_SYS_TIME 1
_ACEOF

fi

echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
if test "${ac_cv_type_uid_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "uid_t" >/dev/null 2>&1; then
  ac_cv_type_uid_t=yes
else
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi
echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
echo "${ECHO_T}$ac_cv_type_uid_t" >&6
if test $ac_cv_type_uid_t = no; then

cat >>confdefs.h <<\_ACEOF
#define uid_t int
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define gid_t int
_ACEOF

fi


echo "$as_me:$LINENO: checking for type ulong" >&5
echo $ECHO_N "checking for type ulong... $ECHO_C" >&6
if test "${ac_cv_ulong+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_ulong=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  ulong foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ulong=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_ulong=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_ulong" >&5
echo "${ECHO_T}$ac_cv_ulong" >&6
if test "$ac_cv_ulong" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ULONG
_ACEOF

fi

echo "$as_me:$LINENO: checking for type uchar" >&5
echo $ECHO_N "checking for type uchar... $ECHO_C" >&6
if test "${ac_cv_uchar+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uchar=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  uchar foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_uchar=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_uchar=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_uchar" >&5
echo "${ECHO_T}$ac_cv_uchar" >&6
if test "$ac_cv_uchar" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_UCHAR
_ACEOF

fi

echo "$as_me:$LINENO: checking for type uint" >&5
echo $ECHO_N "checking for type uint... $ECHO_C" >&6
if test "${ac_cv_uint+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uint=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  uint foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_uint=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_uint=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_uint" >&5
echo "${ECHO_T}$ac_cv_uint" >&6
if test "$ac_cv_uint" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_UINT
_ACEOF

fi

echo "$as_me:$LINENO: checking for type ushort" >&5
echo $ECHO_N "checking for type ushort... $ECHO_C" >&6
if test "${ac_cv_ushort+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_ushort=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  ushort foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ushort=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_ushort=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_ushort" >&5
echo "${ECHO_T}$ac_cv_ushort" >&6
if test "$ac_cv_ushort" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_USHORT
_ACEOF

fi

echo "$as_me:$LINENO: checking for int8" >&5
echo $ECHO_N "checking for int8... $ECHO_C" >&6
if test "${ac_cv_int8+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_int8=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

int main()
{
    int8 i;
    return 0;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_int8=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_int8=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_int8" >&5
echo "${ECHO_T}$ac_cv_int8" >&6
if test "$ac_cv_int8" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_INT_8_16_32
_ACEOF

fi


ac_save_CXXFLAGS="$CXXFLAGS"
echo "$as_me:$LINENO: checking base type of last arg to accept" >&5
echo $ECHO_N "checking base type of last arg to accept... $ECHO_C" >&6
if test "${mysql_cv_btype_last_arg_accept+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

if test "$ac_cv_cxx_compiler_gnu" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
mysql_cv_btype_last_arg_accept=none
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_btype_last_arg_accept=socklen_t
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $mysql_cv_btype_last_arg_accept = none; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
int a = accept(1, (struct sockaddr *) 0, (size_t *) 0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_btype_last_arg_accept=size_t
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $mysql_cv_btype_last_arg_accept = none; then
mysql_cv_btype_last_arg_accept=int
fi
fi
echo "$as_me:$LINENO: result: $mysql_cv_btype_last_arg_accept" >&5
echo "${ECHO_T}$mysql_cv_btype_last_arg_accept" >&6
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


cat >>confdefs.h <<_ACEOF
#define SOCKET_SIZE_TYPE $mysql_cv_btype_last_arg_accept
_ACEOF

CXXFLAGS="$ac_save_CXXFLAGS"

echo "$as_me:$LINENO: checking return type of qsort" >&5
echo $ECHO_N "checking return type of qsort... $ECHO_C" >&6
if test "${mysql_cv_type_qsort+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#ifdef __cplusplus
extern "C"
#endif
void qsort(void *base, size_t nel, size_t width,
 int (*compar) (const void *, const void *));

int
main ()
{
int i;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_type_qsort=void
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_type_qsort=int
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_type_qsort" >&5
echo "${ECHO_T}$mysql_cv_type_qsort" >&6

cat >>confdefs.h <<_ACEOF
#define RETQSORTTYPE $mysql_cv_type_qsort
_ACEOF

if test "$mysql_cv_type_qsort" = "void"
then

cat >>confdefs.h <<_ACEOF
#define QSORT_TYPE_IS_VOID 1
_ACEOF

fi






# Standard MySQL list







































































for ac_func in alarm bmove \
 chsize ftruncate rint finite fpsetmask fpresetsticky\
 cuserid fcntl fconvert  \
 getrusage getpwuid getcwd getrlimit getwd index locking longjmp \
 perror pread realpath rename \
 socket strnlen madvise \
 strtoll strtoul strtoull snprintf tempnam thr_setconcurrency \
 gethostbyaddr_r gethostbyname_r getpwnam \
 bfill bzero bcmp strstr strpbrk strerror\
 tell atod memcpy memmove \
 setupterm strcasecmp sighold \
 vidattr setupterm lrand48 localtime_r \
 sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
 pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
 pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
 pthread_condattr_create rwlock_init \
 crypt dlopen dlerror fchmod getpass getpassphrase
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done


# This is special for libmysql

for ac_func in strtok_r
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done



# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
ac_save_CXXFLAGS="$CXXFLAGS"
echo "$as_me:$LINENO: checking style of gethostname_r routines" >&5
echo $ECHO_N "checking style of gethostname_r routines... $ECHO_C" >&6
if test "${mysql_cv_gethostname_style+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

if test "$ac_cv_cxx_compiler_gnu" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#if !defined(SCO) && !defined(__osf__)
#define _REENTRANT
#endif
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
int
main ()
{
int skr;

 skr = gethostbyname_r((const char *) 0,
  (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_gethostname_style=glibc2
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_gethostname_style=other
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_gethostname_style" >&5
echo "${ECHO_T}$mysql_cv_gethostname_style" >&6
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_style" = "glibc2"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE
_ACEOF

fi

# Check 3rd argument of getthostbyname_r
ac_save_CXXFLAGS="$CXXFLAGS"
echo "$as_me:$LINENO: checking 3 argument to gethostname_r routines" >&5
echo $ECHO_N "checking 3 argument to gethostname_r routines... $ECHO_C" >&6
if test "${mysql_cv_gethostname_arg+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

if test "$ac_cv_cxx_compiler_gnu" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#if !defined(SCO) && !defined(__osf__)
#define _REENTRANT
#endif
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
int
main ()
{
int skr;

 skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (hostent_data*) 0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_gethostname_arg=hostent_data
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_gethostname_arg=char
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_gethostname_arg" >&5
echo "${ECHO_T}$mysql_cv_gethostname_arg" >&6
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_arg" = "hostent_data"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_RETURN_INT
_ACEOF

fi



  # Check definition of pthread_getspecific
  echo "$as_me:$LINENO: checking \"args to pthread_getspecific\"" >&5
echo $ECHO_N "checking \"args to pthread_getspecific\"... $ECHO_C" >&6
if test "${mysql_cv_getspecific_args+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS
#include <pthread.h>
int
main ()
{
 void *pthread_getspecific(pthread_key_t key);
pthread_getspecific((pthread_key_t) NULL);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_getspecific_args=POSIX
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_getspecific_args=other
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_getspecific_args" >&5
echo "${ECHO_T}$mysql_cv_getspecific_args" >&6
  if test "$mysql_cv_getspecific_args" = "other"
  then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
_ACEOF

  fi


  # Check definition of pthread_mutex_init
  echo "$as_me:$LINENO: checking \"args to pthread_mutex_init\"" >&5
echo $ECHO_N "checking \"args to pthread_mutex_init\"... $ECHO_C" >&6
if test "${mysql_cv_mutex_init_args+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS
#include <pthread.h>
int
main ()
{

  pthread_mutexattr_t attr;
  pthread_mutex_t mp;
  pthread_mutex_init(&mp,&attr);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_mutex_init_args=POSIX
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_mutex_init_args=other
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_mutex_init_args" >&5
echo "${ECHO_T}$mysql_cv_mutex_init_args" >&6
  if test "$mysql_cv_mutex_init_args" = "other"
  then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
_ACEOF

  fi


# Check definition of readdir_r
echo "$as_me:$LINENO: checking \"args to readdir_r\"" >&5
echo $ECHO_N "checking \"args to readdir_r\"... $ECHO_C" >&6
if test "${mysql_cv_readdir_r+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS
#include <pthread.h>
#include <dirent.h>
int
main ()
{
 int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_readdir_r=POSIX
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_readdir_r=other
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_readdir_r" >&5
echo "${ECHO_T}$mysql_cv_readdir_r" >&6
if test "$mysql_cv_readdir_r" = "POSIX"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_READDIR_R
_ACEOF

fi


# Check definition av posix sigwait()
echo "$as_me:$LINENO: checking \"style of sigwait\"" >&5
echo $ECHO_N "checking \"style of sigwait\"... $ECHO_C" >&6
if test "${mysql_cv_sigwait+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS
#include <pthread.h>
#include <signal.h>
int
main ()
{
#ifndef _AIX
sigset_t set;
int sig;
sigwait(&set,&sig);
#endif
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_sigwait=POSIX
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_sigwait=other
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_sigwait" >&5
echo "${ECHO_T}$mysql_cv_sigwait" >&6
if test "$mysql_cv_sigwait" = "POSIX"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SIGWAIT
_ACEOF

fi

if test "$mysql_cv_sigwait" != "POSIX"
then
unset mysql_cv_sigwait
# Check definition av posix sigwait()
echo "$as_me:$LINENO: checking \"style of sigwait\"" >&5
echo $ECHO_N "checking \"style of sigwait\"... $ECHO_C" >&6
if test "${mysql_cv_sigwait+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef SCO
#define _REENTRANT
#endif
#define _POSIX_PTHREAD_SEMANTICS
#include <pthread.h>
#include <signal.h>
int
main ()
{
sigset_t set;
int sig;
sigwait(&set);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_sigwait=NONPOSIX
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_sigwait=other
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_sigwait" >&5
echo "${ECHO_T}$mysql_cv_sigwait" >&6
if test "$mysql_cv_sigwait" = "NONPOSIX"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NONPOSIX_SIGWAIT
_ACEOF

fi
fi


  sources="libmysql/libmysql.c libmysql/errmsg.c libmysql/net.c libmysql/violite.c libmysql/password.c \
	libmysql/my_init.c libmysql/my_lib.c libmysql/my_static.c libmysql/my_malloc.c libmysql/my_realloc.c libmysql/my_create.c \
	libmysql/my_delete.c libmysql/my_tempnam.c libmysql/my_open.c libmysql/mf_casecnv.c libmysql/my_read.c \
	libmysql/my_write.c libmysql/errors.c libmysql/my_error.c libmysql/my_getwd.c libmysql/my_div.c libmysql/mf_pack.c \
	libmysql/my_messnc.c libmysql/mf_dirname.c libmysql/mf_fn_ext.c libmysql/mf_wcomp.c libmysql/typelib.c libmysql/safemalloc.c \
	libmysql/my_alloc.c libmysql/mf_format.c libmysql/mf_path.c libmysql/mf_unixpath.c libmysql/my_fopen.c libmysql/mf_loadpath.c \
	libmysql/my_pthread.c libmysql/my_thr_init.c libmysql/thr_mutex.c libmysql/mulalloc.c libmysql/string.c libmysql/default.c \
	libmysql/my_compress.c libmysql/array.c libmysql/my_once.c libmysql/list.c libmysql/my_net.c libmysql/dbug.c \
	libmysql/strmov.c libmysql/strxmov.c libmysql/strnmov.c libmysql/strmake.c libmysql/strend.c libmysql/strfill.c \
	libmysql/is_prefix.c libmysql/int2str.c libmysql/str2int.c libmysql/strinstr.c \
	libmysql/strcont.c libmysql/strcend.c libmysql/bchange.c libmysql/bmove.c libmysql/bmove_upp.c \
	libmysql/longlong2str.c libmysql/strtoull.c libmysql/strtoll.c libmysql/charset.c libmysql/ctype.c"


  ext_builddir=ext/mysql
  ext_srcdir=$abs_srcdir/ext/mysql

  ac_extra=`echo "-I@ext_srcdir@/libmysql"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mysql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mysql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mysql="$shared_objects_mysql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(PHPMYSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) -L$(top_builddir)/netware -lphp4lib $(MYSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(PHPMYSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmysql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmysql.$suffix: $ext_builddir/phpmysql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmysql.$suffix \$(phplibdir)

$ext_builddir/phpmysql.$suffix: \$(shared_objects_mysql) \$(PHPMYSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) -L$(top_builddir)/netware -lphp4lib $(QL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mysql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mysql.$suffix: $ext_builddir/mysql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mysql.$suffix \$(phplibdir)

$ext_builddir/mysql.$suffix: \$(shared_objects_mysql) \$(MYSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MYSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mysql"
    else


  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c $sources; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mysql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  BUILD_DIR="$BUILD_DIR $ext_builddir/libmysql"


elif test "$PHP_MYSQL" != "no"; then





echo "$as_me:$LINENO: checking for char" >&5
echo $ECHO_N "checking for char... $ECHO_C" >&6
if test "${ac_cv_type_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((char *) 0)
  return 0;
if (sizeof (char))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_char=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_char=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
echo "${ECHO_T}$ac_cv_type_char" >&6

echo "$as_me:$LINENO: checking size of char" >&5
echo $ECHO_N "checking size of char... $ECHO_C" >&6
if test "${ac_cv_sizeof_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_char" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_char=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (char)); }
unsigned long ulongval () { return (long) (sizeof (char)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (char))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_char=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_char=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
echo "${ECHO_T}$ac_cv_sizeof_char" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
_ACEOF



echo "$as_me:$LINENO: checking for int" >&5
echo $ECHO_N "checking for int... $ECHO_C" >&6
if test "${ac_cv_type_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((int *) 0)
  return 0;
if (sizeof (int))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_int=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_int=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
echo "${ECHO_T}$ac_cv_type_int" >&6

echo "$as_me:$LINENO: checking size of int" >&5
echo $ECHO_N "checking size of int... $ECHO_C" >&6
if test "${ac_cv_sizeof_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_int" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (int)); }
unsigned long ulongval () { return (long) (sizeof (int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (int))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_int=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_int=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
echo "${ECHO_T}$ac_cv_sizeof_int" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


echo "$as_me:$LINENO: checking for long" >&5
echo $ECHO_N "checking for long... $ECHO_C" >&6
if test "${ac_cv_type_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long *) 0)
  return 0;
if (sizeof (long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
echo "${ECHO_T}$ac_cv_type_long" >&6

echo "$as_me:$LINENO: checking size of long" >&5
echo $ECHO_N "checking size of long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long)); }
unsigned long ulongval () { return (long) (sizeof (long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


echo "$as_me:$LINENO: checking for long long" >&5
echo $ECHO_N "checking for long long... $ECHO_C" >&6
if test "${ac_cv_type_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long long *) 0)
  return 0;
if (sizeof (long long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
echo "${ECHO_T}$ac_cv_type_long_long" >&6

echo "$as_me:$LINENO: checking size of long long" >&5
echo $ECHO_N "checking size of long long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long long)); }
unsigned long ulongval () { return (long) (sizeof (long long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
_ACEOF


echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_size_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6
if test $ac_cv_type_size_t = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned
_ACEOF

fi

echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>

int
main ()
{
if ((struct tm *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_time=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_time=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then

cat >>confdefs.h <<\_ACEOF
#define TIME_WITH_SYS_TIME 1
_ACEOF

fi

echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
if test "${ac_cv_type_uid_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "uid_t" >/dev/null 2>&1; then
  ac_cv_type_uid_t=yes
else
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi
echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
echo "${ECHO_T}$ac_cv_type_uid_t" >&6
if test $ac_cv_type_uid_t = no; then

cat >>confdefs.h <<\_ACEOF
#define uid_t int
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define gid_t int
_ACEOF

fi


echo "$as_me:$LINENO: checking for type ulong" >&5
echo $ECHO_N "checking for type ulong... $ECHO_C" >&6
if test "${ac_cv_ulong+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_ulong=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  ulong foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ulong=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_ulong=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_ulong" >&5
echo "${ECHO_T}$ac_cv_ulong" >&6
if test "$ac_cv_ulong" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ULONG
_ACEOF

fi

echo "$as_me:$LINENO: checking for type uchar" >&5
echo $ECHO_N "checking for type uchar... $ECHO_C" >&6
if test "${ac_cv_uchar+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uchar=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  uchar foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_uchar=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_uchar=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_uchar" >&5
echo "${ECHO_T}$ac_cv_uchar" >&6
if test "$ac_cv_uchar" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_UCHAR
_ACEOF

fi

echo "$as_me:$LINENO: checking for type uint" >&5
echo $ECHO_N "checking for type uint... $ECHO_C" >&6
if test "${ac_cv_uint+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uint=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  uint foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_uint=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_uint=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_uint" >&5
echo "${ECHO_T}$ac_cv_uint" >&6
if test "$ac_cv_uint" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_UINT
_ACEOF

fi

echo "$as_me:$LINENO: checking for type ushort" >&5
echo $ECHO_N "checking for type ushort... $ECHO_C" >&6
if test "${ac_cv_ushort+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_ushort=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdio.h>
#include <sys/types.h>
main()
{
  ushort foo;
  foo++;
  exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_ushort=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_ushort=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_ushort" >&5
echo "${ECHO_T}$ac_cv_ushort" >&6
if test "$ac_cv_ushort" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_USHORT
_ACEOF

fi

echo "$as_me:$LINENO: checking for int8" >&5
echo $ECHO_N "checking for int8... $ECHO_C" >&6
if test "${ac_cv_int8+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_int8=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

int main()
{
    int8 i;
    return 0;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_int8=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_int8=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi

echo "$as_me:$LINENO: result: $ac_cv_int8" >&5
echo "${ECHO_T}$ac_cv_int8" >&6
if test "$ac_cv_int8" = "yes"
then

cat >>confdefs.h <<\_ACEOF
#define HAVE_INT_8_16_32
_ACEOF

fi


ac_save_CXXFLAGS="$CXXFLAGS"
echo "$as_me:$LINENO: checking base type of last arg to accept" >&5
echo $ECHO_N "checking base type of last arg to accept... $ECHO_C" >&6
if test "${mysql_cv_btype_last_arg_accept+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

if test "$ac_cv_cxx_compiler_gnu" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
mysql_cv_btype_last_arg_accept=none
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_btype_last_arg_accept=socklen_t
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
if test $mysql_cv_btype_last_arg_accept = none; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
int a = accept(1, (struct sockaddr *) 0, (size_t *) 0);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_btype_last_arg_accept=size_t
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $mysql_cv_btype_last_arg_accept = none; then
mysql_cv_btype_last_arg_accept=int
fi
fi
echo "$as_me:$LINENO: result: $mysql_cv_btype_last_arg_accept" >&5
echo "${ECHO_T}$mysql_cv_btype_last_arg_accept" >&6
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu


cat >>confdefs.h <<_ACEOF
#define SOCKET_SIZE_TYPE $mysql_cv_btype_last_arg_accept
_ACEOF

CXXFLAGS="$ac_save_CXXFLAGS"

echo "$as_me:$LINENO: checking return type of qsort" >&5
echo $ECHO_N "checking return type of qsort... $ECHO_C" >&6
if test "${mysql_cv_type_qsort+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#ifdef __cplusplus
extern "C"
#endif
void qsort(void *base, size_t nel, size_t width,
 int (*compar) (const void *, const void *));

int
main ()
{
int i;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  mysql_cv_type_qsort=void
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

mysql_cv_type_qsort=int
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $mysql_cv_type_qsort" >&5
echo "${ECHO_T}$mysql_cv_type_qsort" >&6

cat >>confdefs.h <<_ACEOF
#define RETQSORTTYPE $mysql_cv_type_qsort
_ACEOF

if test "$mysql_cv_type_qsort" = "void"
then

cat >>confdefs.h <<_ACEOF
#define QSORT_TYPE_IS_VOID 1
_ACEOF

fi






  ext_builddir=ext/mysql
  ext_srcdir=$abs_srcdir/ext/mysql

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC mysql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC mysql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_mysql="$shared_objects_mysql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(PHPMYSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) -L$(top_builddir)/netware -lphp4lib $(MYSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(PHPMYSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpmysql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpmysql.$suffix: $ext_builddir/phpmysql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpmysql.$suffix \$(phplibdir)

$ext_builddir/phpmysql.$suffix: \$(shared_objects_mysql) \$(PHPMYSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) -L$(top_builddir)/netware -lphp4lib $(QL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_mysql) $(MYSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/mysql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_mysql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/mysql.$suffix: $ext_builddir/mysql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/mysql.$suffix \$(phplibdir)

$ext_builddir/mysql.$suffix: \$(shared_objects_mysql) \$(MYSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_MYSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC mysql"
    else


  case ext/mysql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/mysql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/mysql/"; ac_bdir="ext/mysql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_mysql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC mysql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  for i in $PHP_MYSQL; do
    if test -r $i/include/mysql/mysql.h; then
      MYSQL_DIR=$i
      MYSQL_INC_DIR=$i/include/mysql
    elif test -r $i/include/mysql.h; then
      MYSQL_DIR=$i
      MYSQL_INC_DIR=$i/include
    fi
  done

  if test -z "$MYSQL_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find MySQL header files under $PHP_MYSQL" >&5
echo "$as_me: error: Cannot find MySQL header files under $PHP_MYSQL" >&2;}
   { (exit 1); exit 1; }; }
  fi

  MYSQL_MODULE_TYPE=external

  MY_LIBNAME=mysqlclient
  case $host_alias in
    *netware*)
      MY_LIBNAME=mysql
      ;;
  esac

  for i in lib lib/mysql; do

  str="$MYSQL_DIR/$i/lib$MY_LIBNAME.*"
  for j in `echo $str`; do
    if test -r $j; then
      MYSQL_LIB_DIR=$MYSQL_DIR/$i
      break 2
    fi
  done

  done

  if test -z "$MYSQL_LIB_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find lib$MY_LIBNAME library under $MYSQL_DIR" >&5
echo "$as_me: error: Cannot find lib$MY_LIBNAME library under $MYSQL_DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$MYSQL_LIB_DIR
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$MY_LIBNAME''_mysql_close" | $as_tr_sh`
echo "$as_me:$LINENO: checking for mysql_close in -l$MY_LIBNAME" >&5
echo $ECHO_N "checking for mysql_close in -l$MY_LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$MY_LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mysql_close ();
int
main ()
{
mysql_close ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$MY_LIBNAME_mysql_close

    if test "$PHP_ZLIB_DIR" != "no"; then


  if test "$ext_shared" = "yes"; then
    MYSQL_SHARED_LIBADD="-lz $MYSQL_SHARED_LIBADD"
    if test -n "$PHP_ZLIB_DIR"; then

  if test "$PHP_ZLIB_DIR" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR
  else

    ep_dir="`echo $PHP_ZLIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MYSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_ZLIB_DIR"; then

  if test "$PHP_ZLIB_DIR" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR" || echo "$PHP_ZLIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR
  else

    ep_dir="`echo $PHP_ZLIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac




  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$MY_LIBNAME''_mysql_error" | $as_tr_sh`
echo "$as_me:$LINENO: checking for mysql_error in -l$MY_LIBNAME" >&5
echo $ECHO_N "checking for mysql_error in -l$MY_LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$MY_LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mysql_error ();
int
main ()
{
mysql_error ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$MY_LIBNAME_mysql_error

        { { echo "$as_me:$LINENO: error: mysql configure failed. Please check config.log for more information." >&5
echo "$as_me: error: mysql configure failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

      MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -lz"
    else


  case z in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        MYSQL_SHARED_LIBADD="-lz $MYSQL_SHARED_LIBADD"
    else


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac


    fi
   ;;
  esac



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$MYSQL_LIB_DIR
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$MY_LIBNAME''_mysql_errno" | $as_tr_sh`
echo "$as_me:$LINENO: checking for mysql_errno in -l$MY_LIBNAME" >&5
echo $ECHO_N "checking for mysql_errno in -l$MY_LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$MY_LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mysql_errno ();
int
main ()
{
mysql_errno ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$MY_LIBNAME_mysql_errno

        { { echo "$as_me:$LINENO: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information." >&5
echo "$as_me: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

      MYSQL_LIBS="-lz"
    fi


fi




  if test "$ext_shared" = "yes"; then
    MYSQL_SHARED_LIBADD="-l$MY_LIBNAME $MYSQL_SHARED_LIBADD"
    if test -n "$MYSQL_LIB_DIR"; then

  if test "$MYSQL_LIB_DIR" != "/usr/lib"; then

  if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$MYSQL_LIB_DIR
  else

    ep_dir="`echo $MYSQL_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        MYSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $MYSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MYSQL_LIB_DIR"; then

  if test "$MYSQL_LIB_DIR" != "/usr/lib"; then

  if test -z "$MYSQL_LIB_DIR" || echo "$MYSQL_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$MYSQL_LIB_DIR
  else

    ep_dir="`echo $MYSQL_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MYSQL_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $MY_LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$MY_LIBNAME $LIBS"
   ;;
  esac




  fi


  MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MY_LIBNAME $MYSQL_LIBS"


  if test "$MYSQL_INC_DIR" != "/usr/include"; then

  if test -z "$MYSQL_INC_DIR" || echo "$MYSQL_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$MYSQL_INC_DIR
  else

    ep_dir="`echo $MYSQL_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MYSQL_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  MYSQL_INCLUDE=-I$MYSQL_INC_DIR

else
  MYSQL_MODULE_TYPE=none
fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_SHARED_LIBADD"



  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_MODULE_TYPE"





  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_LIBS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_INCLUDE"







echo "$as_me:$LINENO: checking for ncurses support" >&5
echo $ECHO_N "checking for ncurses support... $ECHO_C" >&6

# Check whether --with-ncurses or --without-ncurses was given.
if test "${with_ncurses+set}" = set; then
  withval="$with_ncurses"
  PHP_NCURSES=$withval
else

  PHP_NCURSES=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_NCURSES=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_NCURSES in
shared,*)
  PHP_NCURSES=`echo "$PHP_NCURSES"|sed 's/^shared,//'`
  ;;
shared)
  PHP_NCURSES=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_NCURSES" != "no"; then

   SEARCH_PATH="$PHP_NCURSES /usr/local /usr"

   for dir in $SEARCH_PATH; do
    for subdir in include/ncurses include; do
     if test -d $dir/$subdir; then
       if test -r $dir/$subdir/ncurses.h; then
         NCURSES_DIR=$dir
         NCURSES_INCDIR=$dir/$subdir

cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_H 1
_ACEOF

         break 2
       elif test -r $dir/$subdir/curses.h; then
         NCURSES_DIR=$dir
         NCURSES_INCDIR=$dir/$subdir
         break 2
       fi
     fi
    done
   done

   if test -z "$NCURSES_DIR"; then
     echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
     { { echo "$as_me:$LINENO: error: Please reinstall the ncurses distribution" >&5
echo "$as_me: error: Please reinstall the ncurses distribution" >&2;}
   { (exit 1); exit 1; }; }
   fi

   # --with-ncurses -> add include path

  if test "$NCURSES_INCDIR" != "/usr/include"; then

  if test -z "$NCURSES_INCDIR" || echo "$NCURSES_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_INCDIR
  else

    ep_dir="`echo $NCURSES_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


   # --with-ncurses -> chech for lib and symbol presence
   LIBNAME=ncurses
   LIBSYMBOL=initscr


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
     -L$NCURSES_DIR/lib -lm
   "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$LIBNAME''_$LIBSYMBOL" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $LIBSYMBOL in -l$LIBNAME" >&5
echo $ECHO_N "checking for $LIBSYMBOL in -l$LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $LIBSYMBOL ();
int
main ()
{
$LIBSYMBOL ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSESLIB 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    NCURSES_SHARED_LIBADD="-l$LIBNAME $NCURSES_SHARED_LIBADD"
    if test -n "$NCURSES_DIR/lib"; then

  if test "$NCURSES_DIR/lib" != "/usr/lib"; then

  if test -z "$NCURSES_DIR/lib" || echo "$NCURSES_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_DIR/lib
  else

    ep_dir="`echo $NCURSES_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        NCURSES_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $NCURSES_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$NCURSES_DIR/lib"; then

  if test "$NCURSES_DIR/lib" != "/usr/lib"; then

  if test -z "$NCURSES_DIR/lib" || echo "$NCURSES_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_DIR/lib
  else

    ep_dir="`echo $NCURSES_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$LIBNAME $LIBS"
   ;;
  esac




  fi




  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
       -L$NCURSES_DIR/lib -l$LIBNAME -lm
     "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for new_panel in -lpanel" >&5
echo $ECHO_N "checking for new_panel in -lpanel... $ECHO_C" >&6
if test "${ac_cv_lib_panel_new_panel+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpanel  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char new_panel ();
int
main ()
{
new_panel ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_panel_new_panel=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_panel_new_panel=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_panel_new_panel" >&5
echo "${ECHO_T}$ac_cv_lib_panel_new_panel" >&6
if test $ac_cv_lib_panel_new_panel = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_PANEL 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    NCURSES_SHARED_LIBADD="-lpanel $NCURSES_SHARED_LIBADD"
    if test -n "$NCURSES_DIR/lib"; then

  if test "$NCURSES_DIR/lib" != "/usr/lib"; then

  if test -z "$NCURSES_DIR/lib" || echo "$NCURSES_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_DIR/lib
  else

    ep_dir="`echo $NCURSES_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        NCURSES_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $NCURSES_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$NCURSES_DIR/lib"; then

  if test "$NCURSES_DIR/lib" != "/usr/lib"; then

  if test -z "$NCURSES_DIR/lib" || echo "$NCURSES_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_DIR/lib
  else

    ep_dir="`echo $NCURSES_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case panel in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpanel $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_panel_new_panel


fi



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$LIBNAME_$LIBSYMBOL

     { { echo "$as_me:$LINENO: error: Wrong ncurses lib version or lib not found" >&5
echo "$as_me: error: Wrong ncurses lib version or lib not found" >&2;}
   { (exit 1); exit 1; }; }


fi


   as_ac_Lib=`echo "ac_cv_lib_$LIBNAME''_color_set" | $as_tr_sh`
echo "$as_me:$LINENO: checking for color_set in -l$LIBNAME" >&5
echo $ECHO_N "checking for color_set in -l$LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char color_set ();
int
main ()
{
color_set ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_COLOR_SET 1
_ACEOF

fi

   as_ac_Lib=`echo "ac_cv_lib_$LIBNAME''_slk_color" | $as_tr_sh`
echo "$as_me:$LINENO: checking for slk_color in -l$LIBNAME" >&5
echo $ECHO_N "checking for slk_color in -l$LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char slk_color ();
int
main ()
{
slk_color ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_SLK_COLOR 1
_ACEOF

fi

   as_ac_Lib=`echo "ac_cv_lib_$LIBNAME''_assume_default_colors" | $as_tr_sh`
echo "$as_me:$LINENO: checking for assume_default_colors in -l$LIBNAME" >&5
echo $ECHO_N "checking for assume_default_colors in -l$LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char assume_default_colors ();
int
main ()
{
assume_default_colors ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_ASSUME_DEFAULT_COLORS 1
_ACEOF

fi

   as_ac_Lib=`echo "ac_cv_lib_$LIBNAME''_use_extended_names" | $as_tr_sh`
echo "$as_me:$LINENO: checking for use_extended_names in -l$LIBNAME" >&5
echo $ECHO_N "checking for use_extended_names in -l$LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char use_extended_names ();
int
main ()
{
use_extended_names ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NCURSES_USE_EXTENDED_NAMES 1
_ACEOF

fi



  ext_builddir=ext/ncurses
  ext_srcdir=$abs_srcdir/ext/ncurses

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then



  case ext/ncurses in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ncurses"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ncurses/"; ac_bdir="ext/ncurses/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ncurses.c ncurses_fe.c ncurses_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC ncurses"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC ncurses"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/ncurses in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ncurses"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ncurses/"; ac_bdir="ext/ncurses/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in ncurses.c ncurses_fe.c ncurses_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_ncurses="$shared_objects_ncurses $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ncurses) $(PHPNCURSES_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ncurses) -L$(top_builddir)/netware -lphp4lib $(NCURSES_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ncurses) $(PHPNCURSES_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpncurses.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ncurses"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpncurses.$suffix: $ext_builddir/phpncurses.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpncurses.$suffix \$(phplibdir)

$ext_builddir/phpncurses.$suffix: \$(shared_objects_ncurses) \$(PHPNCURSES_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_ncurses) $(NCURSES_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ncurses) -L$(top_builddir)/netware -lphp4lib $(RSES_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_ncurses) $(NCURSES_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/ncurses.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_ncurses"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/ncurses.$suffix: $ext_builddir/ncurses.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/ncurses.$suffix \$(phplibdir)

$ext_builddir/ncurses.$suffix: \$(shared_objects_ncurses) \$(NCURSES_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_NCURSES 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/ncurses in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ncurses"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ncurses/"; ac_bdir="ext/ncurses/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ncurses.c ncurses_fe.c ncurses_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC ncurses"
    else


  case ext/ncurses in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/ncurses"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/ncurses/"; ac_bdir="ext/ncurses/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in ncurses.c ncurses_fe.c ncurses_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC ncurses"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST NCURSES_SHARED_LIBADD"


fi










echo "$as_me:$LINENO: checking for Oracle (OCI8) support using ORACLE_HOME installation" >&5
echo $ECHO_N "checking for Oracle (OCI8) support using ORACLE_HOME installation... $ECHO_C" >&6

# Check whether --with-oci8 or --without-oci8 was given.
if test "${with_oci8+set}" = set; then
  withval="$with_oci8"
  PHP_OCI8=$withval
else

  PHP_OCI8=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_OCI8=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_OCI8 in
shared,*)
  PHP_OCI8=`echo "$PHP_OCI8"|sed 's/^shared,//'`
  ;;
shared)
  PHP_OCI8=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_OCI8" = "no"; then


echo "$as_me:$LINENO: checking for Oracle (OCI8) support using Oracle Instant Client" >&5
echo $ECHO_N "checking for Oracle (OCI8) support using Oracle Instant Client... $ECHO_C" >&6

# Check whether --with-oci8-instant-client or --without-oci8-instant-client was given.
if test "${with_oci8_instant_client+set}" = set; then
  withval="$with_oci8_instant_client"
  PHP_OCI8_INSTANT_CLIENT=$withval
else

  PHP_OCI8_INSTANT_CLIENT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_OCI8_INSTANT_CLIENT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_OCI8_INSTANT_CLIENT in
shared,*)
  PHP_OCI8_INSTANT_CLIENT=`echo "$PHP_OCI8_INSTANT_CLIENT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_OCI8_INSTANT_CLIENT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



else
  PHP_OCI8_INSTANT_CLIENT="no";
fi

if test "$PHP_OCI8" != "no"; then

  if test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then
    { { echo "$as_me:$LINENO: error: --with-oci8 and --with-oci8-instant-client are mutually exclusive" >&5
echo "$as_me: error: --with-oci8 and --with-oci8-instant-client are mutually exclusive" >&2;}
   { (exit 1); exit 1; }; }
  fi

  echo "$as_me:$LINENO: checking Oracle Install Directory" >&5
echo $ECHO_N "checking Oracle Install Directory... $ECHO_C" >&6
  if test "$PHP_OCI8" = "yes"; then
    OCI8_DIR=$ORACLE_HOME
  else
    OCI8_DIR=$PHP_OCI8
  fi
  echo "$as_me:$LINENO: result: $OCI8_DIR" >&5
echo "${ECHO_T}$OCI8_DIR" >&6

  if test -d "$OCI8_DIR/rdbms/public"; then

  if test "$OCI8_DIR/rdbms/public" != "/usr/include"; then

  if test -z "$OCI8_DIR/rdbms/public" || echo "$OCI8_DIR/rdbms/public" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/rdbms/public
  else

    ep_dir="`echo $OCI8_DIR/rdbms/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public"
  fi
  if test -d "$OCI8_DIR/rdbms/demo"; then

  if test "$OCI8_DIR/rdbms/demo" != "/usr/include"; then

  if test -z "$OCI8_DIR/rdbms/demo" || echo "$OCI8_DIR/rdbms/demo" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/rdbms/demo
  else

    ep_dir="`echo $OCI8_DIR/rdbms/demo|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/rdbms/demo\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo"
  fi
  if test -d "$OCI8_DIR/network/public"; then

  if test "$OCI8_DIR/network/public" != "/usr/include"; then

  if test -z "$OCI8_DIR/network/public" || echo "$OCI8_DIR/network/public" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/network/public
  else

    ep_dir="`echo $OCI8_DIR/network/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/network/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public"
  fi
  if test -d "$OCI8_DIR/plsql/public"; then

  if test "$OCI8_DIR/plsql/public" != "/usr/include"; then

  if test -z "$OCI8_DIR/plsql/public" || echo "$OCI8_DIR/plsql/public" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/plsql/public
  else

    ep_dir="`echo $OCI8_DIR/plsql/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/plsql/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public"
  fi

  if test -f "$OCI8_DIR/lib/sysliblist"; then

  for ac_i in `cat $OCI8_DIR/lib/sysliblist`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SYSLIB"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  elif test -f "$OCI8_DIR/rdbms/lib/sysliblist"; then

  for ac_i in `cat $OCI8_DIR/rdbms/lib/sysliblist`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SYSLIB"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  fi


  echo "$as_me:$LINENO: checking Oracle version" >&5
echo $ECHO_N "checking Oracle version... $ECHO_C" >&6
  if test -s "$OCI8_DIR/orainst/unix.rgs"; then
    OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/  */:/g' | cut -d: -f 6 | cut -c 2-4`
    test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
  elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
    OCI8_VERSION=10.1
  elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
    OCI8_VERSION=9.0
  elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
    OCI8_VERSION=8.1
  elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
    OCI8_VERSION=8.0
  elif test -f $OCI8_DIR/lib/libclntsh.a; then
    if test -f $OCI8_DIR/lib/libcore4.a; then
      OCI8_VERSION=8.0
    else
      OCI8_VERSION=8.1
    fi
  else
    { { echo "$as_me:$LINENO: error: Oracle (OCI8) required libraries not found" >&5
echo "$as_me: error: Oracle (OCI8) required libraries not found" >&2;}
   { (exit 1); exit 1; }; }
  fi
  echo "$as_me:$LINENO: result: $OCI8_VERSION" >&5
echo "${ECHO_T}$OCI8_VERSION" >&6

  case $OCI8_VERSION in
    8.0)


  if test "$ext_shared" = "yes"; then
    OCI8_SHARED_LIBADD="-lnlsrtl3 $OCI8_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    OCI8_SHARED_LIBADD="-lcore4 $OCI8_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core4 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore4 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    OCI8_SHARED_LIBADD="-lpsa $OCI8_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case psa in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpsa $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    OCI8_SHARED_LIBADD="-lclntsh $OCI8_SHARED_LIBADD"
    if test -n "$OCI8_DIR/lib"; then

  if test "$OCI8_DIR/lib" != "/usr/lib"; then

  if test -z "$OCI8_DIR/lib" || echo "$OCI8_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/lib
  else

    ep_dir="`echo $OCI8_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$OCI8_DIR/lib"; then

  if test "$OCI8_DIR/lib" != "/usr/lib"; then

  if test -z "$OCI8_DIR/lib" || echo "$OCI8_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/lib
  else

    ep_dir="`echo $OCI8_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclntsh $LIBS"
   ;;
  esac




  fi


      ;;

    8.1)


  case clntsh in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh"
    else


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lclntsh"
   ;;
  esac


    fi
   ;;
  esac



  if test "$OCI8_DIR/lib" != "/usr/lib"; then

  if test -z "$OCI8_DIR/lib" || echo "$OCI8_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/lib
  else

    ep_dir="`echo $OCI8_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi



  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=$OCI8_INCLUDES
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <oci.h>
#if defined(OCI_ATTR_STATEMENT)
    yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

    CPPFLAGS=$old_CPPFLAGS

cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_ATTR_STATEMENT 1
_ACEOF


else

    CPPFLAGS=$old_CPPFLAGS

fi
rm -f conftest*


      ;;

    9.0)


  case clntsh in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh"
    else


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lclntsh"
   ;;
  esac


    fi
   ;;
  esac



  if test "$OCI8_DIR/lib" != "/usr/lib"; then

  if test -z "$OCI8_DIR/lib" || echo "$OCI8_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/lib
  else

    ep_dir="`echo $OCI8_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_ATTR_STATEMENT 1
_ACEOF



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for OCIEnvNlsCreate in -lclntsh" >&5
echo $ECHO_N "checking for OCIEnvNlsCreate in -lclntsh... $ECHO_C" >&6
if test "${ac_cv_lib_clntsh_OCIEnvNlsCreate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lclntsh  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char OCIEnvNlsCreate ();
int
main ()
{
OCIEnvNlsCreate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_clntsh_OCIEnvNlsCreate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_clntsh_OCIEnvNlsCreate=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_clntsh_OCIEnvNlsCreate" >&5
echo "${ECHO_T}$ac_cv_lib_clntsh_OCIEnvNlsCreate" >&6
if test $ac_cv_lib_clntsh_OCIEnvNlsCreate = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for OCINlsCharSetNameToId in -lclntsh" >&5
echo $ECHO_N "checking for OCINlsCharSetNameToId in -lclntsh... $ECHO_C" >&6
if test "${ac_cv_lib_clntsh_OCINlsCharSetNameToId+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lclntsh  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char OCINlsCharSetNameToId ();
int
main ()
{
OCINlsCharSetNameToId ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_clntsh_OCINlsCharSetNameToId=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_clntsh_OCINlsCharSetNameToId=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_clntsh_OCINlsCharSetNameToId" >&5
echo "${ECHO_T}$ac_cv_lib_clntsh_OCINlsCharSetNameToId" >&6
if test $ac_cv_lib_clntsh_OCINlsCharSetNameToId = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI_9_2 1
_ACEOF

          OCI8_VERSION=9.2


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_clntsh_OCINlsCharSetNameToId


fi



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_clntsh_OCIEnvNlsCreate


fi

      ;;

    10.1)


  case clntsh in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh"
    else


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lclntsh"
   ;;
  esac


    fi
   ;;
  esac



  if test "$OCI8_DIR/lib" != "/usr/lib"; then

  if test -z "$OCI8_DIR/lib" || echo "$OCI8_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OCI8_DIR/lib
  else

    ep_dir="`echo $OCI8_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCI8_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_ATTR_STATEMENT 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI_9_2 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_TEMP_LOB 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define PHP_OCI8_HAVE_COLLECTIONS 1
_ACEOF

      ;;

    *)
      { { echo "$as_me:$LINENO: error: Unsupported Oracle version" >&5
echo "$as_me: error: Unsupported Oracle version" >&2;}
   { (exit 1); exit 1; }; }
      ;;
  esac


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for OCILobIsTemporary in -lclntsh" >&5
echo $ECHO_N "checking for OCILobIsTemporary in -lclntsh... $ECHO_C" >&6
if test "${ac_cv_lib_clntsh_OCILobIsTemporary+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lclntsh  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char OCILobIsTemporary ();
int
main ()
{
OCILobIsTemporary ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_clntsh_OCILobIsTemporary=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_clntsh_OCILobIsTemporary=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_clntsh_OCILobIsTemporary" >&5
echo "${ECHO_T}$ac_cv_lib_clntsh_OCILobIsTemporary" >&6
if test $ac_cv_lib_clntsh_OCILobIsTemporary = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_TEMP_LOB 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_clntsh_OCILobIsTemporary


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for OCILobIsTemporary in -locijdbc8" >&5
echo $ECHO_N "checking for OCILobIsTemporary in -locijdbc8... $ECHO_C" >&6
if test "${ac_cv_lib_ocijdbc8_OCILobIsTemporary+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-locijdbc8  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char OCILobIsTemporary ();
int
main ()
{
OCILobIsTemporary ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ocijdbc8_OCILobIsTemporary=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ocijdbc8_OCILobIsTemporary=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ocijdbc8_OCILobIsTemporary" >&5
echo "${ECHO_T}$ac_cv_lib_ocijdbc8_OCILobIsTemporary" >&6
if test $ac_cv_lib_ocijdbc8_OCILobIsTemporary = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case ocijdbc8 in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -locijdbc8"
    else


  case ocijdbc8 in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -locijdbc8"
   ;;
  esac


    fi
   ;;
  esac



cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_TEMP_LOB 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ocijdbc8_OCILobIsTemporary


fi



fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for OCICollAssign in -lclntsh" >&5
echo $ECHO_N "checking for OCICollAssign in -lclntsh... $ECHO_C" >&6
if test "${ac_cv_lib_clntsh_OCICollAssign+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lclntsh  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char OCICollAssign ();
int
main ()
{
OCICollAssign ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_clntsh_OCICollAssign=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_clntsh_OCICollAssign=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_clntsh_OCICollAssign" >&5
echo "${ECHO_T}$ac_cv_lib_clntsh_OCICollAssign" >&6
if test $ac_cv_lib_clntsh_OCICollAssign = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define PHP_OCI8_HAVE_COLLECTIONS 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_clntsh_OCICollAssign


fi




  ext_builddir=ext/oci8
  ext_srcdir=$abs_srcdir/ext/oci8

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC oci8"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC oci8"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp4lib $(OCI8_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpoci8.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpoci8.$suffix: $ext_builddir/phpoci8.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpoci8.$suffix \$(phplibdir)

$ext_builddir/phpoci8.$suffix: \$(shared_objects_oci8) \$(PHPOCI8_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(OCI8_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp4lib $(8_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(OCI8_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/oci8.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/oci8.$suffix: $ext_builddir/oci8.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/oci8.$suffix \$(phplibdir)

$ext_builddir/oci8.$suffix: \$(shared_objects_oci8) \$(OCI8_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_OCI8 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC oci8"
    else


  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC oci8"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8 1
_ACEOF




  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD"





  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR"





  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_VERSION"




elif test "$PHP_OCI8_INSTANT_CLIENT" != "no"; then

  echo "$as_me:$LINENO: checking Oracle Instant Client directory" >&5
echo $ECHO_N "checking Oracle Instant Client directory... $ECHO_C" >&6
  if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then
    PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client/lib  2> /dev/null | tail -1`
    if test -z "$PHP_OCI8_INSTANT_CLIENT"; then
      { { echo "$as_me:$LINENO: error: Oracle Instant Client directory not found. Try --with-oci8-instant-client=DIR" >&5
echo "$as_me: error: Oracle Instant Client directory not found. Try --with-oci8-instant-client=DIR" >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi
  echo "$as_me:$LINENO: result: $PHP_OCI8_INSTANT_CLIENT" >&5
echo "${ECHO_T}$PHP_OCI8_INSTANT_CLIENT" >&6

  OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT

  echo "$as_me:$LINENO: checking Oracle Instant Client SDK header directory" >&5
echo $ECHO_N "checking Oracle Instant Client SDK header directory... $ECHO_C" >&6

  OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | sed -e 's!^/usr/lib/oracle/\(.*\)/client/lib[/]*$!/usr/include/oracle/\1/client!'`

  OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include

  if test -f "$OCISDKRPMINC/oci.h"; then
    echo "$as_me:$LINENO: result: $OCISDKRPMINC" >&5
echo "${ECHO_T}$OCISDKRPMINC" >&6

  if test "$OCISDKRPMINC" != "/usr/include"; then

  if test -z "$OCISDKRPMINC" || echo "$OCISDKRPMINC" | grep '^/' >/dev/null ; then
    ai_p=$OCISDKRPMINC
  else

    ep_dir="`echo $OCISDKRPMINC|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCISDKRPMINC\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8INCDIR=$OCISDKRPMINC
  elif test -f "$OCISDKZIPINC/oci.h"; then
    echo "$as_me:$LINENO: result: $OCISDKZIPINC" >&5
echo "${ECHO_T}$OCISDKZIPINC" >&6

  if test "$OCISDKZIPINC" != "/usr/include"; then

  if test -z "$OCISDKZIPINC" || echo "$OCISDKZIPINC" | grep '^/' >/dev/null ; then
    ai_p=$OCISDKZIPINC
  else

    ep_dir="`echo $OCISDKZIPINC|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OCISDKZIPINC\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    OCI8INCDIR=$OCISDKZIPINC
  else
    { { echo "$as_me:$LINENO: error: Oracle Instant Client SDK header files not found" >&5
echo "$as_me: error: Oracle Instant Client SDK header files not found" >&2;}
   { (exit 1); exit 1; }; }
  fi

  OCISYSLIBLIST=`echo "$OCI8INCDIR" | sed -e 's!\(.*\)/include$!\1/demo/sysliblist!'`
  if test -f "$OCISYSLIBLIST"; then

  for ac_i in `cat $OCISYSLIBLIST`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$OCI8_SYSLIB -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SYSLIB="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SYSLIB"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  fi


  echo "$as_me:$LINENO: checking Oracle Instant Client version" >&5
echo $ECHO_N "checking Oracle Instant Client version... $ECHO_C" >&6
  if test -f $PHP_OCI8_INSTANT_CLIENT/libnnz10.$SHLIB_SUFFIX_NAME; then
    if test -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
      if test ! -f $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME; then
        { { echo "$as_me:$LINENO: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found" >&5
echo "$as_me: error: Link from $PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME to libclntsh.$SHLIB_SUFFIX_NAME.10.1 not found" >&2;}
   { (exit 1); exit 1; }; }
      fi
      OCI8_VERSION=10.1
    else
      { { echo "$as_me:$LINENO: error: Oracle Instant Client library version not supported" >&5
echo "$as_me: error: Oracle Instant Client library version not supported" >&2;}
   { (exit 1); exit 1; }; }
    fi
  else
    { { echo "$as_me:$LINENO: error: Oracle Instant Client libraries not found" >&5
echo "$as_me: error: Oracle Instant Client libraries not found" >&2;}
   { (exit 1); exit 1; }; }
  fi
  echo "$as_me:$LINENO: result: $OCI8_VERSION" >&5
echo "${ECHO_T}$OCI8_VERSION" >&6

  case $OCI8_VERSION in
    10.1)


  case clntsh in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$OCI8_SHARED_LIBADD -lclntsh"
    else


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lclntsh"
   ;;
  esac


    fi
   ;;
  esac



  if test "$PHP_OCI8_INSTANT_CLIENT" != "/usr/lib"; then

  if test -z "$PHP_OCI8_INSTANT_CLIENT" || echo "$PHP_OCI8_INSTANT_CLIENT" | grep '^/' >/dev/null ; then
    ai_p=$PHP_OCI8_INSTANT_CLIENT
  else

    ep_dir="`echo $PHP_OCI8_INSTANT_CLIENT|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_OCI8_INSTANT_CLIENT\"`"
  fi


      if test "$ext_shared" = "yes"; then
        OCI8_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $OCI8_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

      ;;

    *)
      { { echo "$as_me:$LINENO: error: Unsupported Oracle Instant Client version" >&5
echo "$as_me: error: Unsupported Oracle Instant Client version" >&2;}
   { (exit 1); exit 1; }; }
      ;;
  esac


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_ATTR_STATEMENT 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI_9_2 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8_TEMP_LOB 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define PHP_OCI8_HAVE_COLLECTIONS 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI_INSTANT_CLIENT 1
_ACEOF



  ext_builddir=ext/oci8
  ext_srcdir=$abs_srcdir/ext/oci8

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC oci8"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC oci8"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_oci8="$shared_objects_oci8 $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp4lib $(OCI8_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(PHPOCI8_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpoci8.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpoci8.$suffix: $ext_builddir/phpoci8.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpoci8.$suffix \$(phplibdir)

$ext_builddir/phpoci8.$suffix: \$(shared_objects_oci8) \$(PHPOCI8_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(OCI8_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) -L$(top_builddir)/netware -lphp4lib $(8_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oci8) $(OCI8_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/oci8.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oci8"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/oci8.$suffix: $ext_builddir/oci8.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/oci8.$suffix \$(phplibdir)

$ext_builddir/oci8.$suffix: \$(shared_objects_oci8) \$(OCI8_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_OCI8 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC oci8"
    else


  case ext/oci8 in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oci8"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oci8/"; ac_bdir="ext/oci8/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oci8.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC oci8"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



cat >>confdefs.h <<\_ACEOF
#define HAVE_OCI8 1
_ACEOF




  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_SHARED_LIBADD"





  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_DIR"





  PHP_VAR_SUBST="$PHP_VAR_SUBST OCI8_VERSION"




fi









if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Adabas support" >&5
echo $ECHO_N "checking for Adabas support... $ECHO_C" >&6

# Check whether --with-adabas or --without-adabas was given.
if test "${with_adabas+set}" = set; then
  withval="$with_adabas"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local
  fi
  if test "$withval" != "no"; then

  if test "$withval/incl" != "/usr/include"; then

  if test -z "$withval/incl" || echo "$withval/incl" | grep '^/' >/dev/null ; then
    ai_p=$withval/incl
  else

    ep_dir="`echo $withval/incl|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/incl\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$withval/lib" != "/usr/lib"; then

  if test -z "$withval/lib" || echo "$withval/lib" | grep '^/' >/dev/null ; then
    ai_p=$withval/lib
  else

    ep_dir="`echo $withval/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

    ODBC_OBJS="$withval/lib/odbclib.a"
    ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a"
    $srcdir/build/shtool mkdir -f -p ext/odbc
    rm -f "$ODBC_LIB"
    cp "$ODBC_OBJS" "$ODBC_LIB"


  case sqlptc in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlptc $LIBS"
   ;;
  esac




  case sqlrte in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlrte $LIBS"
   ;;
  esac




  if test -n "$abs_builddir/ext/odbc"; then

  if test "$abs_builddir/ext/odbc" != "/usr/lib"; then

  if test -z "$abs_builddir/ext/odbc" || echo "$abs_builddir/ext/odbc" | grep '^/' >/dev/null ; then
    ai_p=$abs_builddir/ext/odbc
  else

    ep_dir="`echo $abs_builddir/ext/odbc|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$abs_builddir/ext/odbc\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case odbc_adabas in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lodbc_adabas $LIBS"
   ;;
  esac




    ODBC_TYPE=adabas

cat >>confdefs.h <<\_ACEOF
#define HAVE_ADABAS 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for SAP DB support" >&5
echo $ECHO_N "checking for SAP DB support... $ECHO_C" >&6

# Check whether --with-sapdb or --without-sapdb was given.
if test "${with_sapdb+set}" = set; then
  withval="$with_sapdb"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local
  fi
  if test "$withval" != "no"; then

  if test "$withval/incl" != "/usr/include"; then

  if test -z "$withval/incl" || echo "$withval/incl" | grep '^/' >/dev/null ; then
    ai_p=$withval/incl
  else

    ep_dir="`echo $withval/incl|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/incl\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  if test "$withval/lib" != "/usr/lib"; then

  if test -z "$withval/lib" || echo "$withval/lib" | grep '^/' >/dev/null ; then
    ai_p=$withval/lib
  else

    ep_dir="`echo $withval/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi



  case sqlod in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlod $LIBS"
   ;;
  esac


    ODBC_TYPE=sapdb

cat >>confdefs.h <<\_ACEOF
#define HAVE_SAPDB 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi


if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Solid support" >&5
echo $ECHO_N "checking for Solid support... $ECHO_C" >&6

# Check whether --with-solid or --without-solid was given.
if test "${with_solid+set}" = set; then
  withval="$with_solid"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local/solid
  fi
  if test "$withval" != "no"; then
    ODBC_INCDIR=$withval/include
    ODBC_LIBDIR=$withval/lib
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_TYPE=solid
    if test -f $ODBC_LIBDIR/soc*35.a; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SOLID_35 1
_ACEOF

    elif test -f $ODBC_LIBDIR/scl*30.a; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SOLID_30 1
_ACEOF

    elif test -f $ODBC_LIBDIR/scl*23.a; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SOLID 1
_ACEOF

    fi
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  echo "$as_me:$LINENO: checking Solid library file" >&5
echo $ECHO_N "checking Solid library file... $ECHO_C" >&6
  ac_solid_uname_r=`uname -r 2>/dev/null`
  ac_solid_uname_s=`uname -s 2>/dev/null`
  case $ac_solid_uname_s in
    AIX) ac_solid_os=a3x;;   # a4x for AIX4/ Solid 2.3/3.0 only
    HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10
    IRIX) ac_solid_os=irx;;  # Solid 2.3(?)/ 3.0 only
    Linux)
      if ldd -v /bin/sh | grep GLIBC > /dev/null; then

cat >>confdefs.h <<\_ACEOF
#define SS_LINUX 1
_ACEOF

        ac_solid_os=l2x
	  else

cat >>confdefs.h <<\_ACEOF
#define SS_LINUX 1
_ACEOF

        ac_solid_os=lux
      fi;;
    SunOS)
      ac_solid_os=ssx;; # should we deal with SunOS 4?
    FreeBSD)
      if test `expr $ac_solid_uname_r : '\(.\)'` -gt "2"; then

cat >>confdefs.h <<\_ACEOF
#define SS_FBX 1
_ACEOF

        ac_solid_os=fex
      else

cat >>confdefs.h <<\_ACEOF
#define SS_FBX 1
_ACEOF

        ac_solid_os=fbx
      fi;;
  esac

  if test -f $ODBC_LIBDIR/soc${ac_solid_os}35.a; then
    ac_solid_version=35
    ac_solid_prefix=soc
  elif test -f $ODBC_LIBDIR/scl${ac_solid_os}30.a; then
    ac_solid_version=30
    ac_solid_prefix=scl
  elif test -f $ODBC_LIBDIR/scl${ac_solid_os}23.a; then
    ac_solid_version=23
    ac_solid_prefix=scl
  fi

#
# Check for the library files, and setup the ODBC_LIBS path...
#
if test ! -f $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \
	! -f $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
  #
  # we have an error and should bail out, as we can't find the libs!
  #
  echo ""
  echo "*********************************************************************"
  echo "* Unable to locate $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
  echo "* Please correct this by creating the following links and reconfiguring:"
  echo "* $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
  echo "* $ODBC_LIBDIR/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so"
  echo "*********************************************************************"
else
  ODBC_LFLAGS=-L$ODBC_LIBDIR
  ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version}
fi

  echo "$as_me:$LINENO: result: \`echo $ODBC_LIBS | sed -e 's!.*/!!'\`" >&5
echo "${ECHO_T}\`echo $ODBC_LIBS | sed -e 's!.*/!!'\`" >&6

  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for IBM DB2 support" >&5
echo $ECHO_N "checking for IBM DB2 support... $ECHO_C" >&6

# Check whether --with-ibm-db2 or --without-ibm-db2 was given.
if test "${with_ibm_db2+set}" = set; then
  withval="$with_ibm_db2"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
      ODBC_INCDIR=/home/db2inst1/sqllib/include
      ODBC_LIBDIR=/home/db2inst1/sqllib/lib
    else
      ODBC_INCDIR=$withval/include
      ODBC_LIBDIR=$withval/lib
    fi

    if ! test -f "$ODBC_INCDIR/sqlcli1.h"; then
      { { echo "$as_me:$LINENO: error: IBM DB2 header files not found" >&5
echo "$as_me: error: IBM DB2 header files not found" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if ! test -f "$ODBC_LIBDIR/libdb2.so"; then
      { { echo "$as_me:$LINENO: error: IBM DB2 required libraries not found" >&5
echo "$as_me: error: IBM DB2 required libraries not found" >&2;}
   { (exit 1); exit 1; }; }
    fi

    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_TYPE=db2
    ODBC_LIBS=-ldb2

cat >>confdefs.h <<\_ACEOF
#define HAVE_IBMDB2 1
_ACEOF


    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Empress support" >&5
echo $ECHO_N "checking for Empress support... $ECHO_C" >&6

# Check whether --with-empress or --without-empress was given.
if test "${with_empress+set}" = set; then
  withval="$with_empress"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
      ODBC_INCDIR=$EMPRESSPATH/include/odbc
      ODBC_LIBDIR=$EMPRESSPATH/shlib
    else
      ODBC_INCDIR=$withval/include/odbc
      ODBC_LIBDIR=$withval/shlib
    fi
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_TYPE=empress

cat >>confdefs.h <<\_ACEOF
#define HAVE_EMPRESS 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  echo "$as_me:$LINENO: checking Empress library file" >&5
echo $ECHO_N "checking Empress library file... $ECHO_C" >&6
  ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1`
  if test ! -f $ODBC_LIBS; then
    ODBC_LIBS=`echo $ODBC_LIBDIR/libempodbccl.so | cut -d' ' -f1`
  fi
  echo "$as_me:$LINENO: result: \`echo $ODBC_LIBS | sed -e 's!.*/!!'\`" >&5
echo "${ECHO_T}\`echo $ODBC_LIBS | sed -e 's!.*/!!'\`" >&6

  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Empress local access support" >&5
echo $ECHO_N "checking for Empress local access support... $ECHO_C" >&6

# Check whether --with-empress-bcs or --without-empress-bcs was given.
if test "${with_empress_bcs+set}" = set; then
  withval="$with_empress_bcs"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
      ODBC_INCDIR=$EMPRESSPATH/include/odbc
      ODBC_LIBDIR=$EMPRESSPATH/shlib
    else
      ODBC_INCDIR=$withval/include/odbc
      ODBC_LIBDIR=$withval/shlib
    fi
    CC="empocc -bcs";export CC;
    LD="empocc -bcs";export LD;
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    LIST=`empocc -listlines -bcs -o a a.c`

    NEWLIST=
    for I in $LIST
    do
        case $I in
          $EMPRESSPATH/odbccl/lib/* | \
          $EMPRESSPATH/rdbms/lib/* | \
          $EMPRESSPATH/common/lib/*)
                NEWLIST="$NEWLIST $I"
                ;;
        esac
    done
    ODBC_LIBS="-lempphpbcs -lms -lmscfg -lbasic -lbasic_os -lnlscstab -lnlsmsgtab -lm -ldl -lcrypt"
    ODBC_TYPE=empress

cat >>confdefs.h <<\_ACEOF
#define HAVE_EMPRESS 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

  echo "$as_me:$LINENO: checking Empress local access library file" >&5
echo $ECHO_N "checking Empress local access library file... $ECHO_C" >&6
  ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1`
  if test ! -f $ODBCBCS_LIBS; then
    ODBCBCS_LIBS=`echo $ODBC_LIBDIR/libempodbcbcs.a | cut -d' ' -f1`
  fi
  echo "$as_me:$LINENO: result: \`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'\`" >&5
echo "${ECHO_T}\`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'\`" >&6

  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Birdstep support" >&5
echo $ECHO_N "checking for Birdstep support... $ECHO_C" >&6

# Check whether --with-birdstep or --without-birdstep was given.
if test "${with_birdstep+set}" = set; then
  withval="$with_birdstep"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output


  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
        ODBC_INCDIR=/usr/local/birdstep/include
        ODBC_LIBDIR=/usr/local/birdstep/lib
    else
        ODBC_INCDIR=$withval/include
        ODBC_LIBDIR=$withval/lib
    fi

    case $host_alias in
      *aix*)

cat >>confdefs.h <<\_ACEOF
#define AIX 1
_ACEOF
;;
      *hpux*)

cat >>confdefs.h <<\_ACEOF
#define HPUX 1
_ACEOF
;;
      *linux*)

cat >>confdefs.h <<\_ACEOF
#define LINUX 1
_ACEOF
;;
      *qnx*)

cat >>confdefs.h <<\_ACEOF
#define NEUTRINO 1
_ACEOF
;;
      i?86-*-solaris*)

cat >>confdefs.h <<\_ACEOF
#define ISOLARIS 1
_ACEOF
;;
      sparc-*-solaris*)

cat >>confdefs.h <<\_ACEOF
#define SOLARIS 1
_ACEOF
;;
      *unixware*)

cat >>confdefs.h <<\_ACEOF
#define UNIXWARE 1
_ACEOF
;;
    esac

    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_TYPE=birdstep
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"

    if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then
      ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil"
    elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then
      ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil"
    fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_BIRDSTEP 1
_ACEOF


    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for a custom ODBC support" >&5
echo $ECHO_N "checking for a custom ODBC support... $ECHO_C" >&6

# Check whether --with-custom-odbc or --without-custom-odbc was given.
if test "${with_custom_odbc+set}" = set; then
  withval="$with_custom_odbc"

  if test "$withval" = "yes"; then
    withval=/usr/local
  fi
  if test "$withval" != "no"; then
    ODBC_INCDIR=$withval/include
    ODBC_LIBDIR=$withval/lib
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LIBS=$CUSTOM_ODBC_LIBS
    ODBC_TYPE=custom

cat >>confdefs.h <<\_ACEOF
#define HAVE_CODBC 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for iODBC support" >&5
echo $ECHO_N "checking for iODBC support... $ECHO_C" >&6

# Check whether --with-iodbc or --without-iodbc was given.
if test "${with_iodbc+set}" = set; then
  withval="$with_iodbc"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local
  fi
  if test "$withval" != "no"; then


  if test -n "$withval/lib"; then

  if test "$withval/lib" != "/usr/lib"; then

  if test -z "$withval/lib" || echo "$withval/lib" | grep '^/' >/dev/null ; then
    ai_p=$withval/lib
  else

    ep_dir="`echo $withval/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case iodbc in
  c|c_r|pthread*) ;;
  *)
      LIBS="-liodbc $LIBS"
   ;;
  esac





  if test "$withval/include" != "/usr/include"; then

  if test -z "$withval/include" || echo "$withval/include" | grep '^/' >/dev/null ; then
    ai_p=$withval/include
  else

    ep_dir="`echo $withval/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test "1"; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ODBC_TYPE=iodbc
    ODBC_INCLUDE=-I$withval/include
    ODBC_LFLAGS=-L$withval/lib
    ODBC_LIBS=-liodbc

cat >>confdefs.h <<\_ACEOF
#define HAVE_IODBC 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HAVE_ODBC2 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for Easysoft ODBC-ODBC Bridge support" >&5
echo $ECHO_N "checking for Easysoft ODBC-ODBC Bridge support... $ECHO_C" >&6

# Check whether --with-esoob or --without-esoob was given.
if test "${with_esoob+set}" = set; then
  withval="$with_esoob"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local/easysoft/oob/client
  fi
  if test "$withval" != "no"; then
    ODBC_INCDIR=$withval/include
    ODBC_LIBDIR=$withval/lib
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LIBS=-lesoobclient
    ODBC_TYPE=ESOOB

cat >>confdefs.h <<\_ACEOF
#define HAVE_ESOOB 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for unixODBC support" >&5
echo $ECHO_N "checking for unixODBC support... $ECHO_C" >&6

# Check whether --with-unixODBC or --without-unixODBC was given.
if test "${with_unixODBC+set}" = set; then
  withval="$with_unixODBC"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    withval=/usr/local
  fi
  if test "$withval" != "no"; then
    ODBC_INCDIR=$withval/include
    ODBC_LIBDIR=$withval/lib
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LIBS=-lodbc
    ODBC_TYPE=unixODBC

cat >>confdefs.h <<\_ACEOF
#define HAVE_UNIXODBC 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -z "$ODBC_TYPE"; then
echo "$as_me:$LINENO: checking for DBMaker support" >&5
echo $ECHO_N "checking for DBMaker support... $ECHO_C" >&6

# Check whether --with-dbmaker or --without-dbmaker was given.
if test "${with_dbmaker+set}" = set; then
  withval="$with_dbmaker"



ext_output="yes, shared"
ext_shared=yes
case $withval in
shared,*)
  withval=`echo "$withval"|sed 's/^shared,//'`
  ;;
shared)
  withval=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



  shared=$ext_shared
  unset ext_shared ext_output

  if test "$withval" = "yes"; then
    # find dbmaker's home directory
    DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | awk -F: '{print $6}'`

    # check DBMaker version (from 5.0 to 2.0)
    DBMAKER_VERSION=5.0

    while test ! -d $DBMAKER_HOME/$DBMAKER_VERSION -a "$DBMAKER_VERSION" != "2.9"; do
        DM_VER=`echo $DBMAKER_VERSION | sed -e 's/\.//' | awk '{ print $1-1;}'`
        MAJOR_V=`echo $DM_VER | awk '{ print $1/10; }'  | awk  -F. '{ print $1; }'`
        MINOR_V=`echo $DM_VER | awk '{ print $1%10; }'`
        DBMAKER_VERSION=$MAJOR_V.$MINOR_V
    done

    if test "$DBMAKER_VERSION" = "2.9"; then
        withval=$DBMAKER_HOME
    else
        DBMAKER_PATH=$DBMAKER_HOME/$DBMAKER_VERSION
    fi

    withval=$DBMAKER_PATH
  fi

  if test "$withval" != "no"; then
    ODBC_INCDIR=$withval/include
    ODBC_LIBDIR=$withval/lib
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LIBS="-ldmapic -lc"
    ODBC_TYPE=dbmaker


cat >>confdefs.h <<\_ACEOF
#define HAVE_DBMAKER 1
_ACEOF


    if test "$shared" = "yes"; then
        echo "$as_me:$LINENO: result: yes (shared)" >&5
echo "${ECHO_T}yes (shared)" >&6
        ODBC_LIBS="-ldmapic -lc -lm"
        ODBC_SHARED="odbc.la"
    else
        echo "$as_me:$LINENO: result: yes (static)" >&5
echo "${ECHO_T}yes (static)" >&6


  if test -n "$ODBC_LIBDIR"; then

  if test "$ODBC_LIBDIR" != "/usr/lib"; then

  if test -z "$ODBC_LIBDIR" || echo "$ODBC_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$ODBC_LIBDIR
  else

    ep_dir="`echo $ODBC_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ODBC_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case dmapic in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ldmapic $LIBS"
   ;;
  esac





  if test "$ODBC_INCDIR" != "/usr/include"; then

  if test -z "$ODBC_INCDIR" || echo "$ODBC_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$ODBC_INCDIR
  else

    ep_dir="`echo $ODBC_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ODBC_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

        ODBC_STATIC="libphpext_odbc.la"
    fi

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;
fi

if test -n "$ODBC_TYPE"; then
  if test "$ODBC_TYPE" != "dbmaker"; then
    ext_shared=$shared

  for ac_i in $ODBC_LFLAGS $ODBC_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        ODBC_SHARED_LIBADD="$ODBC_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ODBC_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ODBC_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

    if test "$ODBC_TYPE" != "birdstep" && test "$ODBC_TYPE" != "solid"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SQLDATASOURCES 1
_ACEOF

    fi
  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_UODBC 1
_ACEOF


  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_SHARED_LIBADD"


  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCDIR"


  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBDIR"



  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_INCLUDE"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LIBS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_LFLAGS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ODBC_TYPE"





  ext_builddir=ext/odbc
  ext_srcdir=$abs_srcdir/ext/odbc

  ac_extra=`echo "$ODBC_INCLUDE"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/odbc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_odbc.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC odbc"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC odbc"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/odbc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_odbc.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_odbc="$shared_objects_odbc $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) -L$(top_builddir)/netware -lphp4lib $(ODBC_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(PHPODBC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpodbc.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_odbc"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpodbc.$suffix: $ext_builddir/phpodbc.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpodbc.$suffix \$(phplibdir)

$ext_builddir/phpodbc.$suffix: \$(shared_objects_odbc) \$(PHPODBC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(ODBC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) -L$(top_builddir)/netware -lphp4lib $(C_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_odbc) $(ODBC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/odbc.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_odbc"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/odbc.$suffix: $ext_builddir/odbc.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/odbc.$suffix \$(phplibdir)

$ext_builddir/odbc.$suffix: \$(shared_objects_odbc) \$(ODBC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_ODBC 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/odbc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_odbc.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC odbc"
    else


  case ext/odbc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/odbc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/odbc/"; ac_bdir="ext/odbc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_odbc.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC odbc"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi






echo "$as_me:$LINENO: checking for Oracle-ORACLE support" >&5
echo $ECHO_N "checking for Oracle-ORACLE support... $ECHO_C" >&6

# Check whether --with-oracle or --without-oracle was given.
if test "${with_oracle+set}" = set; then
  withval="$with_oracle"
  PHP_ORACLE=$withval
else

  PHP_ORACLE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_ORACLE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_ORACLE in
shared,*)
  PHP_ORACLE=`echo "$PHP_ORACLE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_ORACLE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_ORACLE" != "no"; then
  echo "$as_me:$LINENO: checking Oracle Install-Dir" >&5
echo $ECHO_N "checking Oracle Install-Dir... $ECHO_C" >&6
  if test "$PHP_ORACLE" = "yes"; then
  	ORACLE_DIR=$ORACLE_HOME
  else
  	ORACLE_DIR=$PHP_ORACLE
  fi
  echo "$as_me:$LINENO: result: $ORACLE_DIR" >&5
echo "${ECHO_T}$ORACLE_DIR" >&6

  if test -d "$ORACLE_DIR/rdbms/public"; then

  if test "$ORACLE_DIR/rdbms/public" != "/usr/include"; then

  if test -z "$ORACLE_DIR/rdbms/public" || echo "$ORACLE_DIR/rdbms/public" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/rdbms/public
  else

    ep_dir="`echo $ORACLE_DIR/rdbms/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/rdbms/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  fi
  if test -d "$ORACLE_DIR/rdbms/demo"; then

  if test "$ORACLE_DIR/rdbms/demo" != "/usr/include"; then

  if test -z "$ORACLE_DIR/rdbms/demo" || echo "$ORACLE_DIR/rdbms/demo" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/rdbms/demo
  else

    ep_dir="`echo $ORACLE_DIR/rdbms/demo|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/rdbms/demo\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  fi
  if test -d "$ORACLE_DIR/network/public"; then

  if test "$ORACLE_DIR/network/public" != "/usr/include"; then

  if test -z "$ORACLE_DIR/network/public" || echo "$ORACLE_DIR/network/public" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/network/public
  else

    ep_dir="`echo $ORACLE_DIR/network/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/network/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  fi
  if test -d "$ORACLE_DIR/plsql/public"; then

  if test "$ORACLE_DIR/plsql/public" != "/usr/include"; then

  if test -z "$ORACLE_DIR/plsql/public" || echo "$ORACLE_DIR/plsql/public" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/plsql/public
  else

    ep_dir="`echo $ORACLE_DIR/plsql/public|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/plsql/public\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  fi

  if test -f "$ORACLE_DIR/lib/sysliblist"; then

  for ac_i in `cat $ORACLE_DIR/lib/sysliblist`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ORACLE_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  elif test -f "$ORACLE_DIR/rdbms/lib/sysliblist"; then

  for ac_i in `cat $ORACLE_DIR/rdbms/lib/sysliblist`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ORACLE_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  fi


  echo "$as_me:$LINENO: checking Oracle version" >&5
echo $ECHO_N "checking Oracle version... $ECHO_C" >&6
  if test -s "$ORACLE_DIR/orainst/unix.rgs"; then
  	ORACLE_VERSION=`grep '"ocommon"' $ORACLE_DIR/orainst/unix.rgs | sed 's/  */:/g' | cut -d: -f 6 | cut -c 2-4`
	test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3
  elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
    ORACLE_VERSION=9.0
  elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
    ORACLE_VERSION=8.1
  elif test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
    ORACLE_VERSION=8.0
  elif test -f $ORACLE_DIR/lib/libclntsh.a; then
    if test -f $ORACLE_DIR/lib/libcore4.a; then
      ORACLE_VERSION=8.0
    else
      ORACLE_VERSION=8.1
    fi
  else
  	{ { echo "$as_me:$LINENO: error: Oracle needed libraries not found" >&5
echo "$as_me: error: Oracle needed libraries not found" >&2;}
   { (exit 1); exit 1; }; }
  fi
  echo "$as_me:$LINENO: result: $ORACLE_VERSION" >&5
echo "${ECHO_T}$ORACLE_VERSION" >&6

  case $ORACLE_VERSION in
	7.0|7.1)
	  if test -f $ORACLE_DIR/lib/liboracle.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-loracle $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case oracle in
  c|c_r|pthread*) ;;
  *)
      LIBS="-loracle $LIBS"
   ;;
  esac




  fi


	  else


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcv6 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case cv6 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcv6 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcv6 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case cv6 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcv6 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lora $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ora in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lora $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi


		if test "$ext_shared" = "yes"; then
		  ORACLE_SHARED_LIBADD="$ORACLE_DIR/lib/osntab.o $ORACLE_SHARED_LIBADD";
		else
		  LIBS="$ORACLE_DIR/lib/osntab.o $LIBS";
		fi


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-locic $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ocic in
  c|c_r|pthread*) ;;
  *)
      LIBS="-locic $LIBS"
   ;;
  esac




  fi


		if test "`uname -s 2>/dev/null`" = "AIX"; then
		  if test "$ext_shared" = "yes"; then
		  	ORACLE_SHARED_LIBADD="$ORACLE_SHARED_LIBADD -bI:$ORACLE_DIR/lib/mili.exp"
		  else
		  	LIBS="$LIBS -bI:$ORACLE_DIR/lib/mili.exp"
		  fi
		fi
	  fi
	  ;;

	7.2)
	  if test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclntsh $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclntsh $LIBS"
   ;;
  esac




  fi


	  else


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lc3v6 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case c3v6 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lc3v6 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lora $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ora in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lora $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lora $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ora in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lora $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi


		if test "$ext_shared" = "yes"; then
		  ORACLE_SHARED_LIBADD="$ORACLE_DIR/lib/osntab.o $ORACLE_SHARED_LIBADD";
		else
		  LIBS="$ORACLE_DIR/lib/osntab.o $LIBS";
		fi


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-locic $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ocic in
  c|c_r|pthread*) ;;
  *)
      LIBS="-locic $LIBS"
   ;;
  esac




  fi


	  fi
	  ;;

	7.3)
	  if test -f $ORACLE_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME; then


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclntsh $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclntsh $LIBS"
   ;;
  esac




  fi


	  else


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lc3v6 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case c3v6 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lc3v6 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl3 $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lepc $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case epc in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lepc $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lgeneric $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case generic in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lgeneric $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcommon $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case common in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcommon $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclient $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case client in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclient $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lncr $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ncr in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lncr $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lgeneric $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case generic in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lgeneric $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcommon $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case common in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcommon $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclient $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case client in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclient $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lncr $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case ncr in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lncr $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lsqlnet $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sqlnet in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsqlnet $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclient $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case client in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclient $LIBS"
   ;;
  esac




  fi


	  fi
	  ;;

	8.0)


  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lnlsrtl3 $ORACLE_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case nlsrtl3 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lnlsrtl3 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lcore4 $ORACLE_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case core4 in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcore4 $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lpsa $ORACLE_SHARED_LIBADD"
    if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n """"; then

  if test """" != "/usr/lib"; then

  if test -z """" || echo """" | grep '^/' >/dev/null ; then
    ai_p=""
  else

    ep_dir="`echo ""|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"""\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case psa in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpsa $LIBS"
   ;;
  esac




  fi




  if test "$ext_shared" = "yes"; then
    ORACLE_SHARED_LIBADD="-lclntsh $ORACLE_SHARED_LIBADD"
    if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ORACLE_DIR/lib"; then

  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lclntsh $LIBS"
   ;;
  esac




  fi


	  ;;

	8.1|9.0)


  case clntsh in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ORACLE_SHARED_LIBADD -lclntsh"
    else


  case clntsh in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -lclntsh"
   ;;
  esac


    fi
   ;;
  esac



  if test "$ORACLE_DIR/lib" != "/usr/lib"; then

  if test -z "$ORACLE_DIR/lib" || echo "$ORACLE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ORACLE_DIR/lib
  else

    ep_dir="`echo $ORACLE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ORACLE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ORACLE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ORACLE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

	  ;;
	*)
      { { echo "$as_me:$LINENO: error: Unsupported Oracle version!" >&5
echo "$as_me: error: Unsupported Oracle version!" >&2;}
   { (exit 1); exit 1; }; }
	  ;;
  esac


  ext_builddir=ext/oracle
  ext_srcdir=$abs_srcdir/ext/oracle

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/oracle in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oracle"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oracle/"; ac_bdir="ext/oracle/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oracle.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC oracle"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC oracle"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/oracle in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oracle"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oracle/"; ac_bdir="ext/oracle/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in oracle.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_oracle="$shared_objects_oracle $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oracle) $(PHPORACLE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oracle) -L$(top_builddir)/netware -lphp4lib $(ORACLE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oracle) $(PHPORACLE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phporacle.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oracle"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phporacle.$suffix: $ext_builddir/phporacle.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phporacle.$suffix \$(phplibdir)

$ext_builddir/phporacle.$suffix: \$(shared_objects_oracle) \$(PHPORACLE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_oracle) $(ORACLE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oracle) -L$(top_builddir)/netware -lphp4lib $(CLE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_oracle) $(ORACLE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/oracle.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_oracle"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/oracle.$suffix: $ext_builddir/oracle.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/oracle.$suffix \$(phplibdir)

$ext_builddir/oracle.$suffix: \$(shared_objects_oracle) \$(ORACLE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_ORACLE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/oracle in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oracle"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oracle/"; ac_bdir="ext/oracle/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oracle.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC oracle"
    else


  case ext/oracle in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/oracle"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/oracle/"; ac_bdir="ext/oracle/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in oracle.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC oracle"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



cat >>confdefs.h <<\_ACEOF
#define HAVE_ORACLE 1
_ACEOF




  PHP_VAR_SUBST="$PHP_VAR_SUBST ORACLE_SHARED_LIBADD"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ORACLE_DIR"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ORACLE_VERSION"



fi




echo "$as_me:$LINENO: checking whether to enable user-space object overloading support" >&5
echo $ECHO_N "checking whether to enable user-space object overloading support... $ECHO_C" >&6
# Check whether --enable-overload or --disable-overload was given.
if test "${enable_overload+set}" = set; then
  enableval="$enable_overload"
  PHP_OVERLOAD=$enableval
else

  PHP_OVERLOAD=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_OVERLOAD=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_OVERLOAD in
shared,*)
  PHP_OVERLOAD=`echo "$PHP_OVERLOAD"|sed 's/^shared,//'`
  ;;
shared)
  PHP_OVERLOAD=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_OVERLOAD" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_OVERLOAD 1
_ACEOF


  ext_builddir=ext/overload
  ext_srcdir=$abs_srcdir/ext/overload

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/overload in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/overload"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/overload/"; ac_bdir="ext/overload/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in overload.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC overload"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC overload"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/overload in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/overload"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/overload/"; ac_bdir="ext/overload/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in overload.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_overload="$shared_objects_overload $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_overload) $(PHPOVERLOAD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_overload) -L$(top_builddir)/netware -lphp4lib $(OVERLOAD_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_overload) $(PHPOVERLOAD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpoverload.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_overload"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpoverload.$suffix: $ext_builddir/phpoverload.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpoverload.$suffix \$(phplibdir)

$ext_builddir/phpoverload.$suffix: \$(shared_objects_overload) \$(PHPOVERLOAD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_overload) $(OVERLOAD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_overload) -L$(top_builddir)/netware -lphp4lib $(RLOAD_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_overload) $(OVERLOAD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/overload.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_overload"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/overload.$suffix: $ext_builddir/overload.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/overload.$suffix \$(phplibdir)

$ext_builddir/overload.$suffix: \$(shared_objects_overload) \$(OVERLOAD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_OVERLOAD 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/overload in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/overload"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/overload/"; ac_bdir="ext/overload/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in overload.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC overload"
    else


  case ext/overload in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/overload"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/overload/"; ac_bdir="ext/overload/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in overload.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC overload"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi





echo "$as_me:$LINENO: checking whether to enable pcntl support" >&5
echo $ECHO_N "checking whether to enable pcntl support... $ECHO_C" >&6
# Check whether --enable-pcntl or --disable-pcntl was given.
if test "${enable_pcntl+set}" = set; then
  enableval="$enable_pcntl"
  PHP_PCNTL=$enableval
else

  PHP_PCNTL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PCNTL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PCNTL in
shared,*)
  PHP_PCNTL=`echo "$PHP_PCNTL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PCNTL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PCNTL" != "no"; then


for ac_func in fork
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

cat >>confdefs.h <<\_ACEOF
#define HAVE_FORK 1
_ACEOF

else
   { { echo "$as_me:$LINENO: error: pcntl: fork() not supported by this platform" >&5
echo "$as_me: error: pcntl: fork() not supported by this platform" >&2;}
   { (exit 1); exit 1; }; }
fi
done


for ac_func in waitpid
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

cat >>confdefs.h <<\_ACEOF
#define HAVE_WAITPID 1
_ACEOF

else
   { { echo "$as_me:$LINENO: error: pcntl: fork() not supported by this platform" >&5
echo "$as_me: error: pcntl: fork() not supported by this platform" >&2;}
   { (exit 1); exit 1; }; }
fi
done


for ac_func in sigaction
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

cat >>confdefs.h <<\_ACEOF
#define HAVE_SIGACTION 1
_ACEOF

else
   { { echo "$as_me:$LINENO: error: pcntl: sigaction() not supported by this platform" >&5
echo "$as_me: error: pcntl: sigaction() not supported by this platform" >&2;}
   { (exit 1); exit 1; }; }
fi
done



  ext_builddir=ext/pcntl
  ext_srcdir=$abs_srcdir/ext/pcntl

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then



  case ext/pcntl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pcntl.c php_signal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pcntl"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pcntl"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pcntl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in pcntl.c php_signal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pcntl="$shared_objects_pcntl $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PHPPCNTL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) -L$(top_builddir)/netware -lphp4lib $(PCNTL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PHPPCNTL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppcntl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcntl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppcntl.$suffix: $ext_builddir/phppcntl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppcntl.$suffix \$(phplibdir)

$ext_builddir/phppcntl.$suffix: \$(shared_objects_pcntl) \$(PHPPCNTL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PCNTL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) -L$(top_builddir)/netware -lphp4lib $(TL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pcntl) $(PCNTL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pcntl.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pcntl"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pcntl.$suffix: $ext_builddir/pcntl.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pcntl.$suffix \$(phplibdir)

$ext_builddir/pcntl.$suffix: \$(shared_objects_pcntl) \$(PCNTL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PCNTL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pcntl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pcntl.c php_signal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pcntl"
    else


  case ext/pcntl in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pcntl"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pcntl/"; ac_bdir="ext/pcntl/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pcntl.c php_signal.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pcntl"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for PDFlib support" >&5
echo $ECHO_N "checking for PDFlib support... $ECHO_C" >&6

# Check whether --with-pdflib or --without-pdflib was given.
if test "${with_pdflib+set}" = set; then
  withval="$with_pdflib"
  PHP_PDFLIB=$withval
else

  PHP_PDFLIB=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PDFLIB=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PDFLIB in
shared,*)
  PHP_PDFLIB=`echo "$PHP_PDFLIB"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PDFLIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test -z "$PHP_JPEG_DIR"; then


echo "$as_me:$LINENO: checking for the location of libjpeg" >&5
echo $ECHO_N "checking for the location of libjpeg... $ECHO_C" >&6

# Check whether --with-jpeg-dir or --without-jpeg-dir was given.
if test "${with_jpeg_dir+set}" = set; then
  withval="$with_jpeg_dir"
  PHP_JPEG_DIR=$withval
else

  PHP_JPEG_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_JPEG_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_JPEG_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test -z "$PHP_PNG_DIR"; then


echo "$as_me:$LINENO: checking for the location of libpng" >&5
echo $ECHO_N "checking for the location of libpng... $ECHO_C" >&6

# Check whether --with-png-dir or --without-png-dir was given.
if test "${with_png_dir+set}" = set; then
  withval="$with_png_dir"
  PHP_PNG_DIR=$withval
else

  PHP_PNG_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_PNG_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_PNG_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test -z "$PHP_ZLIB_DIR"; then


echo "$as_me:$LINENO: checking for the location of libz" >&5
echo $ECHO_N "checking for the location of libz... $ECHO_C" >&6

# Check whether --with-zlib-dir or --without-zlib-dir was given.
if test "${with_zlib_dir+set}" = set; then
  withval="$with_zlib_dir"
  PHP_ZLIB_DIR=$withval
else

  PHP_ZLIB_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ZLIB_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ZLIB_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi



echo "$as_me:$LINENO: checking for the location of libtiff" >&5
echo $ECHO_N "checking for the location of libtiff... $ECHO_C" >&6

# Check whether --with-tiff-dir or --without-tiff-dir was given.
if test "${with_tiff_dir+set}" = set; then
  withval="$with_tiff_dir"
  PHP_TIFF_DIR=$withval
else

  PHP_TIFF_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_TIFF_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_TIFF_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PDFLIB" != "no"; then


  ext_builddir=ext/pdf
  ext_srcdir=$abs_srcdir/ext/pdf

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pdf/"; ac_bdir="ext/pdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pdf"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pdf"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pdf/"; ac_bdir="ext/pdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in pdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pdf="$shared_objects_pdf $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pdf) $(PHPPDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdf) -L$(top_builddir)/netware -lphp4lib $(PDF_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdf) $(PHPPDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppdf.$suffix: $ext_builddir/phppdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppdf.$suffix \$(phplibdir)

$ext_builddir/phppdf.$suffix: \$(shared_objects_pdf) \$(PHPPDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pdf) $(PDF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdf) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pdf) $(PDF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pdf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pdf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pdf.$suffix: $ext_builddir/pdf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pdf.$suffix \$(phplibdir)

$ext_builddir/pdf.$suffix: \$(shared_objects_pdf) \$(PDF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PDF 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pdf/"; ac_bdir="ext/pdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pdf"
    else


  case ext/pdf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pdf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pdf/"; ac_bdir="ext/pdf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pdf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pdf"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST PDF_SHARED_LIBADD"



    if test "$PHP_JPEG_DIR" != "no"; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PHP_JPEG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5
echo $ECHO_N "checking for jpeg_read_header in -ljpeg... $ECHO_C" >&6
if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljpeg  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char jpeg_read_header ();
int
main ()
{
jpeg_read_header ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_jpeg_jpeg_read_header=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_jpeg_jpeg_read_header=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5
echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_read_header" >&6
if test $ac_cv_lib_jpeg_jpeg_read_header = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    PDF_SHARED_LIBADD="-ljpeg $PDF_SHARED_LIBADD"
    if test -n "$PHP_JPEG_DIR/lib"; then

  if test "$PHP_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_JPEG_DIR/lib" || echo "$PHP_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_JPEG_DIR/lib
  else

    ep_dir="`echo $PHP_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_JPEG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_JPEG_DIR/lib"; then

  if test "$PHP_JPEG_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_JPEG_DIR/lib" || echo "$PHP_JPEG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_JPEG_DIR/lib
  else

    ep_dir="`echo $PHP_JPEG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_JPEG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case jpeg in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ljpeg $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_jpeg_jpeg_read_header

      { { echo "$as_me:$LINENO: error: libjpeg not found!" >&5
echo "$as_me: error: libjpeg not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    { echo "$as_me:$LINENO: WARNING: If configure fails, try --with-jpeg-dir=<DIR>" >&5
echo "$as_me: WARNING: If configure fails, try --with-jpeg-dir=<DIR>" >&2;}
  fi

    if test "$PHP_PNG_DIR" != "no"; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PHP_PNG_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for png_create_info_struct in -lpng" >&5
echo $ECHO_N "checking for png_create_info_struct in -lpng... $ECHO_C" >&6
if test "${ac_cv_lib_png_png_create_info_struct+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char png_create_info_struct ();
int
main ()
{
png_create_info_struct ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_png_png_create_info_struct=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_png_png_create_info_struct=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_create_info_struct" >&5
echo "${ECHO_T}$ac_cv_lib_png_png_create_info_struct" >&6
if test $ac_cv_lib_png_png_create_info_struct = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    PDF_SHARED_LIBADD="-lpng $PDF_SHARED_LIBADD"
    if test -n "$PHP_PNG_DIR/lib"; then

  if test "$PHP_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_PNG_DIR/lib" || echo "$PHP_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_PNG_DIR/lib
  else

    ep_dir="`echo $PHP_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_PNG_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_PNG_DIR/lib"; then

  if test "$PHP_PNG_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_PNG_DIR/lib" || echo "$PHP_PNG_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_PNG_DIR/lib
  else

    ep_dir="`echo $PHP_PNG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_PNG_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case png in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpng $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_png_png_create_info_struct

      { { echo "$as_me:$LINENO: error: libpng not found!" >&5
echo "$as_me: error: libpng not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    { echo "$as_me:$LINENO: WARNING: If configure fails, try --with-png-dir=<DIR>" >&5
echo "$as_me: WARNING: If configure fails, try --with-png-dir=<DIR>" >&2;}
  fi

    if test "$PHP_TIFF_DIR" != "no"; then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PHP_TIFF_DIR/lib
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for TIFFOpen in -ltiff" >&5
echo $ECHO_N "checking for TIFFOpen in -ltiff... $ECHO_C" >&6
if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltiff  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char TIFFOpen ();
int
main ()
{
TIFFOpen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_tiff_TIFFOpen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_tiff_TIFFOpen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFOpen" >&5
echo "${ECHO_T}$ac_cv_lib_tiff_TIFFOpen" >&6
if test $ac_cv_lib_tiff_TIFFOpen = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    PDF_SHARED_LIBADD="-ltiff $PDF_SHARED_LIBADD"
    if test -n "$PHP_TIFF_DIR/lib"; then

  if test "$PHP_TIFF_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_TIFF_DIR/lib" || echo "$PHP_TIFF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_TIFF_DIR/lib
  else

    ep_dir="`echo $PHP_TIFF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_TIFF_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_TIFF_DIR/lib"; then

  if test "$PHP_TIFF_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_TIFF_DIR/lib" || echo "$PHP_TIFF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_TIFF_DIR/lib
  else

    ep_dir="`echo $PHP_TIFF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_TIFF_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case tiff in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ltiff $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_tiff_TIFFOpen

      { { echo "$as_me:$LINENO: error: libtiff not found!" >&5
echo "$as_me: error: libtiff not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

  else
    { echo "$as_me:$LINENO: WARNING: If configure fails, try --with-tiff-dir=<DIR>" >&5
echo "$as_me: WARNING: If configure fails, try --with-tiff-dir=<DIR>" >&2;}
  fi

    echo "$as_me:$LINENO: checking for the location of zlib" >&5
echo $ECHO_N "checking for the location of zlib... $ECHO_C" >&6
  if test "$PHP_ZLIB_DIR" = "no"; then
    echo "$as_me:$LINENO: result: no. If configure fails, try --with-zlib-dir=<DIR>" >&5
echo "${ECHO_T}no. If configure fails, try --with-zlib-dir=<DIR>" >&6
  else
    echo "$as_me:$LINENO: result: $PHP_ZLIB_DIR" >&5
echo "${ECHO_T}$PHP_ZLIB_DIR" >&6


  if test "$ext_shared" = "yes"; then
    PDF_SHARED_LIBADD="-lz $PDF_SHARED_LIBADD"
    if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_ZLIB_DIR/lib"; then

  if test "$PHP_ZLIB_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_ZLIB_DIR/lib" || echo "$PHP_ZLIB_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_ZLIB_DIR/lib
  else

    ep_dir="`echo $PHP_ZLIB_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_ZLIB_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case z in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lz $LIBS"
   ;;
  esac




  fi


  fi


    case $host_alias in
    *darwin*)



  unique=`echo CoreServices|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$FRAMEWORKS$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "FRAMEWORKS$unique=set"

    if test ""; then
      PHP_FRAMEWORKS="-framework CoreServices $PHP_FRAMEWORKS"
    else
      PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework CoreServices"
    fi

  fi





  unique=`echo ApplicationServices|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$FRAMEWORKS$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "FRAMEWORKS$unique=set"

    if test ""; then
      PHP_FRAMEWORKS="-framework ApplicationServices $PHP_FRAMEWORKS"
    else
      PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework ApplicationServices"
    fi

  fi


      ;;
  esac

  case $PHP_PDFLIB in
    yes)
      echo "$as_me:$LINENO: checking for PDF_show_boxed in -lpdf" >&5
echo $ECHO_N "checking for PDF_show_boxed in -lpdf... $ECHO_C" >&6
if test "${ac_cv_lib_pdf_PDF_show_boxed+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PDF_show_boxed ();
int
main ()
{
PDF_show_boxed ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pdf_PDF_show_boxed=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pdf_PDF_show_boxed=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_show_boxed" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_show_boxed" >&6
if test $ac_cv_lib_pdf_PDF_show_boxed = yes; then


cat >>confdefs.h <<\_ACEOF
#define HAVE_PDFLIB 1
_ACEOF



  case pdf in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="-lpdf $PDF_SHARED_LIBADD"
    else


  case pdf in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpdf $LIBS"
   ;;
  esac


    fi
   ;;
  esac



else

        { { echo "$as_me:$LINENO: error:
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
See config.log for more information.
" >&5
echo "$as_me: error:
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
See config.log for more information.
" >&2;}
   { (exit 1); exit 1; }; }

fi

    ;;
    *)
      if test -f "$PHP_PDFLIB/include/pdflib.h" ; then


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for PDF_show_boxed in -lpdf" >&5
echo $ECHO_N "checking for PDF_show_boxed in -lpdf... $ECHO_C" >&6
if test "${ac_cv_lib_pdf_PDF_show_boxed+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpdf  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PDF_show_boxed ();
int
main ()
{
PDF_show_boxed ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pdf_PDF_show_boxed=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pdf_PDF_show_boxed=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pdf_PDF_show_boxed" >&5
echo "${ECHO_T}$ac_cv_lib_pdf_PDF_show_boxed" >&6
if test $ac_cv_lib_pdf_PDF_show_boxed = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_PDFLIB 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    PDF_SHARED_LIBADD="-lpdf $PDF_SHARED_LIBADD"
    if test -n "$PHP_PDFLIB/lib"; then

  if test "$PHP_PDFLIB/lib" != "/usr/lib"; then

  if test -z "$PHP_PDFLIB/lib" || echo "$PHP_PDFLIB/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_PDFLIB/lib
  else

    ep_dir="`echo $PHP_PDFLIB/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_PDFLIB/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PDF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PDF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_PDFLIB/lib"; then

  if test "$PHP_PDFLIB/lib" != "/usr/lib"; then

  if test -z "$PHP_PDFLIB/lib" || echo "$PHP_PDFLIB/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_PDFLIB/lib
  else

    ep_dir="`echo $PHP_PDFLIB/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_PDFLIB/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case pdf in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpdf $LIBS"
   ;;
  esac




  fi



  if test "$PHP_PDFLIB/include" != "/usr/include"; then

  if test -z "$PHP_PDFLIB/include" || echo "$PHP_PDFLIB/include" | grep '^/' >/dev/null ; then
    ai_p=$PHP_PDFLIB/include
  else

    ep_dir="`echo $PHP_PDFLIB/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_PDFLIB/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_pdf_PDF_show_boxed

          { { echo "$as_me:$LINENO: error:
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
See config.log for more information.
" >&5
echo "$as_me: error:
PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz.
Use the options --with-tiff-dir=<DIR>, --with-jpeg-dir=<DIR>, --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
See config.log for more information.
" >&2;}
   { (exit 1); exit 1; }; }


fi

      else
        { { echo "$as_me:$LINENO: error: pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory." >&5
echo "$as_me: error: pdflib.h not found! Check the path passed to --with-pdflib=<PATH>. PATH should be the install prefix directory." >&2;}
   { (exit 1); exit 1; }; }
      fi
    ;;
  esac
fi




echo "$as_me:$LINENO: checking for Verisign Payflow Pro support" >&5
echo $ECHO_N "checking for Verisign Payflow Pro support... $ECHO_C" >&6

# Check whether --with-pfpro or --without-pfpro was given.
if test "${with_pfpro+set}" = set; then
  withval="$with_pfpro"
  PHP_PFPRO=$withval
else

  PHP_PFPRO=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PFPRO=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PFPRO in
shared,*)
  PHP_PFPRO=`echo "$PHP_PFPRO"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PFPRO=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PFPRO" != "no"; then
  PFPRO_LIB=libpfpro.so
  PFPRO_HDR=pfpro.h

  for i in $PHP_PFPRO /usr/local /usr; do
    if test -r $i/$PFPRO_HDR; then
      PFPRO_INC_DIR=$i
    elif test -r $i/include/$PFPRO_HDR; then
      PFPRO_INC_DIR=$i/include
    elif test -r $i/lib/$PFPRO_HDR; then
      PFPRO_INC_DIR=$i/lib
    elif test -r $i/bin/$PFPRO_HDR; then
      PFPRO_INC_DIR=$i/bin
    fi

    if test -r $i/$PFPRO_LIB; then
      PFPRO_LIB_DIR=$i
    elif test -r $i/lib/$PFPRO_LIB; then
      PFPRO_LIB_DIR=$i/lib
    fi

	test -n "$PFPRO_INC_DIR" && test -n "$PFPRO_LIB_DIR" && break
  done

  if test -z "$PFPRO_INC_DIR"; then
    { { echo "$as_me:$LINENO: error: Could not find pfpro.h. Please make sure you have the
                 Verisign Payflow Pro SDK installed. Use
                 ./configure --with-pfpro=<pfpro-dir> if necessary" >&5
echo "$as_me: error: Could not find pfpro.h. Please make sure you have the
                 Verisign Payflow Pro SDK installed. Use
                 ./configure --with-pfpro=<pfpro-dir> if necessary" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -z "$PFPRO_LIB_DIR"; then
    { { echo "$as_me:$LINENO: error: Could not find libpfpro.so. Please make sure you have the
                 Verisign Payflow Pro SDK installed. Use
                 ./configure --with-pfpro=<pfpro-dir> if necessary" >&5
echo "$as_me: error: Could not find libpfpro.so. Please make sure you have the
                 Verisign Payflow Pro SDK installed. Use
                 ./configure --with-pfpro=<pfpro-dir> if necessary" >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$PFPRO_LIB_DIR
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for pfproInit in -lpfpro" >&5
echo $ECHO_N "checking for pfproInit in -lpfpro... $ECHO_C" >&6
if test "${ac_cv_lib_pfpro_pfproInit+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpfpro  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pfproInit ();
int
main ()
{
pfproInit ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pfpro_pfproInit=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pfpro_pfproInit=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pfpro_pfproInit" >&5
echo "${ECHO_T}$ac_cv_lib_pfpro_pfproInit" >&6
if test $ac_cv_lib_pfpro_pfproInit = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

    PFPRO_VERSION=3


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_pfpro_pfproInit


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$PFPRO_LIB_DIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for PNInit in -lpfpro" >&5
echo $ECHO_N "checking for PNInit in -lpfpro... $ECHO_C" >&6
if test "${ac_cv_lib_pfpro_PNInit+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpfpro  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PNInit ();
int
main ()
{
PNInit ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pfpro_PNInit=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pfpro_PNInit=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pfpro_PNInit" >&5
echo "${ECHO_T}$ac_cv_lib_pfpro_PNInit" >&6
if test $ac_cv_lib_pfpro_PNInit = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      PFPRO_VERSION=2


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_pfpro_PNInit

      { { echo "$as_me:$LINENO: error: The pfpro extension requires version 2 or 3 of the SDK" >&5
echo "$as_me: error: The pfpro extension requires version 2 or 3 of the SDK" >&2;}
   { (exit 1); exit 1; }; }


fi



fi



cat >>confdefs.h <<_ACEOF
#define PFPRO_VERSION $PFPRO_VERSION
_ACEOF


  if test "$PFPRO_INC_DIR" != "/usr/include"; then

  if test -z "$PFPRO_INC_DIR" || echo "$PFPRO_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$PFPRO_INC_DIR
  else

    ep_dir="`echo $PFPRO_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PFPRO_INC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    PFPRO_SHARED_LIBADD="-lpfpro $PFPRO_SHARED_LIBADD"
    if test -n "$PFPRO_LIB_DIR"; then

  if test "$PFPRO_LIB_DIR" != "/usr/lib"; then

  if test -z "$PFPRO_LIB_DIR" || echo "$PFPRO_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$PFPRO_LIB_DIR
  else

    ep_dir="`echo $PFPRO_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PFPRO_LIB_DIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PFPRO_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PFPRO_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PFPRO_LIB_DIR"; then

  if test "$PFPRO_LIB_DIR" != "/usr/lib"; then

  if test -z "$PFPRO_LIB_DIR" || echo "$PFPRO_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$PFPRO_LIB_DIR
  else

    ep_dir="`echo $PFPRO_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PFPRO_LIB_DIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case pfpro in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpfpro $LIBS"
   ;;
  esac




  fi




  ext_builddir=ext/pfpro
  ext_srcdir=$abs_srcdir/ext/pfpro

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pfpro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pfpro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pfpro/"; ac_bdir="ext/pfpro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pfpro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pfpro"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pfpro"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pfpro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pfpro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pfpro/"; ac_bdir="ext/pfpro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in pfpro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pfpro="$shared_objects_pfpro $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pfpro) $(PHPPFPRO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pfpro) -L$(top_builddir)/netware -lphp4lib $(PFPRO_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pfpro) $(PHPPFPRO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppfpro.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pfpro"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppfpro.$suffix: $ext_builddir/phppfpro.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppfpro.$suffix \$(phplibdir)

$ext_builddir/phppfpro.$suffix: \$(shared_objects_pfpro) \$(PHPPFPRO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pfpro) $(PFPRO_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pfpro) -L$(top_builddir)/netware -lphp4lib $(RO_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pfpro) $(PFPRO_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pfpro.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pfpro"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pfpro.$suffix: $ext_builddir/pfpro.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pfpro.$suffix \$(phplibdir)

$ext_builddir/pfpro.$suffix: \$(shared_objects_pfpro) \$(PFPRO_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PFPRO 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pfpro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pfpro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pfpro/"; ac_bdir="ext/pfpro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pfpro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pfpro"
    else


  case ext/pfpro in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pfpro"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pfpro/"; ac_bdir="ext/pfpro/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pfpro.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pfpro"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST PFPRO_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_PFPRO 1
_ACEOF

fi






echo "$as_me:$LINENO: checking for PostgreSQL support" >&5
echo $ECHO_N "checking for PostgreSQL support... $ECHO_C" >&6

# Check whether --with-pgsql or --without-pgsql was given.
if test "${with_pgsql+set}" = set; then
  withval="$with_pgsql"
  PHP_PGSQL=$withval
else

  PHP_PGSQL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PGSQL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PGSQL in
shared,*)
  PHP_PGSQL=`echo "$PHP_PGSQL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PGSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PGSQL" != "no"; then

  if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then
    PGSQL_INCLUDE=$PGSQL_INCLUDE
  else

    ep_dir="`echo $PGSQL_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    PGSQL_INCLUDE="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`"
  fi


  echo "$as_me:$LINENO: checking for pg_config" >&5
echo $ECHO_N "checking for pg_config... $ECHO_C" >&6
  for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin ""; do
	if test -x $i/pg_config; then
      PG_CONFIG="$i/pg_config"
      break;
    fi
  done

  if test -n "$PG_CONFIG"; then
    echo "$as_me:$LINENO: result: $PG_CONFIG" >&5
echo "${ECHO_T}$PG_CONFIG" >&6
    PGSQL_INCLUDE=`$PG_CONFIG --includedir`
    PGSQL_LIBDIR=`$PG_CONFIG --libdir`
    if test -r "$PGSQL_INCLUDE/pg_config.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PG_CONFIG_H 1
_ACEOF

    fi
  else
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    if test "$PHP_PGSQL" = "yes"; then
      PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql"
    else
      PGSQL_SEARCH_PATHS=$PHP_PGSQL
    fi

    for i in $PGSQL_SEARCH_PATHS; do
      for j in include include/pgsql include/postgres include/postgresql ""; do
        if test -r "$i/$j/libpq-fe.h"; then
          PGSQL_INC_BASE=$i
          PGSQL_INCLUDE=$i/$j
          if test -r "$i/$j/pg_config.h"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PG_CONFIG_H 1
_ACEOF

          fi
        fi
      done

      for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
        if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
          PGSQL_LIBDIR=$i/$j
        fi
      done
    done
  fi

  if test -z "$PGSQL_INCLUDE"; then
    { { echo "$as_me:$LINENO: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" >&5
echo "$as_me: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -z "$PGSQL_LIBDIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" >&5
echo "$as_me: error: Cannot find libpq.so. Please specify correct PostgreSQL installation path" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -z "$PGSQL_INCLUDE" -a -z "$PGSQL_LIBDIR" ; then
    { { echo "$as_me:$LINENO: error: Unable to find libpq anywhere under $withval" >&5
echo "$as_me: error: Unable to find libpq anywhere under $withval" >&2;}
   { (exit 1); exit 1; }; }
  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_PGSQL 1
_ACEOF

  old_LIBS=$LIBS
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
  echo "$as_me:$LINENO: checking for PQescapeString in -lpq" >&5
echo $ECHO_N "checking for PQescapeString in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQescapeString+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQescapeString ();
int
main ()
{
PQescapeString ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQescapeString=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQescapeString=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQescapeString" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQescapeString" >&6
if test $ac_cv_lib_pq_PQescapeString = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQESCAPE 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQunescapeBytea in -lpq" >&5
echo $ECHO_N "checking for PQunescapeBytea in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQunescapeBytea+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQunescapeBytea ();
int
main ()
{
PQunescapeBytea ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQunescapeBytea=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQunescapeBytea=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQunescapeBytea" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQunescapeBytea" >&6
if test $ac_cv_lib_pq_PQunescapeBytea = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQUNESCAPEBYTEA 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQsetnonblocking in -lpq" >&5
echo $ECHO_N "checking for PQsetnonblocking in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQsetnonblocking+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQsetnonblocking ();
int
main ()
{
PQsetnonblocking ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQsetnonblocking=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQsetnonblocking=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQsetnonblocking" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQsetnonblocking" >&6
if test $ac_cv_lib_pq_PQsetnonblocking = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQSETNONBLOCKING 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQcmdTuples in -lpq" >&5
echo $ECHO_N "checking for PQcmdTuples in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQcmdTuples+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQcmdTuples ();
int
main ()
{
PQcmdTuples ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQcmdTuples=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQcmdTuples=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQcmdTuples" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQcmdTuples" >&6
if test $ac_cv_lib_pq_PQcmdTuples = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQCMDTUPLES 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQoidValue in -lpq" >&5
echo $ECHO_N "checking for PQoidValue in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQoidValue+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQoidValue ();
int
main ()
{
PQoidValue ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQoidValue=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQoidValue=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQoidValue" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQoidValue" >&6
if test $ac_cv_lib_pq_PQoidValue = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQOIDVALUE 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQclientEncoding in -lpq" >&5
echo $ECHO_N "checking for PQclientEncoding in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQclientEncoding+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQclientEncoding ();
int
main ()
{
PQclientEncoding ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQclientEncoding=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQclientEncoding=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQclientEncoding" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQclientEncoding" >&6
if test $ac_cv_lib_pq_PQclientEncoding = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQCLIENTENCODING 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQparameterStatus in -lpq" >&5
echo $ECHO_N "checking for PQparameterStatus in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQparameterStatus+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQparameterStatus ();
int
main ()
{
PQparameterStatus ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQparameterStatus=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQparameterStatus=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQparameterStatus" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQparameterStatus" >&6
if test $ac_cv_lib_pq_PQparameterStatus = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQPARAMETERSTATUS 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQprotocolVersion in -lpq" >&5
echo $ECHO_N "checking for PQprotocolVersion in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQprotocolVersion+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQprotocolVersion ();
int
main ()
{
PQprotocolVersion ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQprotocolVersion=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQprotocolVersion=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQprotocolVersion" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQprotocolVersion" >&6
if test $ac_cv_lib_pq_PQprotocolVersion = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQPROTOCOLVERSION 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQtransactionStatus in -lpq" >&5
echo $ECHO_N "checking for PQtransactionStatus in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQtransactionStatus+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQtransactionStatus ();
int
main ()
{
PQtransactionStatus ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQtransactionStatus=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQtransactionStatus=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQtransactionStatus" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQtransactionStatus" >&6
if test $ac_cv_lib_pq_PQtransactionStatus = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PGTRANSACTIONSTATUS 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQexecParams in -lpq" >&5
echo $ECHO_N "checking for PQexecParams in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQexecParams+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQexecParams ();
int
main ()
{
PQexecParams ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQexecParams=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQexecParams=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQexecParams" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQexecParams" >&6
if test $ac_cv_lib_pq_PQexecParams = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQEXECPARAMS 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQprepare in -lpq" >&5
echo $ECHO_N "checking for PQprepare in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQprepare+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQprepare ();
int
main ()
{
PQprepare ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQprepare=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQprepare=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQprepare" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQprepare" >&6
if test $ac_cv_lib_pq_PQprepare = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQPREPARE 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQexecPrepared in -lpq" >&5
echo $ECHO_N "checking for PQexecPrepared in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQexecPrepared+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQexecPrepared ();
int
main ()
{
PQexecPrepared ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQexecPrepared=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQexecPrepared=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQexecPrepared" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQexecPrepared" >&6
if test $ac_cv_lib_pq_PQexecPrepared = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQEXECPREPARED 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQresultErrorField in -lpq" >&5
echo $ECHO_N "checking for PQresultErrorField in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQresultErrorField+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQresultErrorField ();
int
main ()
{
PQresultErrorField ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQresultErrorField=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQresultErrorField=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQresultErrorField" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQresultErrorField" >&6
if test $ac_cv_lib_pq_PQresultErrorField = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQRESULTERRORFIELD 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQsendQueryParams in -lpq" >&5
echo $ECHO_N "checking for PQsendQueryParams in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQsendQueryParams+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQsendQueryParams ();
int
main ()
{
PQsendQueryParams ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQsendQueryParams=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQsendQueryParams=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQsendQueryParams" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQsendQueryParams" >&6
if test $ac_cv_lib_pq_PQsendQueryParams = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQSENDQUERYPARAMS 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQsendPrepare in -lpq" >&5
echo $ECHO_N "checking for PQsendPrepare in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQsendPrepare+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQsendPrepare ();
int
main ()
{
PQsendPrepare ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQsendPrepare=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQsendPrepare=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQsendPrepare" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQsendPrepare" >&6
if test $ac_cv_lib_pq_PQsendPrepare = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQSENDPREPARE 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQsendQueryPrepared in -lpq" >&5
echo $ECHO_N "checking for PQsendQueryPrepared in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQsendQueryPrepared+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQsendQueryPrepared ();
int
main ()
{
PQsendQueryPrepared ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQsendQueryPrepared=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQsendQueryPrepared=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQsendQueryPrepared" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQsendQueryPrepared" >&6
if test $ac_cv_lib_pq_PQsendQueryPrepared = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQSENDQUERYPREPARED 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQputCopyData in -lpq" >&5
echo $ECHO_N "checking for PQputCopyData in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQputCopyData+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQputCopyData ();
int
main ()
{
PQputCopyData ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQputCopyData=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQputCopyData=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQputCopyData" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQputCopyData" >&6
if test $ac_cv_lib_pq_PQputCopyData = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQPUTCOPYDATA 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQputCopyEnd in -lpq" >&5
echo $ECHO_N "checking for PQputCopyEnd in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQputCopyEnd+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQputCopyEnd ();
int
main ()
{
PQputCopyEnd ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQputCopyEnd=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQputCopyEnd=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQputCopyEnd" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQputCopyEnd" >&6
if test $ac_cv_lib_pq_PQputCopyEnd = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQPUTCOPYEND 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQgetCopyData in -lpq" >&5
echo $ECHO_N "checking for PQgetCopyData in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQgetCopyData+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQgetCopyData ();
int
main ()
{
PQgetCopyData ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQgetCopyData=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQgetCopyData=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQgetCopyData" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQgetCopyData" >&6
if test $ac_cv_lib_pq_PQgetCopyData = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQGETCOPYDATA 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for PQsetErrorVerbosity in -lpq" >&5
echo $ECHO_N "checking for PQsetErrorVerbosity in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_PQsetErrorVerbosity+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char PQsetErrorVerbosity ();
int
main ()
{
PQsetErrorVerbosity ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_PQsetErrorVerbosity=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_PQsetErrorVerbosity=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_PQsetErrorVerbosity" >&5
echo "${ECHO_T}$ac_cv_lib_pq_PQsetErrorVerbosity" >&6
if test $ac_cv_lib_pq_PQsetErrorVerbosity = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PQSETERRORVERBOSITY 1
_ACEOF

fi

  echo "$as_me:$LINENO: checking for pg_encoding_to_char in -lpq" >&5
echo $ECHO_N "checking for pg_encoding_to_char in -lpq... $ECHO_C" >&6
if test "${ac_cv_lib_pq_pg_encoding_to_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lpq  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char pg_encoding_to_char ();
int
main ()
{
pg_encoding_to_char ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_pq_pg_encoding_to_char=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_pq_pg_encoding_to_char=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_pq_pg_encoding_to_char" >&5
echo "${ECHO_T}$ac_cv_lib_pq_pg_encoding_to_char" >&6
if test $ac_cv_lib_pq_pg_encoding_to_char = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT 1
_ACEOF

fi

  LIBS=$old_LIBS
  LDFLAGS=$old_LDFLAGS



  if test "$ext_shared" = "yes"; then
    PGSQL_SHARED_LIBADD="-lpq $PGSQL_SHARED_LIBADD"
    if test -n "$PGSQL_LIBDIR"; then

  if test "$PGSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PGSQL_LIBDIR
  else

    ep_dir="`echo $PGSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PGSQL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PGSQL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PGSQL_LIBDIR"; then

  if test "$PGSQL_LIBDIR" != "/usr/lib"; then

  if test -z "$PGSQL_LIBDIR" || echo "$PGSQL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PGSQL_LIBDIR
  else

    ep_dir="`echo $PGSQL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PGSQL_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case pq in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpq $LIBS"
   ;;
  esac




  fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST PGSQL_SHARED_LIBADD"



  if test "$PGSQL_INCLUDE" != "/usr/include"; then

  if test -z "$PGSQL_INCLUDE" || echo "$PGSQL_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$PGSQL_INCLUDE
  else

    ep_dir="`echo $PGSQL_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PGSQL_INCLUDE\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  ext_builddir=ext/pgsql
  ext_srcdir=$abs_srcdir/ext/pgsql

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pgsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pgsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pgsql"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pgsql"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pgsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in pgsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pgsql="$shared_objects_pgsql $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PHPPGSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) -L$(top_builddir)/netware -lphp4lib $(PGSQL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PHPPGSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppgsql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pgsql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppgsql.$suffix: $ext_builddir/phppgsql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppgsql.$suffix \$(phplibdir)

$ext_builddir/phppgsql.$suffix: \$(shared_objects_pgsql) \$(PHPPGSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PGSQL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) -L$(top_builddir)/netware -lphp4lib $(QL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pgsql) $(PGSQL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pgsql.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pgsql"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pgsql.$suffix: $ext_builddir/pgsql.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pgsql.$suffix \$(phplibdir)

$ext_builddir/pgsql.$suffix: \$(shared_objects_pgsql) \$(PGSQL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PGSQL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pgsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pgsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pgsql"
    else


  case ext/pgsql in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pgsql"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pgsql/"; ac_bdir="ext/pgsql/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pgsql.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pgsql"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi






echo "$as_me:$LINENO: checking whether to enable POSIX-like functions" >&5
echo $ECHO_N "checking whether to enable POSIX-like functions... $ECHO_C" >&6
# Check whether --enable-posix or --disable-posix was given.
if test "${enable_posix+set}" = set; then
  enableval="$enable_posix"
  PHP_POSIX=$enableval
else

  PHP_POSIX=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_POSIX=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_POSIX in
shared,*)
  PHP_POSIX=`echo "$PHP_POSIX"|sed 's/^shared,//'`
  ;;
shared)
  PHP_POSIX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_POSIX" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_POSIX 1
_ACEOF


  ext_builddir=ext/posix
  ext_srcdir=$abs_srcdir/ext/posix

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/posix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in posix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC posix"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC posix"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/posix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in posix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_posix="$shared_objects_posix $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_posix) $(PHPPOSIX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) -L$(top_builddir)/netware -lphp4lib $(POSIX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) $(PHPPOSIX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpposix.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_posix"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpposix.$suffix: $ext_builddir/phpposix.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpposix.$suffix \$(phplibdir)

$ext_builddir/phpposix.$suffix: \$(shared_objects_posix) \$(PHPPOSIX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_posix) $(POSIX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) -L$(top_builddir)/netware -lphp4lib $(IX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_posix) $(POSIX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/posix.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_posix"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/posix.$suffix: $ext_builddir/posix.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/posix.$suffix \$(phplibdir)

$ext_builddir/posix.$suffix: \$(shared_objects_posix) \$(POSIX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_POSIX 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/posix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in posix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC posix"
    else


  case ext/posix in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/posix"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/posix/"; ac_bdir="ext/posix/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in posix.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC posix"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"














for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo getrlimit getlogin getgroups
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done

fi




echo "$as_me:$LINENO: checking for PSPELL support" >&5
echo $ECHO_N "checking for PSPELL support... $ECHO_C" >&6

# Check whether --with-pspell or --without-pspell was given.
if test "${with_pspell+set}" = set; then
  withval="$with_pspell"
  PHP_PSPELL=$withval
else

  PHP_PSPELL=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PSPELL=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PSPELL in
shared,*)
  PHP_PSPELL=`echo "$PHP_PSPELL"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PSPELL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PSPELL" != "no"; then

  ext_builddir=ext/pspell
  ext_srcdir=$abs_srcdir/ext/pspell

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/pspell in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pspell.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC pspell"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC pspell"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/pspell in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in pspell.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_pspell="$shared_objects_pspell $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PHPPSPELL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) -L$(top_builddir)/netware -lphp4lib $(PSPELL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PHPPSPELL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phppspell.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pspell"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phppspell.$suffix: $ext_builddir/phppspell.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phppspell.$suffix \$(phplibdir)

$ext_builddir/phppspell.$suffix: \$(shared_objects_pspell) \$(PHPPSPELL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PSPELL_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) -L$(top_builddir)/netware -lphp4lib $(ELL_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_pspell) $(PSPELL_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/pspell.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_pspell"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/pspell.$suffix: $ext_builddir/pspell.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/pspell.$suffix \$(phplibdir)

$ext_builddir/pspell.$suffix: \$(shared_objects_pspell) \$(PSPELL_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_PSPELL 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/pspell in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pspell.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC pspell"
    else


  case ext/pspell in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/pspell"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/pspell/"; ac_bdir="ext/pspell/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in pspell.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC pspell"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


	if test "$PHP_PSPELL" != "yes"; then
	    PSPELL_SEARCH_DIRS=$PHP_PSPELL
	else
	    PSPELL_SEARCH_DIRS="/usr/local /usr"
	fi
	for i in $PSPELL_SEARCH_DIRS; do
		if test -f $i/include/pspell/pspell.h; then
			PSPELL_DIR=$i
			PSPELL_INCDIR=$i/include/pspell
		elif test -f $i/include/pspell.h; then
			PSPELL_DIR=$i
			PSPELL_INCDIR=$i/include
		fi
	done

	if test -z "$PSPELL_DIR"; then
		{ { echo "$as_me:$LINENO: error: Cannot find pspell" >&5
echo "$as_me: error: Cannot find pspell" >&2;}
   { (exit 1); exit 1; }; }
	fi

	PSPELL_LIBDIR=$PSPELL_DIR/lib



  if test "$ext_shared" = "yes"; then
    PSPELL_SHARED_LIBADD="-lpspell $PSPELL_SHARED_LIBADD"
    if test -n "$PSPELL_LIBDIR"; then

  if test "$PSPELL_LIBDIR" != "/usr/lib"; then

  if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PSPELL_LIBDIR
  else

    ep_dir="`echo $PSPELL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PSPELL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PSPELL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PSPELL_LIBDIR"; then

  if test "$PSPELL_LIBDIR" != "/usr/lib"; then

  if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PSPELL_LIBDIR
  else

    ep_dir="`echo $PSPELL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case pspell in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lpspell $LIBS"
   ;;
  esac




  fi




  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
		-L$PSPELL_LIBDIR
	"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for new_aspell_config in -laspell" >&5
echo $ECHO_N "checking for new_aspell_config in -laspell... $ECHO_C" >&6
if test "${ac_cv_lib_aspell_new_aspell_config+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-laspell  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char new_aspell_config ();
int
main ()
{
new_aspell_config ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_aspell_new_aspell_config=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_aspell_new_aspell_config=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_aspell_new_aspell_config" >&5
echo "${ECHO_T}$ac_cv_lib_aspell_new_aspell_config" >&6
if test $ac_cv_lib_aspell_new_aspell_config = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    PSPELL_SHARED_LIBADD="-laspell $PSPELL_SHARED_LIBADD"
    if test -n "$PSPELL_LIBDIR"; then

  if test "$PSPELL_LIBDIR" != "/usr/lib"; then

  if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PSPELL_LIBDIR
  else

    ep_dir="`echo $PSPELL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        PSPELL_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $PSPELL_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PSPELL_LIBDIR"; then

  if test "$PSPELL_LIBDIR" != "/usr/lib"; then

  if test -z "$PSPELL_LIBDIR" || echo "$PSPELL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$PSPELL_LIBDIR
  else

    ep_dir="`echo $PSPELL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PSPELL_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case aspell in
  c|c_r|pthread*) ;;
  *)
      LIBS="-laspell $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_aspell_new_aspell_config


fi



  if test "$PSPELL_INCDIR" != "/usr/include"; then

  if test -z "$PSPELL_INCDIR" || echo "$PSPELL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$PSPELL_INCDIR
  else

    ep_dir="`echo $PSPELL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PSPELL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST PSPELL_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_PSPELL 1
_ACEOF

fi




echo "$as_me:$LINENO: checking for QtDOM support" >&5
echo $ECHO_N "checking for QtDOM support... $ECHO_C" >&6

# Check whether --with-qtdom or --without-qtdom was given.
if test "${with_qtdom+set}" = set; then
  withval="$with_qtdom"
  PHP_QTDOM=$withval
else

  PHP_QTDOM=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_QTDOM=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_QTDOM in
shared,*)
  PHP_QTDOM=`echo "$PHP_QTDOM"|sed 's/^shared,//'`
  ;;
shared)
  PHP_QTDOM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_QTDOM" != "no"; then
  case $PHP_QTDOM in
    yes)
      if test -f $QTDIR/include/qdom.h; then
        QTDOM_LIBDIR=$QTDIR/lib
        QTDOM_INCDIR=$QTDIR/include
      elif test -f /usr/lib/qt2/include/qdom.h; then
        QTDOM_LIBDIR=/usr/lib
        QTDOM_INCDIR=/usr/lib/qt2/include
      fi
      ;;
    *)
      if test -f $PHP_QTDOM/include/qdom.h; then
        QTDOM_LIBDIR=$PHP_QTDOM/lib
        QTDOM_INCDIR=$PHP_QTDOM/include
      fi
      ;;
  esac

  if test -z "$QTDOM_INCDIR"; then
    { { echo "$as_me:$LINENO: error: qdom.h not found." >&5
echo "$as_me: error: qdom.h not found." >&2;}
   { (exit 1); exit 1; }; }
  fi



  if test "$ext_shared" = "yes"; then
    QTDOM_SHARED_LIBADD="-lqt $QTDOM_SHARED_LIBADD"
    if test -n "$QTDOM_LIBDIR"; then

  if test "$QTDOM_LIBDIR" != "/usr/lib"; then

  if test -z "$QTDOM_LIBDIR" || echo "$QTDOM_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$QTDOM_LIBDIR
  else

    ep_dir="`echo $QTDOM_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$QTDOM_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        QTDOM_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $QTDOM_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$QTDOM_LIBDIR"; then

  if test "$QTDOM_LIBDIR" != "/usr/lib"; then

  if test -z "$QTDOM_LIBDIR" || echo "$QTDOM_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$QTDOM_LIBDIR
  else

    ep_dir="`echo $QTDOM_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$QTDOM_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case qt in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lqt $LIBS"
   ;;
  esac




  fi



  if test "$QTDOM_INCDIR" != "/usr/include"; then

  if test -z "$QTDOM_INCDIR" || echo "$QTDOM_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$QTDOM_INCDIR
  else

    ep_dir="`echo $QTDOM_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$QTDOM_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  ext_builddir=ext/qtdom
  ext_srcdir=$abs_srcdir/ext/qtdom

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/qtdom in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/qtdom"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/qtdom/"; ac_bdir="ext/qtdom/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in qtdom.c qtdom_qt.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC qtdom"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC qtdom"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/qtdom in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/qtdom"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/qtdom/"; ac_bdir="ext/qtdom/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in qtdom.c qtdom_qt.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_qtdom="$shared_objects_qtdom $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_qtdom) $(PHPQTDOM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_qtdom) -L$(top_builddir)/netware -lphp4lib $(QTDOM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_qtdom) $(PHPQTDOM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpqtdom.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_qtdom"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpqtdom.$suffix: $ext_builddir/phpqtdom.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpqtdom.$suffix \$(phplibdir)

$ext_builddir/phpqtdom.$suffix: \$(shared_objects_qtdom) \$(PHPQTDOM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_qtdom) $(QTDOM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_qtdom) -L$(top_builddir)/netware -lphp4lib $(OM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_qtdom) $(QTDOM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/qtdom.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_qtdom"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/qtdom.$suffix: $ext_builddir/qtdom.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/qtdom.$suffix \$(phplibdir)

$ext_builddir/qtdom.$suffix: \$(shared_objects_qtdom) \$(QTDOM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_QTDOM 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/qtdom in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/qtdom"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/qtdom/"; ac_bdir="ext/qtdom/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in qtdom.c qtdom_qt.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC qtdom"
    else


  case ext/qtdom in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/qtdom"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/qtdom/"; ac_bdir="ext/qtdom/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in qtdom.c qtdom_qt.cpp; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC qtdom"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST QTDOM_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_QTDOM 1
_ACEOF


  if test -z "$php_cxx_done"; then
    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$ac_tool_prefix"; then
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
  echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

    test -n "$CXX" && break
  done
fi
if test -z "$CXX"; then
  ac_ct_CXX=$CXX
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
do
  # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CXX"; then
  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CXX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
echo "${ECHO_T}$ac_ct_CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  test -n "$ac_ct_CXX" && break
done
test -n "$ac_ct_CXX" || ac_ct_CXX="g++"

  CXX=$ac_ct_CXX
fi


# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
     "checking for C++ compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_compiler_gnu=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_compiler_gnu=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu

fi
echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
GXX=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-g"
echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cxx_g+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_prog_cxx_g=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi
for ac_declaration in \
   '' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
#include <stdlib.h>
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

continue
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_declaration
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_cxx_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
if test -z "$CXXCPP"; then
  if test "${ac_cv_prog_CXXCPP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      # Double quotes because CXXCPP needs to be expanded
    for CXXCPP in "$CXX -E" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  break
fi

    done
    ac_cv_prog_CXXCPP=$CXXCPP

fi
  CXXCPP=$ac_cv_prog_CXXCPP
else
  ac_cv_prog_CXXCPP=$CXXCPP
fi
echo "$as_me:$LINENO: result: $CXXCPP" >&5
echo "${ECHO_T}$CXXCPP" >&6
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  # <limits.h> exists even on freestanding compilers.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
		     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  :
else
  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

    php_cxx_done=yes
  fi

fi




echo "$as_me:$LINENO: checking for libedit readline replacement" >&5
echo $ECHO_N "checking for libedit readline replacement... $ECHO_C" >&6

# Check whether --with-libedit or --without-libedit was given.
if test "${with_libedit+set}" = set; then
  withval="$with_libedit"
  PHP_LIBEDIT=$withval
else

  PHP_LIBEDIT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_LIBEDIT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_LIBEDIT in
shared,*)
  PHP_LIBEDIT=`echo "$PHP_LIBEDIT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_LIBEDIT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_LIBEDIT" = "no"; then


echo "$as_me:$LINENO: checking for readline support" >&5
echo $ECHO_N "checking for readline support... $ECHO_C" >&6

# Check whether --with-readline or --without-readline was given.
if test "${with_readline+set}" = set; then
  withval="$with_readline"
  PHP_READLINE=$withval
else

  PHP_READLINE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_READLINE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_READLINE in
shared,*)
  PHP_READLINE=`echo "$PHP_READLINE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_READLINE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6



fi

if test "$PHP_READLINE" != "no"; then
  for i in $PHP_READLINE /usr/local /usr; do
    test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
  done

  if test -z "$READLINE_DIR"; then
    { { echo "$as_me:$LINENO: error: Please reinstall readline - I cannot find readline.h" >&5
echo "$as_me: error: Please reinstall readline - I cannot find readline.h" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$READLINE_DIR/include" != "/usr/include"; then

  if test -z "$READLINE_DIR/include" || echo "$READLINE_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$READLINE_DIR/include
  else

    ep_dir="`echo $READLINE_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$READLINE_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_READLINE_LIBS=""
  echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5
echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6
if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char tgetent ();
int
main ()
{
tgetent ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ncurses_tgetent=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ncurses_tgetent=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6
if test $ac_cv_lib_ncurses_tgetent = yes; then



  case ncurses in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="-lncurses $READLINE_SHARED_LIBADD"
    else


  case ncurses in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lncurses $LIBS"
   ;;
  esac


    fi
   ;;
  esac


    PHP_READLINE_LIBS="$PHP_READLINE_LIBS -lncurses"

else

    echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5
echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6
if test "${ac_cv_lib_termcap_tgetent+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermcap  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char tgetent ();
int
main ()
{
tgetent ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_termcap_tgetent=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_termcap_tgetent=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6
if test $ac_cv_lib_termcap_tgetent = yes; then



  case termcap in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD"
    else


  case termcap in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ltermcap $LIBS"
   ;;
  esac


    fi
   ;;
  esac


      PHP_READLINE_LIBS="$PHP_READLINE_LIBS -ltermcap"

fi


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for readline in -lreadline" >&5
echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6
if test "${ac_cv_lib_readline_readline+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lreadline  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char readline ();
int
main ()
{
readline ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_readline_readline=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_readline_readline=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5
echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6
if test $ac_cv_lib_readline_readline = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-lreadline $READLINE_SHARED_LIBADD"
    if test -n "$READLINE_DIR/lib"; then

  if test "$READLINE_DIR/lib" != "/usr/lib"; then

  if test -z "$READLINE_DIR/lib" || echo "$READLINE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$READLINE_DIR/lib
  else

    ep_dir="`echo $READLINE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$READLINE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $READLINE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$READLINE_DIR/lib"; then

  if test "$READLINE_DIR/lib" != "/usr/lib"; then

  if test -z "$READLINE_DIR/lib" || echo "$READLINE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$READLINE_DIR/lib
  else

    ep_dir="`echo $READLINE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$READLINE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case readline in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lreadline $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_readline_readline

    { { echo "$as_me:$LINENO: error: readline library not found" >&5
echo "$as_me: error: readline library not found" >&2;}
   { (exit 1); exit 1; }; }


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for rl_callback_read_char in -lreadline" >&5
echo $ECHO_N "checking for rl_callback_read_char in -lreadline... $ECHO_C" >&6
if test "${ac_cv_lib_readline_rl_callback_read_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lreadline  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char rl_callback_read_char ();
int
main ()
{
rl_callback_read_char ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_readline_rl_callback_read_char=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_readline_rl_callback_read_char=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_read_char" >&5
echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_read_char" >&6
if test $ac_cv_lib_readline_rl_callback_read_char = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_RL_CALLBACK_READ_CHAR 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_readline_rl_callback_read_char


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$READLINE_DIR/lib $PHP_READLINE_LIBS
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for add_history in -lhistory" >&5
echo $ECHO_N "checking for add_history in -lhistory... $ECHO_C" >&6
if test "${ac_cv_lib_history_add_history+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lhistory  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char add_history ();
int
main ()
{
add_history ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_history_add_history=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_history_add_history=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_history_add_history" >&5
echo "${ECHO_T}$ac_cv_lib_history_add_history" >&6
if test $ac_cv_lib_history_add_history = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-lhistory $READLINE_SHARED_LIBADD"
    if test -n "$READLINE_DIR/lib"; then

  if test "$READLINE_DIR/lib" != "/usr/lib"; then

  if test -z "$READLINE_DIR/lib" || echo "$READLINE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$READLINE_DIR/lib
  else

    ep_dir="`echo $READLINE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$READLINE_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $READLINE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$READLINE_DIR/lib"; then

  if test "$READLINE_DIR/lib" != "/usr/lib"; then

  if test -z "$READLINE_DIR/lib" || echo "$READLINE_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$READLINE_DIR/lib
  else

    ep_dir="`echo $READLINE_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$READLINE_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case history in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lhistory $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_history_add_history

    { { echo "$as_me:$LINENO: error: history library required by readline not found" >&5
echo "$as_me: error: history library required by readline not found" >&2;}
   { (exit 1); exit 1; }; }


fi



  ext_builddir=ext/readline
  ext_srcdir=$abs_srcdir/ext/readline

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then



  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC readline"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC readline"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_readline="$shared_objects_readline $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) -L$(top_builddir)/netware -lphp4lib $(READLINE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreadline.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpreadline.$suffix: $ext_builddir/phpreadline.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpreadline.$suffix \$(phplibdir)

$ext_builddir/phpreadline.$suffix: \$(shared_objects_readline) \$(PHPREADLINE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_readline) $(READLINE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) -L$(top_builddir)/netware -lphp4lib $(DLINE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(READLINE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/readline.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/readline.$suffix: $ext_builddir/readline.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/readline.$suffix \$(phplibdir)

$ext_builddir/readline.$suffix: \$(shared_objects_readline) \$(READLINE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_READLINE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC readline"
    else


  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC readline"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST READLINE_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBREADLINE 1
_ACEOF


elif test "$PHP_LIBEDIT" != "no"; then

  for i in $PHP_LIBEDIT /usr/local /usr; do
    test -f $i/include/readline/readline.h && LIBEDIT_DIR=$i && break
  done

  if test -z "$LIBEDIT_DIR"; then
    { { echo "$as_me:$LINENO: error: Please reinstall libedit - I cannot find readline.h" >&5
echo "$as_me: error: Please reinstall libedit - I cannot find readline.h" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$LIBEDIT_DIR/include" != "/usr/include"; then

  if test -z "$LIBEDIT_DIR/include" || echo "$LIBEDIT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$LIBEDIT_DIR/include
  else

    ep_dir="`echo $LIBEDIT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5
echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6
if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char tgetent ();
int
main ()
{
tgetent ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ncurses_tgetent=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ncurses_tgetent=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5
echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6
if test $ac_cv_lib_ncurses_tgetent = yes; then



  case ncurses in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="-lncurses $READLINE_SHARED_LIBADD"
    else


  case ncurses in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lncurses $LIBS"
   ;;
  esac


    fi
   ;;
  esac



else

    echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5
echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6
if test "${ac_cv_lib_termcap_tgetent+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltermcap  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char tgetent ();
int
main ()
{
tgetent ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_termcap_tgetent=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_termcap_tgetent=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5
echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6
if test $ac_cv_lib_termcap_tgetent = yes; then



  case termcap in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="-ltermcap $READLINE_SHARED_LIBADD"
    else


  case termcap in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ltermcap $LIBS"
   ;;
  esac


    fi
   ;;
  esac



fi


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$READLINE_DIR/lib
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for readline in -ledit" >&5
echo $ECHO_N "checking for readline in -ledit... $ECHO_C" >&6
if test "${ac_cv_lib_edit_readline+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ledit  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char readline ();
int
main ()
{
readline ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_edit_readline=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_edit_readline=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_edit_readline" >&5
echo "${ECHO_T}$ac_cv_lib_edit_readline" >&6
if test $ac_cv_lib_edit_readline = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-ledit $READLINE_SHARED_LIBADD"
    if test -n "$LIBEDIT_DIR/lib"; then

  if test "$LIBEDIT_DIR/lib" != "/usr/lib"; then

  if test -z "$LIBEDIT_DIR/lib" || echo "$LIBEDIT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$LIBEDIT_DIR/lib
  else

    ep_dir="`echo $LIBEDIT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        READLINE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $READLINE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$LIBEDIT_DIR/lib"; then

  if test "$LIBEDIT_DIR/lib" != "/usr/lib"; then

  if test -z "$LIBEDIT_DIR/lib" || echo "$LIBEDIT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$LIBEDIT_DIR/lib
  else

    ep_dir="`echo $LIBEDIT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$LIBEDIT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case edit in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ledit $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_edit_readline

    { { echo "$as_me:$LINENO: error: edit library required by readline not found" >&5
echo "$as_me: error: edit library required by readline not found" >&2;}
   { (exit 1); exit 1; }; }


fi



  ext_builddir=ext/readline
  ext_srcdir=$abs_srcdir/ext/readline

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" != "cli"; then



  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC readline"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC readline"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_readline="$shared_objects_readline $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) -L$(top_builddir)/netware -lphp4lib $(READLINE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(PHPREADLINE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpreadline.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpreadline.$suffix: $ext_builddir/phpreadline.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpreadline.$suffix \$(phplibdir)

$ext_builddir/phpreadline.$suffix: \$(shared_objects_readline) \$(PHPREADLINE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_readline) $(READLINE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) -L$(top_builddir)/netware -lphp4lib $(DLINE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_readline) $(READLINE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/readline.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_readline"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/readline.$suffix: $ext_builddir/readline.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/readline.$suffix \$(phplibdir)

$ext_builddir/readline.$suffix: \$(shared_objects_readline) \$(READLINE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_READLINE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "cli" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC readline"
    else


  case ext/readline in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/readline"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/readline/"; ac_bdir="ext/readline/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in readline.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC readline"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST READLINE_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBEDIT 1
_ACEOF

fi




echo "$as_me:$LINENO: checking for recode support" >&5
echo $ECHO_N "checking for recode support... $ECHO_C" >&6

# Check whether --with-recode or --without-recode was given.
if test "${with_recode+set}" = set; then
  withval="$with_recode"
  PHP_RECODE=$withval
else

  PHP_RECODE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_RECODE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_RECODE in
shared,*)
  PHP_RECODE=`echo "$PHP_RECODE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_RECODE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_RECODE" != "no"; then
  RECODE_LIST="$PHP_RECODE /usr/local /usr /opt"

  for i in $RECODE_LIST; do
    if test -f $i/include/recode.h; then
      RECODE_DIR=$i
      RECODE_INC=include
      RECODE_LIB=lib
    fi
    if test -f $i/include/recode/recode.h; then
      RECODE_DIR=$i
      RECODE_INC=include/recode
      RECODE_LIB=lib/recode
    fi
    if test -f $i/recode/include/recode.h; then
      RECODE_DIR=$i/recode
      RECODE_INC=include
      RECODE_LIB=lib
    fi
    test -n "$RECODE_DIR" && break
  done

  if test -z "$RECODE_DIR"; then
    { { echo "$as_me:$LINENO: error: Can not find recode.h anywhere under $RECODE_LIST." >&5
echo "$as_me: error: Can not find recode.h anywhere under $RECODE_LIST." >&2;}
   { (exit 1); exit 1; }; }
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$RECODE_DIR/$RECODE_LIB
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for recode_format_table in -lrecode" >&5
echo $ECHO_N "checking for recode_format_table in -lrecode... $ECHO_C" >&6
if test "${ac_cv_lib_recode_recode_format_table+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lrecode  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char recode_format_table ();
int
main ()
{
recode_format_table ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_recode_recode_format_table=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_recode_recode_format_table=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_recode_recode_format_table" >&5
echo "${ECHO_T}$ac_cv_lib_recode_recode_format_table" >&6
if test $ac_cv_lib_recode_recode_format_table = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD"
    if test -n "$RECODE_DIR/$RECODE_LIB"; then

  if test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then

  if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then
    ai_p=$RECODE_DIR/$RECODE_LIB
  else

    ep_dir="`echo $RECODE_DIR/$RECODE_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`"
  fi


      if test "$ext_shared" = "yes"; then
        RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $RECODE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$RECODE_DIR/$RECODE_LIB"; then

  if test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then

  if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then
    ai_p=$RECODE_DIR/$RECODE_LIB
  else

    ep_dir="`echo $RECODE_DIR/$RECODE_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case recode in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lrecode $LIBS"
   ;;
  esac




  fi




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_recode_recode_format_table

    old_LDFLAGS=$LDFLAGS
    old_LIBS=$LIBS
    LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
    LIBS="$LIBS -lrecode"
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

char *program_name;

int
main ()
{

recode_format_table();

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then



  if test "$ext_shared" = "yes"; then
    RECODE_SHARED_LIBADD="-lrecode $RECODE_SHARED_LIBADD"
    if test -n "$RECODE_DIR/$RECODE_LIB"; then

  if test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then

  if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then
    ai_p=$RECODE_DIR/$RECODE_LIB
  else

    ep_dir="`echo $RECODE_DIR/$RECODE_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`"
  fi


      if test "$ext_shared" = "yes"; then
        RECODE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $RECODE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$RECODE_DIR/$RECODE_LIB"; then

  if test "$RECODE_DIR/$RECODE_LIB" != "/usr/lib"; then

  if test -z "$RECODE_DIR/$RECODE_LIB" || echo "$RECODE_DIR/$RECODE_LIB" | grep '^/' >/dev/null ; then
    ai_p=$RECODE_DIR/$RECODE_LIB
  else

    ep_dir="`echo $RECODE_DIR/$RECODE_LIB|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_LIB\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case recode in
  c|c_r|pthread*) ;;
  *)
      DLIBS="-lrecode $DLIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_BROKEN_RECODE 1
_ACEOF


else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


      { { echo "$as_me:$LINENO: error: I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?" >&5
echo "$as_me: error: I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
    LIBS=$old_LIBS
    LDFLAGS=$old_LDFLAGS


fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBRECODE 1
_ACEOF


  if test "$RECODE_DIR/$RECODE_INC" != "/usr/include"; then

  if test -z "$RECODE_DIR/$RECODE_INC" || echo "$RECODE_DIR/$RECODE_INC" | grep '^/' >/dev/null ; then
    ai_p=$RECODE_DIR/$RECODE_INC
  else

    ep_dir="`echo $RECODE_DIR/$RECODE_INC|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$RECODE_DIR/$RECODE_INC\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST RECODE_SHARED_LIBADD"


for ac_header in stdbool.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


  ext_builddir=ext/recode
  ext_srcdir=$abs_srcdir/ext/recode

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/recode in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in recode.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC recode"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC recode"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/recode in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in recode.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_recode="$shared_objects_recode $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) -L$(top_builddir)/netware -lphp4lib $(RECODE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(PHPRECODE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phprecode.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_recode"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phprecode.$suffix: $ext_builddir/phprecode.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phprecode.$suffix \$(phplibdir)

$ext_builddir/phprecode.$suffix: \$(shared_objects_recode) \$(PHPRECODE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_recode) $(RECODE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) -L$(top_builddir)/netware -lphp4lib $(ODE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_recode) $(RECODE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/recode.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_recode"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/recode.$suffix: $ext_builddir/recode.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/recode.$suffix \$(phplibdir)

$ext_builddir/recode.$suffix: \$(shared_objects_recode) \$(RECODE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_RECODE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/recode in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in recode.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC recode"
    else


  case ext/recode in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/recode"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/recode/"; ac_bdir="ext/recode/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in recode.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC recode"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking whether to enable PHP sessions" >&5
echo $ECHO_N "checking whether to enable PHP sessions... $ECHO_C" >&6
# Check whether --enable-session or --disable-session was given.
if test "${enable_session+set}" = set; then
  enableval="$enable_session"
  PHP_SESSION=$enableval
else

  PHP_SESSION=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SESSION=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SESSION in
shared,*)
  PHP_SESSION=`echo "$PHP_SESSION"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SESSION=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for mm support" >&5
echo $ECHO_N "checking for mm support... $ECHO_C" >&6

# Check whether --with-mm or --without-mm was given.
if test "${with_mm+set}" = set; then
  withval="$with_mm"
  PHP_MM=$withval
else

  PHP_MM=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_MM=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_MM
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SESSION" != "no"; then

  echo "$as_me:$LINENO: checking whether pwrite works" >&5
echo $ECHO_N "checking whether pwrite works... $ECHO_C" >&6
if test "${ac_cv_pwrite+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


  if test "$cross_compiling" = yes; then

    ac_cv_pwrite=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

    main() {
    int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);

    if (fd < 0) exit(1);
    if (pwrite(fd, "text", 4, 0) != 4) exit(1);
    /* Linux glibc breakage until 2.2.5 */
    if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
    exit(0);
    }


_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_pwrite=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_pwrite=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

    if test "$ac_cv_pwrite" = "no"; then

  if test "$cross_compiling" = yes; then

    ac_cv_pwrite=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
ssize_t pwrite(int, void *, size_t, off64_t);
    main() {
    int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);

    if (fd < 0) exit(1);
    if (pwrite(fd, "text", 4, 0) != 4) exit(1);
    /* Linux glibc breakage until 2.2.5 */
    if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
    exit(0);
    }


_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_pwrite=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_pwrite=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

      if test "$ac_cv_pwrite" = "yes"; then
        ac_cv_pwrite=64
      fi
    fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pwrite" >&5
echo "${ECHO_T}$ac_cv_pwrite" >&6

  if test "$ac_cv_pwrite" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PWRITE 1
_ACEOF

    if test "$ac_cv_pwrite" = "64"; then

cat >>confdefs.h <<\_ACEOF
#define PHP_PWRITE_64 1
_ACEOF

    fi
  fi


  echo "$as_me:$LINENO: checking whether pread works" >&5
echo $ECHO_N "checking whether pread works... $ECHO_C" >&6
if test "${ac_cv_pread+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


  echo test > conftest_in
  if test "$cross_compiling" = yes; then

    ac_cv_pread=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

    main() {
    char buf[3];
    int fd = open("conftest_in", O_RDONLY);
    if (fd < 0) exit(1);
    if (pread(fd, buf, 2, 0) != 2) exit(1);
    /* Linux glibc breakage until 2.2.5 */
    if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
    exit(0);
    }

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_pread=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_pread=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  rm -f conftest_in

    if test "$ac_cv_pread" = "no"; then

  echo test > conftest_in
  if test "$cross_compiling" = yes; then

    ac_cv_pread=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
ssize_t pread(int, void *, size_t, off64_t);
    main() {
    char buf[3];
    int fd = open("conftest_in", O_RDONLY);
    if (fd < 0) exit(1);
    if (pread(fd, buf, 2, 0) != 2) exit(1);
    /* Linux glibc breakage until 2.2.5 */
    if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
    exit(0);
    }

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_pread=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_pread=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  rm -f conftest_in

      if test "$ac_cv_pread" = "yes"; then
        ac_cv_pread=64
      fi
    fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pread" >&5
echo "${ECHO_T}$ac_cv_pread" >&6

  if test "$ac_cv_pread" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_PREAD 1
_ACEOF

    if test "$ac_cv_pread" = "64"; then

cat >>confdefs.h <<\_ACEOF
#define PHP_PREAD_64 1
_ACEOF

    fi
  fi


  ext_builddir=ext/session
  ext_srcdir=$abs_srcdir/ext/session

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/session in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC session"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC session"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/session in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_session="$shared_objects_session $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) -L$(top_builddir)/netware -lphp4lib $(SESSION_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(PHPSESSION_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsession.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_session"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsession.$suffix: $ext_builddir/phpsession.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsession.$suffix \$(phplibdir)

$ext_builddir/phpsession.$suffix: \$(shared_objects_session) \$(PHPSESSION_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_session) $(SESSION_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) -L$(top_builddir)/netware -lphp4lib $(SION_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_session) $(SESSION_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/session.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_session"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/session.$suffix: $ext_builddir/session.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/session.$suffix \$(phplibdir)

$ext_builddir/session.$suffix: \$(shared_objects_session) \$(SESSION_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SESSION 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/session in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC session"
    else


  case ext/session in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/session"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/session/"; ac_bdir="ext/session/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in session.c mod_files.c mod_mm.c mod_user.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC session"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST SESSION_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_PHP_SESSION 1
_ACEOF

fi

if test "$PHP_MM" != "no"; then
  for i in $PHP_MM /usr/local /usr; do
    test -f "$i/include/mm.h" && MM_DIR=$i && break
  done

  if test -z "$MM_DIR" ; then
    { { echo "$as_me:$LINENO: error: cannot find mm library" >&5
echo "$as_me: error: cannot find mm library" >&2;}
   { (exit 1); exit 1; }; }
  fi



  if test "$ext_shared" = "yes"; then
    SESSION_SHARED_LIBADD="-lmm $SESSION_SHARED_LIBADD"
    if test -n "$MM_DIR/lib"; then

  if test "$MM_DIR/lib" != "/usr/lib"; then

  if test -z "$MM_DIR/lib" || echo "$MM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MM_DIR/lib
  else

    ep_dir="`echo $MM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MM_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SESSION_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SESSION_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$MM_DIR/lib"; then

  if test "$MM_DIR/lib" != "/usr/lib"; then

  if test -z "$MM_DIR/lib" || echo "$MM_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MM_DIR/lib
  else

    ep_dir="`echo $MM_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MM_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case mm in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lmm $LIBS"
   ;;
  esac




  fi



  if test "$MM_DIR/include" != "/usr/include"; then

  if test -z "$MM_DIR/include" || echo "$MM_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$MM_DIR/include
  else

    ep_dir="`echo $MM_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MM_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBMM 1
_ACEOF

fi



echo "$as_me:$LINENO: checking whether to enable shmop support" >&5
echo $ECHO_N "checking whether to enable shmop support... $ECHO_C" >&6
# Check whether --enable-shmop or --disable-shmop was given.
if test "${enable_shmop+set}" = set; then
  enableval="$enable_shmop"
  PHP_SHMOP=$enableval
else

  PHP_SHMOP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SHMOP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SHMOP in
shared,*)
  PHP_SHMOP=`echo "$PHP_SHMOP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SHMOP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SHMOP" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SHMOP 1
_ACEOF


  ext_builddir=ext/shmop
  ext_srcdir=$abs_srcdir/ext/shmop

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/shmop in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in shmop.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC shmop"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC shmop"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/shmop in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in shmop.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_shmop="$shared_objects_shmop $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) -L$(top_builddir)/netware -lphp4lib $(SHMOP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(PHPSHMOP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpshmop.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_shmop"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpshmop.$suffix: $ext_builddir/phpshmop.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpshmop.$suffix \$(phplibdir)

$ext_builddir/phpshmop.$suffix: \$(shared_objects_shmop) \$(PHPSHMOP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(SHMOP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) -L$(top_builddir)/netware -lphp4lib $(OP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_shmop) $(SHMOP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/shmop.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_shmop"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/shmop.$suffix: $ext_builddir/shmop.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/shmop.$suffix \$(phplibdir)

$ext_builddir/shmop.$suffix: \$(shared_objects_shmop) \$(SHMOP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SHMOP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/shmop in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in shmop.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC shmop"
    else


  case ext/shmop in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/shmop"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/shmop/"; ac_bdir="ext/shmop/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in shmop.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC shmop"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for SNMP support" >&5
echo $ECHO_N "checking for SNMP support... $ECHO_C" >&6

# Check whether --with-snmp or --without-snmp was given.
if test "${with_snmp+set}" = set; then
  withval="$with_snmp"
  PHP_SNMP=$withval
else

  PHP_SNMP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SNMP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SNMP in
shared,*)
  PHP_SNMP=`echo "$PHP_SNMP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SNMP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking OpenSSL dir for SNMP" >&5
echo $ECHO_N "checking OpenSSL dir for SNMP... $ECHO_C" >&6

# Check whether --with-openssl-dir or --without-openssl-dir was given.
if test "${with_openssl_dir+set}" = set; then
  withval="$with_openssl_dir"
  PHP_OPENSSL_DIR=$withval
else

  PHP_OPENSSL_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_OPENSSL_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_OPENSSL_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SNMP" != "no"; then

        if test "$PHP_SNMP" = "yes"; then
    # Extract the first word of "net-snmp-config", so it can be a program name with args.
set dummy net-snmp-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_SNMP_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $SNMP_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_SNMP_CONFIG="$SNMP_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy="/usr/local/bin:$PATH"
for as_dir in $as_dummy
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  ;;
esac
fi
SNMP_CONFIG=$ac_cv_path_SNMP_CONFIG

if test -n "$SNMP_CONFIG"; then
  echo "$as_me:$LINENO: result: $SNMP_CONFIG" >&5
echo "${ECHO_T}$SNMP_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  else
    SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config"
  fi

  if test -x "$SNMP_CONFIG"; then
    SNMP_LIBS=`$SNMP_CONFIG --netsnmp-libs`
    SNMP_LIBS="$SNMP_LIBS `$SNMP_CONFIG --external-libs`"
    SNMP_PREFIX=`$SNMP_CONFIG --prefix`

    if test -n "$SNMP_LIBS" && test -n "$SNMP_PREFIX"; then

  if test "${SNMP_PREFIX}/include" != "/usr/include"; then

  if test -z "${SNMP_PREFIX}/include" || echo "${SNMP_PREFIX}/include" | grep '^/' >/dev/null ; then
    ai_p=${SNMP_PREFIX}/include
  else

    ep_dir="`echo $SNMP_PREFIX/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"${SNMP_PREFIX}/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  for ac_i in $SNMP_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SNMP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


cat >>confdefs.h <<\_ACEOF
#define HAVE_NET_SNMP 1
_ACEOF

      SNMP_LIBNAME=netsnmp
    else
      { { echo "$as_me:$LINENO: error: Could not find the required paths. Please check your net-snmp installation." >&5
echo "$as_me: error: Could not find the required paths. Please check your net-snmp installation." >&2;}
   { (exit 1); exit 1; }; }
    fi
  else


    if test "$PHP_SNMP" = "yes"; then
      for i in /usr/include /usr/local/include; do
        test -f $i/snmp.h                       && SNMP_INCDIR=$i
        test -f $i/ucd-snmp/snmp.h              && SNMP_INCDIR=$i/ucd-snmp
        test -f $i/snmp/snmp.h                  && SNMP_INCDIR=$i/snmp
        test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp
      done
      for i in /usr /usr/snmp /usr/local /usr/local/snmp; do
        test -f $i/lib/libsnmp.a -o -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i/lib
      done
    else
      SNMP_INCDIR=$PHP_SNMP/include
      test -d $PHP_SNMP/include/ucd-snmp && SNMP_INCDIR=$PHP_SNMP/include/ucd-snmp
      SNMP_LIBDIR=$PHP_SNMP/lib
    fi

    if test -z "$SNMP_INCDIR"; then
      { { echo "$as_me:$LINENO: error: snmp.h not found. Check your SNMP installation." >&5
echo "$as_me: error: snmp.h not found. Check your SNMP installation." >&2;}
   { (exit 1); exit 1; }; }
    elif test -z "$SNMP_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: libsnmp not found. Check your SNMP installation." >&5
echo "$as_me: error: libsnmp not found. Check your SNMP installation." >&2;}
   { (exit 1); exit 1; }; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$SNMP_INCDIR

for ac_header in default_store.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

    if test "$ac_cv_header_default_store_h" = "yes"; then
      echo "$as_me:$LINENO: checking for OpenSSL support in SNMP libraries" >&5
echo $ECHO_N "checking for OpenSSL support in SNMP libraries... $ECHO_C" >&6
      cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <ucd-snmp-config.h>
#if USE_OPENSSL
        yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

        SNMP_SSL=yes

else

        SNMP_SSL=no

fi
rm -f conftest*

    fi
    CPPFLAGS=$old_CPPFLAGS
    echo "$as_me:$LINENO: result: $SNMP_SSL" >&5
echo "${ECHO_T}$SNMP_SSL" >&6

    if test "$SNMP_SSL" = "yes"; then
      if test "$PHP_OPENSSL_DIR" != "no"; then
        PHP_OPENSSL=$PHP_OPENSSL_DIR
      fi

      if test "$PHP_OPENSSL" = "no"; then
        { { echo "$as_me:$LINENO: error: The UCD-SNMP in this system is built with SSL support.

        Add --with-openssl-dir=DIR to your configure line." >&5
echo "$as_me: error: The UCD-SNMP in this system is built with SSL support.

        Add --with-openssl-dir=DIR to your configure line." >&2;}
   { (exit 1); exit 1; }; }
      else

  found_openssl=no
  unset OPENSSL_INCDIR
  unset OPENSSL_LIBDIR

    test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
  test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no

    if test "$PHP_OPENSSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_OPENSSL
  elif test "$PHP_IMAP_SSL" != "no"; then
    PHP_OPENSSL_DIR=$PHP_IMAP_SSL
  fi

    if test -z "$PKG_CONFIG"; then
    # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $PKG_CONFIG in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
  ;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG

if test -n "$PKG_CONFIG"; then
  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  fi

    if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
    if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
      found_openssl=yes
      OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
      OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
      OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
    else
      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then

  for ac_i in $OPENSSL_LIBS; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SNMP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done


  for ac_i in $OPENSSL_INCS; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done

    fi
  fi

    if test "$found_openssl" = "no"; then

    if test "$PHP_OPENSSL_DIR" = "yes"; then
      PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
    fi

    for i in $PHP_OPENSSL_DIR; do
      if test -r $i/include/openssl/evp.h; then
        OPENSSL_INCDIR=$i/include
      fi
      if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
        OPENSSL_LIBDIR=$i/lib
      fi
      test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
    done

    if test -z "$OPENSSL_INCDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's <evp.h>" >&5
echo "$as_me: error: Cannot find OpenSSL's <evp.h>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -z "$OPENSSL_LIBDIR"; then
      { { echo "$as_me:$LINENO: error: Cannot find OpenSSL's libraries" >&5
echo "$as_me: error: Cannot find OpenSSL's libraries" >&2;}
   { (exit 1); exit 1; }; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$OPENSSL_INCDIR
    echo "$as_me:$LINENO: checking for OpenSSL version" >&5
echo $ECHO_N "checking for OpenSSL version... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "yes" >/dev/null 2>&1; then

      echo "$as_me:$LINENO: result: >= 0.9.6" >&5
echo "${ECHO_T}>= 0.9.6" >&6

else

      { { echo "$as_me:$LINENO: error: OpenSSL version 0.9.6 or greater required." >&5
echo "$as_me: error: OpenSSL version 0.9.6 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS


  if test "$OPENSSL_INCDIR" != "/usr/include"; then

  if test -z "$OPENSSL_INCDIR" || echo "$OPENSSL_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_INCDIR
  else

    ep_dir="`echo $OPENSSL_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for CRYPTO_free in -lcrypto" >&5
echo $ECHO_N "checking for CRYPTO_free in -lcrypto... $ECHO_C" >&6
if test "${ac_cv_lib_crypto_CRYPTO_free+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char CRYPTO_free ();
int
main ()
{
CRYPTO_free ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_crypto_CRYPTO_free=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_crypto_CRYPTO_free=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_free" >&5
echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_free" >&6
if test $ac_cv_lib_crypto_CRYPTO_free = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case crypto in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="-lcrypto $SNMP_SHARED_LIBADD"
    else


  case crypto in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcrypto $LIBS"
   ;;
  esac


    fi
   ;;
  esac




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_crypto_CRYPTO_free

      { { echo "$as_me:$LINENO: error: libcrypto not found!" >&5
echo "$as_me: error: libcrypto not found!" >&2;}
   { (exit 1); exit 1; }; }


fi


    old_LIBS=$LIBS
    LIBS="$LIBS -lcrypto"

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$OPENSSL_LIBDIR
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for SSL_CTX_set_ssl_version in -lssl" >&5
echo $ECHO_N "checking for SSL_CTX_set_ssl_version in -lssl... $ECHO_C" >&6
if test "${ac_cv_lib_ssl_SSL_CTX_set_ssl_version+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lssl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SSL_CTX_set_ssl_version ();
int
main ()
{
SSL_CTX_set_ssl_version ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_ssl_SSL_CTX_set_ssl_version=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_ssl_SSL_CTX_set_ssl_version=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&5
echo "${ECHO_T}$ac_cv_lib_ssl_SSL_CTX_set_ssl_version" >&6
if test $ac_cv_lib_ssl_SSL_CTX_set_ssl_version = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

      found_openssl=yes


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_ssl_SSL_CTX_set_ssl_version

      { { echo "$as_me:$LINENO: error: libssl not found!" >&5
echo "$as_me: error: libssl not found!" >&2;}
   { (exit 1); exit 1; }; }


fi

    LIBS=$old_LIBS


  case ssl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="-lssl $SNMP_SHARED_LIBADD"
    else


  case ssl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lssl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  if test "$OPENSSL_LIBDIR" != "/usr/lib"; then

  if test -z "$OPENSSL_LIBDIR" || echo "$OPENSSL_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_LIBDIR
  else

    ep_dir="`echo $OPENSSL_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SNMP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  fi

  if test "$found_openssl" = "yes"; then
    OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR


:
else
          { { echo "$as_me:$LINENO: error: SNMP: OpenSSL check failed. Please check config.log for more information." >&5
echo "$as_me: error: SNMP: OpenSSL check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }

  fi

      fi
    fi

    echo "$as_me:$LINENO: checking for kstat_read in -lkstat" >&5
echo $ECHO_N "checking for kstat_read in -lkstat... $ECHO_C" >&6
if test "${ac_cv_lib_kstat_kstat_read+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lkstat  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char kstat_read ();
int
main ()
{
kstat_read ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_kstat_kstat_read=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_kstat_kstat_read=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_kstat_kstat_read" >&5
echo "${ECHO_T}$ac_cv_lib_kstat_kstat_read" >&6
if test $ac_cv_lib_kstat_kstat_read = yes; then


  case kstat in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="-lkstat $SNMP_SHARED_LIBADD"
    else


  case kstat in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lkstat $LIBS"
   ;;
  esac


    fi
   ;;
  esac


fi


  if test "$SNMP_INCDIR" != "/usr/include"; then

  if test -z "$SNMP_INCDIR" || echo "$SNMP_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$SNMP_INCDIR
  else

    ep_dir="`echo $SNMP_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SNMP_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    SNMP_SHARED_LIBADD="-lsnmp $SNMP_SHARED_LIBADD"
    if test -n "$SNMP_LIBDIR"; then

  if test "$SNMP_LIBDIR" != "/usr/lib"; then

  if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$SNMP_LIBDIR
  else

    ep_dir="`echo $SNMP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SNMP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SNMP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$SNMP_LIBDIR"; then

  if test "$SNMP_LIBDIR" != "/usr/lib"; then

  if test -z "$SNMP_LIBDIR" || echo "$SNMP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$SNMP_LIBDIR
  else

    ep_dir="`echo $SNMP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SNMP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case snmp in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsnmp $LIBS"
   ;;
  esac




  fi


    SNMP_LIBNAME=snmp
  fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    $SNMP_SHARED_LIBADD
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$SNMP_LIBNAME''_snmp_parse_oid" | $as_tr_sh`
echo "$as_me:$LINENO: checking for snmp_parse_oid in -l$SNMP_LIBNAME" >&5
echo $ECHO_N "checking for snmp_parse_oid in -l$SNMP_LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$SNMP_LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char snmp_parse_oid ();
int
main ()
{
snmp_parse_oid ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_SNMP_PARSE_OID 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$SNMP_LIBNAME_snmp_parse_oid


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    $SNMP_SHARED_LIBADD
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$SNMP_LIBNAME''_init_snmp" | $as_tr_sh`
echo "$as_me:$LINENO: checking for init_snmp in -l$SNMP_LIBNAME" >&5
echo $ECHO_N "checking for init_snmp in -l$SNMP_LIBNAME... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$SNMP_LIBNAME  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char init_snmp ();
int
main ()
{
init_snmp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_SNMP 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$SNMP_LIBNAME_init_snmp

    { { echo "$as_me:$LINENO: error: SNMP sanity check failed. Please check config.log for more information." >&5
echo "$as_me: error: SNMP sanity check failed. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi



  ext_builddir=ext/snmp
  ext_srcdir=$abs_srcdir/ext/snmp

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/snmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in snmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC snmp"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC snmp"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/snmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in snmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_snmp="$shared_objects_snmp $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) -L$(top_builddir)/netware -lphp4lib $(SNMP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(PHPSNMP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsnmp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_snmp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsnmp.$suffix: $ext_builddir/phpsnmp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsnmp.$suffix \$(phplibdir)

$ext_builddir/phpsnmp.$suffix: \$(shared_objects_snmp) \$(PHPSNMP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(SNMP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) -L$(top_builddir)/netware -lphp4lib $(P_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_snmp) $(SNMP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/snmp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_snmp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/snmp.$suffix: $ext_builddir/snmp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/snmp.$suffix \$(phplibdir)

$ext_builddir/snmp.$suffix: \$(shared_objects_snmp) \$(SNMP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SNMP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/snmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in snmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC snmp"
    else


  case ext/snmp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/snmp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/snmp/"; ac_bdir="ext/snmp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in snmp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC snmp"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST SNMP_SHARED_LIBADD"

fi


echo "$as_me:$LINENO: checking whether to enable UCD SNMP hack" >&5
echo $ECHO_N "checking whether to enable UCD SNMP hack... $ECHO_C" >&6
# Check whether --enable-ucd-snmp-hack or --disable-ucd-snmp-hack was given.
if test "${enable_ucd_snmp_hack+set}" = set; then
  enableval="$enable_ucd_snmp_hack"

  if test "$enableval" = "yes" ; then

cat >>confdefs.h <<\_ACEOF
#define UCD_SNMP_HACK 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  fi

else

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi;




echo "$as_me:$LINENO: checking whether to enable sockets support" >&5
echo $ECHO_N "checking whether to enable sockets support... $ECHO_C" >&6
# Check whether --enable-sockets or --disable-sockets was given.
if test "${enable_sockets+set}" = set; then
  enableval="$enable_sockets"
  PHP_SOCKETS=$enableval
else

  PHP_SOCKETS=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SOCKETS=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SOCKETS in
shared,*)
  PHP_SOCKETS=`echo "$PHP_SOCKETS"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SOCKETS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SOCKETS" != "no"; then
    echo "$as_me:$LINENO: checking for struct cmsghdr" >&5
echo $ECHO_N "checking for struct cmsghdr... $ECHO_C" >&6
if test "${ac_cv_cmsghdr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/socket.h>
int
main ()
{
struct cmsghdr s; s
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_cmsghdr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_cmsghdr=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

fi
echo "$as_me:$LINENO: result: $ac_cv_cmsghdr" >&5
echo "${ECHO_T}$ac_cv_cmsghdr" >&6

  if test "$ac_cv_cmsghdr" = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_CMSGHDR 1
_ACEOF

  fi



for ac_func in hstrerror set_h_errno
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done





for ac_header in netdb.h netinet/tcp.h sys/un.h errno.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/socket.h>

int
main ()
{
static struct msghdr tp; int n = (int) tp.msg_flags; return n
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


cat >>confdefs.h <<\_ACEOF
#define MISSING_MSGHDR_MSGFLAGS 1
_ACEOF


fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

cat >>confdefs.h <<\_ACEOF
#define HAVE_SOCKETS 1
_ACEOF



  ext_builddir=ext/sockets
  ext_srcdir=$abs_srcdir/ext/sockets

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sockets in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sockets.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sockets"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sockets"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sockets in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in sockets.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sockets="$shared_objects_sockets $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(PHPSOCKETS_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) -L$(top_builddir)/netware -lphp4lib $(SOCKETS_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(PHPSOCKETS_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsockets.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sockets"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsockets.$suffix: $ext_builddir/phpsockets.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsockets.$suffix \$(phplibdir)

$ext_builddir/phpsockets.$suffix: \$(shared_objects_sockets) \$(PHPSOCKETS_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(SOCKETS_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) -L$(top_builddir)/netware -lphp4lib $(KETS_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sockets) $(SOCKETS_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sockets.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sockets"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sockets.$suffix: $ext_builddir/sockets.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sockets.$suffix \$(phplibdir)

$ext_builddir/sockets.$suffix: \$(shared_objects_sockets) \$(SOCKETS_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SOCKETS 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sockets in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sockets.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sockets"
    else


  case ext/sockets in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sockets"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sockets/"; ac_bdir="ext/sockets/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sockets.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sockets"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi









for ac_func in getcwd getwd asinh acosh atanh log1p hypot
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done




  if test "$ac_cv_func_crypt" = "no"; then
  echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
if test "${ac_cv_lib_crypt_crypt+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypt  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char crypt ();
int
main ()
{
crypt ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_crypt_crypt=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_crypt_crypt=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
if test $ac_cv_lib_crypt_crypt = yes; then

    LIBS="-lcrypt $LIBS -lcrypt"

cat >>confdefs.h <<\_ACEOF
#define HAVE_CRYPT 1
_ACEOF


fi

  fi

  echo "$as_me:$LINENO: checking for standard DES crypt" >&5
echo $ECHO_N "checking for standard DES crypt... $ECHO_C" >&6
if test "${ac_cv_crypt_des+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

    ac_cv_crypt_des=yes

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_UNISTD_H
#include <unistd.h>
#endif

#if HAVE_CRYPT_H
#include <crypt.h>
#endif

main() {
#if HAVE_CRYPT
    exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M"));
#else
	exit(0);
#endif
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_crypt_des=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_crypt_des=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_crypt_des" >&5
echo "${ECHO_T}$ac_cv_crypt_des" >&6
  if test "$ac_cv_crypt_des" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi

cat >>confdefs.h <<_ACEOF
#define PHP_STD_DES_CRYPT $ac_result
_ACEOF


  echo "$as_me:$LINENO: checking for extended DES crypt" >&5
echo $ECHO_N "checking for extended DES crypt... $ECHO_C" >&6
if test "${ac_cv_crypt_ext_des+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

    ac_cv_crypt_ext_des=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_UNISTD_H
#include <unistd.h>
#endif

#if HAVE_CRYPT_H
#include <crypt.h>
#endif

main() {
#if HAVE_CRYPT
    exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
#else
	exit(0);
#endif
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_crypt_ext_des=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_crypt_ext_des=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_crypt_ext_des" >&5
echo "${ECHO_T}$ac_cv_crypt_ext_des" >&6
  if test "$ac_cv_crypt_ext_des" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi

cat >>confdefs.h <<_ACEOF
#define PHP_EXT_DES_CRYPT $ac_result
_ACEOF


  echo "$as_me:$LINENO: checking for MD5 crypt" >&5
echo $ECHO_N "checking for MD5 crypt... $ECHO_C" >&6
if test "${ac_cv_crypt_md5+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

    ac_cv_crypt_md5=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_UNISTD_H
#include <unistd.h>
#endif

#if HAVE_CRYPT_H
#include <crypt.h>
#endif

main() {
#if HAVE_CRYPT
    char salt[15], answer[40];

    salt[0]='$'; salt[1]='1'; salt[2]='$';
    salt[3]='r'; salt[4]='a'; salt[5]='s';
    salt[6]='m'; salt[7]='u'; salt[8]='s';
    salt[9]='l'; salt[10]='e'; salt[11]='$';
    salt[12]='\0';
    strcpy(answer,salt);
    strcat(answer,"rISCgZzpwk3UhDidwXvin0");
    exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
	exit(0);
#endif
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_crypt_md5=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_crypt_md5=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_crypt_md5" >&5
echo "${ECHO_T}$ac_cv_crypt_md5" >&6
  if test "$ac_cv_crypt_md5" = "yes"; then
    ac_result=1
  else
    if test "$ac_cv_crypt_des" != "yes"; then

  DEBUG_LOG=debug.log
  cat >debug.log <<X
CONFIGURE:  $CONFIGURE_COMMAND
CC:         $CC
CFLAGS:     $CFLAGS
CPPFLAGS:   $CPPFLAGS
CXX:        $CXX
CXXFLAGS:   $CXXFLAGS
INCLUDES:   $INCLUDES
LDFLAGS:    $LDFLAGS
LIBS:       $LIBS
DLIBS:      $DLIBS
SAPI:       $PHP_SAPI
PHP_RPATHS: $PHP_RPATHS
uname -a:   `uname -a`

X
    cat >conftest.$ac_ext <<X
main()
{
  exit(0);
}
X
    (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>debug.log 2>&1
    rm -fr conftest*

    fi
    ac_result=0
  fi

cat >>confdefs.h <<_ACEOF
#define PHP_MD5_CRYPT $ac_result
_ACEOF


  echo "$as_me:$LINENO: checking for Blowfish crypt" >&5
echo $ECHO_N "checking for Blowfish crypt... $ECHO_C" >&6
if test "${ac_cv_crypt_blowfish+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

    ac_cv_crypt_blowfish=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_UNISTD_H
#include <unistd.h>
#endif

#if HAVE_CRYPT_H
#include <crypt.h>
#endif

main() {
#if HAVE_CRYPT
    char salt[30], answer[70];

    salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0';
    strcat(salt,"rasmuslerd............");
    strcpy(answer,salt);
    strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
    exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
	exit(0);
#endif
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

    ac_cv_crypt_blowfish=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

    ac_cv_crypt_blowfish=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_crypt_blowfish" >&5
echo "${ECHO_T}$ac_cv_crypt_blowfish" >&6
  if test "$ac_cv_crypt_blowfish" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi

cat >>confdefs.h <<_ACEOF
#define PHP_BLOWFISH_CRYPT $ac_result
_ACEOF



  echo "$as_me:$LINENO: checking whether flush should be called explicitly after a buffered io" >&5
echo $ECHO_N "checking whether flush should be called explicitly after a buffered io... $ECHO_C" >&6
if test "${ac_cv_flush_io+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

  ac_cv_flush_io=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
	char *filename = tmpnam(NULL);
	char buffer[64];
	int result = 0;

	FILE *fp = fopen(filename, "wb");
	if (NULL == fp)
		return 0;
	fputs("line 1\n", fp);
	fputs("line 2\n", fp);
	fclose(fp);

	fp = fopen(filename, "rb+");
	if (NULL == fp)
		return 0;
	fgets(buffer, sizeof(buffer), fp);
	fputs("line 3\n", fp);
	rewind(fp);
	fgets(buffer, sizeof(buffer), fp);
	if (0 != strcmp(buffer, "line 1\n"))
		result = 1;
	fgets(buffer, sizeof(buffer), fp);
	if (0 != strcmp(buffer, "line 3\n"))
		result = 1;
	fclose(fp);
	unlink(filename);

	exit(result);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  ac_cv_flush_io=no

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

  ac_cv_flush_io=yes

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_flush_io" >&5
echo "${ECHO_T}$ac_cv_flush_io" >&6
  if test "$ac_cv_flush_io" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FLUSHIO 1
_ACEOF

  fi



# Check whether --with-regex or --without-regex was given.
if test "${with_regex+set}" = set; then
  withval="$with_regex"

  case $withval in
    system)
      if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; then
        REGEX_TYPE=php
      else
        REGEX_TYPE=system
      fi
      ;;
    apache)
      REGEX_TYPE=apache
      ;;
    php)
      REGEX_TYPE=php
      ;;
    *)
      REGEX_TYPE=php
      { echo "$as_me:$LINENO: WARNING: Invalid regex library type. Using default value: php" >&5
echo "$as_me: WARNING: Invalid regex library type. Using default value: php" >&2;}
      ;;
  esac

else

  REGEX_TYPE=php

fi;


  if test "$REGEX_TYPE" = "php"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_REGEX_T_RE_MAGIC 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define HSREGEX 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define REGEX 1
_ACEOF



  case regex in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "regex"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/regex/"; ac_bdir="regex/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in regcomp.c regexec.c regerror.c regfree.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


  elif test "$REGEX_TYPE" = "system"; then

cat >>confdefs.h <<\_ACEOF
#define REGEX 0
_ACEOF

        echo "$as_me:$LINENO: checking whether field re_magic exists in struct regex_t" >&5
echo $ECHO_N "checking whether field re_magic exists in struct regex_t... $ECHO_C" >&6
if test "${ac_cv_regex_t_re_magic+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

      cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <regex.h>
int
main ()
{
regex_t rt; rt.re_magic;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_regex_t_re_magic=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_regex_t_re_magic=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

fi
echo "$as_me:$LINENO: result: $ac_cv_regex_t_re_magic" >&5
echo "${ECHO_T}$ac_cv_regex_t_re_magic" >&6
    if test "$ac_cv_regex_t_re_magic" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_REGEX_T_RE_MAGIC
_ACEOF

    fi
  fi
  echo "$as_me:$LINENO: checking which regex library to use" >&5
echo $ECHO_N "checking which regex library to use... $ECHO_C" >&6
  echo "$as_me:$LINENO: result: $REGEX_TYPE" >&5
echo "${ECHO_T}$REGEX_TYPE" >&6


echo "$as_me:$LINENO: checking whether rounding works as expected" >&5
echo $ECHO_N "checking whether rounding works as expected... $ECHO_C" >&6
if test "$cross_compiling" = yes; then

  PHP_ROUND_FUZZ=0.50000000001
  echo "$as_me:$LINENO: result: cross compile" >&5
echo "${ECHO_T}cross compile" >&6

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <math.h>
  /* keep this out-of-line to prevent use of gcc inline floor() */
  double somefn(double n) {
    return floor(n*pow(10,2) + 0.5);
  }
  int main() {
    return somefn(0.045)/10.0 != 0.5;
  }

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  PHP_ROUND_FUZZ=0.5
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

  PHP_ROUND_FUZZ=0.50000000001
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

cat >>confdefs.h <<_ACEOF
#define PHP_ROUND_FUZZ $PHP_ROUND_FUZZ
_ACEOF


echo "$as_me:$LINENO: checking for working POSIX fnmatch" >&5
echo $ECHO_N "checking for working POSIX fnmatch... $ECHO_C" >&6
if test "${ac_cv_func_fnmatch_works+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # Some versions of Solaris, SCO, and the GNU C Library
   # have a broken or incompatible fnmatch.
   # So we run a test program.  If we are cross-compiling, take no chance.
   # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
   if test "$cross_compiling" = yes; then
  ac_cv_func_fnmatch_works=cross
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <fnmatch.h>
#	   define y(a, b, c) (fnmatch (a, b, c) == 0)
#	   define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)

int
main ()
{
exit
	   (!(y ("a*", "abc", 0)
	      && n ("d*/*1", "d/s/1", FNM_PATHNAME)
	      && y ("a\\\\bc", "abc", 0)
	      && n ("a\\\\bc", "abc", FNM_NOESCAPE)
	      && y ("*x", ".x", 0)
	      && n ("*x", ".x", FNM_PERIOD)
	      && 1));
  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_fnmatch_works=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_func_fnmatch_works=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_works" >&5
echo "${ECHO_T}$ac_cv_func_fnmatch_works" >&6
if test $ac_cv_func_fnmatch_works = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FNMATCH 1
_ACEOF

fi







for ac_func in glob strfmon
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done


if test "$PHP_SAPI" = "cgi" -o "$PHP_SAPI" = "cli" -o "$PHP_SAPI" = "embed"; then

cat >>confdefs.h <<\_ACEOF
#define ENABLE_CHROOT_FUNC 1
_ACEOF

fi




for ac_func in fpclass isinf isnan
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done


echo "$as_me:$LINENO: checking whether atof() accepts NAN" >&5
echo $ECHO_N "checking whether atof() accepts NAN... $ECHO_C" >&6
if test "${ac_cv_atof_accept_nan+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

      ac_cv_atof_accept_nan=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <math.h>
#include <stdlib.h>

#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif

int main(int argc, char** argv)
{
	return zend_isnan(atof("NAN")) ? 0 : 1;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_atof_accept_nan=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      ac_cv_atof_accept_nan=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_atof_accept_nan" >&5
echo "${ECHO_T}$ac_cv_atof_accept_nan" >&6
if test "$ac_cv_atof_accept_nan" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ATOF_ACCEPTS_NAN 1
_ACEOF

fi

echo "$as_me:$LINENO: checking whether atof() accepts INF" >&5
echo $ECHO_N "checking whether atof() accepts INF... $ECHO_C" >&6
if test "${ac_cv_atof_accept_inf+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

      ac_cv_atof_accept_inf=no

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <math.h>
#include <stdlib.h>

#ifdef HAVE_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif

int main(int argc, char** argv)
{
	return zend_isinf(atof("INF")) && zend_isinf(atof("-INF")) ? 0 : 1;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_atof_accept_inf=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      ac_cv_atof_accept_inf=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_atof_accept_inf" >&5
echo "${ECHO_T}$ac_cv_atof_accept_inf" >&6
if test "$ac_cv_atof_accept_inf" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ATOF_ACCEPTS_INF 1
_ACEOF

fi

echo "$as_me:$LINENO: checking whether HUGE_VAL == INF" >&5
echo $ECHO_N "checking whether HUGE_VAL == INF... $ECHO_C" >&6
if test "${ac_cv_huge_val_inf+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

      ac_cv_huge_val_inf=yes

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <math.h>
#include <stdlib.h>

#ifdef HAVE_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif

int main(int argc, char** argv)
{
	return zend_isinf(HUGE_VAL) ? 0 : 1;
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_huge_val_inf=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      ac_cv_huge_val_inf=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_huge_val_inf" >&5
echo "${ECHO_T}$ac_cv_huge_val_inf" >&6
if test "$ac_cv_huge_val_inf" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_HUGE_VAL_INF 1
_ACEOF

fi

echo "$as_me:$LINENO: checking whether HUGE_VAL + -HUGEVAL == NAN" >&5
echo $ECHO_N "checking whether HUGE_VAL + -HUGEVAL == NAN... $ECHO_C" >&6
if test "${ac_cv_huge_val_nan+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  if test "$cross_compiling" = yes; then

      ac_cv_huge_val_nan=yes

else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <math.h>
#include <stdlib.h>

#ifdef HAVE_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif

int main(int argc, char** argv)
{
#if defined(__sparc__) && !(__GNUC__ >= 3)
	/* prevent bug #27830 */
	return 1;
#else
	return zend_isnan(HUGE_VAL + -HUGE_VAL) ? 0 : 1;
#endif
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      ac_cv_huge_val_nan=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      ac_cv_huge_val_nan=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_huge_val_nan" >&5
echo "${ECHO_T}$ac_cv_huge_val_nan" >&6
if test "$ac_cv_huge_val_nan" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_HUGE_VAL_NAN 1
_ACEOF

fi


  ext_builddir=ext/standard
  ext_srcdir=$abs_srcdir/ext/standard

  ac_extra=

  if test "" != "shared" && test "" != "yes" && test "" != "cli"; then



  case ext/standard in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
                            cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
                            flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
                            info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
                            microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
                            reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
                            url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
                            incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
                            http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
                            var_unserializer.c ftok.c aggregation.c sha1.c ; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC standard"
    if test "" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC standard"
    fi
  else
    if test "" = "shared" || test "" = "yes"; then

  case ext/standard in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
                            cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
                            flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
                            info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
                            microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
                            reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
                            url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
                            incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
                            http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
                            var_unserializer.c ftok.c aggregation.c sha1.c ; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_standard="$shared_objects_standard $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) -L$(top_builddir)/netware -lphp4lib $(STANDARD_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(PHPSTANDARD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpstandard.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_standard"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpstandard.$suffix: $ext_builddir/phpstandard.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpstandard.$suffix \$(phplibdir)

$ext_builddir/phpstandard.$suffix: \$(shared_objects_standard) \$(PHPSTANDARD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_standard) $(STANDARD_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) -L$(top_builddir)/netware -lphp4lib $(NDARD_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_standard) $(STANDARD_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/standard.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_standard"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/standard.$suffix: $ext_builddir/standard.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/standard.$suffix \$(phplibdir)

$ext_builddir/standard.$suffix: \$(shared_objects_standard) \$(STANDARD_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_STANDARD 1
_ACEOF

    fi
  fi

  if test "" != "shared" && test "" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/standard in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
                            cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
                            flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
                            info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
                            microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
                            reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
                            url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
                            incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
                            http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
                            var_unserializer.c ftok.c aggregation.c sha1.c ; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC standard"
    else


  case ext/standard in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/standard"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/standard/"; ac_bdir="ext/standard/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in array.c base64.c basic_functions.c browscap.c crc32.c crypt.c \
                            cyr_convert.c datetime.c dir.c dl.c dns.c exec.c file.c filestat.c \
                            flock_compat.c formatted_print.c fsock.c head.c html.c image.c \
                            info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \
                            microtime.c pack.c pageinfo.c parsedate.c quot_print.c rand.c \
                            reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \
                            url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \
                            incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \
                            http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
                            var_unserializer.c ftok.c aggregation.c sha1.c ; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC standard"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"




  src=$ext_srcdir/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments





echo "$as_me:$LINENO: checking for libswf support" >&5
echo $ECHO_N "checking for libswf support... $ECHO_C" >&6

# Check whether --with-swf or --without-swf was given.
if test "${with_swf+set}" = set; then
  withval="$with_swf"
  PHP_SWF=$withval
else

  PHP_SWF=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SWF=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SWF in
shared,*)
  PHP_SWF=`echo "$PHP_SWF"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SWF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SWF" != "no"; then
  if test -r $PHP_SWF/lib/libswf.a; then
    SWF_DIR=$PHP_SWF
  else
    echo "$as_me:$LINENO: checking for libswf in default path" >&5
echo $ECHO_N "checking for libswf in default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      if test -r $i/lib/libswf.a; then
        SWF_DIR=$i
        echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
      fi
    done
  fi

  if test -z "$SWF_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the libswf distribution -
   swf.h should be <swf-dir>/include and
   libswf.a should be in <swf-dir>/lib" >&5
echo "$as_me: error: Please reinstall the libswf distribution -
   swf.h should be <swf-dir>/include and
   libswf.a should be in <swf-dir>/lib" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$SWF_DIR/include" != "/usr/include"; then

  if test -z "$SWF_DIR/include" || echo "$SWF_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$SWF_DIR/include
  else

    ep_dir="`echo $SWF_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SWF_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST SWF_SHARED_LIBADD"



  if test "$ext_shared" = "yes"; then
    SWF_SHARED_LIBADD="-lswf $SWF_SHARED_LIBADD"
    if test -n "$SWF_DIR/lib"; then

  if test "$SWF_DIR/lib" != "/usr/lib"; then

  if test -z "$SWF_DIR/lib" || echo "$SWF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$SWF_DIR/lib
  else

    ep_dir="`echo $SWF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SWF_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SWF_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SWF_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$SWF_DIR/lib"; then

  if test "$SWF_DIR/lib" != "/usr/lib"; then

  if test -z "$SWF_DIR/lib" || echo "$SWF_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$SWF_DIR/lib
  else

    ep_dir="`echo $SWF_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SWF_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case swf in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lswf $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_SWF 1
_ACEOF



  ext_builddir=ext/swf
  ext_srcdir=$abs_srcdir/ext/swf

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/swf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/swf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/swf/"; ac_bdir="ext/swf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in swf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC swf"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC swf"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/swf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/swf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/swf/"; ac_bdir="ext/swf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in swf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_swf="$shared_objects_swf $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_swf) $(PHPSWF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_swf) -L$(top_builddir)/netware -lphp4lib $(SWF_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_swf) $(PHPSWF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpswf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_swf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpswf.$suffix: $ext_builddir/phpswf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpswf.$suffix \$(phplibdir)

$ext_builddir/phpswf.$suffix: \$(shared_objects_swf) \$(PHPSWF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_swf) $(SWF_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_swf) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_swf) $(SWF_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/swf.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_swf"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/swf.$suffix: $ext_builddir/swf.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/swf.$suffix \$(phplibdir)

$ext_builddir/swf.$suffix: \$(shared_objects_swf) \$(SWF_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SWF 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/swf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/swf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/swf/"; ac_bdir="ext/swf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in swf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC swf"
    else


  case ext/swf in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/swf"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/swf/"; ac_bdir="ext/swf/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in swf.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC swf"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking for Sybase support" >&5
echo $ECHO_N "checking for Sybase support... $ECHO_C" >&6

# Check whether --with-sybase or --without-sybase was given.
if test "${with_sybase+set}" = set; then
  withval="$with_sybase"
  PHP_SYBASE=$withval
else

  PHP_SYBASE=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SYBASE=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SYBASE in
shared,*)
  PHP_SYBASE=`echo "$PHP_SYBASE"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SYBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_SYBASE" != "no"; then
  if test "$PHP_SYBASE" = "yes"; then
    SYBASE_INCDIR=/home/sybase/include
    SYBASE_LIBDIR=/home/sybase/lib
  else
    SYBASE_INCDIR=$PHP_SYBASE/include
    SYBASE_LIBDIR=$PHP_SYBASE/lib
  fi

  if test "$SYBASE_INCDIR" != "/usr/include"; then

  if test -z "$SYBASE_INCDIR" || echo "$SYBASE_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$SYBASE_INCDIR
  else

    ep_dir="`echo $SYBASE_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SYBASE_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    SYBASE_SHARED_LIBADD="-lsybdb $SYBASE_SHARED_LIBADD"
    if test -n "$SYBASE_LIBDIR"; then

  if test "$SYBASE_LIBDIR" != "/usr/lib"; then

  if test -z "$SYBASE_LIBDIR" || echo "$SYBASE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$SYBASE_LIBDIR
  else

    ep_dir="`echo $SYBASE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SYBASE_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SYBASE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SYBASE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$SYBASE_LIBDIR"; then

  if test "$SYBASE_LIBDIR" != "/usr/lib"; then

  if test -z "$SYBASE_LIBDIR" || echo "$SYBASE_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$SYBASE_LIBDIR
  else

    ep_dir="`echo $SYBASE_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SYBASE_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case sybdb in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsybdb $LIBS"
   ;;
  esac




  fi



  ext_builddir=ext/sybase
  ext_srcdir=$abs_srcdir/ext/sybase

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sybase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase/"; ac_bdir="ext/sybase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sybase"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sybase"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sybase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase/"; ac_bdir="ext/sybase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_sybase_db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sybase="$shared_objects_sybase $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sybase) $(PHPSYBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase) -L$(top_builddir)/netware -lphp4lib $(SYBASE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase) $(PHPSYBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsybase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsybase.$suffix: $ext_builddir/phpsybase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsybase.$suffix \$(phplibdir)

$ext_builddir/phpsybase.$suffix: \$(shared_objects_sybase) \$(PHPSYBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sybase) $(SYBASE_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase) -L$(top_builddir)/netware -lphp4lib $(ASE_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase) $(SYBASE_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sybase.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sybase.$suffix: $ext_builddir/sybase.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sybase.$suffix \$(phplibdir)

$ext_builddir/sybase.$suffix: \$(shared_objects_sybase) \$(SYBASE_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SYBASE 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sybase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase/"; ac_bdir="ext/sybase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sybase"
    else


  case ext/sybase in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase/"; ac_bdir="ext/sybase/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_db.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sybase"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


  echo "$as_me:$LINENO: checking for dnet_addr in -ldnet_stub" >&5
echo $ECHO_N "checking for dnet_addr in -ldnet_stub... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_stub_dnet_addr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dnet_addr ();
int
main ()
{
dnet_addr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dnet_stub_dnet_addr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dnet_stub_dnet_addr=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_addr" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_addr" >&6
if test $ac_cv_lib_dnet_stub_dnet_addr = yes; then


  if test "$ext_shared" = "yes"; then
    SYBASE_SHARED_LIBADD="-ldnet_stub $SYBASE_SHARED_LIBADD"
    if test -n ""; then

  if test "" != "/usr/lib"; then

  if test -z "" || echo "" | grep '^/' >/dev/null ; then
    ai_p=
  else

    ep_dir="`echo |sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SYBASE_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SYBASE_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n ""; then

  if test "" != "/usr/lib"; then

  if test -z "" || echo "" | grep '^/' >/dev/null ; then
    ai_p=
  else

    ep_dir="`echo |sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case dnet_stub in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ldnet_stub $LIBS"
   ;;
  esac




  fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBDNET_STUB 1
_ACEOF


fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_SYBASE 1
_ACEOF

  echo "$as_me:$LINENO: checking for tdsdbopen in -lsybdb" >&5
echo $ECHO_N "checking for tdsdbopen in -lsybdb... $ECHO_C" >&6
if test "${ac_cv_lib_sybdb_tdsdbopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsybdb  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char tdsdbopen ();
int
main ()
{
tdsdbopen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_sybdb_tdsdbopen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_sybdb_tdsdbopen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_sybdb_tdsdbopen" >&5
echo "${ECHO_T}$ac_cv_lib_sybdb_tdsdbopen" >&6
if test $ac_cv_lib_sybdb_tdsdbopen = yes; then

cat >>confdefs.h <<\_ACEOF
#define PHP_SYBASE_DBOPEN tdsdbopen
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define DBMFIX 1
_ACEOF

else

cat >>confdefs.h <<\_ACEOF
#define PHP_SYBASE_DBOPEN dbopen
_ACEOF

fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST SYBASE_SHARED_LIBADD"

fi




echo "$as_me:$LINENO: checking for Sybase-CT support" >&5
echo $ECHO_N "checking for Sybase-CT support... $ECHO_C" >&6

# Check whether --with-sybase-ct or --without-sybase-ct was given.
if test "${with_sybase_ct+set}" = set; then
  withval="$with_sybase_ct"
  PHP_SYBASE_CT=$withval
else

  PHP_SYBASE_CT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SYBASE_CT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SYBASE_CT in
shared,*)
  PHP_SYBASE_CT=`echo "$PHP_SYBASE_CT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SYBASE_CT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SYBASE_CT" != "no"; then

  if test "$PHP_SYBASE" != "no" && test "$ext_shared" = "no"; then
    { { echo "$as_me:$LINENO: error: You can not use both --with-sybase and --with-sybase-ct in same build!" >&5
echo "$as_me: error: You can not use both --with-sybase and --with-sybase-ct in same build!" >&2;}
   { (exit 1); exit 1; }; }
  fi


cat >>confdefs.h <<\_ACEOF
#define HAVE_SYBASE_CT 1
_ACEOF


  ext_builddir=ext/sybase_ct
  ext_srcdir=$abs_srcdir/ext/sybase_ct

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sybase_ct in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_ct.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sybase_ct"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sybase_ct"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sybase_ct in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_sybase_ct.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sybase_ct="$shared_objects_sybase_ct $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(PHPSYBASE_CT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) -L$(top_builddir)/netware -lphp4lib $(SYBASE_CT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(PHPSYBASE_CT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsybase_ct.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase_ct"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsybase_ct.$suffix: $ext_builddir/phpsybase_ct.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsybase_ct.$suffix \$(phplibdir)

$ext_builddir/phpsybase_ct.$suffix: \$(shared_objects_sybase_ct) \$(PHPSYBASE_CT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(SYBASE_CT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) -L$(top_builddir)/netware -lphp4lib $(ASE_CT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sybase_ct) $(SYBASE_CT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sybase_ct.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sybase_ct"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sybase_ct.$suffix: $ext_builddir/sybase_ct.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sybase_ct.$suffix \$(phplibdir)

$ext_builddir/sybase_ct.$suffix: \$(shared_objects_sybase_ct) \$(SYBASE_CT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SYBASE_CT 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sybase_ct in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_ct.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sybase_ct"
    else


  case ext/sybase_ct in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sybase_ct"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sybase_ct/"; ac_bdir="ext/sybase_ct/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_sybase_ct.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sybase_ct"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST SYBASE_CT_SHARED_LIBADD"


  if test "$PHP_SYBASE_CT" = "yes"; then
    SYBASE_CT_INCDIR=/home/sybase/include
    SYBASE_CT_LIBDIR=/home/sybase/lib
  else
    SYBASE_CT_INCDIR=$PHP_SYBASE_CT/include
    SYBASE_CT_LIBDIR=$PHP_SYBASE_CT/lib
  fi

  if test -f $SYBASE_CT_INCDIR/ctpublic.h; then

  if test "$SYBASE_CT_INCDIR" != "/usr/include"; then

  if test -z "$SYBASE_CT_INCDIR" || echo "$SYBASE_CT_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$SYBASE_CT_INCDIR
  else

    ep_dir="`echo $SYBASE_CT_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SYBASE_CT_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

  else
    { { echo "$as_me:$LINENO: error: ctpublic.h missing!" >&5
echo "$as_me: error: ctpublic.h missing!" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$SYBASE_CT_LIBDIR" != "/usr/lib"; then

  if test -z "$SYBASE_CT_LIBDIR" || echo "$SYBASE_CT_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$SYBASE_CT_LIBDIR
  else

    ep_dir="`echo $SYBASE_CT_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$SYBASE_CT_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $SYBASE_CT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

  if test -f $SYBASE_CT_INCDIR/tds.h; then


  case ct in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lct $SYBASE_CT_SHARED_LIBADD"
    else


  case ct in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lct $LIBS"
   ;;
  esac


    fi
   ;;
  esac


    SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lct"
  else


  case cs in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lcs $SYBASE_CT_SHARED_LIBADD"
    else


  case cs in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcs $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  case ct in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lct $SYBASE_CT_SHARED_LIBADD"
    else


  case ct in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lct $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  case comn in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lcomn $SYBASE_CT_SHARED_LIBADD"
    else


  case comn in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lcomn $LIBS"
   ;;
  esac


    fi
   ;;
  esac




  case intl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lintl $SYBASE_CT_SHARED_LIBADD"
    else


  case intl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lintl $LIBS"
   ;;
  esac


    fi
   ;;
  esac



    SYBASE_CT_LIBS="-L$SYBASE_CT_LIBDIR -lcs -lct -lcomn -lintl"


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      $SYBASE_CT_LIBS
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for netg_errstr in -ltcl" >&5
echo $ECHO_N "checking for netg_errstr in -ltcl... $ECHO_C" >&6
if test "${ac_cv_lib_tcl_netg_errstr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ltcl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char netg_errstr ();
int
main ()
{
netg_errstr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_tcl_netg_errstr=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_tcl_netg_errstr=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_tcl_netg_errstr" >&5
echo "${ECHO_T}$ac_cv_lib_tcl_netg_errstr" >&6
if test $ac_cv_lib_tcl_netg_errstr = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  case tcl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-ltcl $SYBASE_CT_SHARED_LIBADD"
    else


  case tcl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ltcl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_tcl_netg_errstr



  case sybtcl in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-lsybtcl $SYBASE_CT_SHARED_LIBADD"
    else


  case sybtcl in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lsybtcl $LIBS"
   ;;
  esac


    fi
   ;;
  esac




fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$SYBASE_CT_LIBDIR"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for insck__getVdate in -linsck" >&5
echo $ECHO_N "checking for insck__getVdate in -linsck... $ECHO_C" >&6
if test "${ac_cv_lib_insck_insck__getVdate+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-linsck  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char insck__getVdate ();
int
main ()
{
insck__getVdate ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_insck_insck__getVdate=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_insck_insck__getVdate=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_insck_insck__getVdate" >&5
echo "${ECHO_T}$ac_cv_lib_insck_insck__getVdate" >&6
if test $ac_cv_lib_insck_insck__getVdate = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  case insck in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD"
    else


  case insck in
  c|c_r|pthread*) ;;
  *)
      LIBS="-linsck $LIBS"
   ;;
  esac


    fi
   ;;
  esac



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_insck_insck__getVdate


fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="-L$SYBASE_CT_LIBDIR"

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for bsd_tcp in -linsck" >&5
echo $ECHO_N "checking for bsd_tcp in -linsck... $ECHO_C" >&6
if test "${ac_cv_lib_insck_bsd_tcp+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-linsck  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char bsd_tcp ();
int
main ()
{
bsd_tcp ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_insck_bsd_tcp=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_insck_bsd_tcp=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_insck_bsd_tcp" >&5
echo "${ECHO_T}$ac_cv_lib_insck_bsd_tcp" >&6
if test $ac_cv_lib_insck_bsd_tcp = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


  case insck in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        SYBASE_CT_SHARED_LIBADD="-linsck $SYBASE_CT_SHARED_LIBADD"
    else


  case insck in
  c|c_r|pthread*) ;;
  *)
      LIBS="-linsck $LIBS"
   ;;
  esac


    fi
   ;;
  esac



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_insck_bsd_tcp


fi

  fi
fi




echo "$as_me:$LINENO: checking whether to enable System V IPC support" >&5
echo $ECHO_N "checking whether to enable System V IPC support... $ECHO_C" >&6
# Check whether --enable-sysvmsg or --disable-sysvmsg was given.
if test "${enable_sysvmsg+set}" = set; then
  enableval="$enable_sysvmsg"
  PHP_SYSVMSG=$enableval
else

  PHP_SYSVMSG=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SYSVMSG=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SYSVMSG in
shared,*)
  PHP_SYSVMSG=`echo "$PHP_SYSVMSG"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SYSVMSG=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SYSVMSG" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SYSVMSG 1
_ACEOF


  ext_builddir=ext/sysvmsg
  ext_srcdir=$abs_srcdir/ext/sysvmsg

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sysvmsg in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvmsg.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sysvmsg"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sysvmsg"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sysvmsg in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in sysvmsg.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sysvmsg="$shared_objects_sysvmsg $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(PHPSYSVMSG_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) -L$(top_builddir)/netware -lphp4lib $(SYSVMSG_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(PHPSYSVMSG_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvmsg.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvmsg"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsysvmsg.$suffix: $ext_builddir/phpsysvmsg.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsysvmsg.$suffix \$(phplibdir)

$ext_builddir/phpsysvmsg.$suffix: \$(shared_objects_sysvmsg) \$(PHPSYSVMSG_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(SYSVMSG_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) -L$(top_builddir)/netware -lphp4lib $(VMSG_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvmsg) $(SYSVMSG_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvmsg.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvmsg"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sysvmsg.$suffix: $ext_builddir/sysvmsg.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sysvmsg.$suffix \$(phplibdir)

$ext_builddir/sysvmsg.$suffix: \$(shared_objects_sysvmsg) \$(SYSVMSG_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SYSVMSG 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sysvmsg in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvmsg.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sysvmsg"
    else


  case ext/sysvmsg in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvmsg"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvmsg/"; ac_bdir="ext/sysvmsg/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvmsg.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sysvmsg"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi




echo "$as_me:$LINENO: checking whether to enable System V semaphore support" >&5
echo $ECHO_N "checking whether to enable System V semaphore support... $ECHO_C" >&6
# Check whether --enable-sysvsem or --disable-sysvsem was given.
if test "${enable_sysvsem+set}" = set; then
  enableval="$enable_sysvsem"
  PHP_SYSVSEM=$enableval
else

  PHP_SYSVSEM=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SYSVSEM=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SYSVSEM in
shared,*)
  PHP_SYSVSEM=`echo "$PHP_SYSVSEM"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SYSVSEM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SYSVSEM" != "no"; then

  ext_builddir=ext/sysvsem
  ext_srcdir=$abs_srcdir/ext/sysvsem

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sysvsem in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvsem.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sysvsem"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sysvsem"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sysvsem in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in sysvsem.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sysvsem="$shared_objects_sysvsem $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(PHPSYSVSEM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) -L$(top_builddir)/netware -lphp4lib $(SYSVSEM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(PHPSYSVSEM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvsem.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvsem"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsysvsem.$suffix: $ext_builddir/phpsysvsem.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsysvsem.$suffix \$(phplibdir)

$ext_builddir/phpsysvsem.$suffix: \$(shared_objects_sysvsem) \$(PHPSYSVSEM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(SYSVSEM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) -L$(top_builddir)/netware -lphp4lib $(VSEM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvsem) $(SYSVSEM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvsem.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvsem"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sysvsem.$suffix: $ext_builddir/sysvsem.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sysvsem.$suffix \$(phplibdir)

$ext_builddir/sysvsem.$suffix: \$(shared_objects_sysvsem) \$(SYSVSEM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SYSVSEM 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sysvsem in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvsem.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sysvsem"
    else


  case ext/sysvsem in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvsem"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvsem/"; ac_bdir="ext/sysvsem/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvsem.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sysvsem"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



cat >>confdefs.h <<\_ACEOF
#define HAVE_SYSVSEM 1
_ACEOF

 echo "$as_me:$LINENO: checking for union semun" >&5
echo $ECHO_N "checking for union semun... $ECHO_C" >&6
if test "${php_cv_semun+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

int
main ()
{
union semun x;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

     php_cv_semun=yes

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


     php_cv_semun=no

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

fi
echo "$as_me:$LINENO: result: $php_cv_semun" >&5
echo "${ECHO_T}$php_cv_semun" >&6
 if test "$php_cv_semun" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SEMUN 1
_ACEOF

 else

cat >>confdefs.h <<\_ACEOF
#define HAVE_SEMUN 0
_ACEOF

 fi
fi




echo "$as_me:$LINENO: checking whether to enable System V shared memory support" >&5
echo $ECHO_N "checking whether to enable System V shared memory support... $ECHO_C" >&6
# Check whether --enable-sysvshm or --disable-sysvshm was given.
if test "${enable_sysvshm+set}" = set; then
  enableval="$enable_sysvshm"
  PHP_SYSVSHM=$enableval
else

  PHP_SYSVSHM=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_SYSVSHM=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_SYSVSHM in
shared,*)
  PHP_SYSVSHM=`echo "$PHP_SYSVSHM"|sed 's/^shared,//'`
  ;;
shared)
  PHP_SYSVSHM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_SYSVSHM" != "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_SYSVSHM 1
_ACEOF


  ext_builddir=ext/sysvshm
  ext_srcdir=$abs_srcdir/ext/sysvshm

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/sysvshm in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvshm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC sysvshm"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC sysvshm"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/sysvshm in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in sysvshm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_sysvshm="$shared_objects_sysvshm $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(PHPSYSVSHM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) -L$(top_builddir)/netware -lphp4lib $(SYSVSHM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(PHPSYSVSHM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpsysvshm.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvshm"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpsysvshm.$suffix: $ext_builddir/phpsysvshm.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpsysvshm.$suffix \$(phplibdir)

$ext_builddir/phpsysvshm.$suffix: \$(shared_objects_sysvshm) \$(PHPSYSVSHM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(SYSVSHM_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) -L$(top_builddir)/netware -lphp4lib $(VSHM_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_sysvshm) $(SYSVSHM_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/sysvshm.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_sysvshm"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/sysvshm.$suffix: $ext_builddir/sysvshm.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/sysvshm.$suffix \$(phplibdir)

$ext_builddir/sysvshm.$suffix: \$(shared_objects_sysvshm) \$(SYSVSHM_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_SYSVSHM 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/sysvshm in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvshm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC sysvshm"
    else


  case ext/sysvshm in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/sysvshm"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/sysvshm/"; ac_bdir="ext/sysvshm/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in sysvshm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC sysvshm"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi





echo "$as_me:$LINENO: checking whether to enable tokenizer support" >&5
echo $ECHO_N "checking whether to enable tokenizer support... $ECHO_C" >&6
# Check whether --enable-tokenizer or --disable-tokenizer was given.
if test "${enable_tokenizer+set}" = set; then
  enableval="$enable_tokenizer"
  PHP_TOKENIZER=$enableval
else

  PHP_TOKENIZER=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_TOKENIZER=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_TOKENIZER in
shared,*)
  PHP_TOKENIZER=`echo "$PHP_TOKENIZER"|sed 's/^shared,//'`
  ;;
shared)
  PHP_TOKENIZER=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_TOKENIZER" != "no"; then

  ext_builddir=ext/tokenizer
  ext_srcdir=$abs_srcdir/ext/tokenizer

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/tokenizer in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in tokenizer.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC tokenizer"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC tokenizer"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/tokenizer in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in tokenizer.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_tokenizer="$shared_objects_tokenizer $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) -L$(top_builddir)/netware -lphp4lib $(TOKENIZER_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(PHPTOKENIZER_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phptokenizer.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tokenizer"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phptokenizer.$suffix: $ext_builddir/phptokenizer.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phptokenizer.$suffix \$(phplibdir)

$ext_builddir/phptokenizer.$suffix: \$(shared_objects_tokenizer) \$(PHPTOKENIZER_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(TOKENIZER_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) -L$(top_builddir)/netware -lphp4lib $(ENIZER_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_tokenizer) $(TOKENIZER_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/tokenizer.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_tokenizer"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/tokenizer.$suffix: $ext_builddir/tokenizer.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/tokenizer.$suffix \$(phplibdir)

$ext_builddir/tokenizer.$suffix: \$(shared_objects_tokenizer) \$(TOKENIZER_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_TOKENIZER 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/tokenizer in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in tokenizer.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC tokenizer"
    else


  case ext/tokenizer in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/tokenizer"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/tokenizer/"; ac_bdir="ext/tokenizer/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in tokenizer.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC tokenizer"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  src=$ext_srcdir/Makefile.frag
  ac_srcdir=$ext_srcdir
  ac_builddir=$ext_builddir
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

fi




echo "$as_me:$LINENO: checking whether to enable WDDX support" >&5
echo $ECHO_N "checking whether to enable WDDX support... $ECHO_C" >&6
# Check whether --enable-wddx or --disable-wddx was given.
if test "${enable_wddx+set}" = set; then
  enableval="$enable_wddx"
  PHP_WDDX=$enableval
else

  PHP_WDDX=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_WDDX=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_WDDX in
shared,*)
  PHP_WDDX=`echo "$PHP_WDDX"|sed 's/^shared,//'`
  ;;
shared)
  PHP_WDDX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_WDDX" != "no"; then
  if test "$ext_shared" != "yes" && test "$enable_xml" = "no"; then
    { echo "$as_me:$LINENO: WARNING: Activating XML" >&5
echo "$as_me: WARNING: Activating XML" >&2;}
    enable_xml=yes
  fi

cat >>confdefs.h <<\_ACEOF
#define HAVE_WDDX 1
_ACEOF


  ext_builddir=ext/wddx
  ext_srcdir=$abs_srcdir/ext/wddx

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/wddx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in wddx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC wddx"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC wddx"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/wddx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in wddx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_wddx="$shared_objects_wddx $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(PHPWDDX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) -L$(top_builddir)/netware -lphp4lib $(WDDX_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(PHPWDDX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpwddx.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_wddx"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpwddx.$suffix: $ext_builddir/phpwddx.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpwddx.$suffix \$(phplibdir)

$ext_builddir/phpwddx.$suffix: \$(shared_objects_wddx) \$(PHPWDDX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(WDDX_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) -L$(top_builddir)/netware -lphp4lib $(X_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_wddx) $(WDDX_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/wddx.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_wddx"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/wddx.$suffix: $ext_builddir/wddx.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/wddx.$suffix \$(phplibdir)

$ext_builddir/wddx.$suffix: \$(shared_objects_wddx) \$(WDDX_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_WDDX 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/wddx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in wddx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC wddx"
    else


  case ext/wddx in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/wddx"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/wddx/"; ac_bdir="ext/wddx/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in wddx.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC wddx"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


fi


echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
if test "${ac_cv_c_bigendian_php+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  ac_cv_c_bigendian_php=unknown
  if test "$cross_compiling" = yes; then
  ac_cv_c_bigendian_php=unknown
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int main(void)
{
	short one = 1;
	char *cp = (char *)&one;

	if (*cp == 0) {
		return(0);
	} else {
		return(1);
	}
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_bigendian_php=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_c_bigendian_php=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_c_bigendian_php" >&5
echo "${ECHO_T}$ac_cv_c_bigendian_php" >&6
 if test $ac_cv_c_bigendian_php = yes; then

cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN
_ACEOF

 fi


if test "$ac_cv_c_bigendian_php" = "yes"; then
  order=4321
else
  order=1234
fi



echo "$as_me:$LINENO: checking whether to enable XML support" >&5
echo $ECHO_N "checking whether to enable XML support... $ECHO_C" >&6
# Check whether --enable-xml or --disable-xml was given.
if test "${enable_xml+set}" = set; then
  enableval="$enable_xml"
  PHP_XML=$enableval
else

  PHP_XML=yes

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_XML=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_XML in
shared,*)
  PHP_XML=`echo "$PHP_XML"|sed 's/^shared,//'`
  ;;
shared)
  PHP_XML=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking external libexpat install dir" >&5
echo $ECHO_N "checking external libexpat install dir... $ECHO_C" >&6

# Check whether --with-expat-dir or --without-expat-dir was given.
if test "${with_expat_dir+set}" = set; then
  withval="$with_expat_dir"
  PHP_EXPAT_DIR=$withval
else

  PHP_EXPAT_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_EXPAT_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_EXPAT_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_XML" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBEXPAT 1
_ACEOF


  if test "$PHP_EXPAT_DIR" = "no"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBEXPAT_BUNDLED 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define XML_NS 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define XML_DTD 1
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define XML_CONTEXT_BYTES 1024
_ACEOF


  ext_builddir=ext/xml
  ext_srcdir=$abs_srcdir/ext/xml

  ac_extra=`echo "-DBYTEORDER=$order"|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC xml"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC xml"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in xml.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_xml="$shared_objects_xml $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) -L$(top_builddir)/netware -lphp4lib $(XML_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpxml.$suffix: $ext_builddir/phpxml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpxml.$suffix \$(phplibdir)

$ext_builddir/phpxml.$suffix: \$(shared_objects_xml) \$(PHPXML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xml) $(XML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(XML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/xml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/xml.$suffix: $ext_builddir/xml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/xml.$suffix \$(phplibdir)

$ext_builddir/xml.$suffix: \$(shared_objects_xml) \$(XML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_XML 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC xml"
    else


  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC xml"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  if test "$ext_srcdir/expat" != "/usr/include"; then

  if test -z "$ext_srcdir/expat" || echo "$ext_srcdir/expat" | grep '^/' >/dev/null ; then
    ai_p=$ext_srcdir/expat
  else

    ep_dir="`echo $ext_srcdir/expat|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ext_srcdir/expat\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi


  BUILD_DIR="$BUILD_DIR $ext_builddir/expat"

  else

  ext_builddir=ext/xml
  ext_srcdir=$abs_srcdir/ext/xml

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC xml"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC xml"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in xml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_xml="$shared_objects_xml $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) -L$(top_builddir)/netware -lphp4lib $(XML_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(PHPXML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpxml.$suffix: $ext_builddir/phpxml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpxml.$suffix \$(phplibdir)

$ext_builddir/phpxml.$suffix: \$(shared_objects_xml) \$(PHPXML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xml) $(XML_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xml) $(XML_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/xml.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xml"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/xml.$suffix: $ext_builddir/xml.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/xml.$suffix \$(phplibdir)

$ext_builddir/xml.$suffix: \$(shared_objects_xml) \$(XML_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_XML 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC xml"
    else


  case ext/xml in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xml"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xml/"; ac_bdir="ext/xml/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xml.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC xml"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



    for i in $PHP_XML $PHP_EXPAT_DIR; do
      if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME ; then
        EXPAT_DIR=$i
      fi
    done

    if test -z "$EXPAT_DIR"; then
      { { echo "$as_me:$LINENO: error: not found. Please reinstall the expat distribution." >&5
echo "$as_me: error: not found. Please reinstall the expat distribution." >&2;}
   { (exit 1); exit 1; }; }
    fi


  if test "$EXPAT_DIR/include" != "/usr/include"; then

  if test -z "$EXPAT_DIR/include" || echo "$EXPAT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$EXPAT_DIR/include
  else

    ep_dir="`echo $EXPAT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$EXPAT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    XML_SHARED_LIBADD="-lexpat $XML_SHARED_LIBADD"
    if test -n "$EXPAT_DIR/lib"; then

  if test "$EXPAT_DIR/lib" != "/usr/lib"; then

  if test -z "$EXPAT_DIR/lib" || echo "$EXPAT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$EXPAT_DIR/lib
  else

    ep_dir="`echo $EXPAT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$EXPAT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XML_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XML_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$EXPAT_DIR/lib"; then

  if test "$EXPAT_DIR/lib" != "/usr/lib"; then

  if test -z "$EXPAT_DIR/lib" || echo "$EXPAT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$EXPAT_DIR/lib
  else

    ep_dir="`echo $EXPAT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$EXPAT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case expat in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lexpat $LIBS"
   ;;
  esac




  fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST XML_SHARED_LIBADD"

  fi
fi


# Local macros for automake & autoconf














echo "$as_me:$LINENO: checking for XMLRPC-EPI support" >&5
echo $ECHO_N "checking for XMLRPC-EPI support... $ECHO_C" >&6

# Check whether --with-xmlrpc or --without-xmlrpc was given.
if test "${with_xmlrpc+set}" = set; then
  withval="$with_xmlrpc"
  PHP_XMLRPC=$withval
else

  PHP_XMLRPC=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_XMLRPC=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_XMLRPC in
shared,*)
  PHP_XMLRPC=`echo "$PHP_XMLRPC"|sed 's/^shared,//'`
  ;;
shared)
  PHP_XMLRPC=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking libexpat dir for XMLRPC-EPI" >&5
echo $ECHO_N "checking libexpat dir for XMLRPC-EPI... $ECHO_C" >&6

# Check whether --with-expat-dir or --without-expat-dir was given.
if test "${with_expat_dir+set}" = set; then
  withval="$with_expat_dir"
  PHP_EXPAT_DIR=$withval
else

  PHP_EXPAT_DIR=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_EXPAT_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_EXPAT_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking iconv dir for XMLRPC-EPI" >&5
echo $ECHO_N "checking iconv dir for XMLRPC-EPI... $ECHO_C" >&6

# Check whether --with-iconv-dir or --without-iconv-dir was given.
if test "${with_iconv_dir+set}" = set; then
  withval="$with_iconv_dir"
  PHP_ICONV_DIR=$withval
else

  PHP_ICONV_DIR=yes

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ICONV_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ICONV_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_XMLRPC" != "no"; then


  PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD"


cat >>confdefs.h <<\_ACEOF
#define HAVE_XMLRPC 1
_ACEOF


  testval=no
  for i in $PHP_EXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
    if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBEXPAT2 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    XMLRPC_SHARED_LIBADD="-lexpat $XMLRPC_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XMLRPC_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case expat in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lexpat $LIBS"
   ;;
  esac




  fi



  if test "$i/include" != "/usr/include"; then

  if test -z "$i/include" || echo "$i/include" | grep '^/' >/dev/null ; then
    ai_p=$i/include
  else

    ep_dir="`echo $i/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

      testval=yes
      break
    fi
  done

  if test "$testval" = "no"; then
    { { echo "$as_me:$LINENO: error: XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>" >&5
echo "$as_me: error: XML-RPC support requires libexpat. Use --with-expat-dir=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test "$PHP_ICONV_DIR" != "no"; then
    PHP_ICONV=$PHP_ICONV_DIR
  fi

  if test "$PHP_ICONV" = "no"; then
    PHP_ICONV=yes
  fi


  found_iconv=no
  unset ICONV_DIR

  # Create the directories for a VPATH build:
  test -d ext || mkdir ext
  test -d ext/iconv || mkdir ext/iconv

  echo > ext/iconv/php_have_bsd_iconv.h
  echo > ext/iconv/php_have_glibc_iconv.h
  echo > ext/iconv/php_have_libiconv.h
  echo > ext/iconv/php_have_iconv.h
  echo > ext/iconv/php_php_iconv_impl.h
  echo > ext/iconv/php_php_iconv_h_path.h
  echo > ext/iconv/php_iconv_supports_errno.h

        if test "$PHP_ICONV" = "yes"; then
    echo "$as_me:$LINENO: checking for iconv" >&5
echo $ECHO_N "checking for iconv... $ECHO_C" >&6
if test "${ac_cv_func_iconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define iconv to an innocuous variant, in case <limits.h> declares iconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define iconv innocuous_iconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char iconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef iconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
/* 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
char (*f) () = iconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != iconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_iconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_iconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5
echo "${ECHO_T}$ac_cv_func_iconv" >&6
if test $ac_cv_func_iconv = yes; then


  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h

      found_iconv=yes

else

      echo "$as_me:$LINENO: checking for libiconv" >&5
echo $ECHO_N "checking for libiconv... $ECHO_C" >&6
if test "${ac_cv_func_libiconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define libiconv to an innocuous variant, in case <limits.h> declares libiconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define libiconv innocuous_libiconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char libiconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef libiconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
/* 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
char (*f) () = libiconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != libiconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_libiconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_libiconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_libiconv" >&5
echo "${ECHO_T}$ac_cv_func_libiconv" >&6
if test $ac_cv_func_libiconv = yes; then


  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h

        found_iconv=yes

fi


fi

  fi

        if test "$found_iconv" = "no"; then

    for i in $PHP_ICONV /usr/local /usr; do
      if test -r $i/include/giconv.h; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GICONV_H 1
_ACEOF

        ICONV_DIR=$i
        iconv_lib_name=giconv
        break
      elif test -r $i/include/iconv.h; then
        ICONV_DIR=$i
        iconv_lib_name=iconv
        break
      fi
    done

    if test -z "$ICONV_DIR"; then
      { { echo "$as_me:$LINENO: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&5
echo "$as_me: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
       test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
    then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$ICONV_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_libiconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for libiconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for libiconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
int
main ()
{
libiconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

        found_iconv=yes

  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_libiconv


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$ICONV_DIR/lib
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_iconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for iconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for iconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
int
main ()
{
iconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

          found_iconv=yes

  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_iconv


fi



fi

    fi
  fi

  if test "$found_iconv" = "yes"; then
    if test -n "$ICONV_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ICONV 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    XMLRPC_SHARED_LIBADD="-l$iconv_lib_name $XMLRPC_SHARED_LIBADD"
    if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XMLRPC_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $iconv_lib_name in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$iconv_lib_name $LIBS"
   ;;
  esac




  fi



  if test "$ICONV_DIR/include" != "/usr/include"; then

  if test -z "$ICONV_DIR/include" || echo "$ICONV_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/include
  else

    ep_dir="`echo $ICONV_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi

else
    { { echo "$as_me:$LINENO: error: iconv not found, in order to build xmlrpc you need the iconv library" >&5
echo "$as_me: error: iconv not found, in order to build xmlrpc you need the iconv library" >&2;}
   { (exit 1); exit 1; }; }

  fi

fi


if test "$PHP_XMLRPC" = "yes"; then







cat >>confdefs.h <<\_ACEOF
#define UNDEF_THREADS_HACK
_ACEOF



echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_stdc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_stdc=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <string.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "memchr" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <stdlib.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "free" >/dev/null 2>&1; then
  :
else
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  if test "$cross_compiling" = yes; then
  :
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
		   (('a' <= (c) && (c) <= 'i') \
		     || ('j' <= (c) && (c) <= 'r') \
		     || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif

#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
  int i;
  for (i = 0; i < 256; i++)
    if (XOR (islower (i), ISLOWER (i))
	|| toupper (i) != TOUPPER (i))
      exit(2);
  exit (0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_header_stdc=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then

cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
_ACEOF

fi






for ac_header in xmlparse.h xmltok.h stdlib.h strings.h string.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done






echo "$as_me:$LINENO: checking for char" >&5
echo $ECHO_N "checking for char... $ECHO_C" >&6
if test "${ac_cv_type_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((char *) 0)
  return 0;
if (sizeof (char))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_char=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_char=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
echo "${ECHO_T}$ac_cv_type_char" >&6

echo "$as_me:$LINENO: checking size of char" >&5
echo $ECHO_N "checking size of char... $ECHO_C" >&6
if test "${ac_cv_sizeof_char+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_char" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_char=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (char)); }
unsigned long ulongval () { return (long) (sizeof (char)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (char))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (char))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_char=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (char), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_char=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
echo "${ECHO_T}$ac_cv_sizeof_char" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
_ACEOF



echo "$as_me:$LINENO: checking for int" >&5
echo $ECHO_N "checking for int... $ECHO_C" >&6
if test "${ac_cv_type_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((int *) 0)
  return 0;
if (sizeof (int))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_int=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_int=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
echo "${ECHO_T}$ac_cv_type_int" >&6

echo "$as_me:$LINENO: checking size of int" >&5
echo $ECHO_N "checking size of int... $ECHO_C" >&6
if test "${ac_cv_sizeof_int+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_int" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_int=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (int)); }
unsigned long ulongval () { return (long) (sizeof (int)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (int))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (int))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_int=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (int), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_int=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
echo "${ECHO_T}$ac_cv_sizeof_int" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
_ACEOF


echo "$as_me:$LINENO: checking for long" >&5
echo $ECHO_N "checking for long... $ECHO_C" >&6
if test "${ac_cv_type_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long *) 0)
  return 0;
if (sizeof (long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
echo "${ECHO_T}$ac_cv_type_long" >&6

echo "$as_me:$LINENO: checking size of long" >&5
echo $ECHO_N "checking size of long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long)); }
unsigned long ulongval () { return (long) (sizeof (long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
_ACEOF


echo "$as_me:$LINENO: checking for long long" >&5
echo $ECHO_N "checking for long long... $ECHO_C" >&6
if test "${ac_cv_type_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((long long *) 0)
  return 0;
if (sizeof (long long))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_long_long=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_long_long=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
echo "${ECHO_T}$ac_cv_type_long_long" >&6

echo "$as_me:$LINENO: checking size of long long" >&5
echo $ECHO_N "checking size of long long... $ECHO_C" >&6
if test "${ac_cv_sizeof_long_long+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$ac_cv_type_long_long" = yes; then
  # The cast to unsigned long works around a bug in the HP C Compiler
  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
  # This bug is HP SR number 8606223364.
  if test "$cross_compiling" = yes; then
  # Depending upon the size, compute the lo and hi bounds.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=0 ac_mid=0
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr $ac_mid + 1`
		    if test $ac_lo -le $ac_mid; then
		      ac_lo= ac_hi=
		      break
		    fi
		    ac_mid=`expr 2 '*' $ac_mid + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=-1 ac_mid=-1
  while :; do
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_lo=$ac_mid; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_hi=`expr '(' $ac_mid ')' - 1`
		       if test $ac_mid -le $ac_hi; then
			 ac_lo= ac_hi=
			 break
		       fi
		       ac_mid=`expr 2 '*' $ac_mid`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  done
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo= ac_hi=
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Binary search between lo and hi bounds.
while test "x$ac_lo" != "x$ac_hi"; do
  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)];
test_array [0] = 0

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_hi=$ac_mid
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_lo=`expr '(' $ac_mid ')' + 1`
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
case $ac_lo in
?*) ac_cv_sizeof_long_long=$ac_lo;;
'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; } ;;
esac
else
  if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
long longval () { return (long) (sizeof (long long)); }
unsigned long ulongval () { return (long) (sizeof (long long)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
  if (((long) (sizeof (long long))) < 0)
    {
      long i = longval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long i = ulongval ();
      if (i != ((long) (sizeof (long long))))
	exit (1);
      fprintf (f, "%lu\n", i);
    }
  exit (ferror (f) || fclose (f) != 0);

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_sizeof_long_long=`cat conftest.val`
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (long long), 77
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
rm -f conftest.val
else
  ac_cv_sizeof_long_long=0
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
_ACEOF


echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_size_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6
if test $ac_cv_type_size_t = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned
_ACEOF

fi

echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>

int
main ()
{
if ((struct tm *) 0)
return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_header_time=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_header_time=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then

cat >>confdefs.h <<\_ACEOF
#define TIME_WITH_SYS_TIME 1
_ACEOF

fi

echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
if test "${ac_cv_type_uid_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <sys/types.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "uid_t" >/dev/null 2>&1; then
  ac_cv_type_uid_t=yes
else
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi
echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
echo "${ECHO_T}$ac_cv_type_uid_t" >&6
if test $ac_cv_type_uid_t = no; then

cat >>confdefs.h <<\_ACEOF
#define uid_t int
_ACEOF


cat >>confdefs.h <<\_ACEOF
#define gid_t int
_ACEOF

fi






# Standard XMLRPC list








for ac_func in \
 strtoul strtoull snprintf \
 strstr strpbrk strerror\
 memcpy memmove
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done





  ext_builddir=ext/xmlrpc
  ext_srcdir=$abs_srcdir/ext/xmlrpc

  ac_extra=`echo "-I@ext_srcdir@/libxmlrpc -DVERSION="0.50""|sed s#@ext_srcdir@#$ext_srcdir#g`

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/xmlrpc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \
          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
          libxmlrpc/xml_to_soap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC xmlrpc"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC xmlrpc"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/xmlrpc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \
          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
          libxmlrpc/xml_to_soap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_xmlrpc="$shared_objects_xmlrpc $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) -L$(top_builddir)/netware -lphp4lib $(XMLRPC_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(PHPXMLRPC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxmlrpc.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpxmlrpc.$suffix: $ext_builddir/phpxmlrpc.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpxmlrpc.$suffix \$(phplibdir)

$ext_builddir/phpxmlrpc.$suffix: \$(shared_objects_xmlrpc) \$(PHPXMLRPC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(XMLRPC_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) -L$(top_builddir)/netware -lphp4lib $(RPC_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xmlrpc) $(XMLRPC_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/xmlrpc.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xmlrpc"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/xmlrpc.$suffix: $ext_builddir/xmlrpc.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/xmlrpc.$suffix \$(phplibdir)

$ext_builddir/xmlrpc.$suffix: \$(shared_objects_xmlrpc) \$(XMLRPC_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_XMLRPC 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/xmlrpc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \
          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
          libxmlrpc/xml_to_soap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC xmlrpc"
    else


  case ext/xmlrpc in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xmlrpc"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xmlrpc/"; ac_bdir="ext/xmlrpc/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xmlrpc-epi-php.c libxmlrpc/base64.c \
          libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
          libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
          libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
          libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
          libxmlrpc/xml_to_soap.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC xmlrpc"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  BUILD_DIR="$BUILD_DIR $ext_builddir/libxmlrpc"

  XMLRPC_MODULE_TYPE=builtin

elif test "$PHP_XMLRPC" != "no"; then

  if test -r $PHP_XMLRPC/include/xmlrpc.h; then
    XMLRPC_DIR=$PHP_XMLRPC/include
  elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then
    XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi
  else
    echo "$as_me:$LINENO: checking for XMLRPC-EPI in default path" >&5
echo $ECHO_N "checking for XMLRPC-EPI in default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      if test -r $i/include/xmlrpc.h; then
        XMLRPC_DIR=$i/include
        echo "$as_me:$LINENO: result: found in $i" >&5
echo "${ECHO_T}found in $i" >&6
        break
      fi
    done
  fi

  if test -z "$XMLRPC_DIR"; then
    echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    { { echo "$as_me:$LINENO: error: Please reinstall the XMLRPC-EPI distribution" >&5
echo "$as_me: error: Please reinstall the XMLRPC-EPI distribution" >&2;}
   { (exit 1); exit 1; }; }
  fi


  if test "$XMLRPC_DIR" != "/usr/include"; then

  if test -z "$XMLRPC_DIR" || echo "$XMLRPC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$XMLRPC_DIR
  else

    ep_dir="`echo $XMLRPC_DIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XMLRPC_DIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    XMLRPC_SHARED_LIBADD="-lxmlrpc $XMLRPC_SHARED_LIBADD"
    if test -n "$XMLRPC_DIR/lib"; then

  if test "$XMLRPC_DIR/lib" != "/usr/lib"; then

  if test -z "$XMLRPC_DIR/lib" || echo "$XMLRPC_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$XMLRPC_DIR/lib
  else

    ep_dir="`echo $XMLRPC_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XMLRPC_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XMLRPC_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$XMLRPC_DIR/lib"; then

  if test "$XMLRPC_DIR/lib" != "/usr/lib"; then

  if test -z "$XMLRPC_DIR/lib" || echo "$XMLRPC_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$XMLRPC_DIR/lib
  else

    ep_dir="`echo $XMLRPC_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XMLRPC_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case xmlrpc in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lxmlrpc $LIBS"
   ;;
  esac




  fi


fi




echo "$as_me:$LINENO: checking whether to enable xslt support" >&5
echo $ECHO_N "checking whether to enable xslt support... $ECHO_C" >&6
# Check whether --enable-xslt or --disable-xslt was given.
if test "${enable_xslt+set}" = set; then
  enableval="$enable_xslt"
  PHP_XSLT=$enableval
else

  PHP_XSLT=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_XSLT=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_XSLT in
shared,*)
  PHP_XSLT=`echo "$PHP_XSLT"|sed 's/^shared,//'`
  ;;
shared)
  PHP_XSLT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for XSLT Sablotron backend" >&5
echo $ECHO_N "checking for XSLT Sablotron backend... $ECHO_C" >&6

# Check whether --with-xslt-sablot or --without-xslt-sablot was given.
if test "${with_xslt_sablot+set}" = set; then
  withval="$with_xslt_sablot"
  PHP_XSLT_SABLOT=$withval
else

  PHP_XSLT_SABLOT=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_XSLT_SABLOT=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_XSLT_SABLOT
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for libexpat dir for Sablotron XSL support" >&5
echo $ECHO_N "checking for libexpat dir for Sablotron XSL support... $ECHO_C" >&6

# Check whether --with-expat-dir or --without-expat-dir was given.
if test "${with_expat_dir+set}" = set; then
  withval="$with_expat_dir"
  PHP_EXPAT_DIR=$withval
else

  PHP_EXPAT_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_EXPAT_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_EXPAT_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for iconv dir for Sablotron XSL support" >&5
echo $ECHO_N "checking for iconv dir for Sablotron XSL support... $ECHO_C" >&6

# Check whether --with-iconv-dir or --without-iconv-dir was given.
if test "${with_iconv_dir+set}" = set; then
  withval="$with_iconv_dir"
  PHP_ICONV_DIR=$withval
else

  PHP_ICONV_DIR=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_ICONV_DIR=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_ICONV_DIR
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6






echo "$as_me:$LINENO: checking for JavaScript for Sablotron XSL support" >&5
echo $ECHO_N "checking for JavaScript for Sablotron XSL support... $ECHO_C" >&6

# Check whether --with-sablot-js or --without-sablot-js was given.
if test "${with_sablot_js+set}" = set; then
  withval="$with_sablot_js"
  PHP_SABLOT_JS=$withval
else

  PHP_SABLOT_JS=no

  if test "$PHP_ENABLE_ALL" && test "no" = "yes"; then
    PHP_SABLOT_JS=$PHP_ENABLE_ALL
  fi

fi;

ext_output=$PHP_SABLOT_JS
echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_XSLT" != "no"; then


  ext_builddir=ext/xslt
  ext_srcdir=$abs_srcdir/ext/xslt

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/xslt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xslt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xslt/"; ac_bdir="ext/xslt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xslt.c sablot.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC xslt"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC xslt"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/xslt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xslt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xslt/"; ac_bdir="ext/xslt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in xslt.c sablot.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_xslt="$shared_objects_xslt $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xslt) $(PHPXSLT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xslt) -L$(top_builddir)/netware -lphp4lib $(XSLT_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xslt) $(PHPXSLT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpxslt.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xslt"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpxslt.$suffix: $ext_builddir/phpxslt.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpxslt.$suffix \$(phplibdir)

$ext_builddir/phpxslt.$suffix: \$(shared_objects_xslt) \$(PHPXSLT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_xslt) $(XSLT_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xslt) -L$(top_builddir)/netware -lphp4lib $(T_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xslt) $(XSLT_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/xslt.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_xslt"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/xslt.$suffix: $ext_builddir/xslt.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/xslt.$suffix \$(phplibdir)

$ext_builddir/xslt.$suffix: \$(shared_objects_xslt) \$(XSLT_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_XSLT 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/xslt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xslt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xslt/"; ac_bdir="ext/xslt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xslt.c sablot.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC xslt"
    else


  case ext/xslt in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/xslt"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/xslt/"; ac_bdir="ext/xslt/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in xslt.c sablot.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC xslt"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST XSLT_SHARED_LIBADD"


  if test "$PHP_XSLT_SABLOT" != "no"; then
    XSLT_CHECK_DIR=$PHP_XSLT_SABLOT
    XSLT_TEST_FILE=/include/sablot.h
    XSLT_BACKEND_NAME=Sablotron
    XSLT_LIBNAME=sablot
  fi

  if test -z "$XSLT_BACKEND_NAME"; then
    { { echo "$as_me:$LINENO: error: No backend specified for XSLT extension." >&5
echo "$as_me: error: No backend specified for XSLT extension." >&2;}
   { (exit 1); exit 1; }; }
  fi

  condition="$XSLT_CHECK_DIR$XSLT_TEST_FILE"

  if test -r $condition; then
    XSLT_DIR=$XSLT_CHECK_DIR
  else
    echo "$as_me:$LINENO: checking for $XSLT_BACKEND_NAME libraries in the default path" >&5
echo $ECHO_N "checking for $XSLT_BACKEND_NAME libraries in the default path... $ECHO_C" >&6
    for i in /usr/local /usr; do
      condition="$i$XSLT_TEST_FILE"
      if test -r $condition; then
        XSLT_DIR=$i
        break
      fi
    done
    echo "$as_me:$LINENO: result: found in $XSLT_DIR" >&5
echo "${ECHO_T}found in $XSLT_DIR" >&6
  fi

  if test -z "$XSLT_DIR"; then
    { { echo "$as_me:$LINENO: error: not found. Please re-install the $XSLT_BACKEND_NAME distribution." >&5
echo "$as_me: error: not found. Please re-install the $XSLT_BACKEND_NAME distribution." >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test "$PHP_XSLT_SABLOT" != "no"; then
    echo "$as_me:$LINENO: checking for sablot-config" >&5
echo $ECHO_N "checking for sablot-config... $ECHO_C" >&6
    if test -x $XSLT_DIR/bin/sablot-config ; then
       echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6

cat >>confdefs.h <<\_ACEOF
#define HAVE_SABLOT_CONFIG 1
_ACEOF

              SABINF_CFLAGS=`$XSLT_DIR/bin/sablot-config --cflags`
       SABINF_LIBS=`$XSLT_DIR/bin/sablot-config --libs`
       SABINF_PREFIX=`$XSLT_DIR/bin/sablot-config --prefix`
       SABINF_ALL="\"Cflags: $SABINF_CFLAGS Libs: $SABINF_LIBS Prefix: $SABINF_PREFIX\""

  echo "#define SAB_INFO "$SABINF_ALL"" > include/php_sab_info.h

    else
       echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
    fi
    echo "$as_me:$LINENO: checking for Sablotron version" >&5
echo $ECHO_N "checking for Sablotron version... $ECHO_C" >&6
    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS -I$XSLT_DIR/include"
    if test "$cross_compiling" = yes; then
  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
   { (exit 1); exit 1; }; }
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <stdlib.h>
#include <sablot.h>

int main ()
{
	double version;
	version = atof(SAB_VERSION);

	if (version >= 0.96) {
		exit(0);
	}
	exit(255);
}

_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

      echo "$as_me:$LINENO: result: >= 0.96" >&5
echo "${ECHO_T}>= 0.96" >&6

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

      { { echo "$as_me:$LINENO: error: Sablotron version 0.96 or greater required." >&5
echo "$as_me: error: Sablotron version 0.96 or greater required." >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
    CPPFLAGS=$old_CPPFLAGS

    found_expat=no
    for i in $PHP_EXPAT_DIR $XSLT_DIR /usr/local /usr; do
      if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBEXPAT2 1
_ACEOF


  if test "$i/include" != "/usr/include"; then

  if test -z "$i/include" || echo "$i/include" | grep '^/' >/dev/null ; then
    ai_p=$i/include
  else

    ep_dir="`echo $i/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    XSLT_SHARED_LIBADD="-lexpat $XSLT_SHARED_LIBADD"
    if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XSLT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XSLT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$i/lib"; then

  if test "$i/lib" != "/usr/lib"; then

  if test -z "$i/lib" || echo "$i/lib" | grep '^/' >/dev/null ; then
    ai_p=$i/lib
  else

    ep_dir="`echo $i/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$i/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case expat in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lexpat $LIBS"
   ;;
  esac




  fi


        found_expat=yes
        break
      fi
    done

    if test "$found_expat" = "no"; then
      { { echo "$as_me:$LINENO: error: expat not found. To build sablotron you need the expat library." >&5
echo "$as_me: error: expat not found. To build sablotron you need the expat library." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test "$PHP_ICONV_DIR" != "no"; then
      PHP_ICONV=$PHP_ICONV_DIR
    fi

    if test "$PHP_ICONV" = "no"; then
      PHP_ICONV=yes
    fi


  found_iconv=no
  unset ICONV_DIR

  # Create the directories for a VPATH build:
  test -d ext || mkdir ext
  test -d ext/iconv || mkdir ext/iconv

  echo > ext/iconv/php_have_bsd_iconv.h
  echo > ext/iconv/php_have_glibc_iconv.h
  echo > ext/iconv/php_have_libiconv.h
  echo > ext/iconv/php_have_iconv.h
  echo > ext/iconv/php_php_iconv_impl.h
  echo > ext/iconv/php_php_iconv_h_path.h
  echo > ext/iconv/php_iconv_supports_errno.h

        if test "$PHP_ICONV" = "yes"; then
    echo "$as_me:$LINENO: checking for iconv" >&5
echo $ECHO_N "checking for iconv... $ECHO_C" >&6
if test "${ac_cv_func_iconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define iconv to an innocuous variant, in case <limits.h> declares iconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define iconv innocuous_iconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char iconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef iconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
/* 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
char (*f) () = iconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != iconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_iconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_iconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_iconv" >&5
echo "${ECHO_T}$ac_cv_func_iconv" >&6
if test $ac_cv_func_iconv = yes; then


  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h

      found_iconv=yes

else

      echo "$as_me:$LINENO: checking for libiconv" >&5
echo $ECHO_N "checking for libiconv... $ECHO_C" >&6
if test "${ac_cv_func_libiconv+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define libiconv to an innocuous variant, in case <limits.h> declares libiconv.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define libiconv innocuous_libiconv

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char libiconv (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef libiconv

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
/* 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
char (*f) () = libiconv;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != libiconv;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_libiconv=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_libiconv=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_libiconv" >&5
echo "${ECHO_T}$ac_cv_func_libiconv" >&6
if test $ac_cv_func_libiconv = yes; then


  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h

        found_iconv=yes

fi


fi

  fi

        if test "$found_iconv" = "no"; then

    for i in $PHP_ICONV /usr/local /usr; do
      if test -r $i/include/giconv.h; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_GICONV_H 1
_ACEOF

        ICONV_DIR=$i
        iconv_lib_name=giconv
        break
      elif test -r $i/include/iconv.h; then
        ICONV_DIR=$i
        iconv_lib_name=iconv
        break
      fi
    done

    if test -z "$ICONV_DIR"; then
      { { echo "$as_me:$LINENO: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&5
echo "$as_me: error: Please specify the install prefix of iconv with --with-iconv=<DIR>" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
       test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
    then

  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$ICONV_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_libiconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for libiconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for libiconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char libiconv ();
int
main ()
{
libiconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

        found_iconv=yes

  echo "#define HAVE_LIBICONV 1" > ext/iconv/php_have_libiconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_libiconv


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
          -L$ICONV_DIR/lib
        "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  as_ac_Lib=`echo "ac_cv_lib_$iconv_lib_name''_iconv" | $as_tr_sh`
echo "$as_me:$LINENO: checking for iconv in -l$iconv_lib_name" >&5
echo $ECHO_N "checking for iconv in -l$iconv_lib_name... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-l$iconv_lib_name  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char iconv ();
int
main ()
{
iconv ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_Lib=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_Lib=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared

          found_iconv=yes

  echo "#define HAVE_ICONV 1" > ext/iconv/php_have_iconv.h



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_$iconv_lib_name_iconv


fi



fi

    fi
  fi

  if test "$found_iconv" = "yes"; then
    if test -n "$ICONV_DIR"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ICONV 1
_ACEOF



  if test "$ext_shared" = "yes"; then
    XSLT_SHARED_LIBADD="-l$iconv_lib_name $XSLT_SHARED_LIBADD"
    if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XSLT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XSLT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ICONV_DIR/lib"; then

  if test "$ICONV_DIR/lib" != "/usr/lib"; then

  if test -z "$ICONV_DIR/lib" || echo "$ICONV_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/lib
  else

    ep_dir="`echo $ICONV_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $iconv_lib_name in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$iconv_lib_name $LIBS"
   ;;
  esac




  fi



  if test "$ICONV_DIR/include" != "/usr/include"; then

  if test -z "$ICONV_DIR/include" || echo "$ICONV_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$ICONV_DIR/include
  else

    ep_dir="`echo $ICONV_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICONV_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    fi

else
      { { echo "$as_me:$LINENO: error: iconv not found. To build sablotron you need the iconv library." >&5
echo "$as_me: error: iconv not found. To build sablotron you need the iconv library." >&2;}
   { (exit 1); exit 1; }; }

  fi


    if test "$PHP_SABLOT_JS" != "no"; then
      for i in $PHP_SABLOT_JS /usr/local /usr; do
        if test -f $i/lib/libjs.a -o -f $i/lib/libjs.$SHLIB_SUFFIX_NAME; then
          PHP_SABLOT_JS_DIR=$i
          break
        fi
      done


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
        -L$PHP_SABLOT_JS_DIR/lib
      "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for JS_GetRuntime in -ljs" >&5
echo $ECHO_N "checking for JS_GetRuntime in -ljs... $ECHO_C" >&6
if test "${ac_cv_lib_js_JS_GetRuntime+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ljs  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char JS_GetRuntime ();
int
main ()
{
JS_GetRuntime ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_js_JS_GetRuntime=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_js_JS_GetRuntime=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_js_JS_GetRuntime" >&5
echo "${ECHO_T}$ac_cv_lib_js_JS_GetRuntime" >&6
if test $ac_cv_lib_js_JS_GetRuntime = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared



  if test "$ext_shared" = "yes"; then
    XSLT_SHARED_LIBADD="-ljs $XSLT_SHARED_LIBADD"
    if test -n "$PHP_SABLOT_JS_DIR/lib"; then

  if test "$PHP_SABLOT_JS_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_SABLOT_JS_DIR/lib" || echo "$PHP_SABLOT_JS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_SABLOT_JS_DIR/lib
  else

    ep_dir="`echo $PHP_SABLOT_JS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_SABLOT_JS_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XSLT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XSLT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$PHP_SABLOT_JS_DIR/lib"; then

  if test "$PHP_SABLOT_JS_DIR/lib" != "/usr/lib"; then

  if test -z "$PHP_SABLOT_JS_DIR/lib" || echo "$PHP_SABLOT_JS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_SABLOT_JS_DIR/lib
  else

    ep_dir="`echo $PHP_SABLOT_JS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_SABLOT_JS_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case js in
  c|c_r|pthread*) ;;
  *)
      LIBS="-ljs $LIBS"
   ;;
  esac




  fi


        PHP_SABLOT_JS_LIBS="-L$PHP_SABLOT_JS_DIR/lib -ljs"


else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_js_JS_GetRuntime

        { { echo "$as_me:$LINENO: error: libjs not found. Please check config.log for more information." >&5
echo "$as_me: error: libjs not found. Please check config.log for more information." >&2;}
   { (exit 1); exit 1; }; }


fi

    fi


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$XSLT_DIR/lib $PHP_SABLOT_JS_LIBS
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for SablotSetEncoding in -lsablot" >&5
echo $ECHO_N "checking for SablotSetEncoding in -lsablot... $ECHO_C" >&6
if test "${ac_cv_lib_sablot_SablotSetEncoding+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsablot  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SablotSetEncoding ();
int
main ()
{
SablotSetEncoding ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_sablot_SablotSetEncoding=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_sablot_SablotSetEncoding=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_sablot_SablotSetEncoding" >&5
echo "${ECHO_T}$ac_cv_lib_sablot_SablotSetEncoding" >&6
if test $ac_cv_lib_sablot_SablotSetEncoding = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_SABLOT_SET_ENCODING 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_sablot_SablotSetEncoding


fi



  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
      -L$XSLT_DIR/lib $PHP_SABLOT_JS_LIBS
    "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for SablotGetOptions in -lsablot" >&5
echo $ECHO_N "checking for SablotGetOptions in -lsablot... $ECHO_C" >&6
if test "${ac_cv_lib_sablot_SablotGetOptions+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsablot  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char SablotGetOptions ();
int
main ()
{
SablotGetOptions ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_sablot_SablotGetOptions=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_sablot_SablotGetOptions=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_sablot_SablotGetOptions" >&5
echo "${ECHO_T}$ac_cv_lib_sablot_SablotGetOptions" >&6
if test $ac_cv_lib_sablot_SablotGetOptions = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_SABLOT_GET_OPTIONS 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_sablot_SablotGetOptions


fi



cat >>confdefs.h <<\_ACEOF
#define HAVE_SABLOT_BACKEND 1
_ACEOF

  fi


  if test "$XSLT_DIR/include" != "/usr/include"; then

  if test -z "$XSLT_DIR/include" || echo "$XSLT_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$XSLT_DIR/include
  else

    ep_dir="`echo $XSLT_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XSLT_DIR/include\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  if test "$ext_shared" = "yes"; then
    XSLT_SHARED_LIBADD="-l$XSLT_LIBNAME $XSLT_SHARED_LIBADD"
    if test -n "$XSLT_DIR/lib"; then

  if test "$XSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$XSLT_DIR/lib" || echo "$XSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$XSLT_DIR/lib
  else

    ep_dir="`echo $XSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XSLT_DIR/lib\"`"
  fi


      if test "$ext_shared" = "yes"; then
        XSLT_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $XSLT_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$XSLT_DIR/lib"; then

  if test "$XSLT_DIR/lib" != "/usr/lib"; then

  if test -z "$XSLT_DIR/lib" || echo "$XSLT_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$XSLT_DIR/lib
  else

    ep_dir="`echo $XSLT_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XSLT_DIR/lib\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $XSLT_LIBNAME in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$XSLT_LIBNAME $LIBS"
   ;;
  esac




  fi




cat >>confdefs.h <<\_ACEOF
#define HAVE_XSLT 1
_ACEOF

fi




echo "$as_me:$LINENO: checking for YAZ support" >&5
echo $ECHO_N "checking for YAZ support... $ECHO_C" >&6

# Check whether --with-yaz or --without-yaz was given.
if test "${with_yaz+set}" = set; then
  withval="$with_yaz"
  PHP_YAZ=$withval
else

  PHP_YAZ=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_YAZ=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_YAZ in
shared,*)
  PHP_YAZ=`echo "$PHP_YAZ"|sed 's/^shared,//'`
  ;;
shared)
  PHP_YAZ=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6





if test "$PHP_YAZ" != "no"; then
  yazconfig=NONE
  if test "$PHP_YAZ" = "yes"; then
    # Extract the first word of "yaz-config", so it can be a program name with args.
set dummy yaz-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_yazconfig+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $yazconfig in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_yazconfig="$yazconfig" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_yazconfig="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_yazconfig" && ac_cv_path_yazconfig="NONE"
  ;;
esac
fi
yazconfig=$ac_cv_path_yazconfig

if test -n "$yazconfig"; then
  echo "$as_me:$LINENO: result: $yazconfig" >&5
echo "${ECHO_T}$yazconfig" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  else
    if test -r ${PHP_YAZ}/yaz-config; then
      yazconfig=${PHP_YAZ}/yaz-config
    else
      yazconfig=${PHP_YAZ}/bin/yaz-config
    fi
  fi

  if test -f $yazconfig; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_YAZ 1
_ACEOF

    . $yazconfig

        echo "$as_me:$LINENO: checking for YAZ version" >&5
echo $ECHO_N "checking for YAZ version... $ECHO_C" >&6
    yaz_version=`echo $YAZVERSION | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
    if test "$yaz_version" -ge 1009000; then
      echo "$as_me:$LINENO: result: $YAZVERSION" >&5
echo "${ECHO_T}$YAZVERSION" >&6
    else
      { { echo "$as_me:$LINENO: error: YAZ version 1.9 or later required." >&5
echo "$as_me: error: YAZ version 1.9 or later required." >&2;}
   { (exit 1); exit 1; }; }
    fi

    dir=""
    for c in $YAZLIB; do
      case $c in
       -L*)
         dir=`echo $c|cut -c 3-|sed 's%/\.libs%%g'`

  if test "$dir" != "/usr/lib"; then

  if test -z "$dir" || echo "$dir" | grep '^/' >/dev/null ; then
    ai_p=$dir
  else

    ep_dir="`echo $dir|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$dir\"`"
  fi


      if test "$ext_shared" = "yes"; then
        YAZ_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $YAZ_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

        ;;
       -lyaz*)
        ;;
       *)

  for ac_i in $c; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        YAZ_SHARED_LIBADD="$YAZ_SHARED_LIBADD -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        YAZ_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $YAZ_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

        ;;
      esac
    done


  case yaz in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        YAZ_SHARED_LIBADD="$YAZ_SHARED_LIBADD -lyaz"
    else


  case yaz in
  c|c_r|pthread*) ;;
  *)
      DLIBS="$DLIBS -lyaz"
   ;;
  esac


    fi
   ;;
  esac



  for ac_i in $YAZINC; do
    case $ac_i in
    -I*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/include"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi

    ;;
    esac
  done


  PHP_VAR_SUBST="$PHP_VAR_SUBST YAZ_SHARED_LIBADD"


  ext_builddir=ext/yaz
  ext_srcdir=$abs_srcdir/ext/yaz

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/yaz in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yaz"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yaz/"; ac_bdir="ext/yaz/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_yaz.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC yaz"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC yaz"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/yaz in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yaz"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yaz/"; ac_bdir="ext/yaz/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in php_yaz.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_yaz="$shared_objects_yaz $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_yaz) $(PHPYAZ_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yaz) -L$(top_builddir)/netware -lphp4lib $(YAZ_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yaz) $(PHPYAZ_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpyaz.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_yaz"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpyaz.$suffix: $ext_builddir/phpyaz.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpyaz.$suffix \$(phplibdir)

$ext_builddir/phpyaz.$suffix: \$(shared_objects_yaz) \$(PHPYAZ_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_yaz) $(YAZ_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yaz) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yaz) $(YAZ_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/yaz.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_yaz"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/yaz.$suffix: $ext_builddir/yaz.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/yaz.$suffix \$(phplibdir)

$ext_builddir/yaz.$suffix: \$(shared_objects_yaz) \$(YAZ_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_YAZ 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/yaz in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yaz"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yaz/"; ac_bdir="ext/yaz/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_yaz.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC yaz"
    else


  case ext/yaz in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yaz"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yaz/"; ac_bdir="ext/yaz/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_yaz.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC yaz"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"


  else
    { { echo "$as_me:$LINENO: error: YAZ not found (missing $yazconfig)" >&5
echo "$as_me: error: YAZ not found (missing $yazconfig)" >&2;}
   { (exit 1); exit 1; }; }
  fi
fi




echo "$as_me:$LINENO: checking whether to include YP support" >&5
echo $ECHO_N "checking whether to include YP support... $ECHO_C" >&6
# Check whether --enable-yp or --disable-yp was given.
if test "${enable_yp+set}" = set; then
  enableval="$enable_yp"
  PHP_YP=$enableval
else

  PHP_YP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_YP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_YP in
shared,*)
  PHP_YP=`echo "$PHP_YP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_YP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_YP" != "no"; then

  echo "$as_me:$LINENO: checking for yp_match in -lnsl" >&5
echo $ECHO_N "checking for yp_match in -lnsl... $ECHO_C" >&6
if test "${ac_cv_lib_nsl_yp_match+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char yp_match ();
int
main ()
{
yp_match ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_nsl_yp_match=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_nsl_yp_match=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_yp_match" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_yp_match" >&6
if test $ac_cv_lib_nsl_yp_match = yes; then

	YP_LIBS=nsl
	YP_CHECK_IN_LIB=nsl

else
  echo "$as_me:$LINENO: checking for yp_match in -lc" >&5
echo $ECHO_N "checking for yp_match in -lc... $ECHO_C" >&6
if test "${ac_cv_lib_c_yp_match+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lc  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char yp_match ();
int
main ()
{
yp_match ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_c_yp_match=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_c_yp_match=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_c_yp_match" >&5
echo "${ECHO_T}$ac_cv_lib_c_yp_match" >&6
if test $ac_cv_lib_c_yp_match = yes; then

		YP_LIBS=
		YP_CHECK_IN_LIB=c

else

		{ { echo "$as_me:$LINENO: error: Unable to find required yp/nis library" >&5
echo "$as_me: error: Unable to find required yp/nis library" >&2;}
   { (exit 1); exit 1; }; }

fi


fi




cat >>confdefs.h <<\_ACEOF
#define HAVE_YP 1
_ACEOF


  ext_builddir=ext/yp
  ext_srcdir=$abs_srcdir/ext/yp

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/yp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yp/"; ac_bdir="ext/yp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in yp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC yp"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC yp"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/yp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yp/"; ac_bdir="ext/yp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in yp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_yp="$shared_objects_yp $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_yp) $(PHPYP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yp) -L$(top_builddir)/netware -lphp4lib $(YP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yp) $(PHPYP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpyp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_yp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpyp.$suffix: $ext_builddir/phpyp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpyp.$suffix \$(phplibdir)

$ext_builddir/phpyp.$suffix: \$(shared_objects_yp) \$(PHPYP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_yp) $(YP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yp) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_yp) $(YP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/yp.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_yp"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/yp.$suffix: $ext_builddir/yp.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/yp.$suffix \$(phplibdir)

$ext_builddir/yp.$suffix: \$(shared_objects_yp) \$(YP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_YP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/yp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yp/"; ac_bdir="ext/yp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in yp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC yp"
    else


  case ext/yp in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/yp"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/yp/"; ac_bdir="ext/yp/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in yp.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC yp"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"




  PHP_VAR_SUBST="$PHP_VAR_SUBST YP_SHARED_LIBADD"


  if test -n "$YP_LIBS"; then


  if test "$ext_shared" = "yes"; then
    YP_SHARED_LIBADD="-l$YP_LIBS $YP_SHARED_LIBADD"
    if test -n "$YP_LIBDIR"; then

  if test "$YP_LIBDIR" != "/usr/lib"; then

  if test -z "$YP_LIBDIR" || echo "$YP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$YP_LIBDIR
  else

    ep_dir="`echo $YP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$YP_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        YP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $YP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$YP_LIBDIR"; then

  if test "$YP_LIBDIR" != "/usr/lib"; then

  if test -z "$YP_LIBDIR" || echo "$YP_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$YP_LIBDIR
  else

    ep_dir="`echo $YP_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$YP_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case $YP_LIBS in
  c|c_r|pthread*) ;;
  *)
      LIBS="-l$YP_LIBS $LIBS"
   ;;
  esac




  fi


  fi



  case $host_alias in
  *solaris*)

cat >>confdefs.h <<\_ACEOF
#define SOLARIS_YP 1
_ACEOF
 ;;
  esac
fi




echo "$as_me:$LINENO: checking for ZIP support" >&5
echo $ECHO_N "checking for ZIP support... $ECHO_C" >&6

# Check whether --with-zip or --without-zip was given.
if test "${with_zip+set}" = set; then
  withval="$with_zip"
  PHP_ZIP=$withval
else

  PHP_ZIP=no

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_ZIP=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_ZIP in
shared,*)
  PHP_ZIP=`echo "$PHP_ZIP"|sed 's/^shared,//'`
  ;;
shared)
  PHP_ZIP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_ZIP" != "no"; then
  for i in $PHP_ZIP /usr/local /usr ; do
    if test -f $i/include/zzlib/zziplib.h; then
      ZZIPLIB_DIR=$i
      ZZIPLIB_INCDIR=$i/include/zzlib
    elif test -f $i/include/zziplib.h; then
      ZZIPLIB_DIR=$i
      ZZIPLIB_INCDIR=$i/include
    fi
  done

  if test -z "$ZZIPLIB_DIR"; then
    { { echo "$as_me:$LINENO: error: Cannot find libzzip" >&5
echo "$as_me: error: Cannot find libzzip" >&2;}
   { (exit 1); exit 1; }; }
  fi

  if test -f $ZZIPLIB_INCDIR/zzip/zzip.h; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_NEW_ZZIPLIB 1
_ACEOF

  fi

  ZZIPLIB_LIBDIR=$ZZIPLIB_DIR/lib


  save_old_LDFLAGS=$LDFLAGS
  ac_stuff="
    -L$ZZIPLIB_LIBDIR
  "

  save_ext_shared=$ext_shared
  ext_shared=yes

  for ac_i in $ac_stuff; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
    if test "$ext_shared" = "yes"; then
        LDFLAGS="$LDFLAGS -l$ac_ii"
    else


  case $ac_ii in
  c|c_r|pthread*) ;;
  *)
      LIBS="$LIBS -l$ac_ii"
   ;;
  esac


    fi
   ;;
  esac


    ;;
    -L*)
      ac_ii=`echo $ac_i|cut -c 3-`

  if test "$ac_ii" != "/usr/lib"; then

  if test -z "$ac_ii" || echo "$ac_ii" | grep '^/' >/dev/null ; then
    ai_p=$ac_ii
  else

    ep_dir="`echo $ac_ii|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ac_ii\"`"
  fi


      if test "$ext_shared" = "yes"; then
        LDFLAGS="$ld_runpath_switch$ai_p -L$ai_p $LDFLAGS"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    ;;
    esac
  done

  echo "$as_me:$LINENO: checking for zzip_open in -lzzip" >&5
echo $ECHO_N "checking for zzip_open in -lzzip... $ECHO_C" >&6
if test "${ac_cv_lib_zzip_zzip_open+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lzzip  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char zzip_open ();
int
main ()
{
zzip_open ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_zzip_zzip_open=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_zzip_zzip_open=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_zzip_zzip_open" >&5
echo "${ECHO_T}$ac_cv_lib_zzip_zzip_open" >&6
if test $ac_cv_lib_zzip_zzip_open = yes; then

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared


cat >>confdefs.h <<\_ACEOF
#define HAVE_ZZIPLIB 1
_ACEOF



else

    LDFLAGS=$save_old_LDFLAGS
    ext_shared=$save_ext_shared
    unset ac_cv_lib_zzip_zzip_open

    { { echo "$as_me:$LINENO: error: zziplib module requires zzlib >= 0.10.6." >&5
echo "$as_me: error: zziplib module requires zzlib >= 0.10.6." >&2;}
   { (exit 1); exit 1; }; }


fi




  if test "$ext_shared" = "yes"; then
    ZIP_SHARED_LIBADD="-lzzip $ZIP_SHARED_LIBADD"
    if test -n "$ZZIPLIB_LIBDIR"; then

  if test "$ZZIPLIB_LIBDIR" != "/usr/lib"; then

  if test -z "$ZZIPLIB_LIBDIR" || echo "$ZZIPLIB_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$ZZIPLIB_LIBDIR
  else

    ep_dir="`echo $ZZIPLIB_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZZIPLIB_LIBDIR\"`"
  fi


      if test "$ext_shared" = "yes"; then
        ZIP_SHARED_LIBADD="$ld_runpath_switch$ai_p -L$ai_p $ZIP_SHARED_LIBADD"
      else



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi


      fi

  fi

    fi
  else


  if test -n "$ZZIPLIB_LIBDIR"; then

  if test "$ZZIPLIB_LIBDIR" != "/usr/lib"; then

  if test -z "$ZZIPLIB_LIBDIR" || echo "$ZZIPLIB_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$ZZIPLIB_LIBDIR
  else

    ep_dir="`echo $ZZIPLIB_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZZIPLIB_LIBDIR\"`"
  fi





  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"

    test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
    LDFLAGS="$LDFLAGS -L$ai_p"
    PHP_RPATHS="$PHP_RPATHS $ai_p"

  fi



  fi

  fi


  case zzip in
  c|c_r|pthread*) ;;
  *)
      LIBS="-lzzip $LIBS"
   ;;
  esac




  fi



  if test "$ZZIPLIB_INCDIR" != "/usr/include"; then

  if test -z "$ZZIPLIB_INCDIR" || echo "$ZZIPLIB_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$ZZIPLIB_INCDIR
  else

    ep_dir="`echo $ZZIPLIB_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"

    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ZZIPLIB_INCDIR\"`"
  fi



  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`

  cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "INCLUDEPATH$unique=set"

      if test ""; then
        INCLUDES="-I$ai_p $INCLUDES"
      else
        INCLUDES="$INCLUDES -I$ai_p"
      fi

  fi

  fi



  ext_builddir=ext/zip
  ext_srcdir=$abs_srcdir/ext/zip

  ac_extra=

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" != "cli"; then



  case ext/zip in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zip.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    EXT_STATIC="$EXT_STATIC zip"
    if test "$ext_shared" != "nocli"; then
      EXT_CLI_STATIC="$EXT_CLI_STATIC zip"
    fi
  else
    if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then

  case ext/zip in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$shared_c_pre
  b_cxx_pre=$shared_cxx_pre
  b_c_meta=$shared_c_meta
  b_cxx_meta=$shared_cxx_meta
  b_c_post=$shared_c_post
  b_cxx_post=$shared_cxx_post
  b_lo=$shared_lo


  old_IFS=$IFS
  for ac_src in zip.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      shared_objects_zip="$shared_objects_zip $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done

      case $host_alias in
      *netware*)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp4lib $(ZIP_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(PHPZIP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/phpzip.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/phpzip.$suffix: $ext_builddir/phpzip.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/phpzip.$suffix \$(phplibdir)

$ext_builddir/phpzip.$suffix: \$(shared_objects_zip) \$(PHPZIP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

       ;;
      *)

  install_modules="install-modules"

  case $host_alias in
    *darwin*)
      suffix=so
      link_cmd='$(CC) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD)'
      ;;
    *netware*)
      suffix=nlm
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) -L$(top_builddir)/netware -lphp4lib $(_SHARED_LIBADD)'
      ;;
    *)
      suffix=la
      link_cmd='$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_zip) $(ZIP_SHARED_LIBADD)'
      ;;
  esac

  PHP_MODULES="$PHP_MODULES \$(phplibdir)/zip.$suffix"

  PHP_VAR_SUBST="$PHP_VAR_SUBST shared_objects_zip"

  cat >>Makefile.objects<<EOF
\$(phplibdir)/zip.$suffix: $ext_builddir/zip.$suffix
	\$(LIBTOOL) --mode=install cp $ext_builddir/zip.$suffix \$(phplibdir)

$ext_builddir/zip.$suffix: \$(shared_objects_zip) \$(ZIP_SHARED_DEPENDENCIES)
	$link_cmd

EOF

      ;;
      esac

cat >>confdefs.h <<_ACEOF
#define COMPILE_DL_ZIP 1
_ACEOF

    fi
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes" && test "" = "cli"; then
    if test "$PHP_SAPI" = "cgi"; then


  case ext/zip in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zip.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


      EXT_STATIC="$EXT_STATIC zip"
    else


  case ext/zip in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "ext/zip"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/ext/zip/"; ac_bdir="ext/zip/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zip.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre $ac_extra $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre $ac_extra $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


    fi
    EXT_CLI_STATIC="$EXT_CLI_STATIC zip"
  fi

  BUILD_DIR="$BUILD_DIR $ext_builddir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST ZIP_SHARED_LIBADD"

fi





if test "$PHP_VERSIONING" = "yes"; then
  test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
  if test -f "$PHP_SYM_FILE"; then
    EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE $EXTRA_LDFLAGS"
  fi
fi

enable_shared=yes
enable_static=yes

case $php_build_target in
program|static)
    standard_libtool_flag='-prefer-non-pic -static'
    if test -z "$PHP_MODULES"; then
        enable_shared=no
    fi
;;
shared)
    enable_static=no
    case $with_pic in
      yes) standard_libtool_flag='-prefer-pic';;
      no)  standard_libtool_flag='-prefer-non-pic';;
    esac
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module"
;;
esac

EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"

if test "$ac_cv_lib_crypt_crypt" = "yes"; then
  EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
fi

unset LIBS LDFLAGS



# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring PEAR${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring PEAR${T_ME}" >&6


# compatibility
if test -z "$with_pear" && test "$enable_pear" = "no"; then
  with_pear=no
fi

# If CLI is disabled -> disable PEAR
if test "$PHP_SAPI_CLI" = "no"; then
  with_pear=no
fi



echo "$as_me:$LINENO: checking whether to install PEAR" >&5
echo $ECHO_N "checking whether to install PEAR... $ECHO_C" >&6

# Check whether --with-pear or --without-pear was given.
if test "${with_pear+set}" = set; then
  withval="$with_pear"
  PHP_PEAR=$withval
else

  PHP_PEAR=DEFAULT

  if test "$PHP_ENABLE_ALL" && test "yes" = "yes"; then
    PHP_PEAR=$PHP_ENABLE_ALL
  fi

fi;


ext_output="yes, shared"
ext_shared=yes
case $PHP_PEAR in
shared,*)
  PHP_PEAR=`echo "$PHP_PEAR"|sed 's/^shared,//'`
  ;;
shared)
  PHP_PEAR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac



echo "$as_me:$LINENO: result: $ext_output" >&5
echo "${ECHO_T}$ext_output" >&6




if test "$PHP_PEAR" != "no"; then

        if test "$PHP_PCRE_REGEX" = "no"; then
    pear_error_msg="$pear_error_msg
                    PEAR requires PCRE to be enabled.    Add --with-pcre-regex to the configure line. (or --without-pear)"
  fi
  if test "$PHP_XML" = "no"; then
    pear_error_msg="$pear_error_msg
                    PEAR requires XML to be enabled.     Add --enable-xml to the configure line. (or --without-pear)"
  fi


  if test "$pear_error_msg"; then
    { { echo "$as_me:$LINENO: error: $pear_error_msg" >&5
echo "$as_me: error: $pear_error_msg" >&2;}
   { (exit 1); exit 1; }; }
  fi

  install_pear="install-pear"
  PEAR_INSTALLDIR=$PHP_PEAR

  if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
    case $PHP_LAYOUT in
      GNU) PEAR_INSTALLDIR=$datadir/pear;;
      *)   PEAR_INSTALLDIR=$libdir/php;;
    esac
  fi


  src=$abs_srcdir/pear/Makefile.frag
  ac_srcdir=$abs_srcdir/pear
  ac_builddir=pear
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments

fi




# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring Zend${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring Zend${T_ME}" >&6












if test "$YACC" != "bison -y"; then
    { echo "$as_me:$LINENO: WARNING: You will need bison if you want to regenerate the Zend parser." >&5
echo "$as_me: WARNING: You will need bison if you want to regenerate the Zend parser." >&2;}
else
    echo "$as_me:$LINENO: checking bison version" >&5
echo $ECHO_N "checking bison version... $ECHO_C" >&6
    set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /' | tr -d 'a-z'`
    if test "${1}" = "1" -a "${2}" -lt "28"; then
        { echo "$as_me:$LINENO: WARNING: You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2})." >&5
echo "$as_me: WARNING: You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2})." >&2;}
    fi
    echo "$as_me:$LINENO: result: ${1}.${2} (ok)" >&5
echo "${ECHO_T}${1}.${2} (ok)" >&6
fi



if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
   "`uname -sv`" = "AIX 4"; then
	CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
fi

if test "$ac_cv_c_compiler_gnu" = "yes" -a "`uname -s`" = "Darwin"; then
        CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
fi














for ac_header in inttypes.h \
stdint.h \
limits.h \
malloc.h \
string.h \
unistd.h \
stdarg.h \
sys/types.h \
sys/time.h \
signal.h \
unix.h \
mach-o/dyld.h \
dlfcn.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done


echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((size_t *) 0)
  return 0;
if (sizeof (size_t))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_size_t=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_size_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
echo "${ECHO_T}$ac_cv_type_size_t" >&6
if test $ac_cv_type_size_t = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define size_t unsigned
_ACEOF

fi

echo "$as_me:$LINENO: checking return type of signal handlers" >&5
echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
if test "${ac_cv_type_signal+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <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;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_signal=void
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_signal=int
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
echo "${ECHO_T}$ac_cv_type_signal" >&6

cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF



echo "$as_me:$LINENO: checking for uint" >&5
echo $ECHO_N "checking for uint... $ECHO_C" >&6
if test "${ac_cv_type_uint+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((uint *) 0)
  return 0;
if (sizeof (uint))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_uint=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_uint=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_uint" >&5
echo "${ECHO_T}$ac_cv_type_uint" >&6
if test $ac_cv_type_uint = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define uint unsigned int
_ACEOF

fi

echo "$as_me:$LINENO: checking for ulong" >&5
echo $ECHO_N "checking for ulong... $ECHO_C" >&6
if test "${ac_cv_type_ulong+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{
if ((ulong *) 0)
  return 0;
if (sizeof (ulong))
  return 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_type_ulong=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_type_ulong=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_ulong" >&5
echo "${ECHO_T}$ac_cv_type_ulong" >&6
if test $ac_cv_type_ulong = yes; then
  :
else

cat >>confdefs.h <<_ACEOF
#define ulong unsigned long
_ACEOF

fi



echo "$as_me:$LINENO: checking for int32_t" >&5
echo $ECHO_N "checking for int32_t... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_INTTYPES_H
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
#endif
int
main ()
{
if ((int32_t *) 0)
  return 0;
if (sizeof (int32_t))
  return 0;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then


cat >>confdefs.h <<_ACEOF
#define HAVE_INT32_T 1
_ACEOF

  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext

echo "$as_me:$LINENO: checking for uint32_t" >&5
echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_INTTYPES_H
#include <inttypes.h>
#elif HAVE_STDINT_H
#include <stdint.h>
#endif
int
main ()
{
if ((uint32_t *) 0)
  return 0;
if (sizeof (uint32_t))
  return 0;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then


cat >>confdefs.h <<_ACEOF
#define HAVE_UINT32_T 1
_ACEOF

  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext


for ac_func in vprintf
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

echo "$as_me:$LINENO: checking for _doprnt" >&5
echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
if test "${ac_cv_func__doprnt+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define _doprnt innocuous__doprnt

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char _doprnt (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef _doprnt

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char _doprnt ();
/* 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__doprnt) || defined (__stub____doprnt)
choke me
#else
char (*f) () = _doprnt;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != _doprnt;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func__doprnt=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func__doprnt=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
echo "${ECHO_T}$ac_cv_func__doprnt" >&6
if test $ac_cv_func__doprnt = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_DOPRNT 1
_ACEOF

fi

fi
done


echo "$as_me:$LINENO: checking for working memcmp" >&5
echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
if test "${ac_cv_func_memcmp_working+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_memcmp_working=no
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
int
main ()
{

  /* Some versions of memcmp are not 8-bit clean.  */
  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
    exit (1);

  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
     or more and with at least one buffer not starting on a 4-byte boundary.
     William Lewis provided this test program.   */
  {
    char foo[21];
    char bar[21];
    int i;
    for (i = 0; i < 4; i++)
      {
	char *a = foo + i;
	char *b = bar + i;
	strcpy (a, "--------01111111");
	strcpy (b, "--------10000000");
	if (memcmp (a, b, 16) >= 0)
	  exit (1);
      }
    exit (0);
  }

  ;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_memcmp_working=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_func_memcmp_working=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
test $ac_cv_func_memcmp_working = no && case $LIBOBJS in
    "memcmp.$ac_objext"   | \
  *" memcmp.$ac_objext"   | \
    "memcmp.$ac_objext "* | \
  *" memcmp.$ac_objext "* ) ;;
  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;;
esac


# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo "$as_me:$LINENO: checking for working alloca.h" >&5
echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
if test "${ac_cv_working_alloca_h+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <alloca.h>
int
main ()
{
char *p = (char *) alloca (2 * sizeof (int));
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_working_alloca_h=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_working_alloca_h=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
if test $ac_cv_working_alloca_h = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA_H 1
_ACEOF

fi

echo "$as_me:$LINENO: checking for alloca" >&5
echo $ECHO_N "checking for alloca... $ECHO_C" >&6
if test "${ac_cv_func_alloca_works+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

int
main ()
{
char *p = (char *) alloca (1);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_alloca_works=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_alloca_works=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
echo "${ECHO_T}$ac_cv_func_alloca_works" >&6

if test $ac_cv_func_alloca_works = yes; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA 1
_ACEOF

else
  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
# that cause trouble.  Some versions do not even contain alloca or
# contain a buggy version.  If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.

ALLOCA=alloca.$ac_objext

cat >>confdefs.h <<\_ACEOF
#define C_ALLOCA 1
_ACEOF


echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
if test "${ac_cv_os_cray+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "webecray" >/dev/null 2>&1; then
  ac_cv_os_cray=yes
else
  ac_cv_os_cray=no
fi
rm -f conftest*

fi
echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
echo "${ECHO_T}$ac_cv_os_cray" >&6
if test $ac_cv_os_cray = yes; then
  for ac_func in _getb67 GETB67 getb67; do
    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then

cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
_ACEOF

    break
fi

  done
fi

echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
if test "${ac_cv_c_stack_direction+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
int
find_stack_direction ()
{
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
    {
      addr = &dummy;
      return find_stack_direction ();
    }
  else
    return (&dummy > addr) ? 1 : -1;
}

int
main ()
{
  exit (find_stack_direction () < 0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_stack_direction=1
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )
ac_cv_c_stack_direction=-1
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
echo "${ECHO_T}$ac_cv_c_stack_direction" >&6

cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
_ACEOF


fi









for ac_func in memcpy strdup getpid kill strtod strtol finite fpclass
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done






for ac_func in finite isfinite isinf isnan
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define $ac_func innocuous_$ac_func

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef $ac_func

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char $ac_func ();
/* 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
char (*f) () = $ac_func;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != $ac_func;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  eval "$as_ac_var=yes"
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

eval "$as_ac_var=no"
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done



  echo "$as_me:$LINENO: checking whether fp_except is defined" >&5
echo $ECHO_N "checking whether fp_except is defined... $ECHO_C" >&6
if test "${ac_cv_type_fp_except+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <floatingpoint.h>

int
main ()
{

fp_except x = (fp_except) 0;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

     ac_cv_type_fp_except=yes

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5


     ac_cv_type_fp_except=no

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_fp_except" >&5
echo "${ECHO_T}$ac_cv_type_fp_except" >&6
  if test "$ac_cv_type_fp_except" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define HAVE_FP_EXCEPT 1
_ACEOF

  fi




for ac_header in dlfcn.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done



echo "$as_me:$LINENO: checking whether dlsym() requires a leading underscore in symbol names" >&5
echo $ECHO_N "checking whether dlsym() requires a leading underscore in symbol names... $ECHO_C" >&6
if test "$cross_compiling" = yes; then :

else
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  lt_status=$lt_dlunknown
  cat > conftest.$ac_ext <<EOF
#line 126254 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#include <stdio.h>

#ifdef RTLD_GLOBAL
#  define LT_DLGLOBAL		RTLD_GLOBAL
#else
#  ifdef DL_GLOBAL
#    define LT_DLGLOBAL		DL_GLOBAL
#  else
#    define LT_DLGLOBAL		0
#  endif
#endif

/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
   find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
#  ifdef RTLD_LAZY
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
#  else
#    ifdef DL_LAZY
#      define LT_DLLAZY_OR_NOW		DL_LAZY
#    else
#      ifdef RTLD_NOW
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
#      else
#        ifdef DL_NOW
#          define LT_DLLAZY_OR_NOW	DL_NOW
#        else
#          define LT_DLLAZY_OR_NOW	0
#        endif
#      endif
#    endif
#  endif
#endif

#ifdef __cplusplus
extern "C" void exit (int);
#endif

void fnord() { int i=42;}
int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;

  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
      /* dlclose (self); */
    }

    exit (status);
}
EOF
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
    (./conftest; exit; ) 2>/dev/null
    lt_status=$?
    case x$lt_status in
      x$lt_dlno_uscore)
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
 ;;
      x$lt_dlneed_uscore)
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

cat >>confdefs.h <<\_ACEOF
#define DLSYM_NEEDS_UNDERSCORE 1
_ACEOF

 ;;
      x$lt_unknown|x*)
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
 ;;
    esac
  else :
    # compilation failed

  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6

  fi
fi
rm -fr conftest*




# Check whether --enable-zend-memory-manager or --disable-zend-memory-manager was given.
if test "${enable_zend_memory_manager+set}" = set; then
  enableval="$enable_zend_memory_manager"

  ZEND_USE_ZEND_ALLOC=$enableval

else

  ZEND_USE_ZEND_ALLOC=yes

fi;

# Check whether --enable-experimental-zts or --disable-experimental-zts was given.
if test "${enable_experimental_zts+set}" = set; then
  enableval="$enable_experimental_zts"

  ZEND_EXPERIMENTAL_ZTS=$enableval

else

  ZEND_EXPERIMENTAL_ZTS=no

fi;

# Check whether --enable-inline-optimization or --disable-inline-optimization was given.
if test "${enable_inline_optimization+set}" = set; then
  enableval="$enable_inline_optimization"

  ZEND_INLINE_OPTIMIZATION=$enableval

else

  ZEND_INLINE_OPTIMIZATION=yes

fi;

# Check whether --enable-memory-limit or --disable-memory-limit was given.
if test "${enable_memory_limit+set}" = set; then
  enableval="$enable_memory_limit"

  ZEND_MEMORY_LIMIT=$enableval

else

  ZEND_MEMORY_LIMIT=no

fi;

# Check whether --enable-zend-multibyte or --disable-zend-multibyte was given.
if test "${enable_zend_multibyte+set}" = set; then
  enableval="$enable_zend_multibyte"

  ZEND_MULTIBYTE=$enableval

else

  ZEND_MULTIBYTE=no

fi;

echo "$as_me:$LINENO: checking whether to enable the Zend memory manager" >&5
echo $ECHO_N "checking whether to enable the Zend memory manager... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_USE_ZEND_ALLOC" >&5
echo "${ECHO_T}$ZEND_USE_ZEND_ALLOC" >&6

echo "$as_me:$LINENO: checking whether to enable thread-safety" >&5
echo $ECHO_N "checking whether to enable thread-safety... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_EXPERIMENTAL_ZTS" >&5
echo "${ECHO_T}$ZEND_EXPERIMENTAL_ZTS" >&6

echo "$as_me:$LINENO: checking whether to enable inline optimization for GCC" >&5
echo $ECHO_N "checking whether to enable inline optimization for GCC... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_INLINE_OPTIMIZATION" >&5
echo "${ECHO_T}$ZEND_INLINE_OPTIMIZATION" >&6

echo "$as_me:$LINENO: checking whether to enable a memory limit" >&5
echo $ECHO_N "checking whether to enable a memory limit... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_MEMORY_LIMIT" >&5
echo "${ECHO_T}$ZEND_MEMORY_LIMIT" >&6

echo "$as_me:$LINENO: checking whether to enable Zend debugging" >&5
echo $ECHO_N "checking whether to enable Zend debugging... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_DEBUG" >&5
echo "${ECHO_T}$ZEND_DEBUG" >&6

echo "$as_me:$LINENO: checking whether to enable Zend multibyte" >&5
echo $ECHO_N "checking whether to enable Zend multibyte... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $ZEND_MULTIBYTE" >&5
echo "${ECHO_T}$ZEND_MULTIBYTE" >&6

if test "$ZEND_DEBUG" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define ZEND_DEBUG 1
_ACEOF

  echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
  if test "$CFLAGS" = "-g -O2"; then
  	CFLAGS=-g
  fi
  test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
  test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
    DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
else

cat >>confdefs.h <<\_ACEOF
#define ZEND_DEBUG 0
_ACEOF

fi

test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"

if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define USE_ZEND_ALLOC 1
_ACEOF

else

cat >>confdefs.h <<\_ACEOF
#define USE_ZEND_ALLOC 0
_ACEOF

fi

if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define ZTS 1
_ACEOF

  CFLAGS="$CFLAGS -DZTS"
fi

if test "$ZEND_MEMORY_LIMIT" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define MEMORY_LIMIT 1
_ACEOF

else

cat >>confdefs.h <<\_ACEOF
#define MEMORY_LIMIT 0
_ACEOF

fi

if test "$ZEND_MULTIBYTE" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define ZEND_MULTIBYTE 1
_ACEOF

fi


if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
  INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//`
else
  INLINE_CFLAGS="$CFLAGS"
fi


echo "$as_me:$LINENO: checking for inline" >&5
echo $ECHO_N "checking for inline... $ECHO_C" >&6
if test "${ac_cv_c_inline+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#ifndef __cplusplus
typedef int foo_t;
static $ac_kw foo_t static_foo () {return 0; }
$ac_kw foo_t foo () {return 0; }
#endif

_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_c_inline=$ac_kw; break
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done

fi
echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
echo "${ECHO_T}$ac_cv_c_inline" >&6


case $ac_cv_c_inline in
  inline | yes) ;;
  *)
    case $ac_cv_c_inline in
      no) ac_val=;;
      *) ac_val=$ac_cv_c_inline;;
    esac
    cat >>confdefs.h <<_ACEOF
#ifndef __cplusplus
#define inline $ac_val
#endif
_ACEOF
    ;;
esac






if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then

cat >>confdefs.h <<\_ACEOF
#define ZTS 1
_ACEOF

  PHP_THREAD_SAFETY=yes
else
  PHP_THREAD_SAFETY=no
fi

INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"

if test "$abs_srcdir" != "$abs_builddir"; then
  INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
  INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
fi

ZEND_EXTRA_LIBS="$LIBS"
unset LIBS LDFLAGS


# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring TSRM${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring TSRM${T_ME}" >&6





for ac_header in stdarg.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done



if test "$PHP_THREAD_SAFETY" = "yes"; then




# Check whether --with-tsrm-pth or --without-tsrm-pth was given.
if test "${with_tsrm_pth+set}" = set; then
  withval="$with_tsrm_pth"

  TSRM_PTH=$withval

else

  TSRM_PTH=no

fi;


# Check whether --with-tsrm-st or --without-tsrm-st was given.
if test "${with_tsrm_st+set}" = set; then
  withval="$with_tsrm_st"

  TSRM_ST=$withval

else

  TSRM_ST=no

fi;


# Check whether --with-tsrm-pthreads or --without-tsrm-pthreads was given.
if test "${with_tsrm_pthreads+set}" = set; then
  withval="$with_tsrm_pthreads"

  TSRM_PTHREADS=$withval

else

  TSRM_PTHREADS=yes

fi;

test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config

if test "$TSRM_PTH" != "no"; then


echo "$as_me:$LINENO: checking for GNU Pth" >&5
echo $ECHO_N "checking for GNU Pth... $ECHO_C" >&6
PTH_PREFIX="`$TSRM_PTH --prefix`"
if test -z "$PTH_PREFIX"; then
  echo "$as_me:$LINENO: result: Please check your Pth installation" >&5
echo "${ECHO_T}Please check your Pth installation" >&6
fi

CPPFLAGS="$CPPFLAGS `$TSRM_PTH --cflags`"
LDFLAGS="$LDFLAGS `$TSRM_PTH --ldflags`"
LIBS="$LIBS `$TSRM_PTH --libs`"


cat >>confdefs.h <<\_ACEOF
#define GNUPTH 1
_ACEOF

echo "$as_me:$LINENO: result: yes - installed in $PTH_PREFIX" >&5
echo "${ECHO_T}yes - installed in $PTH_PREFIX" >&6


elif test "$TSRM_ST" != "no"; then

  if test -r "$TSRM_ST/include/st.h"; then
    CPPFLAGS="$CPPFLAGS -I$TSRM_ST/include"
    LDFLAGS="$LDFLAGS -L$TSRM_ST/lib"
  elif test -r "$TSRM_ST/st.h"; then
    CPPFLAGS="$CPPFLAGS -I$TSRM_ST"
    LDFLAGS="$LDFLAGS -L$TSRM_ST"
  fi

for ac_header in st.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
  # Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_header_compiler=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6

# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_c_preproc_warn_flag
    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  ac_header_preproc=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

  ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6

# So?  What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
  yes:no: )
    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    ac_header_preproc=yes
    ;;
  no:yes:* )
    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    (
      cat <<\_ASBOX
## ------------------------------------------ ##
## Report this to the AC_PACKAGE_NAME lists.  ##
## ------------------------------------------ ##
_ASBOX
    ) |
      sed "s/^/$as_me: WARNING:     /" >&2
    ;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6

fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
  cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

else

    { { echo "$as_me:$LINENO: error: Sorry, I was unable to locate the State Threads header file.  Please specify the prefix using --with-tsrm-st=/prefix" >&5
echo "$as_me: error: Sorry, I was unable to locate the State Threads header file.  Please specify the prefix using --with-tsrm-st=/prefix" >&2;}
   { (exit 1); exit 1; }; }

fi

done

  LIBS="$LIBS -lst"
  echo "$as_me:$LINENO: checking for SGI's State Threads" >&5
echo $ECHO_N "checking for SGI's State Threads... $ECHO_C" >&6
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

cat >>confdefs.h <<\_ACEOF
#define TSRM_ST 1
_ACEOF


elif test "$TSRM_PTHREADS" != "no"; then




if test "$beos_threads" = "1"; then
  pthreads_working="yes"
  ac_cv_pthreads_cflags=""
else
  save_CFLAGS=$CFLAGS
  save_LIBS=$LIBS

if test -n "$ac_cv_pthreads_lib"; then
  LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi

if test -n "$ac_cv_pthreads_cflags"; then
  CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi


if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
  LIBS=$save_LIBS
  CFLAGS=$save_CFLAGS

  echo "$as_me:$LINENO: checking for pthreads_cflags" >&5
echo $ECHO_N "checking for pthreads_cflags... $ECHO_C" >&6
if test "${ac_cv_pthreads_cflags+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  ac_cv_pthreads_cflags=
  if test "$pthreads_working" != "yes"; then
    for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
      ac_save=$CFLAGS
      CFLAGS="$CFLAGS $flag"

if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
      CFLAGS=$ac_save
      if test "$pthreads_working" = "yes"; then
        ac_cv_pthreads_cflags=$flag
        break
      fi
    done
  fi
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pthreads_cflags" >&5
echo "${ECHO_T}$ac_cv_pthreads_cflags" >&6

echo "$as_me:$LINENO: checking for pthreads_lib" >&5
echo $ECHO_N "checking for pthreads_lib... $ECHO_C" >&6
if test "${ac_cv_pthreads_lib+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
  for lib in pthread pthreads c_r; do
    ac_save=$LIBS
    LIBS="$LIBS -l$lib"

if test "$cross_compiling" = yes; then

    pthreads_working=no
  case $host_alias in
  *netware*)
    pthreads_working=yes
  esac


else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

#include <pthread.h>
#include <stddef.h>

void *thread_routine(void *data) {
    return data;
}

int main() {
    pthread_t thd;
    pthread_mutexattr_t mattr;
    int data = 1;
    pthread_mutexattr_init(&mattr);
    return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then

  pthreads_working=yes

else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

( exit $ac_status )

  pthreads_working=no

fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
    LIBS=$ac_save
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_lib=$lib
      break
    fi
  done
fi

fi
echo "$as_me:$LINENO: result: $ac_cv_pthreads_lib" >&5
echo "${ECHO_T}$ac_cv_pthreads_lib" >&6

if test "$pthreads_working" = "yes"; then
  threads_result="POSIX-Threads found"
else
  threads_result="POSIX-Threads not found"
fi


if test "$beos_threads" = "1"; then

cat >>confdefs.h <<\_ACEOF
#define BETHREADS 1
_ACEOF

else
  if test "$pthreads_working" != "yes"; then
    { { echo "$as_me:$LINENO: error: Your system seems to lack POSIX threads." >&5
echo "$as_me: error: Your system seems to lack POSIX threads." >&2;}
   { (exit 1); exit 1; }; }
  fi


cat >>confdefs.h <<\_ACEOF
#define PTHREADS 1
_ACEOF


  echo "$as_me:$LINENO: checking for POSIX threads" >&5
echo $ECHO_N "checking for POSIX threads... $ECHO_C" >&6
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
fi

fi


fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
unset LIBS LDFLAGS

test "$prefix" = "NONE" && prefix=/usr/local
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
test "$program_prefix" = "NONE" && program_prefix=
test "$program_suffix" = "NONE" && program_suffix=

case $libdir in
  '${exec_prefix}/lib')
    libdir=$libdir/php
    ;;
esac
case $datadir in
  '${prefix}/share')
    datadir=$datadir/php
    ;;
  *) ;;
esac

phplibdir=`pwd`/modules
$php_shtool mkdir -p $phplibdir
phptempdir=`pwd`/libs

old_exec_prefix=$exec_prefix
old_libdir=$libdir
old_datadir=$datadir
exec_prefix=`eval echo $exec_prefix`
libdir=`eval echo $libdir`
datadir=`eval echo $datadir`


ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO //'`

if test -z "$EXTENSION_DIR"; then
  extbasedir=$ZEND_MODULE_API_NO
  if test "$oldstyleextdir" = "yes"; then
    if test "$PHP_DEBUG" = "1"; then
      part1=debug
    else
      part1=no-debug
    fi
    if test "$enable_experimental_zts" = "yes"; then
      part2=zts
    else
      part2=non-zts
    fi
    extbasedir=$part1-$part2-$extbasedir
    EXTENSION_DIR=$libdir/extensions/$extbasedir
  else
    if test "$enable_experimental_zts" = "yes"; then
      extbasedir=$extbasedir-zts
    fi

    if test "$PHP_DEBUG" = "1"; then
      extbasedir=$extbasedir-debug
    fi
    EXTENSION_DIR=$libdir/$extbasedir
  fi
fi

case $PHP_LAYOUT in
  GNU)
    datarootdir=$prefix/share
    ;;
  *)
    datarootdir=$prefix/php
    ;;
esac

EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR`
EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
EXPANDED_BINDIR=`eval echo $bindir`
EXPANDED_LIBDIR=$libdir
EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
EXPANDED_DATADIR=$datadir
EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR

exec_prefix=$old_exec_prefix
libdir=$old_libdir
datadir=$old_datadir












if test -n "$php_ldflags_add_usr_lib"; then
  PHP_RPATHS="$PHP_RPATHS /usr/lib"
fi


  OLD_RPATHS=$PHP_RPATHS
  unset PHP_RPATHS

  for i in $OLD_RPATHS; do
    PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
    PHP_RPATHS="$PHP_RPATHS -R $i"
    NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
  done

  if test "$PHP_RPATH" = "no"; then
    unset PHP_RPATHS
    unset NATIVE_RPATHS
  fi


if test -z "$php_ldflags_add_usr_lib"; then

  unset ac_new_flags
  for i in $PHP_LDFLAGS; do
    case $i in
    -L/usr/lib|-L/usr/lib/) ;;
    *) ac_new_flags="$ac_new_flags $i" ;;
    esac
  done
  PHP_LDFLAGS=$ac_new_flags


  unset ac_new_flags
  for i in $LDFLAGS; do
    case $i in
    -L/usr/lib|-L/usr/lib/) ;;
    *) ac_new_flags="$ac_new_flags $i" ;;
    esac
  done
  LDFLAGS=$ac_new_flags

fi

EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"

PHP_BUILD_DATE=`date '+%Y-%m-%d'`

cat >>confdefs.h <<_ACEOF
#define PHP_BUILD_DATE "$PHP_BUILD_DATE"
_ACEOF

case $host_alias in
*netware*)
    PHP_OS="NetWare"
    PHP_UNAME="NetWare"

cat >>confdefs.h <<_ACEOF
#define PHP_OS "$PHP_OS"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PHP_UNAME "$PHP_UNAME"
_ACEOF

    ;;
*)
    PHP_UNAME=`uname -a | xargs`

cat >>confdefs.h <<_ACEOF
#define PHP_UNAME "$PHP_UNAME"
_ACEOF

    PHP_OS=`uname | xargs`

cat >>confdefs.h <<_ACEOF
#define PHP_OS "$PHP_OS"
_ACEOF

    ;;
esac

if test "$disable_cli" != "1"; then
  PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
  PHP_INSTALL_CLI_TARGET="install-cli"


  case sapi/cli in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "sapi/cli"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/sapi/cli/"; ac_bdir="sapi/cli/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in php_cli.c getopt.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_CLI_TARGET"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_SAPI_OBJS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_CLI_OBJS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_GLOBAL_OBJS"



  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_MODULES"



  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_LIBS"




  PHP_VAR_SUBST="$PHP_VAR_SUBST abs_builddir"





  PHP_VAR_SUBST="$PHP_VAR_SUBST abs_srcdir"





  PHP_VAR_SUBST="$PHP_VAR_SUBST php_abs_top_builddir"





  PHP_VAR_SUBST="$PHP_VAR_SUBST php_abs_top_srcdir"





  PHP_VAR_SUBST="$PHP_VAR_SUBST bindir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST exec_prefix"


  PHP_VAR_SUBST="$PHP_VAR_SUBST program_prefix"


  PHP_VAR_SUBST="$PHP_VAR_SUBST program_suffix"


  PHP_VAR_SUBST="$PHP_VAR_SUBST includedir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST libdir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST mandir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST phplibdir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST phptempdir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST prefix"


  PHP_VAR_SUBST="$PHP_VAR_SUBST localstatedir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST datadir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST datarootdir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST sysconfdir"



  PHP_VAR_SUBST="$PHP_VAR_SUBST AWK"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CC"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CFLAGS_CLEAN"



  PHP_VAR_SUBST="$PHP_VAR_SUBST CONFIGURE_COMMAND"




  PHP_VAR_SUBST="$PHP_VAR_SUBST CPP"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CPPFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CXX"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CXXFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CXXFLAGS_CLEAN"


  PHP_VAR_SUBST="$PHP_VAR_SUBST CXX_PHP_COMPILE"



  PHP_VAR_SUBST="$PHP_VAR_SUBST DEBUG_CFLAGS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTENSION_DIR"





  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LDFLAGS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LDFLAGS_PROGRAM"





  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LIBS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST ZEND_EXTRA_LIBS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST INCLUDES"





  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_INCLUDES"





  PHP_VAR_SUBST="$PHP_VAR_SUBST INCLUDE_PATH"





  PHP_VAR_SUBST="$PHP_VAR_SUBST INSTALL_IT"




  PHP_VAR_SUBST="$PHP_VAR_SUBST LEX"


  PHP_VAR_SUBST="$PHP_VAR_SUBST LEX_OUTPUT_ROOT"


  PHP_VAR_SUBST="$PHP_VAR_SUBST LFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST LIBTOOL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST LN_S"



  PHP_VAR_SUBST="$PHP_VAR_SUBST NATIVE_RPATHS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST PEAR_INSTALLDIR"




  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_BUILD_DATE"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_COMPILE"



  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_LDFLAGS"





  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_LIBS"




  PHP_VAR_SUBST="$PHP_VAR_SUBST OVERALL_TARGET"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_RPATHS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_SAPI"



  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_VERSION"




  PHP_VAR_SUBST="$PHP_VAR_SUBST PROG_SENDMAIL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST RE2C"


  PHP_VAR_SUBST="$PHP_VAR_SUBST SHELL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST SHARED_LIBTOOL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST WARNING_LEVEL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_FRAMEWORKS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_FRAMEWORKPATH"



  PHP_VAR_SUBST="$PHP_VAR_SUBST YACC"





  PHP_VAR_SUBST="$PHP_VAR_SUBST SHLIB_SUFFIX_NAME"




old_CC=$CC

if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
  CXXFLAGS="$CXXFLAGS $ac_cv_pthreads_cflags"
  INLINE_CFLAGS="$INLINE_CFLAGS $ac_cv_pthreads_cflags"
  cat >meta_ccld<<EOF
#! /bin/sh
exec $CC $ac_cv_pthreads_cflags \$@
EOF
  CC="$abs_builddir/meta_ccld"
  chmod +x meta_ccld
fi

if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
  CPPFLAGS="$CPPFLAGS -DTHREAD=1"
fi



# Check whether --enable- or --disable- was given.
if test "${enable_+set}" = set; then
  enableval="$enable_"

fi;


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Configuring libtool${T_ME}" >&5
echo "${ECHO_T}${T_MD}Configuring libtool${T_ME}" >&6


LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
  p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
  enable_shared=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_shared=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_shared=yes
fi;
# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
  enableval="$enable_static"
  p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
  enable_static=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_static=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_static=yes
fi;
# Check whether --enable-fast-install or --disable-fast-install was given.
if test "${enable_fast_install+set}" = set; then
  enableval="$enable_fast_install"
  p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
  enable_fast_install=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_fast_install=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_fast_install=yes
fi;
# Find the correct PATH separator.  Usually this is `:', but
# DJGPP uses `;' like DOS.
if test "X${PATH_SEPARATOR+set}" != Xset; then
  UNAME=${UNAME-`uname 2>/dev/null`}
  case X$UNAME in
    *-DOS) lt_cv_sys_path_separator=';' ;;
    *)     lt_cv_sys_path_separator=':' ;;
  esac
  PATH_SEPARATOR=$lt_cv_sys_path_separator
fi


# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
  withval="$with_gnu_ld"
  test "$withval" = no || with_gnu_ld=yes
else
  with_gnu_ld=no
fi;
ac_prog=ld
if test "$GCC" = yes; then
  # Check if gcc -print-prog-name=ld gives a path.
  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
  case $host in
  *-*-mingw*)
    # gcc leaves a trailing carriage return which upsets mingw
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  *)
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  esac
  case $ac_prog in
    # Accept absolute paths.
    [\\/]* | [A-Za-z]:[\\/]*)
      re_direlt='/[^/][^/]*/\.\./'
      # Canonicalize the path of ld
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
      done
      test -z "$LD" && LD="$ac_prog"
      ;;
  "")
    # If it fails, then pretend we aren't using GCC.
    ac_prog=ld
    ;;
  *)
    # If it is relative, then search for the first ld in PATH.
    with_gnu_ld=unknown
    ;;
  esac
elif test "$with_gnu_ld" = yes; then
  echo "$as_me:$LINENO: checking for GNU ld" >&5
echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
else
  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
fi
if test "${lt_cv_path_LD+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -z "$LD"; then
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
      lt_cv_path_LD="$ac_dir/$ac_prog"
      # Check to see if the program is GNU ld.  I'd rather use --version,
      # but apparently some GNU ld's only accept -v.
      # Break only if it was the GNU/non-GNU ld that we prefer.
      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
	test "$with_gnu_ld" != no && break
      else
	test "$with_gnu_ld" != yes && break
      fi
    fi
  done
  IFS="$ac_save_ifs"
else
  lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi

LD="$lt_cv_path_LD"
if test -n "$LD"; then
  echo "$as_me:$LINENO: result: $LD" >&5
echo "${ECHO_T}$LD" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
   { (exit 1); exit 1; }; }
echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
if test "${lt_cv_prog_gnu_ld+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  lt_cv_prog_gnu_ld=yes
else
  lt_cv_prog_gnu_ld=no
fi
fi
echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
with_gnu_ld=$lt_cv_prog_gnu_ld


echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
if test "${lt_cv_ld_reload_flag+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  lt_cv_ld_reload_flag='-r'
fi
echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"

echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
if test "${lt_cv_path_NM+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$NM"; then
  # Let the user override the test.
  lt_cv_path_NM="$NM"
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
    test -z "$ac_dir" && ac_dir=.
    tmp_nm=$ac_dir/${ac_tool_prefix}nm
    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
      # Check to see if the nm accepts a BSD-compat flag.
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
      #   nm: unknown option "B" ignored
      # Tru64's nm complains that /dev/null is an invalid object file
      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
	lt_cv_path_NM="$tmp_nm -B"
	break
      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
	lt_cv_path_NM="$tmp_nm -p"
	break
      else
	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
	continue # so that we can try to find one that supports BSD flags
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi

NM="$lt_cv_path_NM"
echo "$as_me:$LINENO: result: $NM" >&5
echo "${ECHO_T}$NM" >&6

echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
if test "${lt_cv_deplibs_check_method+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
# `unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# which responds to the $file_magic_cmd with a given egrep regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.

case $host_os in
aix4* | aix5*)
  lt_cv_deplibs_check_method=pass_all
  ;;

beos*)
  lt_cv_deplibs_check_method=pass_all
  ;;

bsdi4*)
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
  lt_cv_file_magic_cmd='/usr/bin/file -L'
  lt_cv_file_magic_test_file=/shlib/libc.so
  ;;

cygwin* | mingw* | pw32*)
  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  lt_cv_file_magic_cmd='$OBJDUMP -f'
  ;;

darwin* | rhapsody*)
  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
  lt_cv_file_magic_cmd='/usr/bin/file -L'
  case "$host_os" in
  rhapsody* | darwin1.[012])
    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
    ;;
  *) # Darwin 1.3 on
    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
    ;;
  esac
  ;;

freebsd*)
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
    case $host_cpu in
    i*86 )
      # Not sure whether the presence of OpenBSD here was a mistake.
      # Let's accept both of them until this is cleared up.
      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
      lt_cv_file_magic_cmd=/usr/bin/file
      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
      ;;
    esac
  else
    lt_cv_deplibs_check_method=pass_all
  fi
  ;;

gnu*)
  lt_cv_deplibs_check_method=pass_all
  ;;

hpux10.20*|hpux11*)
  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  lt_cv_file_magic_cmd=/usr/bin/file
  lt_cv_file_magic_test_file=/usr/lib/libc.sl
  ;;

irix5* | irix6* | nonstopux*)
  case $host_os in
  irix5* | nonstopux*)
    # this will be overridden with pass_all, but let us keep it just in case
    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
    ;;
  *)
    case $LD in
    *-32|*"-32 ") libmagic=32-bit;;
    *-n32|*"-n32 ") libmagic=N32;;
    *-64|*"-64 ") libmagic=64-bit;;
    *) libmagic=never-match;;
    esac
    # this will be overridden with pass_all, but let us keep it just in case
    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
    ;;
  esac
  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  lt_cv_deplibs_check_method=pass_all
  ;;

# This must be Linux ELF.
linux-gnu*)
  case $host_cpu in
  alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*)
    lt_cv_deplibs_check_method=pass_all ;;
  *)
    # glibc up to 2.1.1 does not perform some relocations on ARM
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
  esac
  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  ;;

netbsd*)
  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
  else
    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
  fi
  ;;

newos6*)
  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
  lt_cv_file_magic_cmd=/usr/bin/file
  lt_cv_file_magic_test_file=/usr/lib/libnls.so
  ;;

openbsd*)
  lt_cv_file_magic_cmd=/usr/bin/file
  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  else
    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
  fi
  ;;

osf3* | osf4* | osf5*)
  # this will be overridden with pass_all, but let us keep it just in case
  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
  lt_cv_file_magic_test_file=/shlib/libc.so
  lt_cv_deplibs_check_method=pass_all
  ;;

sco3.2v5*)
  lt_cv_deplibs_check_method=pass_all
  ;;

solaris*)
  lt_cv_deplibs_check_method=pass_all
  lt_cv_file_magic_test_file=/lib/libc.so
  ;;

sysv5* | sysv4*uw2*)
  lt_cv_archive_cmds_need_lc=no
  lt_cv_deplibs_check_method=pass_all
  ;;

sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  case $host_vendor in
  motorola)
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
    ;;
  ncr)
    lt_cv_deplibs_check_method=pass_all
    ;;
  sequent)
    lt_cv_file_magic_cmd='/bin/file'
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
    ;;
  sni)
    lt_cv_file_magic_cmd='/bin/file'
    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
    lt_cv_file_magic_test_file=/lib/libc.so
    ;;
  siemens)
    lt_cv_deplibs_check_method=pass_all
    ;;
  esac
  ;;
esac

fi
echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method







# Check for command to grab the raw symbol name followed by C symbol from nm.
echo "$as_me:$LINENO: checking command to parse $NM output" >&5
echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix.  What could be older than Ultrix?!! ;)]

# Character class describing NM global symbol codes.
symcode='[BCDEGRST]'

# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'

# Transform the above into a raw symbol and a C symbol.
symxfrm='\1 \2\3 \3'

# Transform an extracted symbol line into a proper C declaration
lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"

# Transform an extracted symbol line into symbol name and symbol address
lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"

# Define system-specific variables.
case $host_os in
aix*)
  symcode='[BCDT]'
  ;;
cygwin* | mingw* | pw32*)
  symcode='[ABCDGISTW]'
  ;;
hpux*) # Its linker distinguishes data from code symbols
  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
  ;;
irix* | nonstopux*)
  symcode='[BCDEGRST]'
  ;;
osf*)
  symcode='[BCDEGQRST]'
  ;;
solaris* | sysv5*)
  symcode='[BDT]'
  ;;
sysv4)
  symcode='[DFNSTU]'
  ;;
esac

# Handle CRLF in mingw tool chain
opt_cr=
case $host_os in
mingw*)
  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  ;;
esac

# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  symcode='[ABCDGISTW]'
fi

# Try without a prefix undercore, then with it.
for ac_symprfx in "" "_"; do

  # Write the raw and C identifiers.
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"

  # Check to see that the pipe works correctly.
  pipe_works=no
  rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
EOF

  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
    # Now try to grab the symbols.
    nlist=conftest.nm
    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && test -s "$nlist"; then
      # Try sorting and uniquifying the output.
      if sort "$nlist" | uniq > "$nlist"T; then
	mv -f "$nlist"T "$nlist"
      else
	rm -f "$nlist"T
      fi

      # Make sure that we snagged all the symbols we need.
      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
	  cat <<EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif

EOF
	  # Now generate the symbol file.
	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'

	  cat <<EOF >> conftest.$ac_ext
#if defined (__STDC__) && __STDC__
# define lt_ptr void *
#else
# define lt_ptr char *
# define const
#endif

/* The mapping between symbol names and symbols. */
const struct {
  const char *name;
  lt_ptr address;
}
lt_preloaded_symbols[] =
{
EOF
	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
	  cat <<\EOF >> conftest.$ac_ext
  {0, (lt_ptr) 0}
};

#ifdef __cplusplus
}
#endif
EOF
	  # Now try linking the two files.
	  mv conftest.$ac_objext conftstm.$ac_objext
	  save_LIBS="$LIBS"
	  save_CFLAGS="$CFLAGS"
	  LIBS="conftstm.$ac_objext"
	  CFLAGS="$CFLAGS$no_builtin_flag"
	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && test -s conftest$ac_exeext; then
	    pipe_works=yes
	  fi
	  LIBS="$save_LIBS"
	  CFLAGS="$save_CFLAGS"
	else
	  echo "cannot find nm_test_func in $nlist" >&5
	fi
      else
	echo "cannot find nm_test_var in $nlist" >&5
      fi
    else
      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
    fi
  else
    echo "$progname: failed program was:" >&5
    cat conftest.$ac_ext >&5
  fi
  rm -f conftest* conftst*

  # Do not use the global_symbol_pipe unless it works.
  if test "$pipe_works" = yes; then
    break
  else
    lt_cv_sys_global_symbol_pipe=
  fi
done

fi

global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
if test -z "$lt_cv_sys_global_symbol_pipe"; then
  global_symbol_to_cdecl=
  global_symbol_to_c_name_address=
else
  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
fi
if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
then
  echo "$as_me:$LINENO: result: failed" >&5
echo "${ECHO_T}failed" >&6
else
  echo "$as_me:$LINENO: result: ok" >&5
echo "${ECHO_T}ok" >&6
fi





# Only perform the check for file, if the check method requires it
case $deplibs_check_method in
file_magic*)
  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $MAGIC_CMD in
  /*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  ;;
  ?:/*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
  ;;
  *)
  ac_save_MAGIC_CMD="$MAGIC_CMD"
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="/usr/bin:$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/${ac_tool_prefix}file; then
      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
      if test -n "$file_magic_test_file"; then
	case $deplibs_check_method in
	"file_magic "*)
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
	    egrep "$file_magic_regex" > /dev/null; then
	    :
	  else
	    cat <<EOF 1>&2

*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such.  This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem.  Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org

EOF
	  fi ;;
	esac
      fi
      break
    fi
  done
  IFS="$ac_save_ifs"
  MAGIC_CMD="$ac_save_MAGIC_CMD"
  ;;
esac
fi

MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
echo "${ECHO_T}$MAGIC_CMD" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

if test -z "$lt_cv_path_MAGIC_CMD"; then
  if test -n "$ac_tool_prefix"; then
    echo "$as_me:$LINENO: checking for file" >&5
echo $ECHO_N "checking for file... $ECHO_C" >&6
if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $MAGIC_CMD in
  /*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  ;;
  ?:/*)
  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
  ;;
  *)
  ac_save_MAGIC_CMD="$MAGIC_CMD"
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="/usr/bin:$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/file; then
      lt_cv_path_MAGIC_CMD="$ac_dir/file"
      if test -n "$file_magic_test_file"; then
	case $deplibs_check_method in
	"file_magic "*)
	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
	    egrep "$file_magic_regex" > /dev/null; then
	    :
	  else
	    cat <<EOF 1>&2

*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such.  This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem.  Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org

EOF
	  fi ;;
	esac
      fi
      break
    fi
  done
  IFS="$ac_save_ifs"
  MAGIC_CMD="$ac_save_MAGIC_CMD"
  ;;
esac
fi

MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
echo "${ECHO_T}$MAGIC_CMD" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  else
    MAGIC_CMD=:
  fi
fi

  fi
  ;;
esac

if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_RANLIB="ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  RANLIB=$ac_ct_RANLIB
else
  RANLIB="$ac_cv_prog_RANLIB"
fi

if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_STRIP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
  echo "$as_me:$LINENO: result: $STRIP" >&5
echo "${ECHO_T}$STRIP" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

fi
if test -z "$ac_cv_prog_STRIP"; then
  ac_ct_STRIP=$STRIP
  # Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_STRIP"; then
  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_STRIP="strip"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
echo "${ECHO_T}$ac_ct_STRIP" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  STRIP=$ac_ct_STRIP
else
  STRIP="$ac_cv_prog_STRIP"
fi


enable_dlopen=no
enable_win32_dll=no

# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
  enableval="$enable_libtool_lock"

fi;
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes

# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
*-*-irix6*)
  # Find out which ABI we are using.
  echo '#line 128791 "configure"' > conftest.$ac_ext
  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
    case `/usr/bin/file conftest.$ac_objext` in
    *32-bit*)
      LD="${LD-ld} -32"
      ;;
    *N32*)
      LD="${LD-ld} -n32"
      ;;
    *64-bit*)
      LD="${LD-ld} -64"
      ;;
    esac
  fi
  rm -rf conftest*
  ;;

*-*-sco3.2v5*)
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  SAVE_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -belf"
  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
if test "${lt_cv_cc_needs_belf+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else


     ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

     cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  lt_cv_cc_needs_belf=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

lt_cv_cc_needs_belf=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
     ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

fi
echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
    CFLAGS="$SAVE_CFLAGS"
  fi
  ;;


esac

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e s/^X//'
sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'

# Same as above, but do not quote variable references.
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'

# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'

# Constants:
rm="rm -f"

# Global variables:
default_ofile=libtool
can_build_shared=yes

# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
libext=a
ltmain="$ac_aux_dir/ltmain.sh"
ofile="$default_ofile"
with_gnu_ld="$lt_cv_prog_gnu_ld"
need_locks="$enable_libtool_lock"

old_CC="$CC"
old_CFLAGS="$CFLAGS"

# Set sane defaults for various variables
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
test -z "$MAGIC_CMD" && MAGIC_CMD=file
test -z "$NM" && NM=nm
test -z "$OBJDUMP" && OBJDUMP=objdump
test -z "$RANLIB" && RANLIB=:
test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o

if test x"$host" != x"$build"; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi

# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac

case $host_os in
aix3*)
  # AIX sometimes has problems with the GCC collect2 program.  For some
  # reason, if we set the COLLECT_NAMES environment variable, the problems
  # vanish in a puff of smoke.
  if test "X${COLLECT_NAMES+set}" != Xset; then
    COLLECT_NAMES=
    export COLLECT_NAMES
  fi
  ;;
esac

# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=

if test -n "$RANLIB"; then
  case $host_os in
  openbsd*)
    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
    ;;
  *)
    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
    ;;
  esac
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi

# Allow CC to be a program name with arguments.
set dummy $CC
compiler="$2"

## FIXME: this should be a separate macro
##
echo "$as_me:$LINENO: checking for objdir" >&5
echo $ECHO_N "checking for objdir... $ECHO_C" >&6
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
  objdir=.libs
else
  # MS-DOS does not allow filenames that begin with a dot.
  objdir=_libs
fi
rmdir .libs 2>/dev/null
echo "$as_me:$LINENO: result: $objdir" >&5
echo "${ECHO_T}$objdir" >&6
##
## END FIXME


## FIXME: this should be a separate macro
##

# Check whether --with-pic or --without-pic was given.
if test "${with_pic+set}" = set; then
  withval="$with_pic"
  pic_mode="$withval"
else
  pic_mode=default
fi;
test -z "$pic_mode" && pic_mode=default

# We assume here that the value for lt_cv_prog_cc_pic will not be cached
# in isolation, and that seeing it set (from the cache) indicates that
# the associated values are set (in the cache) correctly too.
echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
if test "${lt_cv_prog_cc_pic+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
   lt_cv_prog_cc_pic=
  lt_cv_prog_cc_shlib=
  lt_cv_prog_cc_wl=
  lt_cv_prog_cc_static=
  lt_cv_prog_cc_no_builtin=
  lt_cv_prog_cc_can_build_shared=$can_build_shared

  if test "$GCC" = yes; then
    lt_cv_prog_cc_wl='-Wl,'
    lt_cv_prog_cc_static='-static'

    case $host_os in
    aix*)
      # Below there is a dirty hack to force normal static linking with -ldl
      # The problem is because libdl dynamically linked with both libc and
      # libC (AIX C++ library), which obviously doesn't included in libraries
      # list by gcc. This cause undefined symbols with -static flags.
      # This hack allows C programs to be linked with "-static -ldl", but
      # not sure about C++ programs.
      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
      ;;
    amigaos*)
      # FIXME: we need at least 68020 code to build shared libraries, but
      # adding the `-m68020' flag to GCC prevents building anything better,
      # like `-m68040'.
      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
      ;;
    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
      # PIC is the default for these OSes.
      ;;
    darwin* | rhapsody*)
      # PIC is the default on this platform
      # Common symbols not allowed in MH_DYLIB files
      lt_cv_prog_cc_pic='-fno-common'
      ;;
    cygwin* | mingw* | pw32* | os2*)
      # This hack is so that the source file can tell whether it is being
      # built for inclusion in a dll (and should export symbols for example).
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
      ;;
    sysv4*MP*)
      if test -d /usr/nec; then
	 lt_cv_prog_cc_pic=-Kconform_pic
      fi
      ;;
    *)
      lt_cv_prog_cc_pic='-fPIC'
      ;;
    esac
  else
    # PORTME Check for PIC flags for the system compiler.
    case $host_os in
    aix3* | aix4* | aix5*)
      lt_cv_prog_cc_wl='-Wl,'
      # All AIX code is PIC.
      if test "$host_cpu" = ia64; then
	# AIX 5 now supports IA64 processor
	lt_cv_prog_cc_static='-Bstatic'
      else
	lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
      fi
      ;;

    hpux9* | hpux10* | hpux11*)
      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
      lt_cv_prog_cc_wl='-Wl,'
      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
      lt_cv_prog_cc_pic='+Z'
      ;;

    irix5* | irix6* | nonstopux*)
      lt_cv_prog_cc_wl='-Wl,'
      lt_cv_prog_cc_static='-non_shared'
      # PIC (with -KPIC) is the default.
      ;;

    cygwin* | mingw* | pw32* | os2*)
      # This hack is so that the source file can tell whether it is being
      # built for inclusion in a dll (and should export symbols for example).
      lt_cv_prog_cc_pic='-DDLL_EXPORT'
      ;;

    newsos6)
      lt_cv_prog_cc_pic='-KPIC'
      lt_cv_prog_cc_static='-Bstatic'
      ;;

    osf3* | osf4* | osf5*)
      # All OSF/1 code is PIC.
      lt_cv_prog_cc_wl='-Wl,'
      lt_cv_prog_cc_static='-non_shared'
      ;;

    sco3.2v5*)
      lt_cv_prog_cc_pic='-Kpic'
      lt_cv_prog_cc_static='-dn'
      lt_cv_prog_cc_shlib='-belf'
      ;;

    solaris*)
      lt_cv_prog_cc_pic='-KPIC'
      lt_cv_prog_cc_static='-Bstatic'
      lt_cv_prog_cc_wl='-Wl,'
      ;;

    sunos4*)
      lt_cv_prog_cc_pic='-PIC'
      lt_cv_prog_cc_static='-Bstatic'
      lt_cv_prog_cc_wl='-Qoption ld '
      ;;

    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
      lt_cv_prog_cc_pic='-KPIC'
      lt_cv_prog_cc_static='-Bstatic'
      lt_cv_prog_cc_wl='-Wl,'
      ;;

    uts4*)
      lt_cv_prog_cc_pic='-pic'
      lt_cv_prog_cc_static='-Bstatic'
      ;;

    sysv4*MP*)
      if test -d /usr/nec ;then
	lt_cv_prog_cc_pic='-Kconform_pic'
	lt_cv_prog_cc_static='-Bstatic'
      fi
      ;;

    *)
      lt_cv_prog_cc_can_build_shared=no
      ;;
    esac
  fi

fi

if test -z "$lt_cv_prog_cc_pic"; then
  echo "$as_me:$LINENO: result: none" >&5
echo "${ECHO_T}none" >&6
else
  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6

  # Check to make sure the pic_flag actually works.
  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
  if test "${lt_cv_prog_cc_pic_works+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
    cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
        case $host_os in
      hpux9* | hpux10* | hpux11*)
	# On HP-UX, both CC and GCC only warn that PIC is supported... then
	# they create non-PIC objects.  So, if there were any warnings, we
	# assume that PIC is not supported.
	if test -s conftest.err; then
	  lt_cv_prog_cc_pic_works=no
	else
	  lt_cv_prog_cc_pic_works=yes
	fi
	;;
      *)
	lt_cv_prog_cc_pic_works=yes
	;;
      esac

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

      lt_cv_prog_cc_pic_works=no

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    CFLAGS="$save_CFLAGS"

fi


  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
    lt_cv_prog_cc_pic=
    lt_cv_prog_cc_can_build_shared=no
  else
    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
  fi

  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
fi
##
## END FIXME

# Check for any special shared library compilation flags.
if test -n "$lt_cv_prog_cc_shlib"; then
  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$lt_cv_prog_cc_shlib[ 	]" >/dev/null; then :
  else
   { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
    lt_cv_prog_cc_can_build_shared=no
  fi
fi

## FIXME: this should be a separate macro
##
echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
if test "${lt_cv_prog_cc_static_works+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
    lt_cv_prog_cc_static_works=no
  save_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  lt_cv_prog_cc_static_works=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
  LDFLAGS="$save_LDFLAGS"

fi


# Belt *and* braces to stop my trousers falling down:
test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6

pic_flag="$lt_cv_prog_cc_pic"
special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
wl="$lt_cv_prog_cc_wl"
link_static_flag="$lt_cv_prog_cc_static"
no_builtin_flag="$lt_cv_prog_cc_no_builtin"
can_build_shared="$lt_cv_prog_cc_can_build_shared"
##
## END FIXME


## FIXME: this should be a separate macro
##
# Check to see if options -o and -c are simultaneously supported by compiler
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
if test "${lt_cv_compiler_c_o+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

$rm -r conftest 2>/dev/null
mkdir conftest
cd conftest
echo "int some_variable = 0;" > conftest.$ac_ext
mkdir out
# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
# that will create temporary files in the current directory regardless of
# the output directory.  Thus, making CWD read-only will cause this test
# to fail, enabling locking or at least warning the user not to do parallel
# builds.
chmod -w .
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
if { (eval echo configure:129363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
  # The compiler can only warn and ignore the option if not recognized
  # So say no if there are warnings
  if test -s out/conftest.err; then
    lt_cv_compiler_c_o=no
  else
    lt_cv_compiler_c_o=yes
  fi
else
  # Append any errors to the config.log.
  cat out/conftest.err 1>&5
  lt_cv_compiler_c_o=no
fi
CFLAGS="$save_CFLAGS"
chmod u+w .
$rm conftest* out/*
rmdir out
cd ..
rmdir conftest
$rm -r conftest 2>/dev/null

fi

compiler_c_o=$lt_cv_compiler_c_o
echo "$as_me:$LINENO: result: $compiler_c_o" >&5
echo "${ECHO_T}$compiler_c_o" >&6

if test x"$compiler_c_o" = x"yes"; then
  # Check to see if we can write to a .lo
  echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
  if test "${lt_cv_compiler_o_lo+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else

  lt_cv_compiler_o_lo=no
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -c -o conftest.lo"
  save_objext="$ac_objext"
  ac_objext=lo
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
int some_variable = 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      # The compiler can only warn and ignore the option if not recognized
    # So say no if there are warnings
    if test -s conftest.err; then
      lt_cv_compiler_o_lo=no
    else
      lt_cv_compiler_o_lo=yes
    fi

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_objext="$save_objext"
  CFLAGS="$save_CFLAGS"

fi

  compiler_o_lo=$lt_cv_compiler_o_lo
  echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
echo "${ECHO_T}$compiler_o_lo" >&6
else
  compiler_o_lo=no
fi
##
## END FIXME

## FIXME: this should be a separate macro
##
# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
if test "$compiler_c_o" = no && test "$need_locks" != no; then
  # do not overwrite the value of need_locks provided by the user
  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
  hard_links=yes
  $rm conftest*
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  touch conftest.a
  ln conftest.a conftest.b 2>&5 || hard_links=no
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  echo "$as_me:$LINENO: result: $hard_links" >&5
echo "${ECHO_T}$hard_links" >&6
  if test "$hard_links" = no; then
    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
    need_locks=warn
  fi
else
  need_locks=no
fi
##
## END FIXME

## FIXME: this should be a separate macro
##
if test "$GCC" = yes; then
  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
  echo "int some_variable = 0;" > conftest.$ac_ext
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
  compiler_rtti_exceptions=no
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

int
main ()
{
int some_variable = 0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
      # The compiler can only warn and ignore the option if not recognized
    # So say no if there are warnings
    if test -s conftest.err; then
      compiler_rtti_exceptions=no
    else
      compiler_rtti_exceptions=yes
    fi

else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  CFLAGS="$save_CFLAGS"
  echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
echo "${ECHO_T}$compiler_rtti_exceptions" >&6

  if test "$compiler_rtti_exceptions" = "yes"; then
    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  else
    no_builtin_flag=' -fno-builtin'
  fi
fi
##
## END FIXME

## FIXME: this should be a separate macro
##
# See if the linker supports building shared libraries.
echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6

allow_undefined_flag=
no_undefined_flag=
need_lib_prefix=unknown
need_version=unknown
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
archive_cmds=
archive_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
thread_safe_flag_spec=
hardcode_into_libs=no
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
link_all_deplibs=unknown
always_export_symbols=no
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an egrep regular expression of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced.  Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
extract_expsyms_cmds=

case $host_os in
cygwin* | mingw* | pw32*)
  # FIXME: the MSVC++ port hasn't been tested in a loooong time
  # When not using gcc, we currently assume that we are using
  # Microsoft Visual C++.
  if test "$GCC" != yes; then
    with_gnu_ld=no
  fi
  ;;
openbsd*)
  with_gnu_ld=no
  ;;
esac

ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
  # If archive_cmds runs LD, not CC, wlarc should be empty
  wlarc='${wl}'

  # See if GNU ld supports shared libraries.
  case $host_os in
  aix3* | aix4* | aix5*)
    # On AIX, the GNU linker is very broken
    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
    ld_shlibs=no
    cat <<EOF 1>&2

*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support.  If you
*** really care for shared libraries, you may want to modify your PATH
*** so that a non-GNU linker is found, and then restart.

EOF
    ;;

  amigaos*)
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_minus_L=yes

    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
    # that the semantics of dynamic libraries on AmigaOS, at least up
    # to version 4, is to share data among multiple programs linked
    # with the same dynamic library.  Since this doesn't match the
    # behavior of shared libraries on other platforms, we can use
    # them.
    ld_shlibs=no
    ;;

  beos*)
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
      allow_undefined_flag=unsupported
      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
      # support --undefined.  This deserves some investigation.  FIXME
      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
    else
      ld_shlibs=no
    fi
    ;;

  cygwin* | mingw* | pw32*)
    # hardcode_libdir_flag_spec is actually meaningless, as there is
    # no search path for DLLs.
    hardcode_libdir_flag_spec='-L$libdir'
    allow_undefined_flag=unsupported
    always_export_symbols=yes

    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
      else $CC -o impgen impgen.c ; fi)~
      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'

    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'

    # cygwin and mingw dlls have different entry points and sets of symbols
    # to exclude.
    # FIXME: what about values for MSVC?
    dll_entry=__cygwin_dll_entry@12
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
    case $host_os in
    mingw*)
      # mingw values
      dll_entry=_DllMainCRTStartup@12
      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
      ;;
    esac

    # mingw and cygwin differ, and it's simplest to just exclude the union
    # of the two symbol sets.
    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12

    # recent cygwin and mingw systems supply a stub DllMain which the user
    # can override, but on older systems we have to supply one (in ltdll.c)
    if test "x$lt_cv_need_dllmain" = "xyes"; then
      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
    else
      ltdll_obj=
      ltdll_cmds=
    fi

    # Extract the symbol export list from an `--export-all' def file,
    # then regenerate the def file from the symbol export list, so that
    # the compiled dll only exports the symbol export list.
    # Be careful not to strip the DATA tag left be newer dlltools.
    export_symbols_cmds="$ltdll_cmds"'
      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'

    # If the export-symbols file already is a .def file (1st line
    # is EXPORTS), use it as is.
    # If DATA tags from a recent dlltool are present, honour them!
    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
	cp $export_symbols $output_objdir/$soname-def;
      else
	echo EXPORTS > $output_objdir/$soname-def;
	_lt_hint=1;
	cat $export_symbols | while read symbol; do
	 set dummy \$symbol;
	 case \$# in
	   2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
	   4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
	   *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
	 esac;
	 _lt_hint=`expr 1 + \$_lt_hint`;
	done;
      fi~
      '"$ltdll_cmds"'
      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
    ;;

  netbsd*)
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
      wlarc=
    else
      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    fi
    ;;

  solaris*)
    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
      ld_shlibs=no
      cat <<EOF 1>&2

*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems.  Therefore, libtool
*** is disabling shared libraries support.  We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer.  Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.

EOF
    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    else
      ld_shlibs=no
    fi
    ;;

  sunos4*)
    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
    wlarc=
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    ;;

  *)
    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    else
      ld_shlibs=no
    fi
    ;;
  esac

  if test "$ld_shlibs" = yes; then
    runpath_var=LD_RUN_PATH
    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
    export_dynamic_flag_spec='${wl}--export-dynamic'
    case $host_os in
    cygwin* | mingw* | pw32*)
      # dlltool doesn't understand --whole-archive et. al.
      whole_archive_flag_spec=
      ;;
    *)
      # ancient GNU ld didn't support --whole-archive et. al.
      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
      else
	whole_archive_flag_spec=
      fi
      ;;
    esac
  fi
else
  # PORTME fill in a description of your system's linker (not GNU ld)
  case $host_os in
  aix3*)
    allow_undefined_flag=unsupported
    always_export_symbols=yes
    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
    # Note: this linker hardcodes the directories in LIBPATH if there
    # are no directories specified by -L.
    hardcode_minus_L=yes
    if test "$GCC" = yes && test -z "$link_static_flag"; then
      # Neither direct hardcoding nor static linking is supported with a
      # broken collect2.
      hardcode_direct=unsupported
    fi
    ;;

  aix4* | aix5*)
    if test "$host_cpu" = ia64; then
      # On IA64, the linker does run time linking by default, so we don't
      # have to do anything special.
      aix_use_runtimelinking=no
      exp_sym_flag='-Bexport'
      no_entry_flag=""
    else
      aix_use_runtimelinking=no

      # Test if we are trying to use run time linking or normal
      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
      # need to do runtime linking.
      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
	for ld_flag in $LDFLAGS; do
	  case $ld_flag in
	  *-brtl*)
	    aix_use_runtimelinking=yes
	    break
	  ;;
	  esac
	done
      esac

      exp_sym_flag='-bexport'
      no_entry_flag='-bnoentry'
    fi

    # When large executables or shared objects are built, AIX ld can
    # have problems creating the table of contents.  If linking a library
    # or program results in "error TOC overflow" add -mminimal-toc to
    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.

    hardcode_direct=yes
    archive_cmds=''
    hardcode_libdir_separator=':'
    if test "$GCC" = yes; then
      case $host_os in aix4.[012]|aix4.[012].*)
	collect2name=`${CC} -print-prog-name=collect2`
	if test -f "$collect2name" && \
	  strings "$collect2name" | grep resolve_lib_name >/dev/null
	then
	  # We have reworked collect2
	  hardcode_direct=yes
	else
	  # We have old collect2
	  hardcode_direct=unsupported
	  # It fails to find uninstalled libraries when the uninstalled
	  # path is not listed in the libpath.  Setting hardcode_minus_L
	  # to unsupported forces relinking
	  hardcode_minus_L=yes
	  hardcode_libdir_flag_spec='-L$libdir'
	  hardcode_libdir_separator=
	fi
      esac

      shared_flag='-shared'
    else
      # not using gcc
      if test "$host_cpu" = ia64; then
	shared_flag='${wl}-G'
      else
	if test "$aix_use_runtimelinking" = yes; then
	  shared_flag='${wl}-G'
	else
	  shared_flag='${wl}-bM:SRE'
	fi
      fi
    fi

    # It seems that -bexpall can do strange things, so it is better to
    # generate a list of symbols to export.
    always_export_symbols=yes
    if test "$aix_use_runtimelinking" = yes; then
      # Warning - without using the other runtime loading flags (-brtl),
      # -berok will link without error, but may produce a broken library.
      allow_undefined_flag='-berok'
      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
    else
      if test "$host_cpu" = ia64; then
	hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
	allow_undefined_flag="-z nodefs"
	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
      else
	hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
	# Warning - without using the other run time loading flags,
	# -berok will link without error, but may produce a broken library.
	allow_undefined_flag='${wl}-berok'
	# This is a bit strange, but is similar to how AIX traditionally builds
	# it's shared libraries.
	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
      fi
    fi
    ;;

  amigaos*)
    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_minus_L=yes
    # see comment about different semantics on the GNU ld section
    ld_shlibs=no
    ;;

  cygwin* | mingw* | pw32*)
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    # hardcode_libdir_flag_spec is actually meaningless, as there is
    # no search path for DLLs.
    hardcode_libdir_flag_spec=' '
    allow_undefined_flag=unsupported
    # Tell ltmain to make .lib files, not .a files.
    libext=lib
    # FIXME: Setting linknames here is a bad hack.
    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
    # The linker will automatically build a .lib file if we build a DLL.
    old_archive_from_new_cmds='true'
    # FIXME: Should let the user specify the lib program.
    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
    fix_srcfile_path='`cygpath -w "$srcfile"`'
    ;;

  darwin* | rhapsody*)
    case "$host_os" in
    rhapsody* | darwin1.[012])
      allow_undefined_flag='-undefined suppress'
      ;;
    *) # Darwin 1.3 on
      allow_undefined_flag='-flat_namespace -undefined suppress'
      ;;
    esac
    # FIXME: Relying on posixy $() will cause problems for
    #        cross-compilation, but unfortunately the echo tests do not
    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
    #	     `"' quotes if we put them in here... so don't!
    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
    # We need to add '_' to the symbols in $export_symbols first
    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    whole_archive_flag_spec='-all_load $convenience'
    ;;

  freebsd1*)
    ld_shlibs=no
    ;;

  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  # support.  Future versions do this automatically, but an explicit c++rt0.o
  # does not break anything, and helps significantly (at the cost of a little
  # extra space).
  freebsd2.2*)
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
    hardcode_libdir_flag_spec='-R$libdir'
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    ;;

  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  freebsd2*)
    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
    hardcode_direct=yes
    hardcode_minus_L=yes
    hardcode_shlibpath_var=no
    ;;

  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  freebsd*)
    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
    hardcode_libdir_flag_spec='-R$libdir'
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    ;;

  hpux9* | hpux10* | hpux11*)
    case $host_os in
    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
    esac
    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
    hardcode_libdir_separator=:
    hardcode_direct=yes
    hardcode_minus_L=yes # Not in the search PATH, but as the default
			 # location of the library.
    export_dynamic_flag_spec='${wl}-E'
    ;;

  irix5* | irix6* | nonstopux*)
    if test "$GCC" = yes; then
      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    else
      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
      hardcode_libdir_flag_spec='-rpath $libdir'
    fi
    hardcode_libdir_separator=:
    link_all_deplibs=yes
    ;;

  netbsd*)
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
    else
      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
    fi
    hardcode_libdir_flag_spec='-R$libdir'
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    ;;

  newsos6)
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
    hardcode_direct=yes
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    hardcode_libdir_separator=:
    hardcode_shlibpath_var=no
    ;;

  openbsd*)
    hardcode_direct=yes
    hardcode_shlibpath_var=no
    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      export_dynamic_flag_spec='${wl}-E'
    else
      case "$host_os" in
      openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
	hardcode_libdir_flag_spec='-R$libdir'
        ;;
      *)
        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
        ;;
      esac
    fi
    ;;

  os2*)
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_minus_L=yes
    allow_undefined_flag=unsupported
    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
    ;;

  osf3*)
    if test "$GCC" = yes; then
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
    else
      allow_undefined_flag=' -expect_unresolved \*'
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
    fi
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    hardcode_libdir_separator=:
    ;;

  osf4* | osf5*)	# as osf3* with the addition of -msym flag
    if test "$GCC" = yes; then
      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    else
      allow_undefined_flag=' -expect_unresolved \*'
      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'

      #Both c and cxx compiler support -rpath directly
      hardcode_libdir_flag_spec='-rpath $libdir'
    fi
    hardcode_libdir_separator=:
    ;;

  sco3.2v5*)
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
    hardcode_shlibpath_var=no
    runpath_var=LD_RUN_PATH
    hardcode_runpath_var=yes
    export_dynamic_flag_spec='${wl}-Bexport'
    ;;

  solaris*)
    # gcc --version < 3.0 without binutils cannot create self contained
    # shared libraries reliably, requiring libgcc.a to resolve some of
    # the object symbols generated in some cases.  Libraries that use
    # assert need libgcc.a to resolve __eprintf, for example.  Linking
    # a copy of libgcc.a into every shared library to guarantee resolving
    # such symbols causes other problems:  According to Tim Van Holder
    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
    # (to the application) exception stack for one thing.
    no_undefined_flag=' -z defs'
    if test "$GCC" = yes; then
      case `$CC --version 2>/dev/null` in
      [12].*)
	cat <<EOF 1>&2

*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
*** create self contained shared libraries on Solaris systems, without
*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
*** -no-undefined support, which will at least allow you to build shared
*** libraries.  However, you may find that when you link such libraries
*** into an application without using GCC, you have to manually add
*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
*** upgrade to a newer version of GCC.  Another option is to rebuild your
*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.

EOF
        no_undefined_flag=
	;;
      esac
    fi
    # $CC -shared without GNU ld will not create a library from C++
    # object files and a static libstdc++, better avoid it by now
    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
    hardcode_libdir_flag_spec='-R$libdir'
    hardcode_shlibpath_var=no
    case $host_os in
    solaris2.[0-5] | solaris2.[0-5].*) ;;
    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
    esac
    link_all_deplibs=yes
    ;;

  sunos4*)
    if test "x$host_vendor" = xsequent; then
      # Use $CC to link under sequent, because it throws in some extra .o
      # files that make .init and .fini sections work.
      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
    else
      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
    fi
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_direct=yes
    hardcode_minus_L=yes
    hardcode_shlibpath_var=no
    ;;

  sysv4)
    case $host_vendor in
      sni)
        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
        hardcode_direct=yes # is this really true???
        ;;
      siemens)
        ## LD is ld it makes a PLAMLIB
        ## CC just makes a GrossModule.
        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
        reload_cmds='$CC -r -o $output$reload_objs'
        hardcode_direct=no
        ;;
      motorola)
        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
        ;;
    esac
    runpath_var='LD_RUN_PATH'
    hardcode_shlibpath_var=no
    ;;

  sysv4.3*)
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
    hardcode_shlibpath_var=no
    export_dynamic_flag_spec='-Bexport'
    ;;

  uts4*)
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_shlibpath_var=no
    ;;

  dgux*)
    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
    hardcode_libdir_flag_spec='-L$libdir'
    hardcode_shlibpath_var=no
    ;;

  sysv4*MP*)
    if test -d /usr/nec; then
      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_shlibpath_var=no
      runpath_var=LD_RUN_PATH
      hardcode_runpath_var=yes
      ld_shlibs=yes
    fi
    ;;

  sysv4.2uw2*)
    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
    hardcode_direct=yes
    hardcode_minus_L=no
    hardcode_shlibpath_var=no
    hardcode_runpath_var=yes
    runpath_var=LD_RUN_PATH
    ;;

  sysv5* | unixware7*)
    no_undefined_flag='${wl}-z ${wl}text'
    if test "$GCC" = yes; then
      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
    else
      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
    fi
    runpath_var='LD_RUN_PATH'
    hardcode_shlibpath_var=no
    ;;

  *)
    ld_shlibs=no
    ;;
  esac
fi
echo "$as_me:$LINENO: result: $ld_shlibs" >&5
echo "${ECHO_T}$ld_shlibs" >&6
test "$ld_shlibs" = no && can_build_shared=no
##
## END FIXME

## FIXME: this should be a separate macro
##
# Check hardcoding attributes.
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" || \
   test -n "$runpath_var"; then

  # We can hardcode non-existant directories.
  if test "$hardcode_direct" != no &&
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
     # have to relink, otherwise we might link with an installed library
     # when we should be linking with a yet-to-be-installed one
     ## test "$hardcode_shlibpath_var" != no &&
     test "$hardcode_minus_L" != no; then
    # Linking always hardcodes the temporary library directory.
    hardcode_action=relink
  else
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
    hardcode_action=immediate
  fi
else
  # We cannot hardcode anything, or else we can only hardcode existing
  # directories.
  hardcode_action=unsupported
fi
echo "$as_me:$LINENO: result: $hardcode_action" >&5
echo "${ECHO_T}$hardcode_action" >&6
##
## END FIXME

## FIXME: this should be a separate macro
##
striplib=
old_striplib=
echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
##
## END FIXME

reload_cmds='$LD$reload_flag -o $output$reload_objs'
test -z "$deplibs_check_method" && deplibs_check_method=unknown

## FIXME: this should be a separate macro
##
# PORTME Fill in your ld.so characteristics
echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
library_names_spec=
libname_spec='lib$name'
soname_spec=
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"

case $host_os in
aix3*)
  version_type=linux
  library_names_spec='${libname}${release}.so$versuffix $libname.a'
  shlibpath_var=LIBPATH

  # AIX has no versioning support, so we append a major version to the name.
  soname_spec='${libname}${release}.so$major'
  ;;

aix4* | aix5*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  hardcode_into_libs=yes
  if test "$host_cpu" = ia64; then
    # AIX 5 supports IA64
    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
    shlibpath_var=LD_LIBRARY_PATH
  else
    # With GCC up to 2.95.x, collect2 would create an import file
    # for dependence libraries.  The import file would start with
    # the line `#! .'.  This would cause the generated library to
    # depend on `.', always an invalid library.  This was fixed in
    # development snapshots of GCC prior to 3.0.
    case $host_os in
      aix4 | aix4.[01] | aix4.[01].*)
	if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
	     echo ' yes '
	     echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
	  :
	else
	  can_build_shared=no
	fi
	;;
    esac
    # AIX (on Power*) has no versioning support, so currently we can
    # not hardcode correct soname into executable. Probably we can
    # add versioning support to collect2, so additional links can
    # be useful in future.
    if test "$aix_use_runtimelinking" = yes; then
      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
      # instead of lib<name>.a to let people know that these are not
      # typical AIX shared libraries.
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    else
      # We preserve .a as extension for shared libraries through AIX4.2
      # and later when we are not doing run time linking.
      library_names_spec='${libname}${release}.a $libname.a'
      soname_spec='${libname}${release}.so$major'
    fi
    shlibpath_var=LIBPATH
  fi
  hardcode_into_libs=yes
  ;;

amigaos*)
  library_names_spec='$libname.ixlibrary $libname.a'
  # Create ${libname}_ixlibrary.a entries in /sys/libs.
  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  ;;

beos*)
  library_names_spec='${libname}.so'
  dynamic_linker="$host_os ld.so"
  shlibpath_var=LIBRARY_PATH
  ;;

bsdi4*)
  version_type=linux
  need_version=no
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  export_dynamic_flag_spec=-rdynamic
  # the default ld.so.conf also contains /usr/contrib/lib and
  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  # libtool to hard-code these into programs
  ;;

cygwin* | mingw* | pw32*)
  version_type=windows
  need_version=no
  need_lib_prefix=no
  case $GCC,$host_os in
  yes,cygwin*)
    library_names_spec='$libname.dll.a'
    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
      dldir=$destdir/`dirname \$dlpath`~
      test -d \$dldir || mkdir -p \$dldir~
      $install_prog .libs/$dlname \$dldir/$dlname'
    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
      dlpath=$dir/\$dldll~
       $rm \$dlpath'
    ;;
  yes,mingw*)
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
    ;;
  yes,pw32*)
    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
    ;;
  *)
    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
    ;;
  esac
  dynamic_linker='Win32 ld.exe'
  # FIXME: first we should search . and the directory the executable is in
  shlibpath_var=PATH
  ;;

darwin* | rhapsody*)
  dynamic_linker="$host_os dyld"
  version_type=darwin
  need_lib_prefix=no
  need_version=no
  # FIXME: Relying on posixy $() will cause problems for
  #        cross-compilation, but unfortunately the echo tests do not
  #        yet detect zsh echo's removal of \ escapes.
  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
  shlibpath_overrides_runpath=yes
  shlibpath_var=DYLD_LIBRARY_PATH
  ;;

freebsd1*)
  dynamic_linker=no
  ;;

freebsd*)
  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  version_type=freebsd-$objformat
  case $version_type in
    freebsd-elf*)
      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
      need_version=no
      need_lib_prefix=no
      ;;
    freebsd-*)
      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
      need_version=yes
      ;;
  esac
  shlibpath_var=LD_LIBRARY_PATH
  case $host_os in
  freebsd2*)
    shlibpath_overrides_runpath=yes
    ;;
  *)
    shlibpath_overrides_runpath=no
    hardcode_into_libs=yes
    ;;
  esac
  ;;

gnu*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
  soname_spec='${libname}${release}.so$major'
  shlibpath_var=LD_LIBRARY_PATH
  hardcode_into_libs=yes
  ;;

hpux9* | hpux10* | hpux11*)
  # Give a soname corresponding to the major version so that dld.sl refuses to
  # link against other versions.
  dynamic_linker="$host_os dld.sl"
  version_type=sunos
  need_lib_prefix=no
  need_version=no
  shlibpath_var=SHLIB_PATH
  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  soname_spec='${libname}${release}.sl$major'
  # HP-UX runs *really* slowly unless shared libraries are mode 555.
  postinstall_cmds='chmod 555 $lib'
  ;;

irix5* | irix6* | nonstopux*)
  case $host_os in
    nonstopux*) version_type=nonstopux ;;
    *)          version_type=irix ;;
  esac
  need_lib_prefix=no
  need_version=no
  soname_spec='${libname}${release}.so$major'
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
  case $host_os in
  irix5* | nonstopux*)
    libsuff= shlibsuff=
    ;;
  *)
    case $LD in # libtool.m4 will add one of these switches to LD
    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
    *) libsuff= shlibsuff= libmagic=never-match;;
    esac
    ;;
  esac
  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  shlibpath_overrides_runpath=no
  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  ;;

# No shared lib support for Linux oldld, aout, or coff.
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  dynamic_linker=no
  ;;

# This must be Linux ELF.
linux-gnu*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=no
  # This implies no fast_install, which is unacceptable.
  # Some rework will be needed to allow for fast_install
  # before this can be enabled.
  hardcode_into_libs=yes

  # We used to test for /lib/ld.so.1 and disable shared libraries on
  # powerpc, because MkLinux only supported shared libraries with the
  # GNU dynamic linker.  Since this was broken with cross compilers,
  # most powerpc-linux boxes support dynamic linking these days and
  # people can always --disable-shared, the test was removed, and we
  # assume the GNU/Linux dynamic linker is in use.
  dynamic_linker='GNU/Linux ld.so'

  # Find out which ABI we are using (multilib Linux x86_64 hack).
  libsuff=
  case "$host_cpu" in
  x86_64*|s390x*)
    echo '#line 130577 "configure"' > conftest.$ac_ext
    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
      case `/usr/bin/file conftest.$ac_objext` in
      *64-bit*)
        libsuff=64
        ;;
      esac
    fi
    rm -rf conftest*
    ;;
  *)
    ;;
  esac
  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  ;;

netbsd*)
  version_type=sunos
  need_lib_prefix=no
  need_version=no
  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
    dynamic_linker='NetBSD (a.out) ld.so'
  else
    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
    soname_spec='${libname}${release}.so$major'
    dynamic_linker='NetBSD ld.elf_so'
  fi
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  hardcode_into_libs=yes
  ;;

newsos6)
  version_type=linux
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  ;;

openbsd*)
  version_type=sunos
  need_lib_prefix=no
  need_version=no
  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
    case "$host_os" in
    openbsd2.[89] | openbsd2.[89].*)
      shlibpath_overrides_runpath=no
      ;;
    *)
      shlibpath_overrides_runpath=yes
      ;;
    esac
  else
    shlibpath_overrides_runpath=yes
  fi
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

os2*)
  libname_spec='$name'
  need_lib_prefix=no
  library_names_spec='$libname.dll $libname.a'
  dynamic_linker='OS/2 ld.exe'
  shlibpath_var=LIBPATH
  ;;

osf3* | osf4* | osf5*)
  version_type=osf
  need_version=no
  soname_spec='${libname}${release}.so$major'
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  shlibpath_var=LD_LIBRARY_PATH
  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  hardcode_into_libs=yes
  ;;

sco3.2v5*)
  version_type=osf
  soname_spec='${libname}${release}.so$major'
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

solaris*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  hardcode_into_libs=yes
  # ldd complains unless libraries are executable
  postinstall_cmds='chmod +x $lib'
  ;;

sunos4*)
  version_type=sunos
  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  shlibpath_var=LD_LIBRARY_PATH
  shlibpath_overrides_runpath=yes
  if test "$with_gnu_ld" = yes; then
    need_lib_prefix=no
  fi
  need_version=yes
  ;;

sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  version_type=linux
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  shlibpath_var=LD_LIBRARY_PATH
  case $host_vendor in
    sni)
      shlibpath_overrides_runpath=no
      need_lib_prefix=no
      export_dynamic_flag_spec='${wl}-Blargedynsym'
      runpath_var=LD_RUN_PATH
      ;;
    siemens)
      need_lib_prefix=no
      ;;
    motorola)
      need_lib_prefix=no
      need_version=no
      shlibpath_overrides_runpath=no
      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
      ;;
  esac
  ;;

uts4*)
  version_type=linux
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

dgux*)
  version_type=linux
  need_lib_prefix=no
  need_version=no
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  soname_spec='${libname}${release}.so$major'
  shlibpath_var=LD_LIBRARY_PATH
  ;;

sysv4*MP*)
  if test -d /usr/nec ;then
    version_type=linux
    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
    soname_spec='$libname.so.$major'
    shlibpath_var=LD_LIBRARY_PATH
  fi
  ;;

*)
  dynamic_linker=no
  ;;
esac
echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
##
## END FIXME

## FIXME: this should be a separate macro
##
# Report the final consequences.
echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $can_build_shared" >&5
echo "${ECHO_T}$can_build_shared" >&6
##
## END FIXME

## FIXME: this should be a separate macro
##
echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
test "$can_build_shared" = "no" && enable_shared=no

# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case "$host_os" in
aix3*)
  test "$enable_shared" = yes && enable_static=no
  if test -n "$RANLIB"; then
    archive_cmds="$archive_cmds~\$RANLIB \$lib"
    postinstall_cmds='$RANLIB $lib'
  fi
  ;;

aix4*)
  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
    test "$enable_shared" = yes && enable_static=no
  fi
  ;;
esac
echo "$as_me:$LINENO: result: $enable_shared" >&5
echo "${ECHO_T}$enable_shared" >&6
##
## END FIXME

## FIXME: this should be a separate macro
##
echo "$as_me:$LINENO: checking whether to build static libraries" >&5
echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
echo "$as_me:$LINENO: result: $enable_static" >&5
echo "${ECHO_T}$enable_static" >&6
##
## END FIXME

if test "$hardcode_action" = relink; then
  # Fast installation is not supported
  enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
     test "$enable_shared" = no; then
  # Fast installation is not necessary
  enable_fast_install=needless
fi

variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi

if test "x$enable_dlopen" != xyes; then
  enable_dlopen=unknown
  enable_dlopen_self=unknown
  enable_dlopen_self_static=unknown
else
  lt_cv_dlopen=no
  lt_cv_dlopen_libs=

  case $host_os in
  beos*)
    lt_cv_dlopen="load_add_on"
    lt_cv_dlopen_libs=
    lt_cv_dlopen_self=yes
    ;;

  cygwin* | mingw* | pw32*)
    lt_cv_dlopen="LoadLibrary"
    lt_cv_dlopen_libs=
   ;;

  *)
    echo "$as_me:$LINENO: checking for shl_load" >&5
echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
if test "${ac_cv_func_shl_load+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define shl_load innocuous_shl_load

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char shl_load (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef shl_load

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char shl_load ();
/* 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_shl_load) || defined (__stub___shl_load)
choke me
#else
char (*f) () = shl_load;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != shl_load;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_shl_load=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_shl_load=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
echo "${ECHO_T}$ac_cv_func_shl_load" >&6
if test $ac_cv_func_shl_load = yes; then
  lt_cv_dlopen="shl_load"
else
  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
if test "${ac_cv_lib_dld_shl_load+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char shl_load ();
int
main ()
{
shl_load ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dld_shl_load=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dld_shl_load=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
if test $ac_cv_lib_dld_shl_load = yes; then
  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
else
  echo "$as_me:$LINENO: checking for dlopen" >&5
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
if test "${ac_cv_func_dlopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
#define dlopen innocuous_dlopen

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dlopen (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef dlopen

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dlopen ();
/* 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_dlopen) || defined (__stub___dlopen)
choke me
#else
char (*f) () = dlopen;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != dlopen;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_func_dlopen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_func_dlopen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
echo "${ECHO_T}$ac_cv_func_dlopen" >&6
if test $ac_cv_func_dlopen = yes; then
  lt_cv_dlopen="dlopen"
else
  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dlopen ();
int
main ()
{
dlopen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dl_dlopen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dl_dlopen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
if test $ac_cv_lib_dl_dlopen = yes; then
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
if test "${ac_cv_lib_svld_dlopen+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dlopen ();
int
main ()
{
dlopen ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_svld_dlopen=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_svld_dlopen=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
if test $ac_cv_lib_svld_dlopen = yes; then
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
if test "${ac_cv_lib_dld_dld_link+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char dld_link ();
int
main ()
{
dld_link ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>conftest.er1
  ac_status=$?
  grep -v '^ *+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
	 { ac_try='test -z "$ac_c_werror_flag"
			 || test ! -s conftest.err'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; } &&
	 { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_dld_dld_link=yes
else
  echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5

ac_cv_lib_dld_dld_link=no
fi
rm -f conftest.err conftest.$ac_objext \
      conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
if test $ac_cv_lib_dld_dld_link = yes; then
  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
fi


fi


fi


fi


fi


fi

    ;;
  esac

  if test "x$lt_cv_dlopen" != xno; then
    enable_dlopen=yes
  else
    enable_dlopen=no
  fi

  case $lt_cv_dlopen in
  dlopen)
    save_CPPFLAGS="$CPPFLAGS"
        test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"

    save_LDFLAGS="$LDFLAGS"
    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"

    save_LIBS="$LIBS"
    LIBS="$lt_cv_dlopen_libs $LIBS"

    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
if test "${lt_cv_dlopen_self+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  	  if test "$cross_compiling" = yes; then :
  lt_cv_dlopen_self=cross
else
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  lt_status=$lt_dlunknown
  cat > conftest.$ac_ext <<EOF
#line 131339 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#include <stdio.h>

#ifdef RTLD_GLOBAL
#  define LT_DLGLOBAL		RTLD_GLOBAL
#else
#  ifdef DL_GLOBAL
#    define LT_DLGLOBAL		DL_GLOBAL
#  else
#    define LT_DLGLOBAL		0
#  endif
#endif

/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
   find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
#  ifdef RTLD_LAZY
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
#  else
#    ifdef DL_LAZY
#      define LT_DLLAZY_OR_NOW		DL_LAZY
#    else
#      ifdef RTLD_NOW
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
#      else
#        ifdef DL_NOW
#          define LT_DLLAZY_OR_NOW	DL_NOW
#        else
#          define LT_DLLAZY_OR_NOW	0
#        endif
#      endif
#    endif
#  endif
#endif

#ifdef __cplusplus
extern "C" void exit (int);
#endif

void fnord() { int i=42;}
int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;

  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
      /* dlclose (self); */
    }

    exit (status);
}
EOF
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
    (./conftest; exit; ) 2>/dev/null
    lt_status=$?
    case x$lt_status in
      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
    esac
  else :
    # compilation failed
    lt_cv_dlopen_self=no
  fi
fi
rm -fr conftest*


fi
echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
echo "${ECHO_T}$lt_cv_dlopen_self" >&6

    if test "x$lt_cv_dlopen_self" = xyes; then
      LDFLAGS="$LDFLAGS $link_static_flag"
      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
if test "${lt_cv_dlopen_self_static+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  	  if test "$cross_compiling" = yes; then :
  lt_cv_dlopen_self_static=cross
else
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  lt_status=$lt_dlunknown
  cat > conftest.$ac_ext <<EOF
#line 131437 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#include <stdio.h>

#ifdef RTLD_GLOBAL
#  define LT_DLGLOBAL		RTLD_GLOBAL
#else
#  ifdef DL_GLOBAL
#    define LT_DLGLOBAL		DL_GLOBAL
#  else
#    define LT_DLGLOBAL		0
#  endif
#endif

/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
   find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
#  ifdef RTLD_LAZY
#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
#  else
#    ifdef DL_LAZY
#      define LT_DLLAZY_OR_NOW		DL_LAZY
#    else
#      ifdef RTLD_NOW
#        define LT_DLLAZY_OR_NOW	RTLD_NOW
#      else
#        ifdef DL_NOW
#          define LT_DLLAZY_OR_NOW	DL_NOW
#        else
#          define LT_DLLAZY_OR_NOW	0
#        endif
#      endif
#    endif
#  endif
#endif

#ifdef __cplusplus
extern "C" void exit (int);
#endif

void fnord() { int i=42;}
int main ()
{
  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  int status = $lt_dlunknown;

  if (self)
    {
      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
      /* dlclose (self); */
    }

    exit (status);
}
EOF
  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
    (./conftest; exit; ) 2>/dev/null
    lt_status=$?
    case x$lt_status in
      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
    esac
  else :
    # compilation failed
    lt_cv_dlopen_self_static=no
  fi
fi
rm -fr conftest*


fi
echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
    fi

    CPPFLAGS="$save_CPPFLAGS"
    LDFLAGS="$save_LDFLAGS"
    LIBS="$save_LIBS"
    ;;
  esac

  case $lt_cv_dlopen_self in
  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  *) enable_dlopen_self=unknown ;;
  esac

  case $lt_cv_dlopen_self_static in
  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  *) enable_dlopen_self_static=unknown ;;
  esac
fi


## FIXME: this should be a separate macro
##
if test "$enable_shared" = yes && test "$GCC" = yes; then
  case $archive_cmds in
  *'~'*)
    # FIXME: we may have to deal with multi-command sequences.
    ;;
  '$CC '*)
    # Test whether the compiler implicitly links with -lc since on some
    # systems, -lgcc has to come before -lc. If gcc already passes -lc
    # to ld, don't add -lc before -lgcc.
    echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
    if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  $rm conftest*
    echo 'static int dummy;' > conftest.$ac_ext

    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
      soname=conftest
      lib=conftest
      libobjs=conftest.$ac_objext
      deplibs=
      wl=$lt_cv_prog_cc_wl
      compiler_flags=-v
      linker_flags=-v
      verstring=
      output_objdir=.
      libname=conftest
      save_allow_undefined_flag=$allow_undefined_flag
      allow_undefined_flag=
      if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
      then
	lt_cv_archive_cmds_need_lc=no
      else
	lt_cv_archive_cmds_need_lc=yes
      fi
      allow_undefined_flag=$save_allow_undefined_flag
    else
      cat conftest.err 1>&5
    fi
fi

    echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
    ;;
  esac
fi
need_lc=${lt_cv_archive_cmds_need_lc-yes}
##
## END FIXME

## FIXME: this should be a separate macro
##
# The second clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
# no rules to generate ltmain.sh.
if test -f "$ltmain"; then
  :
else
  # If there is no Makefile yet, we rely on a make rule to execute
  # `config.status --recheck' to rerun these tests and create the
  # libtool script then.
  test -f Makefile && make "$ltmain"
fi

if test -f "$ltmain"; then
  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
  $rm -f "${ofile}T"

  echo creating $ofile

  # Now quote all the things that may contain metacharacters while being
  # careful not to overquote the AC_SUBSTed values.  We take copies of the
  # variables and quote the copies for generation of the libtool script.
  for var in echo old_CC old_CFLAGS SED \
    AR AR_FLAGS CC LD LN_S NM SHELL \
    reload_flag reload_cmds wl \
    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
    library_names_spec soname_spec \
    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
    old_striplib striplib file_magic_cmd export_symbols_cmds \
    deplibs_check_method allow_undefined_flag no_undefined_flag \
    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
    global_symbol_to_c_name_address \
    hardcode_libdir_flag_spec hardcode_libdir_separator  \
    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do

    case $var in
    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
    old_postinstall_cmds | old_postuninstall_cmds | \
    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
    postinstall_cmds | postuninstall_cmds | \
    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
      # Double-quote double-evaled strings.
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
      ;;
    *)
      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
      ;;
    esac
  done

  cat <<__EOF__ > "${ofile}T"
#! $SHELL

# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# A sed that does not truncate output.
SED=$lt_SED

# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="${SED} -e s/^X//"

# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi

# ### BEGIN LIBTOOL CONFIG

# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:

# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL

# Whether or not to build shared libraries.
build_libtool_libs=$enable_shared

# Whether or not to build static libraries.
build_old_libs=$enable_static

# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=$need_lc

# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install

# The host system.
host_alias=$host_alias
host=$host

# An echo program that does not interpret backslashes.
echo=$lt_echo

# The archiver.
AR=$lt_AR
AR_FLAGS=$lt_AR_FLAGS

# The default C compiler.
CC=$lt_CC

# Is the compiler the GNU C compiler?
with_gcc=$GCC

# The linker used to build libraries.
LD=$lt_LD

# Whether we need hard or soft links.
LN_S=$lt_LN_S

# A BSD-compatible nm program.
NM=$lt_NM

# A symbol stripping program
STRIP=$STRIP

# Used to examine libraries when file_magic_cmd begins "file"
MAGIC_CMD=$MAGIC_CMD

# Used on cygwin: DLL creation program.
DLLTOOL="$DLLTOOL"

# Used on cygwin: object dumper.
OBJDUMP="$OBJDUMP"

# Used on cygwin: assembler.
AS="$AS"

# The name of the directory that contains temporary libtool files.
objdir=$objdir

# How to create reloadable object files.
reload_flag=$lt_reload_flag
reload_cmds=$lt_reload_cmds

# How to pass a linker flag through the compiler.
wl=$lt_wl

# Object file suffix (normally "o").
objext="$ac_objext"

# Old archive suffix (normally "a").
libext="$libext"

# Executable file suffix (normally "").
exeext="$exeext"

# Additional compiler flags for building library objects.
pic_flag=$lt_pic_flag
pic_mode=$pic_mode

# Does compiler simultaneously support -c and -o options?
compiler_c_o=$lt_compiler_c_o

# Can we write directly to a .lo ?
compiler_o_lo=$lt_compiler_o_lo

# Must we lock files when doing compilation ?
need_locks=$lt_need_locks

# Do we need the lib prefix for modules?
need_lib_prefix=$need_lib_prefix

# Do we need a version for libraries?
need_version=$need_version

# Whether dlopen is supported.
dlopen_support=$enable_dlopen

# Whether dlopen of programs is supported.
dlopen_self=$enable_dlopen_self

# Whether dlopen of statically linked programs is supported.
dlopen_self_static=$enable_dlopen_self_static

# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_link_static_flag

# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_no_builtin_flag

# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec

# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=$lt_whole_archive_flag_spec

# Compiler flag to generate thread-safe objects.
thread_safe_flag_spec=$lt_thread_safe_flag_spec

# Library versioning type.
version_type=$version_type

# Format of library name prefix.
libname_spec=$lt_libname_spec

# List of archive names.  First name is the real one, the rest are links.
# The last name is the one that the linker finds with -lNAME.
library_names_spec=$lt_library_names_spec

# The coded name of the library, if different from the real name.
soname_spec=$lt_soname_spec

# Commands used to build and install an old-style archive.
RANLIB=$lt_RANLIB
old_archive_cmds=$lt_old_archive_cmds
old_postinstall_cmds=$lt_old_postinstall_cmds
old_postuninstall_cmds=$lt_old_postuninstall_cmds

# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds

# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds

# Commands used to build and install a shared archive.
archive_cmds=$lt_archive_cmds
archive_expsym_cmds=$lt_archive_expsym_cmds
postinstall_cmds=$lt_postinstall_cmds
postuninstall_cmds=$lt_postuninstall_cmds

# Commands to strip libraries.
old_striplib=$lt_old_striplib
striplib=$lt_striplib

# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method

# Command to use when deplibs_check_method == file_magic.
file_magic_cmd=$lt_file_magic_cmd

# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$lt_allow_undefined_flag

# Flag that forces no undefined symbols.
no_undefined_flag=$lt_no_undefined_flag

# Commands used to finish a libtool library installation in a directory.
finish_cmds=$lt_finish_cmds

# Same as above, but a single script fragment to be evaled but not shown.
finish_eval=$lt_finish_eval

# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe=$lt_global_symbol_pipe

# Transform the output of nm in a proper C declaration
global_symbol_to_cdecl=$lt_global_symbol_to_cdecl

# Transform the output of nm in a C name address pair
global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address

# This is the shared library runtime path variable.
runpath_var=$runpath_var

# This is the shared library path variable.
shlibpath_var=$shlibpath_var

# Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=$shlibpath_overrides_runpath

# How to hardcode a shared library path into an executable.
hardcode_action=$hardcode_action

# Whether we should hardcode library paths into libraries.
hardcode_into_libs=$hardcode_into_libs

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct=$hardcode_direct

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L=$hardcode_minus_L

# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
# the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var

# Variables whose values should be saved in libtool wrapper scripts and
# restored at relink time.
variables_saved_for_relink="$variables_saved_for_relink"

# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs

# Compile-time system search path for libraries
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec

# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec

# Fix the shell variable \$srcfile for the compiler.
fix_srcfile_path="$fix_srcfile_path"

# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols

# The commands to list exported symbols.
export_symbols_cmds=$lt_export_symbols_cmds

# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=$lt_extract_expsyms_cmds

# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$lt_exclude_expsyms

# Symbols that must always be exported.
include_expsyms=$lt_include_expsyms

# ### END LIBTOOL CONFIG

__EOF__

  case $host_os in
  aix3*)
    cat <<\EOF >> "${ofile}T"

# AIX sometimes has problems with the GCC collect2 program.  For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
  COLLECT_NAMES=
  export COLLECT_NAMES
fi
EOF
    ;;
  esac

  case $host_os in
  cygwin* | mingw* | pw32* | os2*)
    cat <<'EOF' >> "${ofile}T"
      # This is a source program that is used to create dlls on Windows
      # Don't remove nor modify the starting and closing comments
# /* ltdll.c starts here */
# #define WIN32_LEAN_AND_MEAN
# #include <windows.h>
# #undef WIN32_LEAN_AND_MEAN
# #include <stdio.h>
#
# #ifndef __CYGWIN__
# #  ifdef __CYGWIN32__
# #    define __CYGWIN__ __CYGWIN32__
# #  endif
# #endif
#
# #ifdef __cplusplus
# extern "C" {
# #endif
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
# #ifdef __cplusplus
# }
# #endif
#
# #ifdef __CYGWIN__
# #include <cygwin/cygwin_dll.h>
# DECLARE_CYGWIN_DLL( DllMain );
# #endif
# HINSTANCE __hDllInstance_base;
#
# BOOL APIENTRY
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
# {
#   __hDllInstance_base = hInst;
#   return TRUE;
# }
# /* ltdll.c ends here */
	# This is a source program that is used to create import libraries
	# on Windows for dlls which lack them. Don't remove nor modify the
	# starting and closing comments
# /* impgen.c starts here */
# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
#
#  This file is part of GNU libtool.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#  */
#
# #include <stdio.h>		/* for printf() */
# #include <unistd.h>		/* for open(), lseek(), read() */
# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
# #include <string.h>		/* for strdup() */
#
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
# #ifndef O_BINARY
# #define O_BINARY 0
# #endif
#
# static unsigned int
# pe_get16 (fd, offset)
#      int fd;
#      int offset;
# {
#   unsigned char b[2];
#   lseek (fd, offset, SEEK_SET);
#   read (fd, b, 2);
#   return b[0] + (b[1]<<8);
# }
#
# static unsigned int
# pe_get32 (fd, offset)
#     int fd;
#     int offset;
# {
#   unsigned char b[4];
#   lseek (fd, offset, SEEK_SET);
#   read (fd, b, 4);
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
# }
#
# static unsigned int
# pe_as32 (ptr)
#      void *ptr;
# {
#   unsigned char *b = ptr;
#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
# }
#
# int
# main (argc, argv)
#     int argc;
#     char *argv[];
# {
#     int dll;
#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
#     unsigned long export_rva, export_size, nsections, secptr, expptr;
#     unsigned long name_rvas, nexp;
#     unsigned char *expdata, *erva;
#     char *filename, *dll_name;
#
#     filename = argv[1];
#
#     dll = open(filename, O_RDONLY|O_BINARY);
#     if (dll < 1)
# 	return 1;
#
#     dll_name = filename;
#
#     for (i=0; filename[i]; i++)
# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
# 	    dll_name = filename + i +1;
#
#     pe_header_offset = pe_get32 (dll, 0x3c);
#     opthdr_ofs = pe_header_offset + 4 + 20;
#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
#
#     if (num_entries < 1) /* no exports */
# 	return 1;
#
#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
#     export_size = pe_get32 (dll, opthdr_ofs + 100);
#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
#     secptr = (pe_header_offset + 4 + 20 +
# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
#
#     expptr = 0;
#     for (i = 0; i < nsections; i++)
#     {
# 	char sname[8];
# 	unsigned long secptr1 = secptr + 40 * i;
# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
# 	lseek(dll, secptr1, SEEK_SET);
# 	read(dll, sname, 8);
# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
# 	{
# 	    expptr = fptr + (export_rva - vaddr);
# 	    if (export_rva + export_size > vaddr + vsize)
# 		export_size = vsize - (export_rva - vaddr);
# 	    break;
# 	}
#     }
#
#     expdata = (unsigned char*)malloc(export_size);
#     lseek (dll, expptr, SEEK_SET);
#     read (dll, expdata, export_size);
#     erva = expdata - export_rva;
#
#     nexp = pe_as32 (expdata+24);
#     name_rvas = pe_as32 (expdata+32);
#
#     printf ("EXPORTS\n");
#     for (i = 0; i<nexp; i++)
#     {
# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
#     }
#
#     return 0;
# }
# /* impgen.c ends here */

EOF
    ;;
  esac

  # We use sed instead of cat because bash on DJGPP gets confused if
  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
  # text mode, it properly converts lines to CR/LF.  This bash problem
  # is reportedly fixed, but why not run on old versions too?
  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)

  mv -f "${ofile}T" "$ofile" || \
    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
  chmod +x "$ofile"
fi
##
## END FIXME





# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"

# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'

# Prevent multiple expansion


if test "$enable_debug" != "yes"; then

  if test -z "$LIBTOOL"; then
    LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
  else
    LIBTOOL="$LIBTOOL --silent"
  fi

fi


  if test -z "$LIBTOOL"; then
    LIBTOOL='$(SHELL) $(top_builddir)/libtool --preserve-dup-deps'
  else
    LIBTOOL="$LIBTOOL --preserve-dup-deps"
  fi


test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<'
SHARED_LIBTOOL='$(LIBTOOL)'

CC=$old_CC


  echo "$as_me:$LINENO: result: " >&5
echo "${ECHO_T}" >&6
  echo "$as_me:$LINENO: result: ${T_MD}Generating files${T_ME}" >&5
echo "${ECHO_T}${T_MD}Generating files${T_ME}" >&6


CXXFLAGS_CLEAN=$CXXFLAGS
CFLAGS_CLEAN=$CFLAGS
CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"

all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
install_targets="$install_modules $install_pear install-build install-headers install-programs"

case $PHP_SAPI in
  cgi)
    install_targets="install-sapi $install_targets"
    ;;
  cli)
    install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
    ;;
  *)
    install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets"
    ;;
esac


  PHP_VAR_SUBST="$PHP_VAR_SUBST all_targets"


  PHP_VAR_SUBST="$PHP_VAR_SUBST install_targets"




  case TSRM in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "TSRM"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/TSRM/"; ac_bdir="TSRM/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done





  case main in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "main"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/main/"; ac_bdir="main/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in main.c snprintf.c spprintf.c php_sprintf.c \
       safe_mode.c fopen_wrappers.c alloca.c  php_scandir.c \
       php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
       strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
       streams.c network.c php_open_temporary_file.c php_logos.c \
       output.c memory_streams.c user_streams.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done




  case /main in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "/main"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir//main/"; ac_bdir="/main/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in internal_functions.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_SAPI_OBJS="$PHP_SAPI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


case $host_alias in
*netware*)

  BUILD_DIR="$BUILD_DIR win32"


  BUILD_DIR="$BUILD_DIR netware"

  ;;
*)


  case /main in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "/main"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir//main/"; ac_bdir="/main/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in internal_functions_cli.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_CLI_OBJS="$PHP_CLI_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


  ;;
esac



  case /Zend in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "/Zend"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir//Zend/"; ac_bdir="/Zend/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zend_language_parser.c zend_language_scanner.c \
    zend_ini_parser.c zend_ini_scanner.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done





  case Zend in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "Zend"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/Zend/"; ac_bdir="Zend/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in \
    zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
    zend_execute_API.c zend_highlight.c zend_llist.c \
    zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
    zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
    zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
    zend_ini.c zend_qsort.c zend_multibyte.c zend_strtod.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



if test -r "$abs_srcdir/Zend/zend_objects.c"; then


  case Zend in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "Zend"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/Zend/"; ac_bdir="Zend/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zend_objects.c zend_object_handlers.c zend_objects_API.c zend_mm.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done


fi

if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
  flag=-O0
else
  flag=
fi


  case Zend in
  "") ac_srcdir="$abs_srcdir/"; unset ac_bdir; ac_inc="-I. -I$abs_srcdir" ;;
  /*) ac_srcdir=`echo "Zend"|cut -c 2-`"/"; ac_bdir=$ac_srcdir; ac_inc="-I$ac_bdir -I$abs_srcdir/$ac_bdir" ;;
  *) ac_srcdir="$abs_srcdir/Zend/"; ac_bdir="Zend/"; ac_inc="-I$ac_bdir -I$ac_srcdir" ;;
  esac



  b_c_pre=$php_c_pre
  b_cxx_pre=$php_cxx_pre
  b_c_meta=$php_c_meta
  b_cxx_meta=$php_cxx_meta
  b_c_post=$php_c_post
  b_cxx_post=$php_cxx_post
  b_lo=$php_lo


  old_IFS=$IFS
  for ac_src in zend_execute.c; do

      IFS=.
      set $ac_src
      ac_obj=$1
      IFS=$old_IFS

      PHP_GLOBAL_OBJS="$PHP_GLOBAL_OBJS $ac_bdir$ac_obj.lo"

      case $ac_src in
	  *.c) ac_comp="$b_c_pre  $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $flag$b_c_post" ;;
	  *.cpp|*.cc) ac_comp="$b_cxx_pre  $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $flag$b_cxx_post" ;;
      esac

	  cat >>Makefile.objects<<EOF
$ac_bdir$ac_obj.lo: $ac_srcdir$ac_src
	$ac_comp
EOF
  done



  BUILD_DIR="$BUILD_DIR main"


  BUILD_DIR="$BUILD_DIR regex"


  BUILD_DIR="$BUILD_DIR sapi/$PHP_SAPI sapi/cli"


  BUILD_DIR="$BUILD_DIR TSRM"


  BUILD_DIR="$BUILD_DIR Zend"



  src=$abs_srcdir/scripts/Makefile.frag
  ac_srcdir=$abs_srcdir/scripts
  ac_builddir=scripts
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments


  src=$abs_srcdir/Makefile.frag
  ac_srcdir=$abs_srcdir/Zend
  ac_builddir=Zend
  test -f "$src" && sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src  >> Makefile.fragments



  $php_shtool mkdir -p $BUILD_DIR


  cat >Makefile <<EOF
srcdir = $abs_srcdir
builddir = $abs_builddir
top_srcdir = $abs_srcdir
top_builddir = $abs_builddir
EOF
  for i in $PHP_VAR_SUBST; do
    eval echo "$i = \$$i" >> Makefile
  done

  cat $abs_srcdir/Makefile.global Makefile.fragments Makefile.objects >> Makefile



cat >>confdefs.h <<\_ACEOF
#define HAVE_BUILD_DEFS_H 1
_ACEOF


$php_shtool mkdir -p pear/scripts
$php_shtool mkdir -p scripts
$php_shtool mkdir -p scripts/man1

ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
scripts/phpize scripts/man1/phpize.1 \
scripts/php-config scripts/man1/php-config.1 \
$PHP_OUTPUT_FILES"

          ac_config_files="$ac_config_files $ALL_OUTPUT_FILES"
          ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems.  If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.

_ACEOF

# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
{
  (set) 2>&1 |
    case `(ac_space=' '; set | grep ac_space) 2>&1` in
    *ac_space=\ *)
      # `set' does not quote correctly, so add quotes (double-quote
      # substitution turns \\\\ into \\, and sed turns \\ into \).
      sed -n \
	"s/'/'\\\\''/g;
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
      ;;
    *)
      # `set' quotes correctly as required by POSIX, so do not add quotes.
      sed -n \
	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
      ;;
    esac;
} |
  sed '
     t clear
     : clear
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
     t end
     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
     : end' >>confcache
if diff $cache_file confcache >/dev/null 2>&1; then :; else
  if test -w $cache_file; then
    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
    cat confcache >$cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
s/^\([^=]*=[	 ]*\):*/\1/;
s/:*$//;
s/^[^=]*=[	 ]*$//;
}'
fi

DEFS=-DHAVE_CONFIG_H

ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  # 1. Remove the extension, and $U if already installed.
  ac_i=`echo "$ac_i" |
	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
  # 2. Add them.
  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs

LTLIBOBJS=$ac_ltlibobjs



: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi
DUALCASE=1; export DUALCASE # for MKS sh

# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi


# Work around bugs in pre-3.0 UWIN ksh.
$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
for as_var in \
  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  LC_TELEPHONE LC_TIME
do
  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
    eval $as_var=C; export $as_var
  else
    $as_unset $as_var
  fi
done

# Required to use basename.
if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi


# Name of the executable.
as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  	  /^X\/\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`


# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conf$$.sh
  echo  "exit 0"   >>conf$$.sh
  chmod +x conf$$.sh
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conf$$.sh
fi


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, and appends trailing '-' during
  # substitution so that $LINENO is not a special case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.file

if mkdir -p . 2>/dev/null; then
  as_mkdir_p=:
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

as_executable_p="test -f"

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH

exec 6>&1

# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.  Logging --version etc. is OK.
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF

This file was extended by $as_me, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

_CSEOF
echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
echo >&5
_ACEOF

# Files that config.status was made for.
if test -n "$ac_config_files"; then
  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_headers"; then
  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_links"; then
  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_commands"; then
  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
fi

cat >>$CONFIG_STATUS <<\_ACEOF

ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.

Usage: $0 [OPTIONS] [FILE]...

  -h, --help       print this help, then exit
  -V, --version    print version number, then exit
  -q, --quiet      do not print progress messages
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
  --file=FILE[:TEMPLATE]
		   instantiate the configuration file FILE
  --header=FILE[:TEMPLATE]
		   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:
$config_headers

Configuration commands:
$config_commands

Report bugs to <bug-autoconf@gnu.org>."
_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
configured by $0, generated by GNU Autoconf 2.59,
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
# If no file are specified by the user, then we need to provide default
# value.  By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=*)
    ac_option=`expr "x$1" : 'x\([^=]*\)='`
    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
    ac_shift=:
    ;;
  -*)
    ac_option=$1
    ac_optarg=$2
    ac_shift=shift
    ;;
  *) # This is not an option, so the user has probably given explicit
     # arguments.
     ac_option=$1
     ac_need_defaults=false;;
  esac

  case $ac_option in
  # Handling of the options.
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --vers* | -V )
    echo "$ac_cs_version"; exit 0 ;;
  --he | --h)
    # Conflict between --help and --header
    { { echo "$as_me:$LINENO: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
   { (exit 1); exit 1; }; };;
  --help | --hel | -h )
    echo "$ac_cs_usage"; exit 0 ;;
  --debug | --d* | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    $ac_shift
    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
    ac_need_defaults=false;;
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
    ac_cs_silent=: ;;

  # This is an error.
  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
   { (exit 1); exit 1; }; } ;;

  *) ac_config_targets="$ac_config_targets $1" ;;

  esac
  shift
done

ac_configure_extra_args=

if $ac_cs_silent; then
  exec 6>/dev/null
  ac_configure_extra_args="$ac_configure_extra_args --silent"
fi

_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
#
# INIT-COMMANDS section.
#



if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
  REDO_ALL=yes
fi

################################################################
# Create configuration headers
#

test -d TSRM || $php_shtool mkdir TSRM
echo '#include <../main/php_config.h>' > TSRM/tsrm_config.h

test -d Zend || $php_shtool mkdir Zend

cat >Zend/zend_config.h <<FEO
#include <../main/php_config.h>
#if defined(APACHE) && defined(PHP_API_VERSION)
#undef HAVE_DLFCN_H
#endif
FEO

# run this only when generating all the files?
if test -n "\$REDO_ALL"; then
  # Hacking while airborne considered harmful.
  #
  echo "creating main/internal_functions.c"
  extensions="$EXT_STATIC"
  sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c

  echo "creating main/internal_functions_cli.c"
  cli_extensions="$EXT_CLI_STATIC"
  sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c


  if test "$UNAME" = "FreeBSD" && test "$PHP_SAPI" = "apache2filter" && test "$TSRM_PTH" != "pth-config" ; then
    echo "+--------------------------------------------------------------------+"
    echo "|                        *** WARNING ***                             |"
    echo "|                                                                    |"
    echo "| In order to build PHP as a Apache2 module on FreeBSD, you have to  |"
    echo "| add  --with-tsrm-pth to your ./configure line. Therefore you need  |"
    echo "| to install gnu-pth from /usr/ports/devel/pth.                      |"
  fi

  if test -n "$PHP_APXS_BROKEN"; then
    echo "+--------------------------------------------------------------------+"
    echo "| WARNING: Your $APXS script is most likely broken."
    echo "|                                                                    |"
    echo "| Please go read http://www.php.net/faq.build#faq.build.apxs         |"
    echo "| and make the changes described there and try again.                |"
  fi

  # Warn about CGI version with no extra security options.
  if test "$PHP_SAPI" = "cgi"; then
    if test "$REDIRECT" = "0"; then
      if test "$DISCARD_PATH" = "0"; then
        echo "+--------------------------------------------------------------------+"
        echo "|                        *** WARNING ***                             |"
        echo "|                                                                    |"
        echo "| You will be compiling the CGI version of PHP without any           |"
        echo "| redirection checking.  By putting this cgi binary somewhere in     |"
        echo "| your web space, users may be able to circumvent existing .htaccess |"
        echo "| security by loading files directly through the parser.  See        |"
        echo "| http://www.php.net/manual/security.php for more details.           |"
      fi
    fi
  fi


  if test -n "$DEBUG_LOG"; then
    rm -f config.cache
cat <<X
+--------------------------------------------------------------------+
|                       *** ATTENTION ***                            |
|                                                                    |
| Something is likely to be messed up here, because the configure    |
| script was not able to detect a simple feature on your platform.   |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages.                         |
|                                                                    |
| If you are unable to fix this, send the file debug.log to the      |
| php-install@lists.php.net mailing list and include appropiate      |
| information about your setup.                                      |
X
  fi

  if test "$PHP_DB" != "no"; then
cat <<X
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| You chose to compile PHP with DB extension. This extension is      |
| deprecated and does not support database locking correctly. Please |
| use DBA extension which is a fully operational superset.           |
X
  fi

  if test "$MYSQL_MODULE_TYPE" = "builtin" && test "$PHP_SAPI" != "cgi" && test "$PHP_SAPI" != "cli" && test "$php_multiple_shlib_versions_ok" != "yes"; then
cat <<X
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| You chose to compile PHP with the built-in MySQL support.  If you  |
| are compiling a server module, and intend to use other server      |
| modules that also use MySQL (e.g, mod_auth_mysql, PHP 3.0,         |
| mod_perl) you must NOT rely on PHP's built-in MySQL support, and   |
| instead build it with your local MySQL support files, by adding    |
| --with-mysql=/path/to/mysql to your configure line.                |
X
  fi

  # Warn about linking Apache with libpthread if oci8 extension is enabled on linux.
  if test "$PHP_OCI8" != "no" -o "$PHP_ORACLE" != "no"; then
    if test "$PHP_SAPI" = "apache"; then
      if test `uname` = "Linux"; then
cat <<X
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| Please check that your Apache (httpd) is linked with libpthread.   |
| If not, you have to recompile Apache with pthread. For more        |
| details, see this page: http://www.php.net/manual/ref.oci8.php     |
X
      fi
    fi

    if test "$PHP_SIGCHILD" != "yes"; then
cat <<X
+--------------------------------------------------------------------+
| Notice:                                                            |
| If you encounter <defunc> processes when using a local Oracle-DB   |
| please recompile PHP and specify --enable-sigchild when configuring|
| (This problem has been reported under Linux using Oracle >= 8.1.5) |
X
    fi
  fi

cat <<X
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+
|                          *** NOTE ***                              |
|            The default for register_globals is now OFF!            |
|                                                                    |
| If your application relies on register_globals being ON, you       |
| should explicitly set it to on in your php.ini file.               |
| Note that you are strongly encouraged to read                      |
| http://www.php.net/manual/en/security.globals.php                  |
| about the implications of having register_globals set to on, and   |
| avoid using it if possible.                                        |
+--------------------------------------------------------------------+

Thank you for using PHP.

X

fi


_ACEOF



cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
  case "$ac_config_target" in
  # Handling of arguments.
  "$ALL_OUTPUT_FILES" ) CONFIG_FILES="$CONFIG_FILES $ALL_OUTPUT_FILES" ;;
  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
  "main/php_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS main/php_config.h" ;;
  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
   { (exit 1); exit 1; }; };;
  esac
done

# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Have a temporary directory for convenience.  Make it in the build tree
# simply because there is no reason to put it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  trap '{ (exit 1); exit 1; }' 1 2 13 15
}

# Create a (secure) tmp directory for tmp files.

{
  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=./confstat$$-$RANDOM
  (umask 077 && mkdir $tmp)
} ||
{
   echo "$me: cannot create a temporary directory in ." >&2
   { (exit 1); exit 1; }
}

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF

#
# CONFIG_FILES section.
#

# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
if test -n "\$CONFIG_FILES"; then
  # Protect against being on the right side of a sed subst in config.status.
  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
s,@SHELL@,$SHELL,;t t
s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
s,@exec_prefix@,$exec_prefix,;t t
s,@prefix@,$prefix,;t t
s,@program_transform_name@,$program_transform_name,;t t
s,@bindir@,$bindir,;t t
s,@sbindir@,$sbindir,;t t
s,@libexecdir@,$libexecdir,;t t
s,@datadir@,$datadir,;t t
s,@sysconfdir@,$sysconfdir,;t t
s,@sharedstatedir@,$sharedstatedir,;t t
s,@localstatedir@,$localstatedir,;t t
s,@libdir@,$libdir,;t t
s,@includedir@,$includedir,;t t
s,@oldincludedir@,$oldincludedir,;t t
s,@infodir@,$infodir,;t t
s,@mandir@,$mandir,;t t
s,@build_alias@,$build_alias,;t t
s,@host_alias@,$host_alias,;t t
s,@target_alias@,$target_alias,;t t
s,@DEFS@,$DEFS,;t t
s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
s,@LIBS@,$LIBS,;t t
s,@EGREP@,$EGREP,;t t
s,@CONFIGURE_COMMAND@,$CONFIGURE_COMMAND,;t t
s,@build@,$build,;t t
s,@build_cpu@,$build_cpu,;t t
s,@build_vendor@,$build_vendor,;t t
s,@build_os@,$build_os,;t t
s,@host@,$host,;t t
s,@host_cpu@,$host_cpu,;t t
s,@host_vendor@,$host_vendor,;t t
s,@host_os@,$host_os,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
s,@CPP@,$CPP,;t t
s,@RE2C@,$RE2C,;t t
s,@LN_S@,$LN_S,;t t
s,@AWK@,$AWK,;t t
s,@YACC@,$YACC,;t t
s,@LEX@,$LEX,;t t
s,@LEXLIB@,$LEXLIB,;t t
s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
s,@PTHREAD_CC@,$PTHREAD_CC,;t t
s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t
s,@THREADED@,$THREADED,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@PROG_SENDMAIL@,$PROG_SENDMAIL,;t t
s,@ALLOCA@,$ALLOCA,;t t
s,@KRB5_CONFIG@,$KRB5_CONFIG,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@OPENSSL_INCDIR_OPT@,$OPENSSL_INCDIR_OPT,;t t
s,@FRIBIDI_CONFIG@,$FRIBIDI_CONFIG,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@CXXCPP@,$CXXCPP,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@MYSQL_MODULE_TYPE@,$MYSQL_MODULE_TYPE,;t t
s,@MYSQL_LIBS@,$MYSQL_LIBS,;t t
s,@MYSQL_INCLUDE@,$MYSQL_INCLUDE,;t t
s,@OCI8_SHARED_LIBADD@,$OCI8_SHARED_LIBADD,;t t
s,@OCI8_DIR@,$OCI8_DIR,;t t
s,@OCI8_VERSION@,$OCI8_VERSION,;t t
s,@ODBC_INCLUDE@,$ODBC_INCLUDE,;t t
s,@ODBC_LIBS@,$ODBC_LIBS,;t t
s,@ODBC_LFLAGS@,$ODBC_LFLAGS,;t t
s,@ODBC_TYPE@,$ODBC_TYPE,;t t
s,@ORACLE_SHARED_LIBADD@,$ORACLE_SHARED_LIBADD,;t t
s,@ORACLE_DIR@,$ORACLE_DIR,;t t
s,@ORACLE_VERSION@,$ORACLE_VERSION,;t t
s,@SNMP_CONFIG@,$SNMP_CONFIG,;t t
s,@yazconfig@,$yazconfig,;t t
s,@INLINE_CFLAGS@,$INLINE_CFLAGS,;t t
s,@INCLUDE_PATH@,$INCLUDE_PATH,;t t
s,@EXPANDED_PEAR_INSTALLDIR@,$EXPANDED_PEAR_INSTALLDIR,;t t
s,@EXPANDED_EXTENSION_DIR@,$EXPANDED_EXTENSION_DIR,;t t
s,@EXPANDED_BINDIR@,$EXPANDED_BINDIR,;t t
s,@EXPANDED_LIBDIR@,$EXPANDED_LIBDIR,;t t
s,@EXPANDED_DATADIR@,$EXPANDED_DATADIR,;t t
s,@EXPANDED_SYSCONFDIR@,$EXPANDED_SYSCONFDIR,;t t
s,@EXPANDED_LOCALSTATEDIR@,$EXPANDED_LOCALSTATEDIR,;t t
s,@EXPANDED_PHP_CONFIG_FILE_PATH@,$EXPANDED_PHP_CONFIG_FILE_PATH,;t t
s,@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@,$EXPANDED_PHP_CONFIG_FILE_SCAN_DIR,;t t
s,@abs_builddir@,$abs_builddir,;t t
s,@abs_srcdir@,$abs_srcdir,;t t
s,@php_abs_top_builddir@,$php_abs_top_builddir,;t t
s,@php_abs_top_srcdir@,$php_abs_top_srcdir,;t t
s,@DEBUG_CFLAGS@,$DEBUG_CFLAGS,;t t
s,@EXTENSION_DIR@,$EXTENSION_DIR,;t t
s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
s,@EXTRA_LDFLAGS_PROGRAM@,$EXTRA_LDFLAGS_PROGRAM,;t t
s,@EXTRA_LIBS@,$EXTRA_LIBS,;t t
s,@ZEND_EXTRA_LIBS@,$ZEND_EXTRA_LIBS,;t t
s,@INCLUDES@,$INCLUDES,;t t
s,@EXTRA_INCLUDES@,$EXTRA_INCLUDES,;t t
s,@INSTALL_IT@,$INSTALL_IT,;t t
s,@NATIVE_RPATHS@,$NATIVE_RPATHS,;t t
s,@PEAR_INSTALLDIR@,$PEAR_INSTALLDIR,;t t
s,@PHP_LDFLAGS@,$PHP_LDFLAGS,;t t
s,@PHP_LIBS@,$PHP_LIBS,;t t
s,@PHP_VERSION@,$PHP_VERSION,;t t
s,@SHLIB_SUFFIX_NAME@,$SHLIB_SUFFIX_NAME,;t t
s,@ECHO@,$ECHO,;t t
s,@STRIP@,$STRIP,;t t
s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
s,@LIBTOOL@,$LIBTOOL,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF

_ACEOF

  cat >>$CONFIG_STATUS <<\_ACEOF
  # Split the substitutions into bite-sized pieces for seds with
  # small command number limits, like on Digital OSF/1 and HP-UX.
  ac_max_sed_lines=48
  ac_sed_frag=1 # Number of current file.
  ac_beg=1 # First line for current file.
  ac_end=$ac_max_sed_lines # Line after last line for current file.
  ac_more_lines=:
  ac_sed_cmds=
  while $ac_more_lines; do
    if test $ac_beg -gt 1; then
      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
    else
      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
    fi
    if test ! -s $tmp/subs.frag; then
      ac_more_lines=false
    else
      # The purpose of the label and of the branching condition is to
      # speed up the sed processing (if there are no `@' at all, there
      # is no need to browse any of the substitutions).
      # These are the two extra sed commands mentioned above.
      (echo ':t
  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
      if test -z "$ac_sed_cmds"; then
	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
      else
	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
      fi
      ac_sed_frag=`expr $ac_sed_frag + 1`
      ac_beg=$ac_end
      ac_end=`expr $ac_end + $ac_max_sed_lines`
    fi
  done
  if test -z "$ac_sed_cmds"; then
    ac_sed_cmds=cat
  fi
fi # test -n "$CONFIG_FILES"

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case $ac_file in
  - | *:- | *:-:* ) # input from stdin
	cat >$tmp/stdin
	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  * )   ac_file_in=$ac_file.in ;;
  esac

  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
  { if $as_mkdir_p; then
    mkdir -p "$ac_dir"
  else
    as_dir="$ac_dir"
    as_dirs=
    while test ! -d "$as_dir"; do
      as_dirs="$as_dir $as_dirs"
      as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
    done
    test ! -n "$as_dirs" || mkdir $as_dirs
  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }; }

  ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac

# Do not use `cd foo && pwd` to compute absolute paths, because
# the directories may not exist.
case `pwd` in
.) ac_abs_builddir="$ac_dir";;
*)
  case "$ac_dir" in
  .) ac_abs_builddir=`pwd`;;
  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_builddir=${ac_top_builddir}.;;
*)
  case ${ac_top_builddir}. in
  .) ac_abs_top_builddir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_srcdir=$ac_srcdir;;
*)
  case $ac_srcdir in
  .) ac_abs_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_srcdir=$ac_top_srcdir;;
*)
  case $ac_top_srcdir in
  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  esac;;
esac



  if test x"$ac_file" != x-; then
    { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
    rm -f "$ac_file"
  fi
  # Let's still pretend it is `configure' which instantiates (i.e., don't
  # use $as_me), people would be surprised to read:
  #    /* config.h.  Generated by config.status.  */
  if test x"$ac_file" = x-; then
    configure_input=
  else
    configure_input="$ac_file.  "
  fi
  configure_input=$configure_input"Generated from `echo $ac_file_in |
				     sed 's,.*/,,'` by configure."

  # First look for the input files in the build tree, otherwise in the
  # src tree.
  ac_file_inputs=`IFS=:
    for f in $ac_file_in; do
      case $f in
      -) echo $tmp/stdin ;;
      [\\/$]*)
	 # Absolute (can't be DOS-style, as IFS=:)
	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 echo "$f";;
      *) # Relative
	 if test -f "$f"; then
	   # Build tree
	   echo "$f"
	 elif test -f "$srcdir/$f"; then
	   # Source tree
	   echo "$srcdir/$f"
	 else
	   # /dev/null tree
	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 fi;;
      esac
    done` || { (exit 1); exit 1; }
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
  sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s,@configure_input@,$configure_input,;t t
s,@srcdir@,$ac_srcdir,;t t
s,@abs_srcdir@,$ac_abs_srcdir,;t t
s,@top_srcdir@,$ac_top_srcdir,;t t
s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
s,@builddir@,$ac_builddir,;t t
s,@abs_builddir@,$ac_abs_builddir,;t t
s,@top_builddir@,$ac_top_builddir,;t t
s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
  rm -f $tmp/stdin
  if test x"$ac_file" != x-; then
    mv $tmp/out $ac_file
  else
    cat $tmp/out
    rm -f $tmp/out
  fi

done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF

#
# CONFIG_HEADER section.
#

# 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=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'

for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case $ac_file in
  - | *:- | *:-:* ) # input from stdin
	cat >$tmp/stdin
	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  * )   ac_file_in=$ac_file.in ;;
  esac

  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}

  # First look for the input files in the build tree, otherwise in the
  # src tree.
  ac_file_inputs=`IFS=:
    for f in $ac_file_in; do
      case $f in
      -) echo $tmp/stdin ;;
      [\\/$]*)
	 # Absolute (can't be DOS-style, as IFS=:)
	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 # Do quote $f, to prevent DOS paths from being IFS'd.
	 echo "$f";;
      *) # Relative
	 if test -f "$f"; then
	   # Build tree
	   echo "$f"
	 elif test -f "$srcdir/$f"; then
	   # Source tree
	   echo "$srcdir/$f"
	 else
	   # /dev/null tree
	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
	 fi;;
      esac
    done` || { (exit 1); exit 1; }
  # Remove the trailing spaces.
  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in

_ACEOF

# Transform confdefs.h into two sed scripts, `conftest.defines' and
# `conftest.undefs', that substitutes the proper values into
# config.h.in to produce config.h.  The first handles `#define'
# templates, and the second `#undef' templates.
# 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.defines conftest.undefs
# Using a here document instead of a string reduces the quoting nightmare.
# Putting comments in sed scripts is not portable.
#
# `end' is used to avoid that the second main sed command (meant for
# 0-ary CPP macros) applies to n-ary macro definitions.
# See the Autoconf documentation for `clear'.
cat >confdef2sed.sed <<\_ACEOF
s/[\\&,]/\\&/g
s,[\\$`],\\&,g
t clear
: clear
s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
_ACEOF
# If some macros were called several times there might be several times
# the same #defines, which is useless.  Nevertheless, we may not want to
# sort them, since we want the *last* AC-DEFINE to be honored.
uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
rm -f confdef2sed.sed

# 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.undefs <<\_ACEOF
s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
_ACEOF

# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo '  :' >>$CONFIG_STATUS
rm -f conftest.tail
while grep . conftest.defines >/dev/null
do
  # Write a limited-size here document to $tmp/defines.sed.
  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
  # Speed up: don't consider the non `#define' lines.
  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
  # Work around the forget-to-reset-the-flag bug.
  echo 't clr' >>$CONFIG_STATUS
  echo ': clr' >>$CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
  echo 'CEOF
  sed -f $tmp/defines.sed $tmp/in >$tmp/out
  rm -f $tmp/in
  mv $tmp/out $tmp/in
' >>$CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
  rm -f conftest.defines
  mv conftest.tail conftest.defines
done
rm -f conftest.defines
echo '  fi # grep' >>$CONFIG_STATUS
echo >>$CONFIG_STATUS

# Break up conftest.undefs because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
while grep . conftest.undefs >/dev/null
do
  # Write a limited-size here document to $tmp/undefs.sed.
  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
  # Speed up: don't consider the non `#undef'
  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
  # Work around the forget-to-reset-the-flag bug.
  echo 't clr' >>$CONFIG_STATUS
  echo ': clr' >>$CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
  echo 'CEOF
  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
  rm -f $tmp/in
  mv $tmp/out $tmp/in
' >>$CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
  rm -f conftest.undefs
  mv conftest.tail conftest.undefs
done
rm -f conftest.undefs

cat >>$CONFIG_STATUS <<\_ACEOF
  # Let's still pretend it is `configure' which instantiates (i.e., don't
  # use $as_me), people would be surprised to read:
  #    /* config.h.  Generated by config.status.  */
  if test x"$ac_file" = x-; then
    echo "/* Generated by configure.  */" >$tmp/config.h
  else
    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
  fi
  cat $tmp/in >>$tmp/config.h
  rm -f $tmp/in
  if test x"$ac_file" != x-; then
    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
    else
      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_file" : 'X\(//\)[^/]' \| \
	 X"$ac_file" : 'X\(//\)$' \| \
	 X"$ac_file" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
      { if $as_mkdir_p; then
    mkdir -p "$ac_dir"
  else
    as_dir="$ac_dir"
    as_dirs=
    while test ! -d "$as_dir"; do
      as_dirs="$as_dir $as_dirs"
      as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
    done
    test ! -n "$as_dirs" || mkdir $as_dirs
  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }; }

      rm -f $ac_file
      mv $tmp/config.h $ac_file
    fi
  else
    cat $tmp/config.h
    rm -f $tmp/config.h
  fi
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF

#
# CONFIG_COMMANDS section.
#
for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$ac_dest" : 'X\(//\)[^/]' \| \
	 X"$ac_dest" : 'X\(//\)$' \| \
	 X"$ac_dest" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$ac_dest" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
  { if $as_mkdir_p; then
    mkdir -p "$ac_dir"
  else
    as_dir="$ac_dir"
    as_dirs=
    while test ! -d "$as_dir"; do
      as_dirs="$as_dir $as_dirs"
      as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
    done
    test ! -n "$as_dirs" || mkdir $as_dirs
  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }; }

  ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac

# Do not use `cd foo && pwd` to compute absolute paths, because
# the directories may not exist.
case `pwd` in
.) ac_abs_builddir="$ac_dir";;
*)
  case "$ac_dir" in
  .) ac_abs_builddir=`pwd`;;
  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_builddir=${ac_top_builddir}.;;
*)
  case ${ac_top_builddir}. in
  .) ac_abs_top_builddir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_srcdir=$ac_srcdir;;
*)
  case $ac_srcdir in
  .) ac_abs_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  esac;;
esac
case $ac_abs_builddir in
.) ac_abs_top_srcdir=$ac_top_srcdir;;
*)
  case $ac_top_srcdir in
  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  esac;;
esac


  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
done
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF

{ (exit 0); exit 0; }
_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  ac_config_status_args=
  test "$silent" = yes &&
    ac_config_status_args="$ac_config_status_args --quiet"
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || { (exit 1); exit 1; }
fi


