#! /bin/sh







#  +----------------------------------------------------------------------+
#  | PHP version 4.0                                                      |
#  +----------------------------------------------------------------------+
#  | Copyright (c) 1997-2001 The PHP Group                                |
#  +----------------------------------------------------------------------+
#  | This source file is subject to version 2.02 of the PHP license,      |
#  | that is bundled with this package in the file LICENSE, and is        |
#  | available at through the world-wide-web at                           |
#  | http://www.php.net/license/2_02.txt.                                 |
#  | If you did not receive a copy of the PHP license and are unable to   |
#  | obtain it through the world-wide-web, please send a note to          |
#  | license@php.net so we can mail you a copy immediately.               |
#  +----------------------------------------------------------------------+
#  | Authors: Sascha Schumann <sascha@schumann.cx>                        |
#  +----------------------------------------------------------------------+
#
# $Id: dynlib.m4,v 1.6 2001/02/26 06:06:47 andi Exp $ 
#















    





	

























 























































  








































# Do all the work for Automake.  This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.

# serial 1




#
# Check to make sure that the build environment is sane.
#





# Like AC_CONFIG_HEADER, but automatically create stamp file.



# Add --enable-maintainer-mode option to configure.
# From Jim Meyering

# serial 1



# Define a conditional.




# serial 1

# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so.  This macro tries various
# options that select ANSI C on some system or another.  It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac



# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-

# serial 46 AC_PROG_LIBTOOL





# AC_LIBTOOL_HEADER_ASSERT
# ------------------------
# AC_LIBTOOL_HEADER_ASSERT

# _LT_AC_CHECK_DLFCN
# --------------------
# _LT_AC_CHECK_DLFCN

# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
# ---------------------------------
 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE

# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
# ---------------------------------
# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR

# _LT_AC_PROG_ECHO_BACKSLASH
# --------------------------
# Add some code to the start of the generated configure script which
# will find an echo command which doesn't interpret backslashes.
# _LT_AC_PROG_ECHO_BACKSLASH

# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
# ------------------------------------------------------------------
# _LT_AC_TRY_DLOPEN_SELF

# AC_LIBTOOL_DLOPEN_SELF
# -------------------
# AC_LIBTOOL_DLOPEN_SELF

# _LT_AC_LTCONFIG_HACK

# AC_LIBTOOL_DLOPEN - enable checks for dlopen support


# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's


# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `yes'.


# AC_DISABLE_SHARED - set the default shared flag to --disable-shared


# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `yes'.


# AC_DISABLE_STATIC - set the default static flag to --disable-static



# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `yes'.


# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install


# AC_LIBTOOL_PICMODE - implement the --with-pic flag
# Usage: AC_LIBTOOL_PICMODE[(MODE)]
#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
#   `both'.



# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library



# AC_PATH_MAGIC - find a file program which can recognise a shared library



# AC_PROG_LD - find the path to the GNU or non-GNU linker


# AC_PROG_LD_GNU -


# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
#   -- PORTME Some linkers may need a different reload flag.


# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
#  -- PORTME fill in with the dynamic library characteristics



# AC_PROG_NM - find the path to a BSD-compatible name lister


# AC_CHECK_LIBM - check for math library


# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library and INCLTDL to the include flags for
# the libltdl header and adds --enable-ltdl-convenience to the
# configure arguments.  Note that LIBLTDL and INCLTDL are not
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
# with '${top_builddir}/' and INCLTDL will be prefixed with
# '${top_srcdir}/' (note the single quotes!).  If your package is not
# flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.


# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library and INCLTDL to the include flags for
# the libltdl header and adds --enable-ltdl-install to the configure
# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
# with '${top_srcdir}/' (note the single quotes!).  If your package is
# not flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.


# old names








# This is just to silence aclocal about the macro not being used


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

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --enable-maintainer-mode enable make rules and dependencies not useful
                          (and sometimes confusing) to the casual installer"
ac_help="$ac_help
  --with-aolserver=DIR    Specify path to the installed AOLserver"
ac_help="$ac_help
  --with-apxs[=FILE]      Build shared Apache module. FILE is the optional
                          pathname to the Apache apxs tool; defaults to "apxs"."
ac_help="$ac_help
  --with-apache[=DIR]     Build Apache module. DIR is the top-level Apache
                          build directory, defaults to /usr/local/apache."
ac_help="$ac_help
  --with-mod_charset      Enable transfer tables for mod_charset (Rus Apache)."
ac_help="$ac_help
  --with-apxs2[=FILE]     Build shared Apache 2.0 module. FILE is the optional
                          pathname to the Apache apxs tool; defaults to "apxs"."
ac_help="$ac_help
  --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."
ac_help="$ac_help
  --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. "
ac_help="$ac_help
  --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. "
ac_help="$ac_help
  --with-fhttpd[=DIR]     Build fhttpd module.  DIR is the fhttpd sources
                          directory, defaults to /usr/local/src/fhttpd."
ac_help="$ac_help
  --with-fastcgi=SRCDIR   Build PHP as FastCGI application"
ac_help="$ac_help
  --with-isapi=DIR        Build PHP as an ISAPI module for use with Zeus."
ac_help="$ac_help
  --with-nsapi=DIR        Specify path to the installed Netscape"
ac_help="$ac_help
  --with-phttpd=DIR"
ac_help="$ac_help
  --with-pi3web=DIR       Build PHP as a module for use with Pi3Web."
ac_help="$ac_help
  --with-roxen=DIR        Build PHP as a Pike module. DIR is the base Roxen
                          directory, normally /usr/local/roxen/server."
ac_help="$ac_help
  --enable-roxen-zts      Build the Roxen module using Zend Thread Safety."
ac_help="$ac_help
  --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."
ac_help="$ac_help
  --with-thttpd=SRCDIR    Build PHP as thttpd module"
ac_help="$ac_help
  --with-tux=MODULEDIR    Build PHP as a TUX module (Linux only)"
ac_help="$ac_help
  --enable-debug          Compile with debugging symbols."
ac_help="$ac_help
  --with-layout=TYPE      Sets how installed files will be laid out.  Type is
                          one of "PHP" (default) or "GNU""
ac_help="$ac_help
  --with-config-file-path=PATH  
                          Sets the path in which to look for php.ini,
                          defaults to PREFIX/lib"
ac_help="$ac_help
  --with-pear=DIR         Install PEAR in DIR (default PREFIX/lib/php)
  --without-pear          Do not install PEAR"
ac_help="$ac_help
  --enable-safe-mode      Enable safe mode by default."
ac_help="$ac_help
  --with-exec-dir[=DIR]   Only allow executables in DIR when in safe mode
                          defaults to /usr/local/php/bin"
ac_help="$ac_help
  --with-openssl[=DIR]    Include OpenSSL support (requires OpenSSL >= 0.9.5) "
ac_help="$ac_help
  --enable-sigchild       Enable PHP's own SIGCHLD handler."
ac_help="$ac_help
  --enable-magic-quotes   Enable magic quotes by default."
ac_help="$ac_help
  --disable-rpath         Disable passing additional runtime library
                          search paths"
ac_help="$ac_help
  --enable-libgcc         Enable explicitly linking against libgcc"
ac_help="$ac_help
  --disable-short-tags    Disable the short-form <? start tag by default."
ac_help="$ac_help
  --enable-dmalloc        Enable dmalloc"
ac_help="$ac_help
  --enable-php-streams    Include experimental php streams.
                          Do not use unless you are testing the code!"
ac_help="$ac_help
  --with-zlib-dir=<DIR>   Define the location of zlib install directory"
ac_help="$ac_help
  --with-zlib[=DIR]       Include zlib support (requires zlib >= 1.0.9).
                          DIR is the zlib install directory."
ac_help="$ac_help
  --with-aspell[=DIR]     Include ASPELL support."
ac_help="$ac_help
  --enable-bcmath         Enable bc style precision math functions."
ac_help="$ac_help
  --with-bz2[=DIR]        Include BZip2 support"
ac_help="$ac_help
  --enable-calendar       Enable support for calendar conversion"
ac_help="$ac_help
  --with-ccvs[=DIR]       Include CCVS support"
ac_help="$ac_help
  --with-cpdflib[=DIR]    Include cpdflib support (requires cpdflib >= 2).
                          DIR is the cpdfllib install directory,
                          defaults to /usr."
ac_help="$ac_help
  --with-jpeg-dir[=DIR]   jpeg dir for cpdflib 2.x"
ac_help="$ac_help
  --with-tiff-dir[=DIR]   tiff dir for cpdflib 2.x"
ac_help="$ac_help
  --with-crack[=DIR]      Include crack support."
ac_help="$ac_help
  --enable-ctype          Enable ctype support"
ac_help="$ac_help
  --with-curl[=DIR]       Include CURL support"
ac_help="$ac_help
  --with-cybercash[=DIR]  Include CyberCash support.  DIR is the CyberCash MCK 
                          install directory."
ac_help="$ac_help
  --with-cybermut[=DIR]   Include CyberMut (french Credit Mutuel telepaiement)"
ac_help="$ac_help
  --with-cyrus             Include cyrus imap support"
ac_help="$ac_help
  --with-db               Include old xDBM support (deprecated)"
ac_help="$ac_help
  --enable-dba=shared     Build DBA as a shared module"
ac_help="$ac_help
  --with-gdbm[=DIR]       Include GDBM support"
ac_help="$ac_help
  --with-ndbm[=DIR]       Include NDBM support"
ac_help="$ac_help
  --with-db2[=DIR]        Include Berkeley DB2 support"
ac_help="$ac_help
  --with-db3[=DIR]        Include Berkeley DB3 support"
ac_help="$ac_help
  --with-dbm[=DIR]        Include DBM support"
ac_help="$ac_help
  --with-cdb[=DIR]        Include CDB support"
ac_help="$ac_help
"
ac_help="$ac_help
  --enable-dbase          Enable the bundled dbase library"
ac_help="$ac_help
  --with-dbplus             Include dbplus support"
ac_help="$ac_help
  --enable-dbx            Enable dbx"
ac_help="$ac_help
  --with-dom[=DIR]        Include DOM support (requires libxml >= 2.4.2).
                          DIR is the libxml install directory,
                          defaults to /usr."
ac_help="$ac_help
  --enable-exif           Enable exif support"
ac_help="$ac_help
  --with-fbsql[=DIR]      Include FrontBase support. DIR is the FrontBase base
                          directory."
ac_help="$ac_help
  --with-fdftk[=DIR]      Include fdftk support"
ac_help="$ac_help
"
ac_help="$ac_help
  --enable-filepro        Enable the bundled read-only filePro support"
ac_help="$ac_help
  --with-fribidi[=DIR]    Include fribidi support (requires FriBidi >=0.1.12).
                          DIR is the fribidi installation directory - 
                          default /usr/local/"
ac_help="$ac_help
  --enable-ftp            Enable FTP support"
ac_help="$ac_help
  --with-gd[=DIR]         Include GD support (DIR is GD's install dir).
                          Set DIR to "shared" to build as a dl, or 
                          "shared,DIR" to build as a dl and still specify DIR."
ac_help="$ac_help
  --enable-gd-native-ttf    GD: Enable TrueType string function in gd"
ac_help="$ac_help
  --with-jpeg-dir=DIR       GD: Set the path to libjpeg install prefix."
ac_help="$ac_help
  --with-png-dir=DIR        GD: Set the path to libpng install prefix."
ac_help="$ac_help
  --with-xpm-dir=DIR        GD: Set the path to libXpm install prefix."
ac_help="$ac_help
  --with-freetype-dir=DIR   GD: Set the path to freetype2 install prefix."
ac_help="$ac_help
  --with-ttf[=DIR]          GD: Include FreeType 1.x support"
ac_help="$ac_help
  --with-t1lib[=DIR]        GD: Include T1lib support."
ac_help="$ac_help
  --with-gettext[=DIR]    Include GNU gettext support.  DIR is the gettext
                          install directory, defaults to /usr/local"
ac_help="$ac_help
  --with-gmp              Include gmp support"
ac_help="$ac_help
  --with-hyperwave        Include Hyperwave support"
ac_help="$ac_help
  --with-icap[=DIR]       Include ICAP support."
ac_help="$ac_help
  --with-iconv[=DIR]      Include iconv support"
ac_help="$ac_help
  --with-imap[=DIR]       Include IMAP support. DIR is the c-client install prefix."
ac_help="$ac_help
  --with-kerberos[=DIR]     IMAP: Include Kerberos support. DIR is the Kerberos install dir."
ac_help="$ac_help
  --with-imap-ssl[=DIR]     IMAP: Include SSL support. DIR is the OpenSSL install dir."
ac_help="$ac_help
  --with-informix[=DIR]   Include Informix support.  DIR is the Informix base
                          install directory, defaults to ${INFORMIXDIR:-nothing}."
ac_help="$ac_help
  --with-ingres[=DIR]     Include Ingres II support. DIR is the Ingres
                          base directory (default $II_SYSTEM/II/ingres)"
ac_help="$ac_help
  --with-interbase[=DIR]  Include InterBase support.  DIR is the InterBase base
                          install directory, defaults to /usr/interbase"
ac_help="$ac_help
  --with-ircg-config      Path to the ircg-config script"
ac_help="$ac_help
  --with-ircg             Include ircg support"
ac_help="$ac_help
  --with-java[=DIR]       Include Java support. DIR is the base install
                          directory for the JDK.  This extension can only
                          be built as a shared dl."
ac_help="$ac_help
  --with-ldap[=DIR]       Include LDAP support.  DIR is the LDAP base 
                          install directory."
ac_help="$ac_help
  --enable-mailparse           Enable mailparse support"
ac_help="$ac_help
  --enable-mbstring       Enable multibyte string support"
ac_help="$ac_help
  --enable-mbstr-enc-trans   Enable japanese encoding translation"
ac_help="$ac_help
  --with-mcal[=DIR]       Include MCAL support."
ac_help="$ac_help
  --with-mcrypt[=DIR]     Include mcrypt support. DIR is the mcrypt install 
                          directory."
ac_help="$ac_help
  --with-mhash[=DIR]      Include mhash support.  DIR is the mhash
                          install directory."
ac_help="$ac_help
  --with-ming[=DIR]       Include ming support"
ac_help="$ac_help
  --with-mnogosearch[=DIR]
                          Include mnoGoSearch support.  DIR is the mnoGoSearch 
                          base install directory, defaults to 
                          /usr/local/mnogosearch."
ac_help="$ac_help
  --with-msql[=DIR]       Include mSQL support.  DIR is the mSQL base
                          install directory, defaults to /usr/local/Hughes."
ac_help="$ac_help
  --with-muscat[=DIR]     Include muscat support."
ac_help="$ac_help
  --with-mysql[=DIR]      Include MySQL support. DIR is the MySQL base
                          directory. If unspecified, the bundled MySQL library
                          will be used."
ac_help="$ac_help
  --with-ncurses             Include ncurses support"
ac_help="$ac_help
  --with-oci8[=DIR]       Include Oracle-oci8 support. Default DIR is 
                          ORACLE_HOME."
ac_help="$ac_help
  --with-adabas[=DIR]     Include Adabas D support.  DIR is the Adabas base
                          install directory, defaults to /usr/local."
ac_help="$ac_help
  --with-sapdb[=DIR]      Include SAP DB support.  DIR is SAP DB base
                          install directory, defaults to /usr/local."
ac_help="$ac_help
  --with-solid[=DIR]      Include Solid support.  DIR is the Solid base
                          install directory, defaults to /usr/local/solid"
ac_help="$ac_help
  --with-ibm-db2[=DIR]    Include IBM DB2 support.  DIR is the DB2 base
                          install directory, defaults to /home/db2inst1/sqllib"
ac_help="$ac_help
  --with-empress[=DIR]    Include Empress support.  DIR is the Empress base
                          install directory, defaults to \$EMPRESSPATH.
                          From PHP4, this option only supports Empress Version
                          8.60 and above"
ac_help="$ac_help
  --with-empress-bcs[=DIR]
                          Include Empress Local Access support.  DIR is the 
                          Empress base install directory, defaults to 
                          \$EMPRESSPATH.  From PHP4, this option only supports
                          Empress Version 8.60 and above."
ac_help="$ac_help
  --with-velocis[=DIR]    Include Velocis support.  DIR is the Velocis base
                          install directory, defaults to /usr/local/velocis."
ac_help="$ac_help
  --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\"."
ac_help="$ac_help
  --with-iodbc[=DIR]      Include iODBC support.  DIR is the iODBC base
                          install directory, defaults to /usr/local."
ac_help="$ac_help
  --with-esoob[=DIR]      Include Easysoft OOB support. DIR is the OOB base
                          install directory,
                          defaults to /usr/local/easysoft/oob/client."
ac_help="$ac_help
  --with-unixODBC[=DIR]   Include unixODBC support.  DIR is the unixODBC base
                          install directory, defaults to /usr/local."
ac_help="$ac_help
  --with-openlink[=DIR]   Include OpenLink ODBC support.  DIR is the
                          OpenLink base install directory, defaults to
                          /usr/local.  This is the same as iODBC."
ac_help="$ac_help
  --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)."
ac_help="$ac_help
  --with-oracle[=DIR]     Include Oracle-oci7 support.  Default DIR is 
                          ORACLE_HOME."
ac_help="$ac_help
  --with-ovrimos[=DIR]    Include Ovrimos SQL Server support. DIR is the
                          Ovrimos' libsqlcli install directory."
ac_help="$ac_help
  --enable-pcntl           Enable experimental pcntl support (CGI ONLY!)"
ac_help="$ac_help
  --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."
ac_help="$ac_help
  --with-pdflib[=DIR]     Include PDFlib support. DIR is the pdflib
                          base install directory, defaults to /usr/local
                          Set DIR to "shared" to build as dl, or "shared,DIR"
                          to build as dl and still specify DIR."
ac_help="$ac_help
  --with-jpeg-dir[=DIR]     PDFLIB: define libjpeg install directory"
ac_help="$ac_help
  --with-png-dir[=DIR]      PDFLIB: define libpng install directory"
ac_help="$ac_help
  --with-tiff-dir[=DIR]     PDFLIB: define libtiff install directory"
ac_help="$ac_help
  --with-pfpro[=DIR]      Include Verisign Payflow Pro support"
ac_help="$ac_help
  --with-pgsql[=DIR]      Include PostgreSQL support.  DIR is the PostgreSQL
                          base install directory, defaults to /usr/local/pgsql.
                          Set DIR to "shared" to build as a dl, or "shared,DIR" 
                          to build as a dl and still specify DIR."
ac_help="$ac_help
  --disable-posix         Disable POSIX-like functions"
ac_help="$ac_help
  --with-pspell[=DIR]     Include PSPELL support."
ac_help="$ac_help
  --with-qtdom            Include QtDOM support (requires Qt >= 2.2.0)."
ac_help="$ac_help
  --with-libedit[=DIR]    Include libedit readline replacement."
ac_help="$ac_help
  --with-readline[=DIR]   Include readline support.  DIR is the readline
                          install directory."
ac_help="$ac_help
  --with-recode[=DIR]     Include recode support. DIR is the recode install
                          directory."
ac_help="$ac_help
  --with-satellite[=DIR]  Enable CORBA support via Satellite (EXPERIMENTIAL)
                          DIR is the base directory for ORBit"
ac_help="$ac_help
  --with-mm[=DIR]         Include mm support for session storage"
ac_help="$ac_help
  --enable-trans-sid      Enable transparent session id propagation"
ac_help="$ac_help
  --disable-session       Disable session support"
ac_help="$ac_help
  --enable-shmop          Enable shmop support"
ac_help="$ac_help
  --with-snmp[=DIR]       Include SNMP support.  DIR is the SNMP base
                          install directory, defaults to searching through
                          a number of common locations for the snmp install.
                          Set DIR to "shared" to build as a dl, or "shared,DIR"
                          to build as a dl and still specify DIR."
ac_help="$ac_help
  --enable-ucd-snmp-hack  Enable UCD SNMP hack"
ac_help="$ac_help
  --enable-sockets        Enable sockets support"
ac_help="$ac_help
  --with-regex=TYPE       regex library type: system, apache, php"
ac_help="$ac_help
  --with-system-regex     (deprecated) Use system regex library"
ac_help="$ac_help
  --with-swf[=DIR]        Include swf support"
ac_help="$ac_help
  --with-sybase[=DIR]     Include Sybase-DB support.  DIR is the Sybase home
                          directory, defaults to /home/sybase."
ac_help="$ac_help
  --with-sybase-ct[=DIR]  Include Sybase-CT support.  DIR is the Sybase home
                          directory. Defaults to /home/sybase."
ac_help="$ac_help
  --enable-sysvsem        Enable System V semaphore support."
ac_help="$ac_help
  --enable-sysvshm        Enable the System V shared memory support"
ac_help="$ac_help
  --with-vpopmail[=DIR]   Include vpopmail support."
ac_help="$ac_help
  --enable-wddx           Enable WDDX support"
ac_help="$ac_help
"
ac_help="$ac_help
  --disable-xml           Disable XML support using bundled expat lib"
ac_help="$ac_help
  --with-expat-dir=DIR    XML: external libexpat install dir"
ac_help="$ac_help
  --with-xmlrpc[=DIR]     Include XMLRPC-EPI support"
ac_help="$ac_help
  --with-expat-dir=DIR    XMLRPC-EPI: libexpat dir for XMLRPC-EPI"
ac_help="$ac_help
  --enable-xslt           Enable xslt support"
ac_help="$ac_help
  --with-xslt-sablot      XSLT: Enable the sablotron backend"
ac_help="$ac_help
  --with-expat-dir=DIR    Sablotron: libexpat dir for Sablotron 0.50"
ac_help="$ac_help
  --with-yaz[=DIR]        Include YAZ support (ANSI/NISO Z39.50). DIR is
                          the YAZ bin install directory"
ac_help="$ac_help
  --enable-yp             Include YP support"
ac_help="$ac_help
  --with-zip[=DIR]    Include zip support (requires zziplib >= 0.10.6).
                          DIR is the zziplib install directory,
                          default is /usr/local."
ac_help="$ac_help
  --enable-versioning     Export only required symbols.
                          See INSTALL for more information"
ac_help="$ac_help
  --enable-experimental-zts   This will most likely break your build"
ac_help="$ac_help
  --enable-inline-optimization   If you have much memory and are using
                                 gcc, you might try this."
ac_help="$ac_help
  --enable-memory-limit   Compile with memory limit support. "
ac_help="$ac_help
  --with-tsrm-pth[=pth-config]    Use GNU Pth."
ac_help="$ac_help
  --with-tsrm-st"
ac_help="$ac_help
  --with-tsrm-pthreads    Use POSIX threads (default)"
ac_help="$ac_help
  --enable-shared[=PKGS]  build shared libraries [default=yes]"
ac_help="$ac_help
  --enable-static[=PKGS]  build static libraries [default=yes]"
ac_help="$ac_help
  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
ac_help="$ac_help
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"

# 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


ac_help="$ac_help
  --disable-libtool-lock  avoid locking (might break parallel builds)"
ac_help="$ac_help
  --with-pic              try to use only PIC/non-PIC objects [default=use both]"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

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

ac_prev=
for ac_option
do

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

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

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

  case "$ac_option" in

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

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

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

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

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

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

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

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

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

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

  esac
done

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

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

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

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

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

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

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

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

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

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

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






  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile"


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

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

cwd=`pwd`


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

EOF

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

  for arg in $0 "$@"; do
    echo "'$arg' \\" >> config.nice
  done
  echo '"$@"' >> config.nice
  chmod +x config.nice


for arg in $0 "$@"; do
  CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
done

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


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





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

# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1598: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

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

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

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

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

echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:1651: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" 1>&2; exit 1; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
  program_transform_name=
else
  # Double any \ or $.  echo might interpret backslashes.
  cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  rm -f conftestsed
fi
test "$program_prefix" != NONE &&
  program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"

# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1708: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi


PACKAGE=php

VERSION=4.1.2

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi



missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:1747: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal
   echo "$ac_t""found" 1>&6
else
   ACLOCAL="$missing_dir/missing aclocal"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:1760: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$ac_t""found" 1>&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:1773: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake
   echo "$ac_t""found" 1>&6
else
   AUTOMAKE="$missing_dir/missing automake"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:1786: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$ac_t""found" 1>&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:1799: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$ac_t""found" 1>&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$ac_t""missing" 1>&6
fi



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_VERSION \"$PHP_VERSION\"" >> php_version.h.new
cmp php_version.h.new php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
    rm -f php_version.h && mv php_version.h.new php_version.h && \
    echo 'Updated php_version.h'
else
	rm -f php_version.h.new
fi




echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
echo "configure:1829: checking whether to enable maintainer-specific portions of Makefiles" >&5
    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
  enableval="$enable_maintainer_mode"
  USE_MAINTAINER_MODE=$enableval
else
  USE_MAINTAINER_MODE=no
fi

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

if test $USE_MAINTAINER_MODE = yes; then
  MAINTAINER_MODE_TRUE=
  MAINTAINER_MODE_FALSE='#'
else
  MAINTAINER_MODE_TRUE='#'
  MAINTAINER_MODE_FALSE=
fi
  MAINT=$MAINTAINER_MODE_TRUE
  


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

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

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

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


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

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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1886: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AWK="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AWK="$ac_cv_prog_AWK"
if test -n "$AWK"; then
  echo "$ac_t""$AWK" 1>&6
else
  echo "$ac_t""no" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1920: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_YACC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
YACC="$ac_cv_prog_YACC"
if test -n "$YACC"; then
  echo "$ac_t""$YACC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

if test "$YACC" != "bison -y"; then
    echo "configure: warning: You will need bison if you want to regenerate the PHP parsers." 1>&2
else
    echo $ac_n "checking bison version""... $ac_c" 1>&6
echo "configure:1954: checking bison version" >&5
    oldIFS=$IFS; IFS=.
    set `bison -V | sed -e 's/^GNU Bison version //'`
    IFS=$oldIFS
    if test "$1" = "1" -a "$2" -lt "25"; then
        echo "configure: warning: Bison 1.25 or newer needed to regenerate parsers (found $1.$2)." 1>&2
    fi
    echo "$ac_t""$1.$2 (ok)" 1>&6
fi

# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1967: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1997: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2048: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

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

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

cat > conftest.$ac_ext << EOF

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

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

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

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2127: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

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

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

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:2155: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2187: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 2202 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 2219 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 2236 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:2267: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 2269 "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
#define _ALL_SOURCE 1
EOF

else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*



BSD_MAKEFILE=no

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 -traditional-cpp";;
*bsdi*)
    BSD_MAKEFILE=yes;;
*beos*)
	beos_threads=1
	LIBS="$LIBS -lbe -lroot";;
*mips*)
	CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
esac




echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
echo "configure:2317: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# 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			-Aa -D_HPUX_SOURCE
# SVR4			-Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  cat > conftest.$ac_ext <<EOF
#line 2333 "configure"
#include "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;
}
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; }
EOF
if { (eval echo configure:2370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  am_cv_prog_cc_stdc="$ac_arg"; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
CC="$ac_save_CC"

fi

if test -z "$am_cv_prog_cc_stdc"; then
  echo "$ac_t""none needed" 1>&6
else
  echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
fi
case "x$am_cv_prog_cc_stdc" in
  x|xno) ;;
  *) CC="$CC $am_cv_prog_cc_stdc" ;;
esac


# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2397: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "x$CC" != xcc; then
  echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
echo "configure:2426: checking whether $CC and cc understand -c and -o together" >&5
else
  echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
echo "configure:2429: checking whether cc understands -c and -o together" >&5
fi
set dummy $CC; ac_cc="`echo $2 |
		       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'foo(){}' > conftest.c
# 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-cc} -c conftest.c -o conftest.o 1>&5'
if { (eval echo configure:2441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
   test -f conftest.o && { (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
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.c 1>&5'; { (eval echo configure:2447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
      ac_try='cc -c conftest.c -o conftest.o 1>&5'
      if { (eval echo configure:2449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
	 test -f conftest.o && { (eval echo configure:2450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
      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 "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
  cat >> confdefs.h <<\EOF
#define NO_MINUS_C_MINUS_O 1
EOF

fi

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:2477: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2501: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LEX="flex"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
fi
LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
  echo "$ac_t""$LEX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:2535: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2543 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char yywrap();

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

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

fi

if test -n "$LEX"; then
  echo $ac_n "checking lex output file root""... $ac_c" 1>&6
echo "configure:2578: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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.
echo '%%
%%' | $LEX
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 "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
fi
fi

echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root

echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
echo "configure:2599: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 <<EOF
#line 2611 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {

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

fi

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

fi

fi

echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2642: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2647 "configure"
#include "confdefs.h"

int main() {

/* 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;
}

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

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

fi

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

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



























































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" 
else
  cat > conftest.$ac_ext <<EOF
#line 2797 "configure"
#include "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);
} 
EOF
if { (eval echo configure:2815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"

echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6
echo "configure:2835: checking for pthreads_cflags" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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" 
else
  cat > conftest.$ac_ext <<EOF
#line 2850 "configure"
#include "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);
} 
EOF
if { (eval echo configure:2868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
    CFLAGS="$ac_save"
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_cflags="$flag"
      break
    fi
  done
fi

fi

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

echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6
echo "configure:2897: checking for pthreads_lib" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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" 
else
  cat > conftest.$ac_ext <<EOF
#line 2912 "configure"
#include "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);
} 
EOF
if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
    LIBS="$ac_save"
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_lib="$lib"
      break
    fi
  done
fi

fi

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

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



  
  PHP_VAR_SUBST="$PHP_VAR_SUBST SHLIB_SUFFIX_NAME"

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


PHP_SAPI=cgi

  php_build_target=program

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


  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Configuring SAPI modules${T_ME}" 1>&6




echo $ac_n "checking for AOLserver support""... $ac_c" 1>&6
echo "configure:2994: checking for AOLserver support" >&5
# 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 "$ac_t""$PHP_AOLSERVER" 1>&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 "configure: error: Please specify the path to the source distribution of AOLserver using --with-aolserver-src=DIR" 1>&2; exit 1; }
  fi
  if test ! -d $PHP_AOLSERVER/bin ; then
    { echo "configure: error: Please specify the path to the root of AOLserver using --with-aolserver=DIR" 1>&2; exit 1; }
  fi
  
  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { echo "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; 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 <<\EOF
#define HAVE_AOLSERVER 1
EOF

  PHP_SAPI=aolserver
  
  php_build_target=shared

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




echo $ac_n "checking for Apache module support via DSO through APXS""... $ac_c" 1>&6
echo "configure:3071: checking for Apache module support via DSO through APXS" >&5
# 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 "$ac_t""" 1>&6
    echo "$ac_t""" 1>&6
    echo "$ac_t""Sorry, I was not able to successfully run APXS.  Possible reasons:" 1>&6
    echo "$ac_t""" 1>&6
    echo "$ac_t""1.  Perl is not installed;" 1>&6
    echo "$ac_t""2.  Apache was not compiled with DSO support (--enable-module=so);" 1>&6
    echo "$ac_t""3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs" 1>&6
    echo "$ac_t""The output of $APXS follows" 1>&6
    $APXS
    { echo "configure: error: Aborting" 1>&2; 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`
  for flag in $APXS_CFLAGS; do
    case $flag in
    -D*) CPPFLAGS="$CPPFLAGS $flag";;
    esac
  done
  
  if test "$APXS_INCLUDEDIR" != "/usr/include"; then
    
  if test -z "$APXS_INCLUDEDIR" || echo "$APXS_INCLUDEDIR" | grep '^/' >/dev/null ; then
    ai_p=$APXS_INCLUDEDIR
  else
    
    ep_dir="`echo $APXS_INCLUDEDIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$APXS_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

  PHP_SAPI=apache

  # 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 
    APACHE_INSTALL="\$(mkinstalldirs) \"\$(INSTALL_ROOT)`$APXS -q LIBEXECDIR`\" && $APXS -S LIBEXECDIR=\"\$(INSTALL_ROOT)`$APXS -q LIBEXECDIR`\" -i -a -n php4 $SAPI_SHARED"
  fi

  
  php_build_target=shared

  if test -z "`$APXS -q LD_SHLIB`" || test "`$APXS -q LIBEXECDIR`" = "modules"; then
    PHP_APXS_BROKEN=yes
  fi
  STRONGHOLD=
  cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

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

  echo "$ac_t""yes" 1>&6
  case $host_alias in
  *aix*)
    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
    ;;
  esac

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

fi


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

if test "$PHP_SAPI" != "apache"; then
echo $ac_n "checking for Apache module support""... $ac_c" 1>&6
echo "configure:3194: checking for Apache module support" >&5
# Check whether --with-apache or --without-apache was given.
if test "${with_apache+set}" = set; then
  withval="$with_apache"
  
  if test "$withval" = "yes"; then
    # Apache's default directory
    withval=/usr/local/apache
  fi
  if test "$withval" != "no"; then
    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
      APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
      PHP_LIBS="-L. -lphp3"
      echo "$ac_t""yes - Apache 1.2.x" 1>&6
      STRONGHOLD=
      if test -f $withval/src/ap_config.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

      fi
    # For Apache 2.0.x
    elif test -f $withval/src/include/httpd.h &&
         test -f $withval/src/lib/apr/include/apr_general.h ; then
      APACHE_HAS_REGEX=1
      APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix -I$withval/src/lib/apr/include"
      APACHE_TARGET=$withval/src/modules/php4
      if test ! -d $APACHE_TARGET; then
        mkdir $APACHE_TARGET
      fi
      PHP_SAPI=apache
      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 "$ac_t""yes - Apache 2.0.X" 1>&6
      STRONGHOLD=
      if test -f $withval/src/include/ap_config.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

      fi
      if test -f $withval/src/include/ap_compat.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_COMPAT_H 1
EOF

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { echo "configure: error: Please run Apache\'s configure or src/Configure program once and try again" 1>&2; exit 1; }
        fi
      else
        if test -f $withval/src/include/compat.h; then
          cat >> confdefs.h <<\EOF
#define HAVE_OLD_COMPAT_H 1
EOF

        fi
      fi
    # 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
      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 "$ac_t""yes - Apache 1.3.x" 1>&6
      STRONGHOLD=
      if test -f $withval/src/include/ap_config.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

      fi
      if test -f $withval/src/include/ap_compat.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_COMPAT_H 1
EOF

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { echo "configure: error: Please run Apache\'s configure or src/Configure program once and try again" 1>&2; exit 1; }
        fi
      else
        if test -f $withval/src/include/compat.h; then
          cat >> confdefs.h <<\EOF
#define HAVE_OLD_COMPAT_H 1
EOF

        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
      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 "$ac_t""yes - Apache 1.3.x" 1>&6
      STRONGHOLD=
      if test -f $withval/src/include/ap_config.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

      fi
      if test -f $withval/src/include/ap_compat.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_COMPAT_H 1
EOF

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { echo "configure: error: Please run Apache\'s configure or src/Configure program once and try again" 1>&2; exit 1; }
        fi
      else
        if test -f $withval/src/include/compat.h; then
          cat >> confdefs.h <<\EOF
#define HAVE_OLD_COMPAT_H 1
EOF

        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
      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 "$ac_t""yes - StrongHold" 1>&6
      if test -f $withval/apache/ap_config.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_CONFIG_H 1
EOF

      fi
      if test -f $withval/src/ap_compat.h; then
        cat >> confdefs.h <<\EOF
#define HAVE_AP_COMPAT_H 1
EOF

        if test ! -f $withval/src/include/ap_config_auto.h; then
          { echo "configure: error: Please run Apache\'s configure or src/Configure program once and try again" 1>&2; exit 1; }
        fi
      else
        if test -f $withval/src/compat.h; then
          cat >> confdefs.h <<\EOF
#define HAVE_OLD_COMPAT_H 1
EOF

        fi
      fi
    else
      echo "$ac_t""no" 1>&6
      { echo "configure: error: Invalid Apache directory - unable to find httpd.h under $withval" 1>&2; exit 1; }
    fi
  else
    echo "$ac_t""no" 1>&6
  fi

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

fi


  INCLUDES="$INCLUDES $APACHE_INCLUDE"
fi

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


  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"


echo $ac_n "checking for mod_charset compatibility option""... $ac_c" 1>&6
echo "configure:3413: checking for mod_charset compatibility option" >&5
# Check whether --with-mod_charset or --without-mod_charset was given.
if test "${with_mod_charset+set}" = set; then
  withval="$with_mod_charset"
  
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define USE_TRANSFER_TABLES 1
EOF


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

fi


if test -n "$APACHE_MODULE"; then
  
  if test -n "$GCC"; then
        
  gcc_arg_name=ac_cv_gcc_arg_rdynamic
  echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6
echo "configure:3437: checking whether $CC supports -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$ac_cv_gcc_arg_rdynamic" 1>&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"

  
  php_build_target=static

fi

if test -n "$APACHE_INSTALL"; then
  INSTALL_IT=$APACHE_INSTALL
fi



echo $ac_n "checking for Apache 2.0 module support via DSO through APXS""... $ac_c" 1>&6
echo "configure:3483: checking for Apache 2.0 module support via DSO through APXS" >&5
# 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 "$ac_t""" 1>&6
    echo "$ac_t""" 1>&6
    echo "$ac_t""Sorry, I cannot run apxs.  Possible reasons follow:" 1>&6 
    echo "$ac_t""" 1>&6
    echo "$ac_t""1. Perl is not installed" 1>&6
    echo "$ac_t""2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs" 1>&6
    echo "$ac_t""3. Apache was not built using --enable-so (the apxs usage page is displayed)" 1>&6
    echo "$ac_t""" 1>&6
    echo "$ac_t""The output of $APXS follows:" 1>&6
    $APXS
    { echo "configure: error: Aborting" 1>&2; exit 1; }
  fi 

  APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
  APXS_CFLAGS=`$APXS -q CFLAGS`
  for flag in $APXS_CFLAGS; do
    case $flag in
    -D*) CPPFLAGS="$CPPFLAGS $flag";;
    esac
  done
  
  if test "$APXS_INCLUDEDIR" != "/usr/include"; then
    
  if test -z "$APXS_INCLUDEDIR" || echo "$APXS_INCLUDEDIR" | grep '^/' >/dev/null ; then
    ai_p=$APXS_INCLUDEDIR
  else
    
    ep_dir="`echo $APXS_INCLUDEDIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$APXS_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

  PHP_SAPI=apache2filter
  INSTALL_IT="$APXS -i -a -n php4 $SAPI_LIBTOOL"
  
  php_build_target=shared

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

  echo "$ac_t""yes" 1>&6
  case $host_alias in
  *aix*)
    APXS_SBINDIR=`$APXS -q SBINDIR`
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_SBINDIR/httpd.exp"
    ;;
  esac

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

fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST APXS"




RESULT=no
echo $ac_n "checking for Caudium support""... $ac_c" 1>&6
echo "configure:3595: checking for Caudium support" >&5
# 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 "configure: error: Couldn't find a pike in $withval/bin/" 1>&2; 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 "configure: error: Failed to figure out Pike module and include directories" 1>&2; exit 1; }
		fi
		echo "$ac_t""yes" 1>&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 $ac_n "checking for C includes in $PIKE_C_INCLUDE""... $ac_c" 1>&6
echo "configure:3667: checking for C includes in $PIKE_C_INCLUDE" >&5
		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 "$ac_t""found" 1>&6
		      else
		         echo "$ac_t""version mismatch" 1>&6
		      fi
		   else
			echo "$ac_t""not found" 1>&6
		   fi
	else
		{ echo "configure: error: Caudium PHP4 requires Pike 7.0 or newer" 1>&2; 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 <<\EOF
#define HAVE_CAUDIUM 1
EOF

	PHP_SAPI=caudium
	
  php_build_target=shared

	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 "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; exit 1; }
  fi



fi

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

	



if test "$PHP_SAPI" = "cgi"; then

  
  echo $ac_n "checking whether writing to stdout works""... $ac_c" 1>&6
echo "configure:3765: checking whether writing to stdout works" >&5
if eval "test \"`echo '$''{'ac_cv_write_stdout'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  
      ac_cv_write_stdout=no
    
else
  cat > conftest.$ac_ext <<EOF
#line 3776 "configure"
#include "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));
}
    
EOF
if { (eval echo configure:3794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_write_stdout=yes
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      ac_cv_write_stdout=no
    
fi
rm -fr conftest*
fi

  
fi

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

  fi


  

echo $ac_n "checking whether to force Apache CGI redirect""... $ac_c" 1>&6
echo "configure:3825: checking whether to force Apache CGI redirect" >&5
# 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


case $PHP_FORCE_CGI_REDIRECT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FORCE_CGI_REDIRECT=`echo "$PHP_FORCE_CGI_REDIRECT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FORCE_CGI_REDIRECT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FORCE_CGI_REDIRECT" = "no" && PHP_FORCE_CGI_REDIRECT=yes
fi

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




  if test "$PHP_FORCE_CGI_REDIRECT" = "yes"; then
    REDIRECT=1
  else
    REDIRECT=0
  fi
  cat >> confdefs.h <<EOF
#define FORCE_CGI_REDIRECT $REDIRECT
EOF


  

echo $ac_n "checking whether to discard path_info + path_translated""... $ac_c" 1>&6
echo "configure:3880: checking whether to discard path_info + path_translated" >&5
# 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


case $PHP_DISCARD_PATH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DISCARD_PATH=`echo "$PHP_DISCARD_PATH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DISCARD_PATH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DISCARD_PATH" = "no" && PHP_DISCARD_PATH=yes
fi

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




  if test "$PHP_DISCARD_PATH" = "yes"; then
    DISCARD_PATH=1
  else
    DISCARD_PATH=0
  fi
  cat >> confdefs.h <<EOF
#define DISCARD_PATH $DISCARD_PATH
EOF


fi

if test "$PHP_SAPI" = "cgi" ; then
  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(INSTALL_ROOT)\$(bindir)/$SAPI_CGI"
fi

echo $ac_n "checking for fhttpd module support""... $ac_c" 1>&6
echo "configure:3939: checking for fhttpd module support" >&5
# Check whether --with-fhttpd or --without-fhttpd was given.
if test "${with_fhttpd+set}" = set; then
  withval="$with_fhttpd"
  
    if test "$withval" = "yes"; then
      # fhttpd source directory
      withval=/usr/local/src/fhttpd
    fi
    if test "$withval" != "no"; then
# For fhttpd 0.3.x
      if test -f $withval/servproc.h; then 
        FHTTPD_INCLUDE=-I$withval/
        FHTTPD_LIB=$withval/servproc.o
        FHTTPD_TARGET=$withval/
        
  php_build_target=static

		PHP_SAPI=cgi
        cat >> confdefs.h <<\EOF
#define FHTTPD 1
EOF

        echo "$ac_t""yes - fhttpd 0.3.x" 1>&6
      else
        echo "$ac_t""no" 1>&6
        { echo "configure: error: Invalid fhttpd directory - unable to find servproc.h under $withval" 1>&2; exit 1; }
      fi
    else
      echo "$ac_t""no" 1>&6
    fi

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

fi

INCLUDES="$INCLUDES $FHTTPD_INCLUDE"

  PHP_VAR_SUBST="$PHP_VAR_SUBST FHTTPD_LIB"


  PHP_VAR_SUBST="$PHP_VAR_SUBST FHTTPD_TARGET"


echo $ac_n "checking for FastCGI support""... $ac_c" 1>&6
echo "configure:3986: checking for FastCGI support" >&5
# Check whether --with-fastcgi or --without-fastcgi was given.
if test "${with_fastcgi+set}" = set; then
  withval="$with_fastcgi"
  
  if test "$withval" = "yes"; then
        FASTCGIPATH=/usr/local
  else
        FASTCGIPATH=$withval
  fi
  test -f "$FASTCGIPATH/lib/libfcgi.a" || { echo "configure: error: Unable to find libfcgi.a in $FASTCGIPATH/lib" 1>&2; exit 1; }
  test -f "$FASTCGIPATH/include/fastcgi.h" || { echo "configure: error: Unable to find fastcgi.h in $FASTCGIPATH/include" 1>&2; exit 1; }
  PHP_SAPI=fastcgi
  PHP_LIBS=$FASTCGIPATH/lib/libfcgi.a
  
  if test "$FASTCGIPATH/include" != "/usr/include"; then
    
  if test -z "$FASTCGIPATH/include" || echo "$FASTCGIPATH/include" | grep '^/' >/dev/null ; then
    ai_p=$FASTCGIPATH/include
  else
    
    ep_dir="`echo $FASTCGIPATH/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FASTCGIPATH/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_PROGRAM_LDADD="$EXT_PROGRAM_LDADD $FASTCGIPATH/lib/libfcgi.a"
  INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(bindir)/$SAPI_FASTCGI"
  RESULT=yes
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST FASTCGI_LIBADD"

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_PROGRAM_LDADD"


else
  
  RESULT=no

fi

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


RESULT=no
echo $ac_n "checking for Zeus ISAPI support""... $ac_c" 1>&6
echo "configure:4052: checking for Zeus ISAPI support" >&5
# 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 "configure: error: Unable to find httpext.h in $ZEUSPATH/web/include" 1>&2; exit 1; }
	
  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { echo "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; exit 1; }
  fi

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

	
  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
	
  php_build_target=shared

	INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$ZEUSPATH/web/bin/"
	RESULT=yes

fi

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



echo $ac_n "checking for NSAPI support""... $ac_c" 1>&6
echo "configure:4118: checking for NSAPI support" >&5
# 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 "$ac_t""$PHP_NSAPI" 1>&6

if test "$PHP_NSAPI" != "no"; then
  if test ! -d $PHP_NSAPI/bin ; then
    { echo "configure: error: Please specify the path to the root of your Netscape server using --with-nsapi=DIR" 1>&2; exit 1; }
  fi
  echo $ac_n "checking for NSAPI include files""... $ac_c" 1>&6
echo "configure:4138: checking for NSAPI include files" >&5
  if test -d $PHP_NSAPI/include ; then
    NSAPI_INCLUDE=$PHP_NSAPI/include
    echo "$ac_t""Netscape-Enterprise/3.x style" 1>&6
  elif test -d $PHP_NSAPI/plugins/include ; then
    NSAPI_INCLUDE=$PHP_NSAPI/plugins/include
    echo "$ac_t""iPlanet/4.x style" 1>&6
  else
    { echo "configure: error: Please check you have nsapi.h in either DIR/include or DIR/plugins/include" 1>&2; exit 1; }
  fi
  
  if test "$NSAPI_INCLUDE" != "/usr/include"; then
    
  if test -z "$NSAPI_INCLUDE" || echo "$NSAPI_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$NSAPI_INCLUDE
  else
    
    ep_dir="`echo $NSAPI_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NSAPI_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

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

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

  PHP_SAPI=nsapi
  
  php_build_target=shared

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




RESULT=no
echo $ac_n "checking for PHTTPD support""... $ac_c" 1>&6
echo "configure:4201: checking for PHTTPD support" >&5
# 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 "configure: error: You did not specify a directory" 1>&2; exit 1; }
	fi
	
  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { echo "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; 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 <<\EOF
#define HAVE_PHTTPD 1
EOF

	PHP_SAPI=phttpd
	
  php_build_target=shared

	INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PHTTPD_DIR/modules/"
	RESULT=yes

fi

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




echo $ac_n "checking for Pi3Web Support""... $ac_c" 1>&6
echo "configure:4266: checking for Pi3Web Support" >&5
# Check whether --with-pi3web or --without-pi3web was given.
if test "${with_pi3web+set}" = set; then
  withval="$with_pi3web"
  PHP_PI3WEB=$withval
else
  PHP_PI3WEB=no
fi


case $PHP_PI3WEB in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PI3WEB=`echo "$PHP_PI3WEB"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PI3WEB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PI3WEB" = "no" && PHP_PI3WEB=yes
fi

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




if test "$PHP_PI3WEB" != "no"; then
	if test "$PHP_PI3WEB" = "yes"; then
		PI3PATH=../.. # the default
	else
		PI3PATH=$PHP_PI3WEB
	fi
	test -f "$PI3PATH/PiAPI/PiAPI.h" || { echo "configure: error: Unable to find PiAPI.h in $PI3PATH/PiAPI" 1>&2; exit 1; }
	
  enable_experimental_zts=yes
  if test "$pthreads_working" != "yes"; then
    { echo "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; exit 1; }
  fi

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

	
  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
	
  php_build_target=shared

	INSTALL_IT="\$(SHELL) \$(srcdir)/install-sh -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)$PI3PATH/bin/"
fi



RESULT=no
echo $ac_n "checking for Roxen/Pike support""... $ac_c" 1>&6
echo "configure:4460: checking for Roxen/Pike support" >&5
# 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 "configure: error: You did not specify a directory" 1>&2; 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 "configure: error: Couldn't find a pike in $withval/bin/" 1>&2; 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 "configure: error: Failed to figure out Pike module and include directories" 1>&2; exit 1; }
		fi
	else
		{ echo "configure: error: Roxen/PHP requires Pike 0.7.79 or newer" 1>&2; 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 <<\EOF
#define HAVE_ROXEN 1
EOF

	PHP_SAPI=roxen
	
  php_build_target=shared

	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 "$ac_t""$RESULT" 1>&6

if test "$RESULT" != "no" ; then 
 RESULT=no
 echo $ac_n "checking if Roxen should use ZTS""... $ac_c" 1>&6
echo "configure:4538: checking if Roxen should use ZTS" >&5
 # 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 "configure: error: ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads." 1>&2; exit 1; }
  fi

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

	RESULT=yes

 
fi

 echo "$ac_t""$RESULT" 1>&6
fi
	

# $Id: config.m4,v 1.9.8.1 2001/10/30 23:22:44 sniper Exp $
# config.m4 for servlet sapi

echo $ac_n "checking for Servlet support""... $ac_c" 1>&6
echo "configure:4566: checking for Servlet support" >&5
# 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 "$ac_t""no" 1>&6
	{ echo "configure: error: unable to find servlet libraries" 1>&2; exit 1; }
      fi
    fi

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


    INSTALL_IT="\$(mkinstalldirs) \$(libdir)"
    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(srcdir)/sapi/servlet/phpsrvlt.jar \$(libdir)"
    INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 $SAPI_SHARED \$(libdir)"
    PHP_SAPI=servlet
    
  php_build_target=shared

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

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

else
  
  echo "$ac_t""no" 1>&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"
  
  test -d $withval || echo "$ac_t""thttpd directory does not exist ($withval)" 1>&6
  egrep thttpd.2.21b $withval/version.h >/dev/null || echo "$ac_t""This version only supports thttpd-2.21b" 1>&6
  
  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 test -n "$GCC"; then
        
  gcc_arg_name=ac_cv_gcc_arg_rdynamc
  echo $ac_n "checking whether $CC supports -rdynamic""... $ac_c" 1>&6
echo "configure:4650: checking whether $CC supports -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_gcc_arg_rdynamic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$ac_cv_gcc_arg_rdynamic" 1>&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) \$(CPPFLAGS) \$(EXTRA_CFLAGS)' >> $THTTPD/php_makefile; \
    \$(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/;\
    test -f $THTTPD/php_patched || \
    (cd $THTTPD && patch < $abs_srcdir/sapi/thttpd/thttpd_patch && touch php_patched)"
  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_build_target=static

  PHP_SAPI=thttpd

else
  
  PHP_THTTPD=no

fi


echo $ac_n "checking for thttpd""... $ac_c" 1>&6
echo "configure:4733: checking for thttpd" >&5
echo "$ac_t""$PHP_THTTPD" 1>&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_hdr in tuxmodule.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4747: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4752 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 :
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: Cannot find tuxmodule.h" 1>&2; exit 1; }
fi
done

  
  php_build_target=shared

  PHP_SAPI=tux
  PHP_TUX=yes

fi


echo $ac_n "checking for TUX""... $ac_c" 1>&6
echo "configure:4794: checking for TUX" >&5
echo "$ac_t""$PHP_TUX" 1>&6

unset PHP_TUX



echo $ac_n "checking for chosen SAPI module""... $ac_c" 1>&6
echo "configure:4802: checking for chosen SAPI module" >&5
echo "$ac_t""$PHP_SAPI" 1>&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"; then
    { echo "configure: error: host_alias is not set. Make sure to run config.guess" 1>&2; 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




  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Running system checks${T_ME}" 1>&6



  echo $ac_n "checking for missing declarations of reentrant functions""... $ac_c" 1>&6
echo "configure:4851: checking for missing declarations of reentrant functions" >&5
  cat > conftest.$ac_ext <<EOF
#line 4853 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm *(*func)() = localtime_r
; return 0; }
EOF
if { (eval echo configure:4860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    :
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_LOCALTIME_R_DECL 1
EOF

  
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 4878 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm *(*func)() = gmtime_r
; return 0; }
EOF
if { (eval echo configure:4885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    :
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_GMTIME_R_DECL 1
EOF

  
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 4903 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
char *(*func)() = asctime_r
; return 0; }
EOF
if { (eval echo configure:4910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    :
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_ASCTIME_R_DECL 1
EOF

  
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 4928 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
char *(*func)() = ctime_r
; return 0; }
EOF
if { (eval echo configure:4935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    :
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_CTIME_R_DECL 1
EOF

  
fi
rm -f conftest*
  cat > conftest.$ac_ext <<EOF
#line 4953 "configure"
#include "confdefs.h"
#include <string.h>
int main() {
char *(*func)() = strtok_r
; return 0; }
EOF
if { (eval echo configure:4960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    :
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_STRTOK_R_DECL 1
EOF

  
fi
rm -f conftest*
  echo "$ac_t""done" 1>&6


echo $ac_n "checking whether compiler supports -R""... $ac_c" 1>&6
echo "configure:4981: checking whether compiler supports -R" >&5
if eval "test \"`echo '$''{'php_cv_cc_dashr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	SAVE_LIBS=$LIBS
	LIBS="-R /usr/lib $LIBS"
	cat > conftest.$ac_ext <<EOF
#line 4989 "configure"
#include "confdefs.h"

int main() {

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

echo "$ac_t""$php_cv_cc_dashr" 1>&6
if test $php_cv_cc_dashr = "yes"; then
	ld_runpath_switch=-R
else
	echo $ac_n "checking whether compiler supports -Wl,-rpath,""... $ac_c" 1>&6
echo "configure:5014: checking whether compiler supports -Wl,-rpath," >&5
	if eval "test \"`echo '$''{'php_cv_cc_rpath'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
		SAVE_LIBS=$LIBS
		LIBS="-Wl,-rpath,/usr/lib $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 5022 "configure"
#include "confdefs.h"

int main() {

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

	echo "$ac_t""$php_cv_cc_rpath" 1>&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 "sendmail", so it can be a program name with args.
set dummy sendmail; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:5054: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PROG_SENDMAIL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PROG_SENDMAIL" in
  /*)
  ac_cv_path_PROG_SENDMAIL="$PROG_SENDMAIL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PROG_SENDMAIL="$PROG_SENDMAIL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PROG_SENDMAIL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PROG_SENDMAIL="$ac_cv_path_PROG_SENDMAIL"
if test -n "$PROG_SENDMAIL"; then
  echo "$ac_t""$PROG_SENDMAIL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi



  echo $ac_n "checking whether system uses EBCDIC""... $ac_c" 1>&6
echo "configure:5096: checking whether system uses EBCDIC" >&5
if eval "test \"`echo '$''{'ac_cv_ebcdic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
  ac_cv_ebcdic=no

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

int main(void) { 
  return (unsigned char)'A' != (unsigned char)0xC1; 
} 

EOF
if { (eval echo configure:5115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
  ac_cv_ebcdic=yes

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  ac_cv_ebcdic=no

fi
rm -fr conftest*
fi

fi

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

  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

INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"


echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:5151: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5159 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 
 case socket in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsocket $LIBS"


  ;;
  esac

 cat >> confdefs.h <<\EOF
#define HAVE_LIBSOCKET 1
EOF
 
else
  echo "$ac_t""no" 1>&6

  echo $ac_n "checking for htonl in -lsocket""... $ac_c" 1>&6
echo "configure:5206: checking for htonl in -lsocket" >&5
ac_lib_var=`echo socket'_'htonl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5214 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char htonl();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
   
 case socket in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsocket $LIBS"


  ;;
  esac

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

fi



unset ac_cv_func_yp_get_default_domain
echo $ac_n "checking for yp_get_default_domain""... $ac_c" 1>&6
echo "configure:5264: checking for yp_get_default_domain" >&5
if eval "test \"`echo '$''{'ac_cv_func_yp_get_default_domain'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5269 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char yp_get_default_domain(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char yp_get_default_domain();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_yp_get_default_domain) || defined (__stub___yp_get_default_domain)
choke me
#else
yp_get_default_domain();
#endif

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

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

unset ac_cv_func_yp_get_default_domain

if test "$php_no_nsl_checks" != "yes"; then

echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
echo "configure:5317: checking for gethostname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5325 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostname();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 
 case nsl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lnsl $LIBS"


  ;;
  esac

 cat >> confdefs.h <<\EOF
#define HAVE_LIBNSL 1
EOF
 
else
  echo "$ac_t""no" 1>&6

 echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
echo "configure:5372: checking for gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5380 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyaddr();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
  
 case nsl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lnsl $LIBS"


  ;;
  esac

  cat >> confdefs.h <<\EOF
#define HAVE_LIBNSL 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi


fi


fi

echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5434: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5442 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 case dl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ldl $LIBS"


  ;;
  esac

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


echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
echo "configure:5486: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5494 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sin();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lm $LIBS"

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


echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
echo "configure:5534: checking for inet_aton in -lresolv" >&5
ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5542 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char inet_aton();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lresolv $LIBS"

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

  echo $ac_n "checking for inet_aton in -lbind""... $ac_c" 1>&6
echo "configure:5580: checking for inet_aton in -lbind" >&5
ac_lib_var=`echo bind'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lbind  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5588 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char inet_aton();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lbind $LIBS"

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

    echo $ac_n "checking for __inet_aton in -lbind""... $ac_c" 1>&6
echo "configure:5626: checking for __inet_aton in -lbind" >&5
ac_lib_var=`echo bind'_'__inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lbind  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5634 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char __inet_aton();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lbind $LIBS"

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

  
fi


fi


echo $ac_n "checking for res_search in -lsocket""... $ac_c" 1>&6
echo "configure:5680: checking for res_search in -lsocket" >&5
ac_lib_var=`echo socket'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5688 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char res_search();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6
echo "configure:5716: checking for dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5724 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dn_skipname();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lresolv $LIBS"

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

 echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6
echo "configure:5763: checking for __dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5771 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char __dn_skipname();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lresolv $LIBS"

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

 LIBS="$LIBS -lsocket"
 cat >> confdefs.h <<\EOF
#define HAVE_LIBSOCKET 1
EOF
 
else
  echo "$ac_t""no" 1>&6

 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
echo "configure:5818: checking for res_search in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5826 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char res_search();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
  LIBS="$LIBS -lresolv"
  cat >> confdefs.h <<\EOF
#define HAVE_LIBRESOLV 1
EOF
 
 
else
  echo "$ac_t""no" 1>&6

  echo $ac_n "checking for dn_skipname in -lresolv""... $ac_c" 1>&6
echo "configure:5863: checking for dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5871 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dn_skipname();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lresolv $LIBS"

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

  echo $ac_n "checking for __dn_skipname in -lresolv""... $ac_c" 1>&6
echo "configure:5910: checking for __dn_skipname in -lresolv" >&5
ac_lib_var=`echo resolv'_'__dn_skipname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lresolv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5918 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char __dn_skipname();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lresolv $LIBS"

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

 
fi
 

fi


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

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 5994 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 6012 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 6033 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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

fi
fi

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

fi


if test "`uname -s 2>/dev/null`" != "QNX"; then
	ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:6074: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6079 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:6087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
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 $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:6112: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldir  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6120 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

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

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

else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:6153: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lx  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6161 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

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

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

fi

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

fi

  echo $ac_n "checking for fclose declaration""... $ac_c" 1>&6
echo "configure:6238: checking for fclose declaration" >&5
  cat > conftest.$ac_ext <<EOF
#line 6240 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
int (*func)() = fclose
; return 0; }
EOF
if { (eval echo configure:6247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_FCLOSE_DECL 0
EOF

    echo "$ac_t""ok" 1>&6
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MISSING_FCLOSE_DECL 1
EOF

    echo "$ac_t""missing" 1>&6
  
fi
rm -f conftest*

for ac_hdr in alloca.h \
arpa/inet.h \
arpa/nameser.h \
crypt.h \
fcntl.h \
grp.h \
ieeefp.h \
langinfo.h \
limits.h \
locale.h \
netinet/in.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/resource.h \
sys/select.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/vfs.h \
sys/sysexits.h \
sys/time.h \
sys/types.h \
sys/varargs.h \
sys/wait.h \
unistd.h \
unix.h \
utime.h \

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


echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
echo "configure:6348: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6353 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:6361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_tm=time.h
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_tm=sys/time.h
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_tm" 1>&6
if test $ac_cv_struct_tm = sys/time.h; then
  cat >> confdefs.h <<\EOF
#define TM_IN_SYS_TIME 1
EOF

fi

echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
echo "configure:6382: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6387 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
if { (eval echo configure:6395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_tm_zone=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_tm_zone=no
fi
rm -f conftest*
fi

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

else
  echo $ac_n "checking for tzname""... $ac_c" 1>&6
echo "configure:6415: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6420 "configure"
#include "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; }
EOF
if { (eval echo configure:6430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_var_tzname=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_var_tzname=no
fi
rm -f conftest*
fi

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

  fi
fi



echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
echo "configure:6454: checking for tm_gmtoff in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_gmtoff'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6459 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
int main() {
struct tm tm; tm.tm_gmtoff;
; return 0; }
EOF
if { (eval echo configure:6467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_tm_gmtoff=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_tm_gmtoff=no
fi
rm -f conftest*
fi

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

if test "$ac_cv_struct_tm_gmtoff" = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_TM_GMTOFF 1
EOF

fi


echo $ac_n "checking for struct flock""... $ac_c" 1>&6
echo "configure:6490: checking for struct flock" >&5
if eval "test \"`echo '$''{'ac_cv_struct_flock'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6495 "configure"
#include "confdefs.h"

#include <unistd.h>
#include <fcntl.h>
        
int main() {
struct flock x;
; return 0; }
EOF
if { (eval echo configure:6505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
          ac_cv_struct_flock=yes
        
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
          ac_cv_struct_flock=no
        
fi
rm -f conftest*

fi

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

fi


echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
echo "configure:6532: checking for socklen_t" >&5
if eval "test \"`echo '$''{'ac_cv_socklen_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6537 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/socket.h>

int main() {

socklen_t x;

; return 0; }
EOF
if { (eval echo configure:6549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
  ac_cv_socklen_t=yes

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

fi
rm -f conftest*
fi

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

fi


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:6575: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=8
else
  cat > conftest.$ac_ext <<EOF
#line 6583 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:6594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:6614: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=4
else
  cat > conftest.$ac_ext <<EOF
#line 6622 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF



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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R/usr/ucblib -L/usr/ucblib $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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 $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
echo "configure:6688: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6693 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
if { (eval echo configure:6701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_blksize=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_blksize=no
fi
rm -f conftest*
fi

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

fi

if test "`uname -s 2>/dev/null`" != "QNX"; then
	echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
echo "configure:6723: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6728 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
if { (eval echo configure:6736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_blocks=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_blocks=no
fi
rm -f conftest*
fi

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

else
  LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi

else
    echo "configure: warning: warnings level for cc set to 0" 1>&2
	WARNING_LEVEL=0
fi
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
echo "configure:6763: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6768 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
if { (eval echo configure:6776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_rdev=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_rdev=no
fi
rm -f conftest*
fi

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

fi


echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:6798: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6803 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:6831: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6836 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi

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

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

fi


echo $ac_n "checking for IPv6 support""... $ac_c" 1>&6
echo "configure:6866: checking for IPv6 support" >&5
if eval "test \"`echo '$''{'ac_cv_ipv6_support'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6871 "configure"
#include "confdefs.h"
 #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main() {
struct sockaddr_in6 s; int i=AF_INET6; s
; return 0; }
EOF
if { (eval echo configure:6880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_ipv6_support=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_ipv6_support=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:6901: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6906 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char vprintf(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char vprintf();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_vprintf) || defined (__stub___vprintf)
choke me
#else
vprintf();
#endif

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

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

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

if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:6953: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6958 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char _doprnt(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char _doprnt();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub__doprnt) || defined (__stub____doprnt)
choke me
#else
_doprnt();
#endif

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

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

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

fi

for ac_func in asctime_r \
chroot \
ctime_r \
cuserid \
crypt \
flock \
gai_strerror \
gcvt \
getlogin \
gethostbyaddr \
getprotobyname \
getprotobynumber \
getservbyname \
getservbyport \
getrusage \
gettimeofday \
gmtime_r \
inet_aton \
isascii \
link \
localtime_r \
lockf \
lrand48 \
memcpy \
memmove \
mkstemp \
mmap \
nl_langinfo \
putenv \
realpath \
random \
rand_r \
regcomp \
res_search \
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
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7069: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7074 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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


echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
echo "configure:7123: checking for getaddrinfo" >&5
if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7128 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);
; return 0; }
EOF
if { (eval echo configure:7135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_func_getaddrinfo=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_getaddrinfo=no
fi
rm -f conftest*
fi

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

fi

for ac_func in strlcat strlcpy getopt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7158: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7163 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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


echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6
echo "configure:7213: checking whether utime accepts a null argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata; > conftestdata
# 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 <<EOF
#line 7223 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
main() {
struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}
EOF
if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_utime_null=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_utime_null=no
fi
rm -fr conftest*
fi

rm -f core core.* *.core
fi

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

fi

# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:7260: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7265 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:7272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:7293: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7298 "configure"
#include "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; }
EOF
if { (eval echo configure:7326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi

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

fi

if test $ac_cv_func_alloca_works = no; then
  # 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 <<\EOF
#define C_ALLOCA 1
EOF


echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:7358: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7363 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "webecray" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_os_cray=yes
else
  rm -rf conftest*
  ac_cv_os_cray=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7388: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7393 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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

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

done
fi

echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:7443: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat > conftest.$ac_ext <<EOF
#line 7451 "configure"
#include "confdefs.h"
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;
}
main ()
{
  exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:7470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_stack_direction=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi

fi

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

fi


  echo $ac_n "checking whether sprintf is broken""... $ac_c" 1>&6
echo "configure:7493: checking whether sprintf is broken" >&5
if eval "test \"`echo '$''{'ac_cv_broken_sprintf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  
      ac_cv_broken_sprintf=no
    
else
  cat > conftest.$ac_ext <<EOF
#line 7504 "configure"
#include "confdefs.h"
main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }
EOF
if { (eval echo configure:7508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_broken_sprintf=no
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      ac_cv_broken_sprintf=yes
    
fi
rm -fr conftest*
fi

  
fi

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

  else
    cat >> confdefs.h <<\EOF
#define PHP_BROKEN_SPRINTF 0
EOF

  fi


  echo $ac_n "checking for declared timezone""... $ac_c" 1>&6
echo "configure:7542: checking for declared timezone" >&5
if eval "test \"`echo '$''{'ac_cv_declared_timezone'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 7548 "configure"
#include "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; }
EOF
if { (eval echo configure:7563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
  ac_cv_declared_timezone=yes

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

fi
rm -f conftest*
fi

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

  fi


echo $ac_n "checking for type of reentrant time-related functions""... $ac_c" 1>&6
echo "configure:7589: checking for type of reentrant time-related functions" >&5
if eval "test \"`echo '$''{'ac_cv_time_r_type'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  
  ac_cv_time_r_type=POSIX

else
  cat > conftest.$ac_ext <<EOF
#line 7600 "configure"
#include "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);
}

EOF
if { (eval echo configure:7618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
  ac_cv_time_r_type=hpux

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 7632 "configure"
#include "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);
}
  
EOF
if { (eval echo configure:7648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
    ac_cv_time_r_type=irix
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
    ac_cv_time_r_type=POSIX
  
fi
rm -fr conftest*
fi


fi
rm -fr conftest*
fi


fi

echo "$ac_t""$ac_cv_time_r_type" 1>&6
  case $ac_cv_time_r_type in
  hpux) cat >> confdefs.h <<\EOF
#define PHP_HPUX_TIME_R 1
EOF
 ;;
  irix) cat >> confdefs.h <<\EOF
#define PHP_IRIX_TIME_R 1
EOF
 ;;
  esac


    echo $ac_n "checking for readdir_r""... $ac_c" 1>&6
echo "configure:7686: checking for readdir_r" >&5
if eval "test \"`echo '$''{'ac_cv_func_readdir_r'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7691 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char readdir_r(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char readdir_r();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_readdir_r) || defined (__stub___readdir_r)
choke me
#else
readdir_r();
#endif

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

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

  if test "$ac_cv_func_readdir_r" = "yes"; then
  echo $ac_n "checking for type of readdir_r""... $ac_c" 1>&6
echo "configure:7736: checking for type of readdir_r" >&5
if eval "test \"`echo '$''{'ac_cv_what_readdir_r'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  
      ac_cv_what_readdir_r=none
   
else
  cat > conftest.$ac_ext <<EOF
#line 7747 "configure"
#include "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);
}
    
EOF
if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_what_readdir_r=POSIX
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      cat > conftest.$ac_ext <<EOF
#line 7783 "configure"
#include "confdefs.h"

#define _REENTRANT
#include <sys/types.h>
#include <dirent.h>
int readdir_r(DIR *, struct dirent *);
        
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
          ac_cv_what_readdir_r=old-style
        
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
          ac_cv_what_readdir_r=none
      
fi
rm -f conftest*
    
fi
rm -fr conftest*
fi

  
fi

echo "$ac_t""$ac_cv_what_readdir_r" 1>&6
    case $ac_cv_what_readdir_r in
    POSIX)
      cat >> confdefs.h <<\EOF
#define HAVE_POSIX_READDIR_R 1
EOF
;;
    old-style)
      cat >> confdefs.h <<\EOF
#define HAVE_OLD_READDIR_R 1
EOF
;;
    esac
  fi


if eval "test \"`echo '$''{'ac_cv_type_$1'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7838 "configure"
#include "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
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "in_addr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_in_addr_t=yes
else
  rm -rf conftest*
  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 <<\EOF
#define in_addr_t u_int
EOF

fi





echo $ac_n "checking whether to include debugging symbols""... $ac_c" 1>&6
echo "configure:7873: checking whether to include debugging symbols" >&5
# 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
fi


case $PHP_DEBUG in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DEBUG=`echo "$PHP_DEBUG"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DEBUG=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DEBUG" = "no" && PHP_DEBUG=yes
fi

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




if test "$PHP_DEBUG" = "yes"; then
  PHP_DEBUG=1
  ZEND_DEBUG=yes
else
  PHP_DEBUG=0
  ZEND_DEBUG=no
fi



echo $ac_n "checking layout of installed files""... $ac_c" 1>&6
echo "configure:7926: checking layout of installed files" >&5
# 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
fi


case $PHP_LAYOUT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LAYOUT=`echo "$PHP_LAYOUT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LAYOUT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_LAYOUT" = "no" && PHP_LAYOUT=yes
fi

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






echo $ac_n "checking path to configuration file""... $ac_c" 1>&6
echo "configure:7971: checking path to configuration file" >&5
# 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
fi


case $PHP_CONFIG_FILE_PATH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CONFIG_FILE_PATH=`echo "$PHP_CONFIG_FILE_PATH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CONFIG_FILE_PATH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CONFIG_FILE_PATH" = "no" && PHP_CONFIG_FILE_PATH=yes
fi

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




if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
  case $PHP_LAYOUT in
    GNU)
      PHP_CONFIG_FILE_PATH=$sysconfdir
      oldstyleextdir=no;;
    *)
      PHP_CONFIG_FILE_PATH=$libdir
      oldstyleextdir=yes;;
  esac
fi

# compatibility
if test "x$with_pear" = "x" -a "x$enable_pear" = "xno"; then
    with_pear=no
fi



echo $ac_n "checking whether to install PEAR""... $ac_c" 1>&6
echo "configure:8032: checking whether to install PEAR" >&5
# 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
fi


case $PHP_PEAR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PEAR=`echo "$PHP_PEAR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PEAR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PEAR" = "no" && PHP_PEAR=yes
fi

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




if test "$PHP_PEAR" != "no"; then
  PEAR_DIR=pear
  PEAR_INSTALLDIR=$PHP_PEAR
fi

if test "$PHP_PEAR" = "DEFAULT" -o "x$PHP_PEAR" = "xyes"; then
  case $PHP_LAYOUT in
    GNU) PEAR_INSTALLDIR=$datadir/pear;;
    *)   PEAR_INSTALLDIR=$libdir/php;;
  esac
fi

test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"



echo $ac_n "checking whether to enable safe mode by default""... $ac_c" 1>&6
echo "configure:8091: checking whether to enable safe mode by default" >&5
# 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
fi


case $PHP_SAFE_MODE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SAFE_MODE=`echo "$PHP_SAFE_MODE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SAFE_MODE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SAFE_MODE" = "no" && PHP_SAFE_MODE=yes
fi

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




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

else
  cat >> confdefs.h <<\EOF
#define PHP_SAFE_MODE 0
EOF

fi

echo $ac_n "checking for safe mode exec dir""... $ac_c" 1>&6
echo "configure:8146: checking for safe mode exec dir" >&5
# 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 <<\EOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
EOF

    	echo "$ac_t""/usr/local/php/bin" 1>&6
   	else
		cat >> confdefs.h <<EOF
#define PHP_SAFE_MODE_EXEC_DIR "$withval"
EOF

    	echo "$ac_t""$withval" 1>&6
   	fi
  else
	cat >> confdefs.h <<\EOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
EOF

   	echo "$ac_t""/usr/local/php/bin" 1>&6
  fi

else
  
	cat >> confdefs.h <<\EOF
#define PHP_SAFE_MODE_EXEC_DIR "/usr/local/php/bin"
EOF

   	echo "$ac_t""/usr/local/php/bin" 1>&6

fi




echo $ac_n "checking for OpenSSL support""... $ac_c" 1>&6
echo "configure:8187: checking for OpenSSL support" >&5
# 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
fi


case $PHP_OPENSSL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OPENSSL=`echo "$PHP_OPENSSL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OPENSSL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_OPENSSL" = "no" && PHP_OPENSSL=yes
fi

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



if test "$PHP_OPENSSL" = "yes"; then
  PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi

if test "$PHP_OPENSSL" != "no"; then
  
  if test "$PHP_OPENSSL" = "no"; then
    PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
  fi

  for i in $PHP_OPENSSL; do
    if test -r $i/include/openssl/evp.h; then
      OPENSSL_DIR=$i
      OPENSSL_INC=$i/include
    fi
  done

  if test -z "$OPENSSL_DIR"; then
    { echo "configure: error: Cannot find OpenSSL's <evp.h>" 1>&2; exit 1; }
  fi

  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$OPENSSL_INC
  echo $ac_n "checking for OpenSSL version""... $ac_c" 1>&6
echo "configure:8252: checking for OpenSSL version" >&5
  cat > conftest.$ac_ext <<EOF
#line 8254 "configure"
#include "confdefs.h"

  #include <openssl/opensslv.h>
  #if OPENSSL_VERSION_NUMBER >= 0x0090500fL
  yes
  #endif
  
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  
    echo "$ac_t"">= 0.9.5" 1>&6
  
else
  rm -rf conftest*
  
    { echo "configure: error: OpenSSL version 0.9.5 or greater required." 1>&2; exit 1; }
  
fi
rm -f conftest*

  CPPFLAGS=$old_CPPFLAGS

  
  if test "$OPENSSL_DIR/lib" != "/usr/lib"; then
    
  if test -z "$OPENSSL_DIR/lib" || echo "$OPENSSL_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_DIR/lib
  else
    
    ep_dir="`echo $OPENSSL_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$OPENSSL_DIR/lib -L$OPENSSL_DIR/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


  echo $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6
echo "configure:8314: checking for CRYPTO_free in -lcrypto" >&5
ac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcrypto  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8322 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char CRYPTO_free();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    
 case crypto in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcrypto $LIBS"


  ;;
  esac

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

    { echo "configure: error: libcrypto not found!" 1>&2; exit 1; }
  
fi


  echo $ac_n "checking for SSL_CTX_set_ssl_version in -lssl""... $ac_c" 1>&6
echo "configure:8371: checking for SSL_CTX_set_ssl_version in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_set_ssl_version | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lssl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8379 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SSL_CTX_set_ssl_version();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    
 case ssl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lssl $LIBS"


  ;;
  esac

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

    { echo "configure: error: libssl not found!" 1>&2; exit 1; }
  
fi

  
  if test "$OPENSSL_INC" != "/usr/include"; then
    
  if test -z "$OPENSSL_INC" || echo "$OPENSSL_INC" | grep '^/' >/dev/null ; then
    ai_p=$OPENSSL_INC
  else
    
    ep_dir="`echo $OPENSSL_INC|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OPENSSL_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


fi



echo $ac_n "checking whether to enable PHP's own SIGCHLD handler""... $ac_c" 1>&6
echo "configure:8463: checking whether to enable PHP's own SIGCHLD handler" >&5
# 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
fi


case $PHP_SIGCHILD in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SIGCHILD=`echo "$PHP_SIGCHILD"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SIGCHILD=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SIGCHILD" = "no" && PHP_SIGCHILD=yes
fi

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




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

else
  cat >> confdefs.h <<\EOF
#define PHP_SIGCHILD 0
EOF

fi



echo $ac_n "checking whether to enable magic quotes by default""... $ac_c" 1>&6
echo "configure:8520: checking whether to enable magic quotes by default" >&5
# 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
fi


case $PHP_MAGIC_QUOTES in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MAGIC_QUOTES=`echo "$PHP_MAGIC_QUOTES"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MAGIC_QUOTES=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MAGIC_QUOTES" = "no" && PHP_MAGIC_QUOTES=yes
fi

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




if test "$PHP_MAGIC_QUOTES" = "yes"; then
  cat >> confdefs.h <<\EOF
#define MAGIC_QUOTES 1
EOF

else
  cat >> confdefs.h <<\EOF
#define MAGIC_QUOTES 0
EOF

fi



echo $ac_n "checking whether to enable runpaths""... $ac_c" 1>&6
echo "configure:8577: checking whether to enable runpaths" >&5
# 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
fi


case $PHP_RPATH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_RPATH=`echo "$PHP_RPATH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_RPATH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_RPATH" = "no" && PHP_RPATH=yes
fi

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






echo $ac_n "checking whether to explicitly link against libgcc""... $ac_c" 1>&6
echo "configure:8622: checking whether to explicitly link against libgcc" >&5
# 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
fi


case $PHP_LIBGCC in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LIBGCC=`echo "$PHP_LIBGCC"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LIBGCC=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_LIBGCC" = "no" && PHP_LIBGCC=yes
fi

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




if test "$PHP_LIBGCC" = "yes"; then
  
  
  libgcc_libpath=`gcc --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'`
  

  if test -z "$libgcc_libpath"; then
    { echo "configure: error: Cannot locate libgcc. Make sure that gcc is in your path" 1>&2; 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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$libgcc_libpath -L$libgcc_libpath $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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 gcc in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="$LIBS -lgcc"


  ;;
  esac

fi



echo $ac_n "checking whether to enable short tags by default""... $ac_c" 1>&6
echo "configure:8723: checking whether to enable short tags by default" >&5
# 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
fi


case $PHP_SHORT_TAGS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SHORT_TAGS=`echo "$PHP_SHORT_TAGS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SHORT_TAGS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SHORT_TAGS" = "no" && PHP_SHORT_TAGS=yes
fi

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




if test "$PHP_SHORT_TAGS" = "yes"; then
  cat >> confdefs.h <<\EOF
#define DEFAULT_SHORT_OPEN_TAG "1"
EOF

else
  cat >> confdefs.h <<\EOF
#define DEFAULT_SHORT_OPEN_TAG "0"
EOF

fi




echo $ac_n "checking whether to enable dmalloc""... $ac_c" 1>&6
echo "configure:8781: checking whether to enable dmalloc" >&5
# 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
fi


case $PHP_DMALLOC in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DMALLOC=`echo "$PHP_DMALLOC"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DMALLOC=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DMALLOC" = "no" && PHP_DMALLOC=yes
fi

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




if test "$PHP_DMALLOC" = "yes"; then
  
  echo $ac_n "checking for dmalloc_error in -ldmalloc""... $ac_c" 1>&6
echo "configure:8826: checking for dmalloc_error in -ldmalloc" >&5
ac_lib_var=`echo dmalloc'_'dmalloc_error | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldmalloc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8834 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dmalloc_error();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    
 case dmalloc in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ldmalloc $LIBS"


  ;;
  esac

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

    CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
  
else
  echo "$ac_t""no" 1>&6

    { echo "configure: error: Problem with enabling dmalloc. Please check config.log for details." 1>&2; exit 1; }
  
fi

fi

# temporary until streams are better integrated


echo $ac_n "checking whether to enable php streams""... $ac_c" 1>&6
echo "configure:8892: checking whether to enable php streams" >&5
# Check whether --enable-php-streams or --disable-php-streams was given.
if test "${enable_php_streams+set}" = set; then
  enableval="$enable_php_streams"
  PHP_PHP_STREAMS=$enableval
else
  PHP_PHP_STREAMS=no
fi


case $PHP_PHP_STREAMS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PHP_STREAMS=`echo "$PHP_PHP_STREAMS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PHP_STREAMS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PHP_STREAMS" = "no" && PHP_PHP_STREAMS=yes
fi

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




if test "$PHP_PHP_STREAMS" = "yes"; then
  cat >> confdefs.h <<\EOF
#define HAVE_PHP_STREAM 1
EOF

fi

echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
echo "configure:8942: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcrypt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8950 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char crypt();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
  
 case crypt in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcrypt $LIBS"


  ;;
  esac

  
 case crypt in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="$LIBS -lcrypt"


  ;;
  esac

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

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





  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Configuring extensions${T_ME}" 1>&6


# reading config stubs



echo $ac_n "checking if the location of ZLIB install directory is defined""... $ac_c" 1>&6
echo "configure:9023: checking if the location of ZLIB install directory is defined" >&5
# 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
fi


case $PHP_ZLIB_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZLIB_DIR=`echo "$PHP_ZLIB_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZLIB_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ZLIB_DIR" = "no" && PHP_ZLIB_DIR=yes
fi

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






echo $ac_n "checking whether to include ZLIB support""... $ac_c" 1>&6
echo "configure:9068: checking whether to include ZLIB support" >&5
# 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
fi


case $PHP_ZLIB in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZLIB=`echo "$PHP_ZLIB"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZLIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ZLIB" = "no" && PHP_ZLIB=yes
fi

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




if test "$PHP_ZLIB" != "no" -o "$PHP_ZLIB_DIR" != "no"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS zlib"
  
  if test -d "$abs_srcdir/ext/zlib"; then
    ext_builddir=ext/zlib
    ext_srcdir=$abs_srcdir/ext/zlib
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libzlib.la"
    EXT_STATIC="$EXT_STATIC zlib"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ZLIB 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  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 "configure: error: Cannot find libz" 1>&2; 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" && test -n "ZLIB_SHARED_LIBADD"; then
      ZLIB_SHARED_LIBADD="-R$ZLIB_DIR/lib -L$ZLIB_DIR/lib $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


  echo $ac_n "checking for gzgets in -lz""... $ac_c" 1>&6
echo "configure:9309: checking for gzgets in -lz" >&5
ac_lib_var=`echo z'_'gzgets | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lz  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9317 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gzgets();

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

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

    { echo "configure: error: ZLIB extension requires zlib >= 1.0.9" 1>&2; exit 1; }
  
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


  
	echo $ac_n "checking for fopencookie""... $ac_c" 1>&6
echo "configure:9419: checking for fopencookie" >&5
if eval "test \"`echo '$''{'ac_cv_func_fopencookie'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9424 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char fopencookie(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fopencookie();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_fopencookie) || defined (__stub___fopencookie)
choke me
#else
fopencookie();
#endif

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

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


	if test "$have_glibc_fopencookie" = "yes" ; then
	  	            		  cat > conftest.$ac_ext <<EOF
#line 9469 "configure"
#include "confdefs.h"
 #define _GNU_SOURCE
                       #include <stdio.h>
									   
int main() {
 cookie_io_functions_t cookie; 
; return 0; }
EOF
if { (eval echo configure:9478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   have_cookie_io_functions_t=yes 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
    
fi
rm -f conftest*

		  if test "$have_cookie_io_functions_t" = "yes" ; then
        cookie_io_functions_t=cookie_io_functions_t
	      have_fopen_cookie=yes
      else
  	            		    cat > conftest.$ac_ext <<EOF
#line 9494 "configure"
#include "confdefs.h"
 #define _GNU_SOURCE
                       #include <stdio.h>
									   
int main() {
 _IO_cookie_io_functions_t cookie; 
; return 0; }
EOF
if { (eval echo configure:9503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   have_IO_cookie_io_functions_t=yes 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   
fi
rm -f conftest*
		    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 <<\EOF
#define HAVE_FOPENCOOKIE 1
EOF

			  cat >> confdefs.h <<EOF
#define COOKIE_IO_FUNCTIONS_T $cookie_io_functions_t
EOF

      fi      

  	fi

fi


echo $ac_n "checking for ASPELL support""... $ac_c" 1>&6
echo "configure:9536: checking for ASPELL support" >&5
# Check whether --with-aspell or --without-aspell was given.
if test "${with_aspell+set}" = set; then
  withval="$with_aspell"
  
  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
      ASPELL_DIR=/usr/local
    else
      ASPELL_DIR=$withval
    fi

    
  if test "$ASPELL_DIR/include" != "/usr/include"; then
    
  if test -z "$ASPELL_DIR/include" || echo "$ASPELL_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$ASPELL_DIR/include
  else
    
    ep_dir="`echo $ASPELL_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ASPELL_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 -n "$ASPELL_DIR/lib"; then
    
  if test "$ASPELL_DIR/lib" != "/usr/lib"; then
    
  if test -z "$ASPELL_DIR/lib" || echo "$ASPELL_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$ASPELL_DIR/lib
  else
    
    ep_dir="`echo $ASPELL_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ASPELL_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ASPELL_DIR/lib -L$ASPELL_DIR/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
  
 case aspell in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-laspell $LIBS"


  ;;
  esac




    if test ! -f "$ASPELL_DIR/include/aspell-c.h"; then
      { echo "configure: error: Could not find aspell-c.h in $ASPELL_DIR/include - please copy it manually from the aspell sources to $ASPELL_DIR/include" 1>&2; exit 1; }
    fi
    cat >> confdefs.h <<\EOF
#define HAVE_ASPELL 1
EOF

    echo "$ac_t""yes" 1>&6
    
  EXT_SUBDIRS="$EXT_SUBDIRS aspell"
  
  if test -d "$abs_srcdir/ext/aspell"; then
    ext_builddir=ext/aspell
    ext_srcdir=$abs_srcdir/ext/aspell
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libaspell.la"
    EXT_STATIC="$EXT_STATIC aspell"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ASPELL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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

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

fi





echo $ac_n "checking for bc style precision math functions""... $ac_c" 1>&6
echo "configure:9789: checking for bc style precision math functions" >&5
# 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
fi


case $PHP_BCMATH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_BCMATH=`echo "$PHP_BCMATH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_BCMATH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_BCMATH" = "no" && PHP_BCMATH=yes
fi

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




if test "$PHP_BCMATH" != "no"; then
  cat >> confdefs.h <<\EOF
#define WITH_BCMATH 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS bcmath"
  
  if test -d "$abs_srcdir/ext/bcmath"; then
    ext_builddir=ext/bcmath
    ext_srcdir=$abs_srcdir/ext/bcmath
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libbcmath.la"
    EXT_STATIC="$EXT_STATIC bcmath"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_BCMATH 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile"

  
  lib_makefile="$ext_builddir/libbcmath/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/libbcmath
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

  
  lib_makefile="$ext_builddir/libbcmath/src/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/libbcmath/src
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

fi





echo $ac_n "checking for BZip2 support""... $ac_c" 1>&6
echo "configure:10091: checking for BZip2 support" >&5
# 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
fi


case $PHP_BZ2 in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_BZ2=`echo "$PHP_BZ2"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_BZ2=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_BZ2" = "no" && PHP_BZ2=yes
fi

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




if test "$PHP_BZ2" != "no"; then
  if test -r $PHP_BZ2/include/bzlib.h; then
    BZIP_DIR=$PHP_BZ2
  else
    echo $ac_n "checking for BZip2 in default path""... $ac_c" 1>&6
echo "configure:10138: checking for BZip2 in default path" >&5
    for i in /usr/local /usr; do
      if test -r $i/include/bzlib.h; then
        BZIP_DIR=$i
        echo "$ac_t""found in $i" 1>&6
      fi
    done
  fi

  if test -z "$BZIP_DIR"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the BZip2 distribution" 1>&2; exit 1; }
  fi

  
  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


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST BZ2_SHARED_LIBADD"

  

  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" && test -n "BZ2_SHARED_LIBADD"; then
      BZ2_SHARED_LIBADD="-R$BZIP_DIR/lib -L$BZIP_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$BZIP_DIR/lib -L$BZIP_DIR/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
  
 case bz2 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lbz2 $LIBS"


  ;;
  esac



  fi


  echo $ac_n "checking for BZ2_bzerror in -lbz2""... $ac_c" 1>&6
echo "configure:10282: checking for BZ2_bzerror in -lbz2" >&5
ac_lib_var=`echo bz2'_'BZ2_bzerror | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lbz2  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 10290 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char BZ2_bzerror();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: bz2 module requires libbz2 >= 1.0.0" 1>&2; exit 1; }
fi


  
  EXT_SUBDIRS="$EXT_SUBDIRS bz2"
  
  if test -d "$abs_srcdir/ext/bz2"; then
    ext_builddir=ext/bz2
    ext_srcdir=$abs_srcdir/ext/bz2
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libbz2.la"
    EXT_STATIC="$EXT_STATIC bz2"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_BZ2 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to enable calendar conversion support""... $ac_c" 1>&6
echo "configure:10467: checking whether to enable calendar conversion support" >&5
# 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
fi


case $PHP_CALENDAR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CALENDAR=`echo "$PHP_CALENDAR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CALENDAR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CALENDAR" = "no" && PHP_CALENDAR=yes
fi

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




if test "$PHP_CALENDAR" = "yes"; then
  cat >> confdefs.h <<\EOF
#define HAVE_CALENDAR 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS calendar"
  
  if test -d "$abs_srcdir/ext/calendar"; then
    ext_builddir=ext/calendar
    ext_srcdir=$abs_srcdir/ext/calendar
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcalendar.la"
    EXT_STATIC="$EXT_STATIC calendar"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CALENDAR 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for CCVS support""... $ac_c" 1>&6
echo "configure:10655: checking for CCVS support" >&5
# Check whether --with-ccvs or --without-ccvs was given.
if test "${with_ccvs+set}" = set; then
  withval="$with_ccvs"
  PHP_CCVS=$withval
else
  PHP_CCVS=no
fi


case $PHP_CCVS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CCVS=`echo "$PHP_CCVS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CCVS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CCVS" = "no" && PHP_CCVS=yes
fi

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




if test "$PHP_CCVS" != "no"; then
  if test -r $PHP_CCVS/include/cv_api.h; then
     CCVS_DIR=$PHP_CCVS
  else 
    for i in /usr /usr/local /usr/local/ccvs ; do
      if test -r $i/include/cv_api.h; then
        CCVS_DIR=$i
      fi
    done
  fi

  if test -z "$CCVS_DIR"; then
    { echo "configure: error: not found. Please check your CCVS installation; cv_api.h should be in <ccvs_dir>/include/" 1>&2; exit 1; }
  fi
  
  
  if test "$CCVS_DIR/include" != "/usr/include"; then
    
  if test -z "$CCVS_DIR/include" || echo "$CCVS_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$CCVS_DIR/include
  else
    
    ep_dir="`echo $CCVS_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CCVS_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
    CCVS_SHARED_LIBADD="-lccvs $CCVS_SHARED_LIBADD"
    if test -n "$CCVS_DIR/lib"; then
      
  if test "$CCVS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$CCVS_DIR/lib" || echo "$CCVS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CCVS_DIR/lib
  else
    
    ep_dir="`echo $CCVS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CCVS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "CCVS_SHARED_LIBADD"; then
      CCVS_SHARED_LIBADD="-R$CCVS_DIR/lib -L$CCVS_DIR/lib $CCVS_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 "$CCVS_DIR/lib"; then
    
  if test "$CCVS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$CCVS_DIR/lib" || echo "$CCVS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$CCVS_DIR/lib
  else
    
    ep_dir="`echo $CCVS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CCVS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$CCVS_DIR/lib -L$CCVS_DIR/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
  
 case ccvs in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lccvs $LIBS"


  ;;
  esac



  fi


  
  EXT_SUBDIRS="$EXT_SUBDIRS ccvs"
  
  if test -d "$abs_srcdir/ext/ccvs"; then
    ext_builddir=ext/ccvs
    ext_srcdir=$abs_srcdir/ext/ccvs
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libccvs.la"
    EXT_STATIC="$EXT_STATIC ccvs"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CCVS 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST CCVS_SHARED_LIBADD"

fi


echo $ac_n "checking whether to include cpdflib support""... $ac_c" 1>&6
echo "configure:10979: checking whether to include cpdflib support" >&5
# Check whether --with-cpdflib or --without-cpdflib was given.
if test "${with_cpdflib+set}" = set; then
  withval="$with_cpdflib"
  
  case $withval in
    no)
      echo "$ac_t""no" 1>&6 ;;
    yes)
      echo "$ac_t""yes" 1>&6
      
  EXT_SUBDIRS="$EXT_SUBDIRS cpdf"
  
  if test -d "$abs_srcdir/ext/cpdf"; then
    ext_builddir=ext/cpdf
    ext_srcdir=$abs_srcdir/ext/cpdf
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcpdf.la"
    EXT_STATIC="$EXT_STATIC cpdf"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CPDF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


      echo $ac_n "checking for cpdf_open in -lcpdf""... $ac_c" 1>&6
echo "configure:11125: checking for cpdf_open in -lcpdf" >&5
ac_lib_var=`echo cpdf'_'cpdf_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcpdf  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11133 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cpdf_open();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: Cpdf module requires cpdflib >= 2." 1>&2; exit 1; }
fi

      
 case cpdf in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcpdf $LIBS"


  ;;
  esac

      
 case tiff in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltiff $LIBS"


  ;;
  esac

      
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac

      ;;
    *)
      test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE=$withval/include
      if test -n "$CPDFLIB_INCLUDE" ; then
        echo "$ac_t""yes" 1>&6
        
  EXT_SUBDIRS="$EXT_SUBDIRS cpdf"
  
  if test -d "$abs_srcdir/ext/cpdf"; then
    ext_builddir=ext/cpdf
    ext_srcdir=$abs_srcdir/ext/cpdf
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcpdf.la"
    EXT_STATIC="$EXT_STATIC cpdf"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CPDF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


        old_LIBS=$LIBS
        old_withval=$withval

        echo $ac_n "checking for libjpeg (needed by cpdflib 2.x)""... $ac_c" 1>&6
echo "configure:11348: checking for libjpeg (needed by cpdflib 2.x)" >&5
        # Check whether --with-jpeg-dir or --without-jpeg-dir was given.
if test "${with_jpeg_dir+set}" = set; then
  withval="$with_jpeg_dir"
  
          echo "$ac_t""yes" 1>&6
          if test -z $withval; then
            withval=/usr/local
          fi
          LIBS="$LIBS -L$withval/lib"
          echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
echo "configure:11359: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ljpeg  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11367 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char jpeg_read_header();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ljpeg $LIBS"

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

          

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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
  
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac



        
else
  
          echo "$ac_t""no" 1>&6
          echo "configure: warning: If configure fails try --with-jpeg-dir=<DIR>" 1>&2
        
fi
 

        echo $ac_n "checking for libtiff (needed by cpdflib 2.x)""... $ac_c" 1>&6
echo "configure:11467: checking for libtiff (needed by cpdflib 2.x)" >&5
        # Check whether --with-tiff-dir or --without-tiff-dir was given.
if test "${with_tiff_dir+set}" = set; then
  withval="$with_tiff_dir"
  
          echo "$ac_t""yes" 1>&6
          if test -z $withval; then
            withval=/usr/local
          fi
          LIBS="$LIBS -L$withval/lib"
          echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:11478: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltiff  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11486 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo tiff | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ltiff $LIBS"

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

          

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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
  
 case tiff in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltiff $LIBS"


  ;;
  esac



        
else
  
          echo "$ac_t""no" 1>&6
          echo "configure: warning: If configure fails try --with-tiff-dir=<DIR>" 1>&2
        
fi
 
        withval=$old_withval

          LIBS="$LIBS -L$withval/lib"
        echo $ac_n "checking for cpdf_open in -lcpdf""... $ac_c" 1>&6
echo "configure:11588: checking for cpdf_open in -lcpdf" >&5
ac_lib_var=`echo cpdf'_'cpdf_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcpdf  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11596 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cpdf_open();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: Cpdflib module requires cpdflib >= 2." 1>&2; exit 1; }
fi

        LIBS=$old_LIBS
        

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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
  
 case cpdf in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcpdf $LIBS"


  ;;
  esac



        
  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

      else
        echo "$ac_t""no" 1>&6
      fi ;;
  esac

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

fi





echo $ac_n "checking whether to include crack support""... $ac_c" 1>&6
echo "configure:11730: checking whether to include crack support" >&5
# 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
fi


case $PHP_CRACK in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CRACK=`echo "$PHP_CRACK"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CRACK=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CRACK" = "no" && PHP_CRACK=yes
fi

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




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

	for i in /usr/local/lib /usr/lib $PHP_CRACK/lib $PHP_CRACK/cracklib; do
		test -f $i/lib/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i
	done

	for i in /usr/local/include /usr/include $PHP_CRACK/include $PHP_CRACK/cracklib; do
		test -f $i/packer.h && CRACK_INCLUDEDIR=$i
	done
  
	if test -z "$CRACK_LIBDIR"; then
		{ echo "configure: error: Cannot find the cracklib library file" 1>&2; exit 1; }
	fi

	if test -z "$CRACK_INCLUDEDIR"; then
		{ echo "configure: error: Cannot find a cracklib header file" 1>&2; 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" && test -n "CRACK_SHARED_LIBADD"; then
      CRACK_SHARED_LIBADD="-R$CRACK_LIBDIR -L$CRACK_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$CRACK_LIBDIR -L$CRACK_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case crack in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcrack $LIBS"


  ;;
  esac



  fi



	
  EXT_SUBDIRS="$EXT_SUBDIRS crack"
  
  if test -d "$abs_srcdir/ext/crack"; then
    ext_builddir=ext/crack
    ext_srcdir=$abs_srcdir/ext/crack
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcrack.la"
    EXT_STATIC="$EXT_STATIC crack"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CRACK 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


	
  PHP_VAR_SUBST="$PHP_VAR_SUBST CRACK_SHARED_LIBADD"

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

fi









echo $ac_n "checking whether to enable ctype support""... $ac_c" 1>&6
echo "configure:12069: checking whether to enable ctype support" >&5
# 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=no
fi


case $PHP_CTYPE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CTYPE=`echo "$PHP_CTYPE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CTYPE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CTYPE" = "no" && PHP_CTYPE=yes
fi

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




if test "$PHP_CTYPE" != "no"; then
        cat >> confdefs.h <<\EOF
#define HAVE_CTYPE 1
EOF

    
  EXT_SUBDIRS="$EXT_SUBDIRS ctype"
  
  if test -d "$abs_srcdir/ext/ctype"; then
    ext_builddir=ext/ctype
    ext_srcdir=$abs_srcdir/ext/ctype
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libctype.la"
    EXT_STATIC="$EXT_STATIC ctype"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CTYPE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for CURL support""... $ac_c" 1>&6
echo "configure:12257: checking for CURL support" >&5
# 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
fi


case $PHP_CURL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CURL=`echo "$PHP_CURL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CURL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CURL" = "no" && PHP_CURL=yes
fi

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




if test "$PHP_CURL" != "no"; then
  if test -r $PHP_CURL/include/curl/easy.h; then
    CURL_DIR=$PHP_CURL
  else
    echo $ac_n "checking for CURL in default path""... $ac_c" 1>&6
echo "configure:12304: checking for CURL in default path" >&5
    for i in /usr/local /usr; do
      if test -r $i/include/curl/easy.h; then
        CURL_DIR=$i
        echo "$ac_t""found in $i" 1>&6
      fi
    done
  fi

  if test -z "$CURL_DIR"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/" 1>&2; exit 1; }
  fi

  CURL_CONFIG="curl-config"
  echo $ac_n "checking for cURL greater than 7.8.1""... $ac_c" 1>&6
echo "configure:12321: checking for cURL greater than 7.8.1" >&5

  if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then
    CURL_CONFIG=${CURL_DIR}/bin/curl-config
  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 7008001; then
    echo "$ac_t""$curl_version_full" 1>&6
    CURL_LIBS=`$CURL_CONFIG --libs`
  else
    { echo "configure: error: cURL version 7.8.1 or later is required to compile php with cURL support" 1>&2; exit 1; }
  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="-l$ac_ii $CURL_SHARED_LIBADD"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "CURL_SHARED_LIBADD"; then
      CURL_SHARED_LIBADD="-R$ac_ii -L$ac_ii $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" && test -n "CURL_SHARED_LIBADD"; then
      CURL_SHARED_LIBADD="-R$CURL_DIR/lib -L$CURL_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$CURL_DIR/lib -L$CURL_DIR/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
  
 case curl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcurl $LIBS"


  ;;
  esac



  fi



  echo $ac_n "checking for curl_easy_perform in -lcurl""... $ac_c" 1>&6
echo "configure:12535: checking for curl_easy_perform in -lcurl" >&5
ac_lib_var=`echo curl'_'curl_easy_perform | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcurl 
    $CURL_LIBS -L$CURL_DIR/lib
   $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12545 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char curl_easy_perform();

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

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

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

    { echo "configure: error: There is something wrong. Please check config.log for more information." 1>&2; exit 1; }
  
fi


  
  EXT_SUBDIRS="$EXT_SUBDIRS curl"
  
  if test -d "$abs_srcdir/ext/curl"; then
    ext_builddir=ext/curl
    ext_srcdir=$abs_srcdir/ext/curl
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcurl.la"
    EXT_STATIC="$EXT_STATIC curl"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CURL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST CURL_SHARED_LIBADD"

fi


echo $ac_n "checking for CyberCash support""... $ac_c" 1>&6
echo "configure:12727: checking for CyberCash support" >&5
# Check whether --with-cybercash or --without-cybercash was given.
if test "${with_cybercash+set}" = set; then
  withval="$with_cybercash"
  
  if test "$withval" != "no"; then
      test -f $withval/mckcrypt.h && MCK_DIR=$withval
      test -f $withval/c-api/mckcrypt.h && MCK_DIR=$withval/c-api
      if test -n "$MCK_DIR"; then
	echo "$ac_t""yes" 1>&6
	
  EXT_SUBDIRS="$EXT_SUBDIRS cybercash"
  
  if test -d "$abs_srcdir/ext/cybercash"; then
    ext_builddir=ext/cybercash
    ext_srcdir=$abs_srcdir/ext/cybercash
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcybercash.la"
    EXT_STATIC="$EXT_STATIC cybercash"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CYBERCASH 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


	old_LIBS=$LIBS
	LIBS="$LIBS -L$MCK_DIR/lib"
	echo $ac_n "checking for base64_encode in -lmckcrypto""... $ac_c" 1>&6
echo "configure:12875: checking for base64_encode in -lmckcrypto" >&5
ac_lib_var=`echo mckcrypto'_'base64_encode | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmckcrypto  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12883 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char base64_encode();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: Please reinstall the CyberCash MCK - cannot find mckcrypto lib" 1>&2; exit 1; }
fi

	LIBS=$old_LIBS
	

  if test -n "$MCK_DIR/lib"; then
    
  if test "$MCK_DIR/lib" != "/usr/lib"; then
    
  if test -z "$MCK_DIR/lib" || echo "$MCK_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$MCK_DIR/lib
  else
    
    ep_dir="`echo $MCK_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCK_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MCK_DIR/lib -L$MCK_DIR/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
  
 case mckcrypto in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lmckcrypto $LIBS"


  ;;
  esac



	
  if test "$MCK_DIR" != "/usr/include"; then
    
  if test -z "$MCK_DIR" || echo "$MCK_DIR" | grep '^/' >/dev/null ; then
    ai_p=$MCK_DIR
  else
    
    ep_dir="`echo $MCK_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MCK_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 "$ac_t""no" 1>&6
      fi
fi

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

fi






echo $ac_n "checking for cybermut support""... $ac_c" 1>&6
echo "configure:13018: checking for cybermut support" >&5
# Check whether --with-cybermut or --without-cybermut was given.
if test "${with_cybermut+set}" = set; then
  withval="$with_cybermut"
  PHP_CYBERMUT=$withval
else
  PHP_CYBERMUT=no
fi


case $PHP_CYBERMUT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CYBERMUT=`echo "$PHP_CYBERMUT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CYBERMUT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CYBERMUT" = "no" && PHP_CYBERMUT=yes
fi

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





if test "$PHP_CYBERMUT" != "no"; then
  for i in /usr/local /usr $PHP_CYBERMUT; do
    if test -r $i/cm-mac.h; then
      CYBERMUT_INC_DIR=$i
    elif test -r $i/include/cm-mac.h; then
      CYBERMUT_INC_DIR=$i/include
    fi
 
    if test -r $i/libcm-mac.a; then
      CYBERMUT_LIB_DIR=$i
    elif test -r $i/lib/libcm-mac.a; then
      CYBERMUT_LIB_DIR=$i/lib
    fi
  done
    
  if test -z "$CYBERMUT_INC_DIR"; then
    { echo "configure: error: Could not find cm-mac.h Please make sure you have the
                 CyberMut SDK installed. Use
                 ./configure --with-cybermut=<cybermut-dir> if necessary" 1>&2; exit 1; }
  fi
 
  if test -z "$CYBERMUT_LIB_DIR"; then
    { echo "configure: error: Could not find libcm-mac.a Please make sure you have the
                 CyberMut SDK installed. Use
                 ./configure --with-cybermut=<cybermut-dir> if necessary" 1>&2; exit 1; }
  fi                                                                                                                                            
  echo "$ac_t""found in $CYBERMUT_LIB_DIR" 1>&6
  
  echo "$ac_t""linking libcm-mac.a with libcybermut.a" 1>&6
  ln -sf $CYBERMUT_LIB_DIR/libcm-mac.a $CYBERMUT_LIB_DIR/libcybermut.a

  
  if test "$CYBERMUT_INC_DIR" != "/usr/include"; then
    
  if test -z "$CYBERMUT_INC_DIR" || echo "$CYBERMUT_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$CYBERMUT_INC_DIR
  else
    
    ep_dir="`echo $CYBERMUT_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CYBERMUT_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

 
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST CYBERMUT_SHARED_LIBADD"

  

  if test "$ext_shared" = "yes"; then
    CYBERMUT_SHARED_LIBADD="-lcybermut $CYBERMUT_SHARED_LIBADD"
    if test -n "$CYBERMUT_LIB_DIR"; then
      
  if test "$CYBERMUT_LIB_DIR" != "/usr/lib"; then
    
  if test -z "$CYBERMUT_LIB_DIR" || echo "$CYBERMUT_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$CYBERMUT_LIB_DIR
  else
    
    ep_dir="`echo $CYBERMUT_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CYBERMUT_LIB_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "CYBERMUT_SHARED_LIBADD"; then
      CYBERMUT_SHARED_LIBADD="-R$CYBERMUT_LIB_DIR -L$CYBERMUT_LIB_DIR $CYBERMUT_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 "$CYBERMUT_LIB_DIR"; then
    
  if test "$CYBERMUT_LIB_DIR" != "/usr/lib"; then
    
  if test -z "$CYBERMUT_LIB_DIR" || echo "$CYBERMUT_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$CYBERMUT_LIB_DIR
  else
    
    ep_dir="`echo $CYBERMUT_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$CYBERMUT_LIB_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$CYBERMUT_LIB_DIR -L$CYBERMUT_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case cybermut in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcybermut $LIBS"


  ;;
  esac



  fi



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


  
  EXT_SUBDIRS="$EXT_SUBDIRS cybermut"
  
  if test -d "$abs_srcdir/ext/cybermut"; then
    ext_builddir=ext/cybermut
    ext_srcdir=$abs_srcdir/ext/cybermut
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcybermut.la"
    EXT_STATIC="$EXT_STATIC cybermut"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CYBERMUT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for cyrus imap support""... $ac_c" 1>&6
echo "configure:13369: checking for cyrus imap support" >&5
# 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
fi


case $PHP_CYRUS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CYRUS=`echo "$PHP_CYRUS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_CYRUS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_CYRUS" = "no" && PHP_CYRUS=yes
fi

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




if test "$PHP_CYRUS" != "no"; then
	found_cyrus=no
	found_sasl=no
	found_openssl=no
	for i in /usr /usr/local $PHP_CYRUS; 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

			
  PHP_VAR_SUBST="$PHP_VAR_SUBST CYRUS_SHARED_LIBADD"

			

  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" && test -n "CYRUS_SHARED_LIBADD"; then
      CYRUS_SHARED_LIBADD="-R$i/lib -L$i/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case cyrus in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcyrus $LIBS"


  ;;
  esac



  fi


			found_cyrus=yes
		fi
		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

			
  PHP_VAR_SUBST="$PHP_VAR_SUBST SASL_SHARED_LIBADD"

			

  if test "$ext_shared" = "yes"; then
    SASL_SHARED_LIBADD="-lsasl $SASL_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" && test -n "SASL_SHARED_LIBADD"; then
      SASL_SHARED_LIBADD="-R$i/lib -L$i/lib $SASL_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case sasl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsasl $LIBS"


  ;;
  esac



  fi


			found_sasl=yes
		fi
		if test -r $i/include/openssl/ssl.h && test "$found_openssl" = "no" && test "$PHP_OPENSSL" = "no"; then
			
  PHP_VAR_SUBST="$PHP_VAR_SUBST OPENSSL_SHARED_LIBADD"

			
  PHP_VAR_SUBST="$PHP_VAR_SUBST CRYPTO_SHARED_LIBADD"

			

  if test "$ext_shared" = "yes"; then
    OPENSSL_SHARED_LIBADD="-lssl $OPENSSL_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" && test -n "OPENSSL_SHARED_LIBADD"; then
      OPENSSL_SHARED_LIBADD="-R$i/lib -L$i/lib $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
  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case ssl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lssl $LIBS"


  ;;
  esac



  fi


			

  if test "$ext_shared" = "yes"; then
    CRYPTO_SHARED_LIBADD="-lcrypto $CRYPTO_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" && test -n "CRYPTO_SHARED_LIBADD"; then
      CRYPTO_SHARED_LIBADD="-R$i/lib -L$i/lib $CRYPTO_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case crypto in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lcrypto $LIBS"


  ;;
  esac



  fi


			found_openssl=yes
		fi
	done

	if test "$found_cyrus" = "no"; then
		echo "$ac_t""not found" 1>&6
		{ echo "configure: error: Please Re-install the cyrus distribution" 1>&2; exit 1; }
	fi

	if test "$found_sasl" = "no"; then
		echo "$ac_t""sasl not found" 1>&6
		{ echo "configure: error: Please Re-install the cyrus distribution" 1>&2; exit 1; }
	fi

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


	
  EXT_SUBDIRS="$EXT_SUBDIRS cyrus"
  
  if test -d "$abs_srcdir/ext/cyrus"; then
    ext_builddir=ext/cyrus
    ext_srcdir=$abs_srcdir/ext/cyrus
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libcyrus.la"
    EXT_STATIC="$EXT_STATIC cyrus"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_CYRUS 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi



# Checks for libraries.
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order





echo $ac_n "checking whether to include old xDBM support""... $ac_c" 1>&6
echo "configure:14039: checking whether to include old xDBM support" >&5
# 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
fi


case $PHP_DB in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DB=`echo "$PHP_DB"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DB" = "no" && PHP_DB=yes
fi

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




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

  
  echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
echo "configure:14085: checking for gdbm_open in -lgdbm" >&5
ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgdbm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14093 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdbm_open();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define GDBM 1
EOF
 DBM_TYPE=gdbm; DBM_LIB=-lgdbm
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbm_open in -lc""... $ac_c" 1>&6
echo "configure:14126: checking for dbm_open in -lc" >&5
ac_lib_var=`echo c'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14134 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbm_open();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define NDBM 1
EOF
 DBM_TYPE=ndbm; DBM_LIB=
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
echo "configure:14167: checking for dbm_open in -ldbm" >&5
ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldbm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14175 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbm_open();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define NDBM 1
EOF
 DBM_TYPE=ndbm; DBM_LIB=-ldbm
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dbm_open in -ldb""... $ac_c" 1>&6
echo "configure:14208: checking for dbm_open in -ldb" >&5
ac_lib_var=`echo db'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldb  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14216 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbm_open();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define NDBM 1
EOF
 DBM_TYPE=ndbm; DBM_LIB=-ldb
else
  echo "$ac_t""no" 1>&6
DBM_TYPE=""
fi

    
fi

   
fi

  
fi

  echo $ac_n "checking preferred dbm library""... $ac_c" 1>&6
echo "configure:14261: checking preferred dbm library" >&5
  if test "a$DBM_TYPE" = a; then
    echo "$ac_t""none found" 1>&6
    echo "configure: warning: No dbm library found - using built-in flatfile support" 1>&2
  else
    echo "$ac_t""$DBM_TYPE chosen" 1>&6
  fi
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST DBM_LIB"

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST DBM_TYPE"



  if test "$DBM_LIB" = "-lgdbm"; then
    ac_safe=`echo "gdbm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for gdbm.h""... $ac_c" 1>&6
echo "configure:14279: checking for gdbm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 14284 "configure"
#include "confdefs.h"
#include <gdbm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   GDBM_INCLUDE="" 
else
  echo "$ac_t""no" 1>&6
 
      echo "$ac_t"""Try /usr/local/include/gdbm.h"" 1>&6; 
      ac_safe=`echo "/usr/local/include/gdbm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for /usr/local/include/gdbm.h""... $ac_c" 1>&6
echo "configure:14312: checking for /usr/local/include/gdbm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 14317 "configure"
#include "confdefs.h"
#include </usr/local/include/gdbm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   GDBM_INCLUDE=-I/usr/local/include 
else
  echo "$ac_t""no" 1>&6

        echo "$ac_t"""Try /opt/local/include/gdbm.h"" 1>&6;
        ac_safe=`echo "/opt/local/include/gdbm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for /opt/local/include/gdbm.h""... $ac_c" 1>&6
echo "configure:14345: checking for /opt/local/include/gdbm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 14350 "configure"
#include "confdefs.h"
#include </opt/local/include/gdbm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   GDBM_INCLUDE=-I/opt/local/include 
else
  echo "$ac_t""no" 1>&6

                    echo "$ac_t"""Try /usr/pkg/include/gdbm.h"" 1>&6;
          ac_safe=`echo "/usr/pkg/include/gdbm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for /usr/pkg/include/gdbm.h""... $ac_c" 1>&6
echo "configure:14378: checking for /usr/pkg/include/gdbm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 14383 "configure"
#include "confdefs.h"
#include </usr/pkg/include/gdbm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   GDBM_INCLUDE="" 
else
  echo "$ac_t""no" 1>&6

            echo "$ac_t"""Giving up - You need to install gdbm.h somewhere"" 1>&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_SUBDIRS="$EXT_SUBDIRS db"
  
  if test -d "$abs_srcdir/ext/db"; then
    ext_builddir=ext/db
    ext_srcdir=$abs_srcdir/ext/db
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdb.la"
    EXT_STATIC="$EXT_STATIC db"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DB 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi















echo $ac_n "checking whether to enable DBA""... $ac_c" 1>&6
echo "configure:14581: checking whether to enable DBA" >&5
# 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
fi


case $PHP_DBA in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBA=`echo "$PHP_DBA"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBA=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DBA" = "no" && PHP_DBA=yes
fi

echo "$ac_t""$ext_output" 1>&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
    for i in /usr/local /usr $withval; do
      if test -f "$i/include/gdbm.h"; then
        THIS_PREFIX="$i"
      fi
    done

    unset ac_cv_lib_gdbm_gdbm_open
    
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
    echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
echo "configure:14640: checking for gdbm_open in -lgdbm" >&5
ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgdbm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14648 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdbm_open();

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

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

    
  LDFLAGS=$old_LDFLAGS

    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for GDBM support""... $ac_c" 1>&6
echo "configure:14834: checking for GDBM support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


# Check whether --with-ndbm or --without-ndbm was given.
if test "${with_ndbm+set}" = set; then
  withval="$with_ndbm"
  
  if test "$withval" != "no"; then
    for i in /usr/local /usr $withval; do
      if test -f "$i/include/db1/ndbm.h" ; then
        THIS_PREFIX=$i
        NDBM_EXTRA=db1/ndbm.h
      elif test -f "$i/include/ndbm.h" ; then
        THIS_PREFIX=$i
        NDBM_EXTRA=ndbm.h
      fi
	done
    
    if test "$NDBM_EXTRA" != ""; then
      cat >> confdefs.h <<EOF
#define NDBM_INCLUDE_FILE "$NDBM_EXTRA"
EOF

    fi

    for LIB in db1 ndbm c; do
      
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
      echo $ac_n "checking for dbm_open in -l$LIB""... $ac_c" 1>&6
echo "configure:14873: checking for dbm_open in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 14881 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbm_open();

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

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

      
  LDFLAGS=$old_LDFLAGS

    done
    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for NDBM support""... $ac_c" 1>&6
echo "configure:15068: checking for NDBM support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


# Check whether --with-db2 or --without-db2 was given.
if test "${with_db2+set}" = set; then
  withval="$with_db2"
  
  if test "$withval" != "no"; then
    for i in /usr/local /usr /usr/BerkeleyDB $withval/BerkeleyDB $withval; do
      if test -f "$i/db2/db.h"; then
        THIS_PREFIX=$i
        DB2_EXTRA=db2
      elif test -f "$i/include/db2/db.h"; then
        THIS_PREFIX=$i
        DB2_EXTRA=db2/db.h
      elif test -f "$i/include/db/db2.h"; then
        THIS_PREFIX=$i
        DB2_EXTRA=db/db2.h
      elif test -f "$i/include/db2.h"; then
        THIS_PREFIX=$i
        DB2_EXTRA=db2.h
      elif test -f "$i/include/db.h" ; then
        THIS_PREFIX=$i
        DB2_EXTRA=db.h
      fi
	done

    if test "$DB2_EXTRA" = "db2" ; then
      DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2"
      DB2_EXTRA=db.h
    fi
    
    if test -n "$DB2_EXTRA"; then
      cat >> confdefs.h <<EOF
#define DB2_INCLUDE_FILE "$DB2_EXTRA"
EOF

    fi

    for LIB in db db2 c; do
      
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
      echo $ac_n "checking for db_appinit in -l$LIB""... $ac_c" 1>&6
echo "configure:15121: checking for db_appinit in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'db_appinit | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15129 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char db_appinit();

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

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

      
  LDFLAGS=$old_LDFLAGS

    done
    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for Berkeley DB2 support""... $ac_c" 1>&6
echo "configure:15316: checking for Berkeley DB2 support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


# Check whether --with-db3 or --without-db3 was given.
if test "${with_db3+set}" = set; then
  withval="$with_db3"
  
  if test "$withval" != "no"; then
    for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
      if test -f "$i/include/db.h" ; then
        THIS_PREFIX=$i
        DB3_EXTRA=db.h
      fi
    done

    if test -n "$DB3_EXTRA"; then
      cat >> confdefs.h <<EOF
#define DB3_INCLUDE_FILE "$DB3_EXTRA"
EOF

    fi

    for LIB in db db-3 db3; do
      
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
      echo $ac_n "checking for db_create in -l$LIB""... $ac_c" 1>&6
echo "configure:15352: checking for db_create in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'db_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15360 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char db_create();

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

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

      
  LDFLAGS=$old_LDFLAGS

    done
    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for Berkeley DB3 support""... $ac_c" 1>&6
echo "configure:15547: checking for Berkeley DB3 support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


# Check whether --with-dbm or --without-dbm was given.
if test "${with_dbm+set}" = set; then
  withval="$with_dbm"
  
  if test "$withval" != "no"; then
    for i in /usr/local /usr $withval; do
      if test -f "$i/include/dbm.h" ; then
        THIS_PREFIX=$i
      fi
	done

    for LIB in db1 dbm c; do
      
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
      echo $ac_n "checking for dbminit in -l$LIB""... $ac_c" 1>&6
echo "configure:15575: checking for dbminit in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'dbminit | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15583 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbminit();

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

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

      
  LDFLAGS=$old_LDFLAGS

    done
    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for DBM support""... $ac_c" 1>&6
echo "configure:15770: checking for DBM support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


# Check whether --with-cdb or --without-cdb was given.
if test "${with_cdb+set}" = set; then
  withval="$with_cdb"
  
  if test "$withval" != "no"; then
    for i in /usr/local /usr $withval; do
      if test -f "$i/include/cdb.h" ; then
        THIS_PREFIX=$i
      fi
	done

    for LIB in cdb c; do
      
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$THIS_PREFIX/lib $LDFLAGS"
  
      echo $ac_n "checking for cdb_bread in -l$LIB""... $ac_c" 1>&6
echo "configure:15798: checking for cdb_bread in -l$LIB" >&5
ac_lib_var=`echo $LIB'_'cdb_bread | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIB  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 15806 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cdb_bread();

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

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

      
  LDFLAGS=$old_LDFLAGS

    done
    
    
  if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
    THIS_INCLUDE=$THIS_PREFIX/include
    THIS_LFLAGS=$THIS_PREFIX/lib
  fi

    
  THIS_RESULT="yes"
  if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
    { echo "configure: error: cannot find necessary header file(s)" 1>&2; exit 1; }
  fi
  if test "$THIS_LIBS" = "" ; then
    { echo "configure: error: cannot find necessary library" 1>&2; exit 1; }
  fi

    
  
  if test "$THIS_INCLUDE" != "/usr/include"; then
    
  if test -z "$THIS_INCLUDE" || echo "$THIS_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$THIS_INCLUDE
  else
    
    ep_dir="`echo $THIS_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$THIS_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
    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" && test -n "DBA_SHARED_LIBADD"; then
      DBA_SHARED_LIBADD="-R$THIS_LFLAGS -L$THIS_LFLAGS $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$THIS_LFLAGS -L$THIS_LFLAGS $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

echo $ac_n "checking for CDB support""... $ac_c" 1>&6
echo "configure:15993: checking for CDB support" >&5

  if test "$THIS_RESULT" = "yes"; then
    HAVE_DBA=1
    echo "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi
  unset THIS_RESULT


echo $ac_n "checking whether to enable DBA interface""... $ac_c" 1>&6
echo "configure:16005: checking whether to enable DBA interface" >&5
if test "$HAVE_DBA" = "1"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_DBA 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS dba"
  
  if test -d "$abs_srcdir/ext/dba"; then
    ext_builddir=ext/dba
    ext_srcdir=$abs_srcdir/ext/dba
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdba.la"
    EXT_STATIC="$EXT_STATIC dba"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DBA 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST DBA_SHARED_LIBADD"

else
  echo "$ac_t""no" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_DBA 0
EOF

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 $ac_n "checking whether to enable the bundled dbase library""... $ac_c" 1>&6
echo "configure:16170: checking whether to enable the bundled dbase library" >&5
# 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
fi


case $PHP_DBASE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBASE=`echo "$PHP_DBASE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DBASE" = "no" && PHP_DBASE=yes
fi

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




if test "$PHP_DBASE" = "yes"; then
  cat >> confdefs.h <<\EOF
#define DBASE 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS dbase"
  
  if test -d "$abs_srcdir/ext/dbase"; then
    ext_builddir=ext/dbase
    ext_srcdir=$abs_srcdir/ext/dbase
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdbase.la"
    EXT_STATIC="$EXT_STATIC dbase"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DBASE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi





echo $ac_n "checking for dbplus support""... $ac_c" 1>&6
echo "configure:16359: checking for dbplus support" >&5
# Check whether --with-dbplus or --without-dbplus was given.
if test "${with_dbplus+set}" = set; then
  withval="$with_dbplus"
  PHP_DBPLUS=$withval
else
  PHP_DBPLUS=no
fi


case $PHP_DBPLUS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBPLUS=`echo "$PHP_DBPLUS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBPLUS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DBPLUS" = "no" && PHP_DBPLUS=yes
fi

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




if test "$PHP_DBPLUS" != "no"; then
  # --with-dbplus -> check with-path
	SEARCH_PATH="/usr/dbplus"    
  SEARCH_FOR="/include/dbconfig.h"  
  if test -r $PHP_DBPLUS/; then # path given as parameter
    DBPLUS_DIR=$PHP_DBPLUS
  else # search default path list
    echo $ac_n "checking for dbplus files in default path""... $ac_c" 1>&6
echo "configure:16409: checking for dbplus files in default path" >&5
    for i in $SEARCH_PATH ; do
      if test -r $i/$SEARCH_FOR; then
        DBPLUS_DIR=$i
        echo "$ac_t""found in $i" 1>&6
      fi
    done
  fi

  if test -z "$DBPLUS_DIR"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the dbplus distribution" 1>&2; exit 1; }
  fi

  # --with-dbplus -> add include path
  
  if test "$DBPLUS_DIR/include" != "/usr/include"; then
    
  if test -z "$DBPLUS_DIR/include" || echo "$DBPLUS_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/include
  else
    
    ep_dir="`echo $DBPLUS_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_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


  # --with-dbplus -> chech for lib and symbol presence 
	LIBNAME=Ddb
  LIBSYMBOL=Db_Init
  old_LIBS=$LIBS
  LIBS="$LIBS -L$DBPLUS_DIR/lib -ldl -lDmacc -lDracc"
  echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6
echo "configure:16462: checking for $LIBSYMBOL in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 16470 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $LIBSYMBOL();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: wrong dbplus lib version or lib not found" 1>&2; exit 1; }
fi

  LIBS=$old_LIBS
  
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST DBPLUS_SHARED_LIBADD"

  

  if test "$ext_shared" = "yes"; then
    DBPLUS_SHARED_LIBADD="-l$LIBNAME $DBPLUS_SHARED_LIBADD"
    if test -n "$DBPLUS_DIR/lib"; then
      
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "DBPLUS_SHARED_LIBADD"; then
      DBPLUS_SHARED_LIBADD="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/lib $DBPLUS_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 "$DBPLUS_DIR/lib"; then
    
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/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
  
 case $LIBNAME in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$LIBNAME $LIBS"


  ;;
  esac



  fi


  

  if test "$ext_shared" = "yes"; then
    DBPLUS_SHARED_LIBADD="-lDmacc $DBPLUS_SHARED_LIBADD"
    if test -n "$DBPLUS_DIR/lib"; then
      
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "DBPLUS_SHARED_LIBADD"; then
      DBPLUS_SHARED_LIBADD="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/lib $DBPLUS_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 "$DBPLUS_DIR/lib"; then
    
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/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
  
 case Dmacc in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lDmacc $LIBS"


  ;;
  esac



  fi


  

  if test "$ext_shared" = "yes"; then
    DBPLUS_SHARED_LIBADD="-lDracc $DBPLUS_SHARED_LIBADD"
    if test -n "$DBPLUS_DIR/lib"; then
      
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "DBPLUS_SHARED_LIBADD"; then
      DBPLUS_SHARED_LIBADD="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/lib $DBPLUS_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 "$DBPLUS_DIR/lib"; then
    
  if test "$DBPLUS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$DBPLUS_DIR/lib" || echo "$DBPLUS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$DBPLUS_DIR/lib
  else
    
    ep_dir="`echo $DBPLUS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$DBPLUS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$DBPLUS_DIR/lib -L$DBPLUS_DIR/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
  
 case Dracc in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lDracc $LIBS"


  ;;
  esac



  fi



  
  EXT_SUBDIRS="$EXT_SUBDIRS dbplus"
  
  if test -d "$abs_srcdir/ext/dbplus"; then
    ext_builddir=ext/dbplus
    ext_srcdir=$abs_srcdir/ext/dbplus
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdbplus.la"
    EXT_STATIC="$EXT_STATIC dbplus"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DBPLUS 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to enable dbx support""... $ac_c" 1>&6
echo "configure:16934: checking whether to enable dbx support" >&5
# 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
fi


case $PHP_DBX in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBX=`echo "$PHP_DBX"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DBX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DBX" = "no" && PHP_DBX=yes
fi

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




if test "$PHP_DBX" != "no"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS dbx"
  
  if test -d "$abs_srcdir/ext/dbx"; then
    ext_builddir=ext/dbx
    ext_srcdir=$abs_srcdir/ext/dbx
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdbx.la"
    EXT_STATIC="$EXT_STATIC dbx"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DBX 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi






echo $ac_n "checking for DOM support""... $ac_c" 1>&6
echo "configure:17120: checking for DOM support" >&5
# 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
fi


case $PHP_DOM in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DOM=`echo "$PHP_DOM"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_DOM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_DOM" = "no" && PHP_DOM=yes
fi

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




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

  DOMXML_DIR_ADD=""
  if test -r $PHP_DOM/include/libxml/tree.h; then
    DOMXML_DIR=$PHP_DOM
  elif test -r $PHP_DOM/include/libxml2/libxml/tree.h; then
    DOMXML_DIR=$PHP_DOM
    DOMXML_DIR_ADD="/libxml2"
  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 "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the libxml >= 2.4.2 distribution" 1>&2; exit 1; }
  fi

  
  old_CPPFLAGS=$CPPFLAGS
  CPPFLAGS=-I$DOMXML_DIR/include$DOMXML_DIR_ADD
  echo $ac_n "checking for libxml version""... $ac_c" 1>&6
echo "configure:17186: checking for libxml version" >&5
  cat > conftest.$ac_ext <<EOF
#line 17188 "configure"
#include "confdefs.h"

  #include <libxml/xmlversion.h>
  #if LIBXML_VERSION >= 20402
  yes
  #endif
  
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  
    echo "$ac_t"">= 2.4.2" 1>&6
  
else
  rm -rf conftest*
  
    { echo "configure: error: libxml version 2.4.2 or greater required." 1>&2; 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

  

  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" && test -n "DOMXML_SHARED_LIBADD"; then
      DOMXML_SHARED_LIBADD="-R$DOMXML_DIR/lib -L$DOMXML_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$DOMXML_DIR/lib -L$DOMXML_DIR/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
  
 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 "$PHP_ZLIB_DIR" = "no"; then
    { echo "configure: error: DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>" 1>&2; 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" && test -n "DOMXML_SHARED_LIBADD"; then
      DOMXML_SHARED_LIBADD="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/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
  
 case z in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lz $LIBS"


  ;;
  esac



  fi


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

  
  EXT_SUBDIRS="$EXT_SUBDIRS domxml"
  
  if test -d "$abs_srcdir/ext/domxml"; then
    ext_builddir=ext/domxml
    ext_srcdir=$abs_srcdir/ext/domxml
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libdomxml.la"
    EXT_STATIC="$EXT_STATIC domxml"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_DOMXML 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST DOMXML_SHARED_LIBADD"

fi




echo $ac_n "checking whether to enable exif support""... $ac_c" 1>&6
echo "configure:17593: checking whether to enable exif support" >&5
# 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
fi


case $PHP_EXIF in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXIF=`echo "$PHP_EXIF"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXIF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_EXIF" = "no" && PHP_EXIF=yes
fi

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




if test "$PHP_EXIF" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_EXIF 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS exif"
  
  if test -d "$abs_srcdir/ext/exif"; then
    ext_builddir=ext/exif
    ext_srcdir=$abs_srcdir/ext/exif
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libexif.la"
    EXT_STATIC="$EXT_STATIC exif"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_EXIF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for FrontBase SQL92 (fbsql) support""... $ac_c" 1>&6
echo "configure:17781: checking for FrontBase SQL92 (fbsql) support" >&5
# 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
fi


case $PHP_FBSQL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FBSQL=`echo "$PHP_FBSQL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FBSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FBSQL" = "no" && PHP_FBSQL=yes
fi

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




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

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

  
  EXT_SUBDIRS="$EXT_SUBDIRS fbsql"
  
  if test -d "$abs_srcdir/ext/fbsql"; then
    ext_builddir=ext/fbsql
    ext_srcdir=$abs_srcdir/ext/fbsql
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libfbsql.la"
    EXT_STATIC="$EXT_STATIC fbsql"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_FBSQL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



  FBSQL_INSTALLATION_DIR=""
  if test "$PHP_FBSQL" = "yes"; then

    for i in /Local/Library /usr /usr/local /opt /Library; 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 "configure: error: Cannot find FrontBase in well know installation directories" 1>&2; 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 "configure: error: Directory $PHP_FBSQL is not a FrontBase installation directory" 1>&2; exit 1; }
    fi
  fi  

  if test -z "$FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a"; then
     { echo "configure: error: Could not find $FBSQL_INSTALLATION_DIR/lib/libFBCAccess.a" 1>&2; exit 1; }
  fi

  

  if test "$ext_shared" = "yes"; then
    $FBSQL_INSTALLATION_DIR/lib="-lFBCAccess $$FBSQL_INSTALLATION_DIR/lib"
    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" && test -n "$FBSQL_INSTALLATION_DIR/lib"; then
      $FBSQL_INSTALLATION_DIR/lib="-R$FBSQL_INSTALLATION_DIR/lib -L$FBSQL_INSTALLATION_DIR/lib $$FBSQL_INSTALLATION_DIR/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 "$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" && test -n ""; then
      ="-R$FBSQL_INSTALLATION_DIR/lib -L$FBSQL_INSTALLATION_DIR/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
  
 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

fi




echo $ac_n "checking for fdftk support""... $ac_c" 1>&6
echo "configure:18123: checking for fdftk support" >&5
# 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
fi


case $PHP_FDFTK in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FDFTK=`echo "$PHP_FDFTK"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FDFTK=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FDFTK" = "no" && PHP_FDFTK=yes
fi

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




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

  for i in /usr /usr/local $PHP_FDFTK; do
    if test -r $i/include/FdfTk.h -o -r $i/include/fdftk.h; then
      FDFTK_DIR=$i
    fi
  done

  if test -z "$FDFTK_DIR"; then
    { echo "configure: error: FdfTk.h or fdftk.h not found. Please reinstall the fdftk distribution" 1>&2; exit 1; }
  fi

  
  if test "$FDFTK_DIR/include" != "/usr/include"; then
    
  if test -z "$FDFTK_DIR/include" || echo "$FDFTK_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_DIR/include
  else
    
    ep_dir="`echo $FDFTK_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_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

  
  FDFLIBRARY=""
  for i in fdftk FdfTk; do
    echo $ac_n "checking for FDFOpen in -l$i""... $ac_c" 1>&6
echo "configure:18212: checking for FDFOpen in -l$i" >&5
ac_lib_var=`echo $i'_'FDFOpen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$i -L$FDFTK_DIR/lib -lm $LIBS"
cat > conftest.$ac_ext <<EOF
#line 18220 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char FDFOpen();

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

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

  done
  
  if test -z "$FDFLIBRARY"; then
    { echo "configure: error: fdftk module requires >= fdftk 2.0" 1>&2; exit 1; }
  fi
  
  cat >> confdefs.h <<\EOF
#define HAVE_FDFLIB 1
EOF

  

  if test "$ext_shared" = "yes"; then
    FDFTK_SHARED_LIBADD="-l$FDFLIBRARY $FDFTK_SHARED_LIBADD"
    if test -n "$FDFTK_DIR/lib"; then
      
  if test "$FDFTK_DIR/lib" != "/usr/lib"; then
    
  if test -z "$FDFTK_DIR/lib" || echo "$FDFTK_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_DIR/lib
  else
    
    ep_dir="`echo $FDFTK_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "FDFTK_SHARED_LIBADD"; then
      FDFTK_SHARED_LIBADD="-R$FDFTK_DIR/lib -L$FDFTK_DIR/lib $FDFTK_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_DIR/lib"; then
    
  if test "$FDFTK_DIR/lib" != "/usr/lib"; then
    
  if test -z "$FDFTK_DIR/lib" || echo "$FDFTK_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$FDFTK_DIR/lib
  else
    
    ep_dir="`echo $FDFTK_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$FDFTK_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$FDFTK_DIR/lib -L$FDFTK_DIR/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
  
 case $FDFLIBRARY in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$FDFLIBRARY $LIBS"


  ;;
  esac



  fi



  
  PHP_VAR_SUBST="$PHP_VAR_SUBST FDFTK_SHARED_LIBADD"

  
  EXT_SUBDIRS="$EXT_SUBDIRS fdf"
  
  if test -d "$abs_srcdir/ext/fdf"; then
    ext_builddir=ext/fdf
    ext_srcdir=$abs_srcdir/ext/fdf
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libfdf.la"
    EXT_STATIC="$EXT_STATIC fdf"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_FDF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi


# Check whether --with-filepro or --without-filepro was given.
if test "${with_filepro+set}" = set; then
  withval="$with_filepro"
  enable_filepro=$withval
fi




echo $ac_n "checking whether to enable the bundled filePro support""... $ac_c" 1>&6
echo "configure:18507: checking whether to enable the bundled filePro support" >&5
# 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
fi


case $PHP_FILEPRO in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FILEPRO=`echo "$PHP_FILEPRO"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FILEPRO=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FILEPRO" = "no" && PHP_FILEPRO=yes
fi

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




if test "$PHP_FILEPRO" = "yes"; then
  cat >> confdefs.h <<\EOF
#define HAVE_FILEPRO 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS filepro"
  
  if test -d "$abs_srcdir/ext/filepro"; then
    ext_builddir=ext/filepro
    ext_srcdir=$abs_srcdir/ext/filepro
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libfilepro.la"
    EXT_STATIC="$EXT_STATIC filepro"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_FILEPRO 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to add fribidi support""... $ac_c" 1>&6
echo "configure:18695: checking whether to add fribidi support" >&5
# 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
fi


case $PHP_FRIBIDI in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FRIBIDI=`echo "$PHP_FRIBIDI"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FRIBIDI=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FRIBIDI" = "no" && PHP_FRIBIDI=yes
fi

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




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


  if test "$PHP_FRIBIDI" = "yes"; then
    PHP_FRIBIDI=/usr/local
  fi

  
  echo $ac_n "checking for header files in "$PHP_FRIBIDI/include/fribidi"""... $ac_c" 1>&6
echo "configure:18746: checking for header files in "$PHP_FRIBIDI/include/fribidi"" >&5
  if test -f $PHP_FRIBIDI/include/fribidi/fribidi.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_types.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_char_sets.h; then
    FRIBIDI_INCDIR=$PHP_FRIBIDI/include/fribidi/
    echo "$ac_t""found all" 1>&6
  else
    echo "$ac_t""missing" 1>&6
  fi

    
  echo $ac_n "checking for libfribidi.so file in "$PHP_FRIBIDI/lib/"""... $ac_c" 1>&6
echo "configure:18756: checking for libfribidi.so file in "$PHP_FRIBIDI/lib/"" >&5
  if test -f "$PHP_FRIBIDI/lib/libfribidi.so" ; then
    FRIBIDI_LIBDIR=$PHP_FRIBIDI/lib/
    echo "$ac_t""found" 1>&6
  else
    echo "$ac_t""missing" 1>&6
  fi

  
  echo $ac_n "checking for glibconfig.h in "usr/lib/glib/include/"""... $ac_c" 1>&6
echo "configure:18766: checking for glibconfig.h in "usr/lib/glib/include/"" >&5
  if test -f  /usr/lib/glib/include/glibconfig.h ; then
    echo "$ac_t""found" 1>&6
    GLIB_INCDIR=/usr/lib/glib/include/
  else
    echo "$ac_t""missing" 1>&6
  fi

  
    echo $ac_n "checking for FriBidi version""... $ac_c" 1>&6
echo "configure:18776: checking for FriBidi version" >&5
  FRIBIDI_CONFIG=$PHP_FRIBIDI/bin/fribidi-config
  if test -x $FRIBIDI_CONFIG; then
    fribidi_version_full=`$FRIBIDI_CONFIG --version`
  fi
  
  fribidi_version=`echo ${fribidi_version_full} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`

  if test "$fribidi_version" -ge 9000; then
    echo "$ac_t""$fribidi_version_full" 1>&6
  else
    { echo "configure: error: FriBidi version 0.9.0 or later is required to compile php with FriBidi support" 1>&2; exit 1; }
  fi


  echo $ac_n "checking sanity to build  extension""... $ac_c" 1>&6
echo "configure:18792: checking sanity to build  extension" >&5
  if  test -n "$FRIBIDI_INCDIR" && test -n "$FRIBIDI_LIBDIR" && test -n "$GLIB_INCDIR"; then

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

    
  if test ""$FRIBIDI_INCDIR"" != "/usr/include"; then
    
  if test -z ""$FRIBIDI_INCDIR"" || echo ""$FRIBIDI_INCDIR"" | grep '^/' >/dev/null ; then
    ai_p="$FRIBIDI_INCDIR"
  else
    
    ep_dir="`echo "$FRIBIDI_INCDIR"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$FRIBIDI_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 ""$GLIB_INCDIR"" != "/usr/include"; then
    
  if test -z ""$GLIB_INCDIR"" || echo ""$GLIB_INCDIR"" | grep '^/' >/dev/null ; then
    ai_p="$GLIB_INCDIR"
  else
    
    ep_dir="`echo "$GLIB_INCDIR"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$GLIB_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
    FRIBIDI_SHARED_LIBADD="-lfribidi $FRIBIDI_SHARED_LIBADD"
    if test -n ""$FRIBIDI_LIBDIR""; then
      
  if test ""$FRIBIDI_LIBDIR"" != "/usr/lib"; then
    
  if test -z ""$FRIBIDI_LIBDIR"" || echo ""$FRIBIDI_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p="$FRIBIDI_LIBDIR"
  else
    
    ep_dir="`echo "$FRIBIDI_LIBDIR"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$FRIBIDI_LIBDIR"\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "FRIBIDI_SHARED_LIBADD"; then
      FRIBIDI_SHARED_LIBADD="-R"$FRIBIDI_LIBDIR" -L"$FRIBIDI_LIBDIR" $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

    fi
  else
    

  if test -n ""$FRIBIDI_LIBDIR""; then
    
  if test ""$FRIBIDI_LIBDIR"" != "/usr/lib"; then
    
  if test -z ""$FRIBIDI_LIBDIR"" || echo ""$FRIBIDI_LIBDIR"" | grep '^/' >/dev/null ; then
    ai_p="$FRIBIDI_LIBDIR"
  else
    
    ep_dir="`echo "$FRIBIDI_LIBDIR"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$FRIBIDI_LIBDIR"\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"$FRIBIDI_LIBDIR" -L"$FRIBIDI_LIBDIR" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case fribidi in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lfribidi $LIBS"


  ;;
  esac



  fi



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

    
  EXT_SUBDIRS="$EXT_SUBDIRS fribidi"
  
  if test -d "$abs_srcdir/ext/fribidi"; then
    ext_builddir=ext/fribidi
    ext_srcdir=$abs_srcdir/ext/fribidi
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libfribidi.la"
    EXT_STATIC="$EXT_STATIC fribidi"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_FRIBIDI 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


    
  PHP_VAR_SUBST="$PHP_VAR_SUBST FRIBIDI_SHARED_LIBADD"

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




echo $ac_n "checking whether to enable FTP support""... $ac_c" 1>&6
echo "configure:19105: checking whether to enable FTP support" >&5
# 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
fi


case $PHP_FTP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FTP=`echo "$PHP_FTP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FTP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FTP" = "no" && PHP_FTP=yes
fi

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




if test "$PHP_FTP" = "yes"; then
  cat >> confdefs.h <<\EOF
#define HAVE_FTP 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS ftp"
  
  if test -d "$abs_srcdir/ext/ftp"; then
    ext_builddir=ext/ftp
    ext_srcdir=$abs_srcdir/ext/ftp
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libftp.la"
    EXT_STATIC="$EXT_STATIC ftp"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_FTP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi





















echo $ac_n "checking whether to include GD support""... $ac_c" 1>&6
echo "configure:19310: checking whether to include GD support" >&5
# 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
fi


case $PHP_GD in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GD=`echo "$PHP_GD"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GD=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_GD" = "no" && PHP_GD=yes
fi

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




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

  
  EXT_SUBDIRS="$EXT_SUBDIRS gd"
  
  if test -d "$abs_srcdir/ext/gd"; then
    ext_builddir=ext/gd
    ext_srcdir=$abs_srcdir/ext/gd
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libgd.la"
    EXT_STATIC="$EXT_STATIC gd"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_GD 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST GD_SHARED_LIBADD"


  
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST SHLIB_SUFFIX_NAME"

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

  
  

echo $ac_n "checking whether to enable truetype string function in gd""... $ac_c" 1>&6
echo "configure:19508: checking whether to enable truetype string function in gd" >&5
# 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
fi


case $PHP_GD_NATIVE_TTF in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GD_NATIVE_TTF=`echo "$PHP_GD_NATIVE_TTF"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GD_NATIVE_TTF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_GD_NATIVE_TTF" = "no" && PHP_GD_NATIVE_TTF=yes
fi

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



  
  if test "$PHP_GD_NATIVE_TTF" = "yes"; then
    cat >> confdefs.h <<\EOF
#define USE_GD_IMGSTRTTF 1
EOF

  fi

  
  

echo $ac_n "checking for the location of libjpeg""... $ac_c" 1>&6
echo "configure:19561: checking for the location of libjpeg" >&5
# 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
fi


case $PHP_JPEG_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_JPEG_DIR=`echo "$PHP_JPEG_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_JPEG_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_JPEG_DIR" = "no" && PHP_JPEG_DIR=yes
fi

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




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

    for i in /usr /usr/local $PHP_JPEG_DIR; do
      test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i
    done

    echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
echo "configure:19610: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ljpeg 
      -L$GD_JPEG_DIR/lib
     $LIBS"
cat > conftest.$ac_ext <<EOF
#line 19620 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char jpeg_read_header();

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

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

  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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$GD_JPEG_DIR/lib -L$GD_JPEG_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GD_JPEG_DIR/lib -L$GD_JPEG_DIR/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
  
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac



  fi


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

      { echo "configure: error: Problem with libjpeg.(a|so). Please check config.log for more information." 1>&2; exit 1; } 
    
fi

  else 
    echo "$ac_t""If configure fails try --with-jpeg-dir=<DIR>" 1>&6
  fi

  
  

echo $ac_n "checking for the location of libpng""... $ac_c" 1>&6
echo "configure:19757: checking for the location of libpng" >&5
# 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
fi


case $PHP_PNG_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PNG_DIR=`echo "$PHP_PNG_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PNG_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes
fi

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




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

    for i in /usr /usr/local $PHP_PNG_DIR; do
      test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i
    done

    if test "$PHP_ZLIB_DIR" = "no"; then
      { echo "configure: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>" 1>&2; exit 1; }
    fi
    
    echo $ac_n "checking for png_info_init in -lpng""... $ac_c" 1>&6
echo "configure:19810: checking for png_info_init in -lpng" >&5
ac_lib_var=`echo png'_'png_info_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpng 
      -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
     $LIBS"
cat > conftest.$ac_ext <<EOF
#line 19820 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_info_init();

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

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

  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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/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
  
 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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$GD_PNG_DIR/lib -L$GD_PNG_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GD_PNG_DIR/lib -L$GD_PNG_DIR/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
  
 case png in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpng $LIBS"


  ;;
  esac



  fi


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

      { echo "configure: error: Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information." 1>&2; exit 1; } 
    
fi

  else 
    echo "$ac_t""If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>" 1>&6
  fi

  
  

echo $ac_n "checking for the location of libXpm""... $ac_c" 1>&6
echo "configure:20051: checking for the location of libXpm" >&5
# 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
fi


case $PHP_XPM_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XPM_DIR=`echo "$PHP_XPM_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XPM_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_XPM_DIR" = "no" && PHP_XPM_DIR=yes
fi

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




  if test "$PHP_XPM_DIR" != "no"; then
    for i in /usr /usr/local /usr/X11R6 $PHP_XPM_DIR; do
      test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i
    done

    echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6
echo "configure:20099: checking for XpmFreeXpmImage in -lXpm" >&5
ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXpm 
      -L$GD_XPM_DIR/lib -lX11
     $LIBS"
cat > conftest.$ac_ext <<EOF
#line 20109 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char XpmFreeXpmImage();

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

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

  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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$GD_XPM_DIR/lib -L$GD_XPM_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GD_XPM_DIR/lib -L$GD_XPM_DIR/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
  
 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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$GD_XPM_DIR/lib -L$GD_XPM_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GD_XPM_DIR/lib -L$GD_XPM_DIR/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
  
 case X11 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lX11 $LIBS"


  ;;
  esac



  fi


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

      { echo "configure: error: Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information." 1>&2; exit 1; } 
    
fi

  else 
    echo "$ac_t""If configure fails try --with-xpm-dir=<DIR>" 1>&6
  fi

  
  

echo $ac_n "checking for freetype(2)""... $ac_c" 1>&6
echo "configure:20340: checking for freetype(2)" >&5
# 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
fi


case $PHP_FREETYPE_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FREETYPE_DIR=`echo "$PHP_FREETYPE_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_FREETYPE_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_FREETYPE_DIR" = "no" && PHP_FREETYPE_DIR=yes
fi

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




  if test "$PHP_FREETYPE_DIR" != "no"; then
    for i in /usr /usr/local $PHP_FREETYPE_DIR; do
      if test -f "$i/include/freetype2/freetype/freetype.h"; then
        FREETYPE2_DIR=$i
        FREETYPE2_INC_DIR=$i/include/freetype2/freetype
      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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$FREETYPE2_DIR/lib -L$FREETYPE2_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$FREETYPE2_DIR/lib -L$FREETYPE2_DIR/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
  
 case freetype in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lfreetype $LIBS"


  ;;
  esac



  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 <<\EOF
#define USE_GD_IMGSTRTTF 1
EOF

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

    else
      { echo "configure: error: freetype2 not found!" 1>&2; exit 1; }
    fi
  else 
    echo "$ac_t""If configure fails try --with-freetype-dir=<DIR>" 1>&6
  fi

  
  

echo $ac_n "checking whether to include include FreeType 1.x support""... $ac_c" 1>&6
echo "configure:20535: checking whether to include include FreeType 1.x support" >&5
# 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
fi


case $PHP_TTF in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TTF=`echo "$PHP_TTF"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TTF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_TTF" = "no" && PHP_TTF=yes
fi

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



  
  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 /usr /usr/local $PHP_TTF; 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
        done
      fi
      if test -n "$TTF_DIR" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_LIBTTF 1
EOF

        

  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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$TTF_DIR/lib -L$TTF_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$TTF_DIR/lib -L$TTF_DIR/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
  
 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 "$ac_t""no - FreeType 2.x is to be used instead" 1>&6
    fi
  fi

  
  

echo $ac_n "checking whether to include T1lib support""... $ac_c" 1>&6
echo "configure:20734: checking whether to include T1lib support" >&5
# 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
fi


case $PHP_T1LIB in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_T1LIB=`echo "$PHP_T1LIB"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_T1LIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_T1LIB" = "no" && PHP_T1LIB=yes
fi

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




  if test "$PHP_T1LIB" != "no"; then
    for i in /usr /usr/local $PHP_T1LIB; do
      test -f "$i/include/t1lib.h" && T1_DIR=$i
    done

    if test -n "$T1_DIR"; then
      echo $ac_n "checking for T1_LoadFont in -lt1""... $ac_c" 1>&6
echo "configure:20783: checking for T1_LoadFont in -lt1" >&5
ac_lib_var=`echo t1'_'T1_LoadFont | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lt1 
        -L$T1_DIR/lib
       $LIBS"
cat > conftest.$ac_ext <<EOF
#line 20793 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char T1_LoadFont();

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

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

        
  if test ""$T1_DIR/include"" != "/usr/include"; then
    
  if test -z ""$T1_DIR/include"" || echo ""$T1_DIR/include"" | grep '^/' >/dev/null ; then
    ai_p="$T1_DIR/include"
  else
    
    ep_dir="`echo "$T1_DIR/include"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$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 ""$T1_DIR/lib""; then
      
  if test ""$T1_DIR/lib"" != "/usr/lib"; then
    
  if test -z ""$T1_DIR/lib"" || echo ""$T1_DIR/lib"" | grep '^/' >/dev/null ; then
    ai_p="$T1_DIR/lib"
  else
    
    ep_dir="`echo "$T1_DIR/lib"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$T1_DIR/lib"\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R"$T1_DIR/lib" -L"$T1_DIR/lib" $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 ""$T1_DIR/lib""; then
    
  if test ""$T1_DIR/lib"" != "/usr/lib"; then
    
  if test -z ""$T1_DIR/lib"" || echo ""$T1_DIR/lib"" | grep '^/' >/dev/null ; then
    ai_p="$T1_DIR/lib"
  else
    
    ep_dir="`echo "$T1_DIR/lib"|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \""$T1_DIR/lib"\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"$T1_DIR/lib" -L"$T1_DIR/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
  
 case t1 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lt1 $LIBS"


  ;;
  esac



  fi


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

        { echo "configure: error: Problem with libt1.(a|so). Please check config.log for more information." 1>&2; exit 1; } 
      
fi

    else
      { echo "configure: error: Your t1lib distribution is not installed correctly. Please reinstall it." 1>&2; exit 1; } 
    fi
  fi


  case $PHP_GD in
    yes)
      
 case gd in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  GD_SHARED_LIBADD="-lgd $GD_SHARED_LIBADD"

   else
     
 case gd in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lgd $LIBS"


  ;;
  esac

   fi

  ;;
  esac

      
  save_LIBS="$LIBS"
  LIBS="$GD_SHARED_LIBADD $LIBS" 
  echo $ac_n "checking for gdImageString16 in -lgd""... $ac_c" 1>&6
echo "configure:20996: checking for gdImageString16 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageString16 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21004 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageString16();

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

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

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

  echo $ac_n "checking for gdImagePaletteCopy in -lgd""... $ac_c" 1>&6
echo "configure:21039: checking for gdImagePaletteCopy in -lgd" >&5
ac_lib_var=`echo gd'_'gdImagePaletteCopy | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21047 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImagePaletteCopy();

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

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

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

  echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6
echo "configure:21082: checking for gdImageCreateFromPng in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21090 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromPng();

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

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

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

  echo $ac_n "checking for gdImageCreateFromGif in -lgd""... $ac_c" 1>&6
echo "configure:21125: checking for gdImageCreateFromGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21133 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGif();

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

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

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

  echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6
echo "configure:21168: checking for gdImageGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21176 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageGif();

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

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

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

  echo $ac_n "checking for gdImageWBMP in -lgd""... $ac_c" 1>&6
echo "configure:21211: checking for gdImageWBMP in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageWBMP | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21219 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageWBMP();

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

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

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

  echo $ac_n "checking for gdImageCreateFromJpeg in -lgd""... $ac_c" 1>&6
echo "configure:21254: checking for gdImageCreateFromJpeg in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromJpeg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21262 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromJpeg();

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

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

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

  echo $ac_n "checking for gdImageCreateFromXpm in -lgd""... $ac_c" 1>&6
echo "configure:21297: checking for gdImageCreateFromXpm in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromXpm | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21305 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromXpm();

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

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

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

  echo $ac_n "checking for gdImageCreateFromGd2 in -lgd""... $ac_c" 1>&6
echo "configure:21340: checking for gdImageCreateFromGd2 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGd2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21348 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGd2();

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

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

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

  echo $ac_n "checking for gdImageCreateTrueColor in -lgd""... $ac_c" 1>&6
echo "configure:21383: checking for gdImageCreateTrueColor in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateTrueColor | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21391 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateTrueColor();

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

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

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

  echo $ac_n "checking for gdImageSetTile in -lgd""... $ac_c" 1>&6
echo "configure:21426: checking for gdImageSetTile in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetTile | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageSetTile();

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

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

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

  echo $ac_n "checking for gdImageSetBrush in -lgd""... $ac_c" 1>&6
echo "configure:21469: checking for gdImageSetBrush in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetBrush | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21477 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageSetBrush();

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

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

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

  echo $ac_n "checking for gdImageStringTTF in -lgd""... $ac_c" 1>&6
echo "configure:21512: checking for gdImageStringTTF in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringTTF | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21520 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringTTF();

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

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

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

  echo $ac_n "checking for gdImageStringFT in -lgd""... $ac_c" 1>&6
echo "configure:21555: checking for gdImageStringFT in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFT | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21563 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringFT();

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

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

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

  echo $ac_n "checking for gdImageStringFTEx in -lgd""... $ac_c" 1>&6
echo "configure:21598: checking for gdImageStringFTEx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFTEx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21606 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringFTEx();

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

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

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

  echo $ac_n "checking for gdImageColorClosestHWB in -lgd""... $ac_c" 1>&6
echo "configure:21641: checking for gdImageColorClosestHWB in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorClosestHWB | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21649 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageColorClosestHWB();

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

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

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

  echo $ac_n "checking for gdImageColorResolve in -lgd""... $ac_c" 1>&6
echo "configure:21684: checking for gdImageColorResolve in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorResolve | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21692 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageColorResolve();

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

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

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

  echo $ac_n "checking for gdImageGifCtx in -lgd""... $ac_c" 1>&6
echo "configure:21727: checking for gdImageGifCtx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGifCtx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21735 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageGifCtx();

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

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

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

  LIBS=$save_LIBS

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

	;;
    *)
      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" && test -n "GD_SHARED_LIBADD"; then
      GD_SHARED_LIBADD="-R$GD_LIB -L$GD_LIB $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GD_LIB -L$GD_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
  
 case gd in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lgd $LIBS"


  ;;
  esac



  fi


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

        
  save_LIBS="$LIBS"
  LIBS="$GD_SHARED_LIBADD $LIBS" 
  echo $ac_n "checking for gdImageString16 in -lgd""... $ac_c" 1>&6
echo "configure:21888: checking for gdImageString16 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageString16 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21896 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageString16();

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

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

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

  echo $ac_n "checking for gdImagePaletteCopy in -lgd""... $ac_c" 1>&6
echo "configure:21931: checking for gdImagePaletteCopy in -lgd" >&5
ac_lib_var=`echo gd'_'gdImagePaletteCopy | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21939 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImagePaletteCopy();

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

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

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

  echo $ac_n "checking for gdImageCreateFromPng in -lgd""... $ac_c" 1>&6
echo "configure:21974: checking for gdImageCreateFromPng in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromPng | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 21982 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromPng();

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

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

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

  echo $ac_n "checking for gdImageCreateFromGif in -lgd""... $ac_c" 1>&6
echo "configure:22017: checking for gdImageCreateFromGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22025 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGif();

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

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

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

  echo $ac_n "checking for gdImageGif in -lgd""... $ac_c" 1>&6
echo "configure:22060: checking for gdImageGif in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGif | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22068 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageGif();

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

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

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

  echo $ac_n "checking for gdImageWBMP in -lgd""... $ac_c" 1>&6
echo "configure:22103: checking for gdImageWBMP in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageWBMP | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22111 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageWBMP();

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

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

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

  echo $ac_n "checking for gdImageCreateFromJpeg in -lgd""... $ac_c" 1>&6
echo "configure:22146: checking for gdImageCreateFromJpeg in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromJpeg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22154 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromJpeg();

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

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

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

  echo $ac_n "checking for gdImageCreateFromXpm in -lgd""... $ac_c" 1>&6
echo "configure:22189: checking for gdImageCreateFromXpm in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromXpm | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22197 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromXpm();

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

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

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

  echo $ac_n "checking for gdImageCreateFromGd2 in -lgd""... $ac_c" 1>&6
echo "configure:22232: checking for gdImageCreateFromGd2 in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateFromGd2 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22240 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateFromGd2();

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

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

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

  echo $ac_n "checking for gdImageCreateTrueColor in -lgd""... $ac_c" 1>&6
echo "configure:22275: checking for gdImageCreateTrueColor in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageCreateTrueColor | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22283 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageCreateTrueColor();

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

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

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

  echo $ac_n "checking for gdImageSetTile in -lgd""... $ac_c" 1>&6
echo "configure:22318: checking for gdImageSetTile in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetTile | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22326 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageSetTile();

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

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

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

  echo $ac_n "checking for gdImageSetBrush in -lgd""... $ac_c" 1>&6
echo "configure:22361: checking for gdImageSetBrush in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageSetBrush | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22369 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageSetBrush();

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

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

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

  echo $ac_n "checking for gdImageStringTTF in -lgd""... $ac_c" 1>&6
echo "configure:22404: checking for gdImageStringTTF in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringTTF | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22412 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringTTF();

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

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

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

  echo $ac_n "checking for gdImageStringFT in -lgd""... $ac_c" 1>&6
echo "configure:22447: checking for gdImageStringFT in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFT | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22455 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringFT();

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

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

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

  echo $ac_n "checking for gdImageStringFTEx in -lgd""... $ac_c" 1>&6
echo "configure:22490: checking for gdImageStringFTEx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageStringFTEx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22498 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageStringFTEx();

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

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

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

  echo $ac_n "checking for gdImageColorClosestHWB in -lgd""... $ac_c" 1>&6
echo "configure:22533: checking for gdImageColorClosestHWB in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorClosestHWB | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22541 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageColorClosestHWB();

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

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

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

  echo $ac_n "checking for gdImageColorResolve in -lgd""... $ac_c" 1>&6
echo "configure:22576: checking for gdImageColorResolve in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageColorResolve | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22584 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageColorResolve();

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

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

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

  echo $ac_n "checking for gdImageGifCtx in -lgd""... $ac_c" 1>&6
echo "configure:22619: checking for gdImageGifCtx in -lgd" >&5
ac_lib_var=`echo gd'_'gdImageGifCtx | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lgd  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22627 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdImageGifCtx();

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

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

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

  LIBS=$save_LIBS

      else
        { echo "configure: error: Unable to find libgd.(a|so) anywhere under $withval" 1>&2; exit 1; }
      fi 
    ;;
  esac

  if test -f /usr/pkg/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
    GD_INCLUDE=/usr/pkg/include/gd
  fi

  if test -f /usr/include/gd/gd.h -a -z "$GD_INCLUDE" ; then
    GD_INCLUDE=/usr/include/gd
  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

  
  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


fi




echo $ac_n "checking whether to include GNU gettext support""... $ac_c" 1>&6
echo "configure:22726: checking whether to include GNU gettext support" >&5
# 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
fi


case $PHP_GETTEXT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GETTEXT=`echo "$PHP_GETTEXT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GETTEXT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_GETTEXT" = "no" && PHP_GETTEXT=yes
fi

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




if test "$PHP_GETTEXT" != "no"; then
  for i in /usr /usr/local $PHP_GETTEXT; do
    if test -r $i/include/libintl.h; then
	  GETTEXT_DIR=$i
    fi
  done

  if test -z "$GETTEXT_DIR"; then
    { echo "configure: error: Cannot locate header file libintl.h" 1>&2; exit 1; }
  fi

  GETTEXT_LIBDIR=$GETTEXT_DIR/lib
  GETTEXT_INCDIR=$GETTEXT_DIR/include
  
  O_LDFLAGS=$LDFLAGS
  LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
  echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
echo "configure:22785: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lintl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22793 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char bindtextdomain();

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

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

      echo $ac_n "checking for bindtextdomain in -lc""... $ac_c" 1>&6
echo "configure:22824: checking for bindtextdomain in -lc" >&5
ac_lib_var=`echo c'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 22832 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char bindtextdomain();

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

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

          { echo "configure: error: Unable to find required gettext library" 1>&2; exit 1; }
      
fi

  
fi

  LDFLAGS=$O_LDFLAGS

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

  
  EXT_SUBDIRS="$EXT_SUBDIRS gettext"
  
  if test -d "$abs_srcdir/ext/gettext"; then
    ext_builddir=ext/gettext
    ext_srcdir=$abs_srcdir/ext/gettext
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libgettext.la"
    EXT_STATIC="$EXT_STATIC gettext"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_GETTEXT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  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" && test -n "GETTEXT_SHARED_LIBADD"; then
      GETTEXT_SHARED_LIBADD="-R$GETTEXT_LIBDIR -L$GETTEXT_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$GETTEXT_LIBDIR -L$GETTEXT_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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

fi





echo $ac_n "checking for gmp support""... $ac_c" 1>&6
echo "configure:23149: checking for gmp support" >&5
# 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
fi


case $PHP_GMP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GMP=`echo "$PHP_GMP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_GMP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_GMP" = "no" && PHP_GMP=yes
fi

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




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

  for i in /usr/local /usr $PHP_GMP; do
    if test -f $i/include/gmp.h; then
      GMP_DIR=$i
    fi
  done

  if test -z "$GMP_DIR"; then
    { echo "configure: error: Unable to locate gmp.h" 1>&2; exit 1; }
  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_SUBDIRS="$EXT_SUBDIRS gmp"
  
  if test -d "$abs_srcdir/ext/gmp"; then
    ext_builddir=ext/gmp
    ext_srcdir=$abs_srcdir/ext/gmp
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libgmp.la"
    EXT_STATIC="$EXT_STATIC gmp"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_GMP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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

  

  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" && test -n ""; then
      ="-R$GMP_DIR/lib -L$GMP_DIR/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
  
 case gmp in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lgmp $LIBS"


  ;;
  esac



fi


echo $ac_n "checking for Hyperwave support""... $ac_c" 1>&6
echo "configure:23429: checking for Hyperwave support" >&5
# 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 <<\EOF
#define HYPERWAVE 1
EOF

    echo "$ac_t""yes" 1>&6
    
  EXT_SUBDIRS="$EXT_SUBDIRS hyperwave"
  
  if test -d "$abs_srcdir/ext/hyperwave"; then
    ext_builddir=ext/hyperwave
    ext_srcdir=$abs_srcdir/ext/hyperwave
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libhyperwave.la"
    EXT_STATIC="$EXT_STATIC hyperwave"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_HYPERWAVE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  else
    cat >> confdefs.h <<\EOF
#define HYPERWAVE 0
EOF

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

else
  
  cat >> confdefs.h <<\EOF
#define HYPERWAVE 0
EOF

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

fi





echo $ac_n "checking for ICAP support""... $ac_c" 1>&6
echo "configure:23598: checking for ICAP support" >&5
# Check whether --with-icap or --without-icap was given.
if test "${with_icap+set}" = set; then
  withval="$with_icap"
  PHP_ICAP=$withval
else
  PHP_ICAP=no
fi


case $PHP_ICAP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ICAP=`echo "$PHP_ICAP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ICAP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ICAP" = "no" && PHP_ICAP=yes
fi

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




if test "$PHP_ICAP" != "no"; then
  ICAP_DIR=$PHP_ICAP
  test "$ICAP_DIR" = "yes" && ICAP_DIR=/usr/local
    
  
  if test "$ICAP_DIR" != "/usr/include"; then
    
  if test -z "$ICAP_DIR" || echo "$ICAP_DIR" | grep '^/' >/dev/null ; then
    ai_p=$ICAP_DIR
  else
    
    ep_dir="`echo $ICAP_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICAP_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

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST ICAP_SHARED_LIBADD"

  

  if test "$ext_shared" = "yes"; then
    ICAP_SHARED_LIBADD="-licap $ICAP_SHARED_LIBADD"
    if test -n "$ICAP_DIR"; then
      
  if test "$ICAP_DIR" != "/usr/lib"; then
    
  if test -z "$ICAP_DIR" || echo "$ICAP_DIR" | grep '^/' >/dev/null ; then
    ai_p=$ICAP_DIR
  else
    
    ep_dir="`echo $ICAP_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICAP_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "ICAP_SHARED_LIBADD"; then
      ICAP_SHARED_LIBADD="-R$ICAP_DIR -L$ICAP_DIR $ICAP_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 "$ICAP_DIR"; then
    
  if test "$ICAP_DIR" != "/usr/lib"; then
    
  if test -z "$ICAP_DIR" || echo "$ICAP_DIR" | grep '^/' >/dev/null ; then
    ai_p=$ICAP_DIR
  else
    
    ep_dir="`echo $ICAP_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ICAP_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ICAP_DIR -L$ICAP_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case icap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-licap $LIBS"


  ;;
  esac



  fi


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

  
  EXT_SUBDIRS="$EXT_SUBDIRS icap"
  
  if test -d "$abs_srcdir/ext/icap"; then
    ext_builddir=ext/icap
    ext_srcdir=$abs_srcdir/ext/icap
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libicap.la"
    EXT_STATIC="$EXT_STATIC icap"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ICAP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for iconv support""... $ac_c" 1>&6
echo "configure:23917: checking for iconv support" >&5
# 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
fi


case $PHP_ICONV in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ICONV=`echo "$PHP_ICONV"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ICONV=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ICONV" = "no" && PHP_ICONV=yes
fi

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




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

  for i in /usr /usr/local $PHP_ICONV; do
    test -r $i/include/iconv.h && ICONV_DIR=$i
  done

  if test -z "$ICONV_DIR"; then
    { echo "configure: error: Please reinstall the iconv library." 1>&2; exit 1; }
  fi
  
  if test -f $ICONV_DIR/lib/libconv.a -o -f $ICONV_DIR/lib/libiconv.$SHLIB_SUFFIX_NAME ; then
    

  if test "$ext_shared" = "yes"; then
    ICONV_SHARED_LIBADD="-liconv $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" && test -n "ICONV_SHARED_LIBADD"; then
      ICONV_SHARED_LIBADD="-R$ICONV_DIR/lib -L$ICONV_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ICONV_DIR/lib -L$ICONV_DIR/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
  
 case iconv in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-liconv $LIBS"


  ;;
  esac



  fi


    echo $ac_n "checking for libiconv_open in -liconv""... $ac_c" 1>&6
echo "configure:24065: checking for libiconv_open in -liconv" >&5
ac_lib_var=`echo iconv'_'libiconv_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-liconv  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24073 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char libiconv_open();

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

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

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

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

  else
    echo $ac_n "checking for iconv_open in -lc""... $ac_c" 1>&6
echo "configure:24115: checking for iconv_open in -lc" >&5
ac_lib_var=`echo c'_'iconv_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24123 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv_open();

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

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

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

  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

  
  EXT_SUBDIRS="$EXT_SUBDIRS iconv"
  
  if test -d "$abs_srcdir/ext/iconv"; then
    ext_builddir=ext/iconv
    ext_srcdir=$abs_srcdir/ext/iconv
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libiconv.la"
    EXT_STATIC="$EXT_STATIC iconv"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ICONV 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST ICONV_SHARED_LIBADD"

fi













echo $ac_n "checking for IMAP support""... $ac_c" 1>&6
echo "configure:24343: checking for IMAP support" >&5
# 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
fi


case $PHP_IMAP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_IMAP=`echo "$PHP_IMAP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_IMAP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_IMAP" = "no" && PHP_IMAP=yes
fi

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




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

    
  PHP_VAR_SUBST="$PHP_VAR_SUBST IMAP_SHARED_LIBADD"

    
  EXT_SUBDIRS="$EXT_SUBDIRS imap"
  
  if test -d "$abs_srcdir/ext/imap"; then
    ext_builddir=ext/imap
    ext_srcdir=$abs_srcdir/ext/imap
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libimap.la"
    EXT_STATIC="$EXT_STATIC imap"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_IMAP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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


    for i in /usr/local /usr $PHP_IMAP; do
      if test -r "$i/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i
  elif test -r "$i/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i

      elif test -r "$i/include/c-client/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include/c-client
  elif test -r "$i/include/c-client/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i/include/c-client

      elif test -r "$i/include/imap/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include/imap
  elif test -r "$i/include/imap/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i/include/imap

      elif test -r "$i/include/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/include
  elif test -r "$i/include/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i/include

      elif test -r "$i/imap/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/imap
  elif test -r "$i/imap/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i/imap

      elif test -r "$i/c-client/c-client.h"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP2000 1
EOF

    IMAP_DIR=$i
    IMAP_INC_DIR=$i/c-client
  elif test -r "$i/c-client/rfc822.h"; then 
    IMAP_DIR=$i; 
    IMAP_INC_DIR=$i/c-client

      fi
    done

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$IMAP_INC_DIR
    cat > conftest.$ac_ext <<EOF
#line 24603 "configure"
#include "confdefs.h"

      #include "imap4r1.h"
      #if defined(IMAPSSLPORT)
      this_is_true
      #endif
    
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "this_is_true" >/dev/null 2>&1; then
  rm -rf conftest*
  
      cat >> confdefs.h <<\EOF
#define HAVE_IMAP2001 1
EOF

    
else
  rm -rf conftest*
   
fi
rm -f conftest*

    CPPFLAGS=$old_CPPFLAGS

    echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
echo "configure:24630: checking for pam_start in -lpam" >&5
ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpam  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24638 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pam_start();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo pam | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lpam $LIBS"

else
  echo "$ac_t""no" 1>&6
fi
 
    echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
echo "configure:24677: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcrypt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 24685 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char crypt();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lcrypt $LIBS"

else
  echo "$ac_t""no" 1>&6
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 "configure: error: Cannot find rfc822.h. Please check your IMAP installation." 1>&2; 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
    if test -r $i; then
      IMAP_LIBDIR=$IMAP_DIR/lib
      break 2
    fi
  done

      
  str="$IMAP_DIR/c-client/lib$lib.*"
  for i in `echo $str`; do
    if test -r $i; then
      IMAP_LIBDIR=$IMAP_DIR/c-client
      break 2
    fi
  done

    done

    if test -z "$IMAP_LIBDIR"; then
      { echo "configure: error: Cannot find imap library. Please check your IMAP installation." 1>&2; 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

    
  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" && test -n "IMAP_SHARED_LIBADD"; then
      IMAP_SHARED_LIBADD="-R$IMAP_LIBDIR -L$IMAP_LIBDIR $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 $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

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


  if test "$PHP_KERBEROS" = "yes"; then
    test -d /usr/kerberos && PHP_KERBEROS=/usr/kerberos
  fi

  if test "$PHP_KERBEROS" != "no"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP_KRB 1
EOF

    
  if test "$PHP_KERBEROS/lib" != "/usr/lib"; then
    
  if test -z "$PHP_KERBEROS/lib" || echo "$PHP_KERBEROS/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_KERBEROS/lib
  else
    
    ep_dir="`echo $PHP_KERBEROS/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_KERBEROS/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "IMAP_SHARED_LIBADD"; then
      IMAP_SHARED_LIBADD="-R$PHP_KERBEROS/lib -L$PHP_KERBEROS/lib $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

  else
    cat > conftest.$ac_ext <<EOF
#line 25029 "configure"
#include "confdefs.h"
#include <$IMAP_INC_DIR/linkage.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "auth_gss" >/dev/null 2>&1; then
  rm -rf conftest*
  
      { echo "configure: error: This c-client library is build with Kerberos support. 

      Add --with-kerberos<=DIR> to your configure line. Check config.log for details." 1>&2; exit 1; }
    
fi
rm -f conftest*

  fi


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


  if test "$PHP_IMAP_SSL" = "yes"; then
    PHP_IMAP_SSL=/usr
  fi

  if test "$PHP_IMAP_SSL" != "no"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IMAP_SSL 1
EOF

    
  if test "$PHP_IMAP_SSL/lib" != "/usr/lib"; then
    
  if test -z "$PHP_IMAP_SSL/lib" || echo "$PHP_IMAP_SSL/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_IMAP_SSL/lib
  else
    
    ep_dir="`echo $PHP_IMAP_SSL/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_IMAP_SSL/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "IMAP_SHARED_LIBADD"; then
      IMAP_SHARED_LIBADD="-R$PHP_IMAP_SSL/lib -L$PHP_IMAP_SSL/lib $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 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*) ;;
 *)

   
  DLIBS="-lssl $DLIBS"


  ;;
  esac

   fi

  ;;
  esac

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

   
  DLIBS="-lcrypto $DLIBS"


  ;;
  esac

   fi

  ;;
  esac

  else
    old_LIBS=$LIBS
    LIBS="$LIBS -L$IMAP_LIBDIR -l$IMAP_LIB"
    if test $PHP_KERBEROS != "no"; then
      LIBS="$LIBS -L$PHP_KERBEROS/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
    fi

    if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 25168 "configure"
#include "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_open();
      int main() {
        mail_open(0,"",0);
        return 0;
      }
    
EOF
if { (eval echo configure:25193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      { echo "configure: error: This c-client library is build with SSL support. 
      
      Add --with-imap-ssl<=DIR> to your configure line. Check config.log for details." 1>&2; exit 1; }
    
fi
rm -fr conftest*
fi

    LIBS=$old_LIBS
  fi

fi




echo $ac_n "checking for Informix support""... $ac_c" 1>&6
echo "configure:25218: checking for Informix support" >&5
# 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
fi


case $PHP_INFORMIX in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INFORMIX=`echo "$PHP_INFORMIX"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INFORMIX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_INFORMIX" = "no" && PHP_INFORMIX=yes
fi

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




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

  
  EXT_SUBDIRS="$EXT_SUBDIRS informix"
  
  if test -d "$abs_srcdir/ext/informix"; then
    ext_builddir=ext/informix
    ext_srcdir=$abs_srcdir/ext/informix
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libinformix.la"
    EXT_STATIC="$EXT_STATIC informix"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_INFORMIX 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST INFORMIX_SHARED_LIBADD"


  if test "$INFORMIXDIR" = ""; then
    { echo "configure: error: INFORMIXDIR environment variable is not set." 1>&2; exit 1; }
  fi

  if test "$PHP_INFORMIX" = "yes"; then
    
  if test "$INFORMIXDIR/incl/esql" != "/usr/include"; then
    
  if test -z "$INFORMIXDIR/incl/esql" || echo "$INFORMIXDIR/incl/esql" | grep '^/' >/dev/null ; then
    ai_p=$INFORMIXDIR/incl/esql
  else
    
    ep_dir="`echo $INFORMIXDIR/incl/esql|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$INFORMIXDIR/incl/esql\"`"
  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 "$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" && test -n "INFORMIX_SHARED_LIBADD"; then
      INFORMIX_SHARED_LIBADD="-R$INFORMIXDIR/lib -L$INFORMIXDIR/lib $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" && test -n "INFORMIX_SHARED_LIBADD"; then
      INFORMIX_SHARED_LIBADD="-R$INFORMIXDIR/lib/esql -L$INFORMIXDIR/lib/esql $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 "configure: error: Specified Informix base install directory is different than your INFORMIXDIR environment variable." 1>&2; exit 1; }
    fi
    
  if test "$PHP_INFORMIX/incl/esql" != "/usr/include"; then
    
  if test -z "$PHP_INFORMIX/incl/esql" || echo "$PHP_INFORMIX/incl/esql" | grep '^/' >/dev/null ; then
    ai_p=$PHP_INFORMIX/incl/esql
  else
    
    ep_dir="`echo $PHP_INFORMIX/incl/esql|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_INFORMIX/incl/esql\"`"
  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_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" && test -n "INFORMIX_SHARED_LIBADD"; then
      INFORMIX_SHARED_LIBADD="-R$PHP_INFORMIX/lib -L$PHP_INFORMIX/lib $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" && test -n "INFORMIX_SHARED_LIBADD"; then
      INFORMIX_SHARED_LIBADD="-R$PHP_INFORMIX/lib/esql -L$PHP_INFORMIX/lib/esql $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 $ac_n "checking Informix version""... $ac_c" 1>&6
echo "configure:25622: checking Informix version" >&5
  IFX_VERSION=`$INFORMIXDIR/bin/esql -V | sed -ne '1 s/^[^0-9]*\([0-9]\)\.\([0-9]*\).*/\1\2/p'`
  echo "$ac_t""$IFX_VERSION" 1>&6
  cat >> confdefs.h <<EOF
#define IFX_VERSION $IFX_VERSION
EOF


  if test $IFX_VERSION -ge "900"; then
    cat >> confdefs.h <<\EOF
#define HAVE_IFX_IUS 1
EOF

    IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EDHAVE_IFX_IUS"
  else
    IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EUHAVE_IFX_IUS"
  fi
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST IFX_ESQL_FLAGS"


  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" && test -n "INFORMIX_SHARED_LIBADD"; then
      INFORMIX_SHARED_LIBADD="-R$ext_builddir -L$ext_builddir $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

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

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST INFORMIXDIR"

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST IFX_LIBOBJS"

fi




echo $ac_n "checking for Ingres II support""... $ac_c" 1>&6
echo "configure:25773: checking for Ingres II support" >&5
# 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
fi


case $PHP_INGRES in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INGRES=`echo "$PHP_INGRES"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INGRES=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_INGRES" = "no" && PHP_INGRES=yes
fi

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




if test "$PHP_INGRES" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_II 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS ingres_ii"
  
  if test -d "$abs_srcdir/ext/ingres_ii"; then
    ext_builddir=ext/ingres_ii
    ext_srcdir=$abs_srcdir/ext/ingres_ii
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libingres_ii.la"
    EXT_STATIC="$EXT_STATIC ingres_ii"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_INGRES_II 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  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 "configure: error: Cannot find iiapi.h under $II_DIR/files" 1>&2; exit 1; }
  fi

  if test -r $II_DIR/lib/libiiapi.a; then
    II_LIB_DIR=$II_DIR/lib
  else
    { echo "configure: error: Cannot find libiiapi.a under $II_DIR/lib" 1>&2; exit 1; }
  fi

  

  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-liiapi $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" && test -n "II_SHARED_LIBADD"; then
      II_SHARED_LIBADD="-R$II_LIB_DIR -L$II_LIB_DIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$II_LIB_DIR -L$II_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case iiapi in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-liiapi $LIBS"


  ;;
  esac



  fi


  

  if test "$ext_shared" = "yes"; then
    II_SHARED_LIBADD="-lingres $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" && test -n "II_SHARED_LIBADD"; then
      II_SHARED_LIBADD="-R$II_LIB_DIR -L$II_LIB_DIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$II_LIB_DIR -L$II_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ingres in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lingres $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 $ac_n "checking for InterBase support""... $ac_c" 1>&6
echo "configure:26202: checking for InterBase support" >&5
# 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
fi


case $PHP_INTERBASE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INTERBASE=`echo "$PHP_INTERBASE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_INTERBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_INTERBASE" = "no" && PHP_INTERBASE=yes
fi

echo "$ac_t""$ext_output" 1>&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
  

  if test "$ext_shared" = "yes"; then
    INTERBASE_SHARED_LIBADD="-lgds $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" && test -n "INTERBASE_SHARED_LIBADD"; then
      INTERBASE_SHARED_LIBADD="-R$IBASE_LIBDIR -L$IBASE_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$IBASE_LIBDIR -L$IBASE_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case gds in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lgds $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 <<\EOF
#define HAVE_IBASE 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS interbase"
  
  if test -d "$abs_srcdir/ext/interbase"; then
    ext_builddir=ext/interbase
    ext_srcdir=$abs_srcdir/ext/interbase
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libinterbase.la"
    EXT_STATIC="$EXT_STATIC interbase"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_INTERBASE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST INTERBASE_SHARED_LIBADD"

fi

# Check whether --with-ircg-config or --without-ircg-config was given.
if test "${with_ircg_config+set}" = set; then
  withval="$with_ircg_config"
   IRCG_CONFIG=$withval 
else
   IRCG_CONFIG=ircg-config 
fi




echo $ac_n "checking for ircg support""... $ac_c" 1>&6
echo "configure:26533: checking for ircg support" >&5
# Check whether --with-ircg or --without-ircg was given.
if test "${with_ircg+set}" = set; then
  withval="$with_ircg"
  PHP_IRCG=$withval
else
  PHP_IRCG=no
fi


case $PHP_IRCG in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_IRCG=`echo "$PHP_IRCG"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_IRCG=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_IRCG" = "no" && PHP_IRCG=yes
fi

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




if test "$PHP_IRCG" != "no"; then
  $IRCG_CONFIG --ldflags
  if test "$?" != "0"; then
    { echo "configure: error: I cannot run the ircg-config script which should have been installed by IRCG. Please ensure that the script is in your PATH or point --with-ircg-config to the path of the script." 1>&2; exit 1; }
  fi
  
  
  for ac_i in `$IRCG_CONFIG --ldflags`; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`
      
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n ""; then
      ="-R$ac_ii -L$ac_ii $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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 `$IRCG_CONFIG --cppflags`; 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

  

  if test -n "$PHP_IRCG/lib"; then
    
  if test "$PHP_IRCG/lib" != "/usr/lib"; then
    
  if test -z "$PHP_IRCG/lib" || echo "$PHP_IRCG/lib" | grep '^/' >/dev/null ; then
    ai_p=$PHP_IRCG/lib
  else
    
    ep_dir="`echo $PHP_IRCG/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_IRCG/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_IRCG/lib -L$PHP_IRCG/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
  
 case ircg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lircg $LIBS"


  ;;
  esac



  
  if test "$PHP_IRCG/include" != "/usr/include"; then
    
  if test -z "$PHP_IRCG/include" || echo "$PHP_IRCG/include" | grep '^/' >/dev/null ; then
    ai_p=$PHP_IRCG/include
  else
    
    ep_dir="`echo $PHP_IRCG/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$PHP_IRCG/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_SAPI" = "thttpd"; then
    cat >> confdefs.h <<\EOF
#define IRCG_WITH_THTTPD 1
EOF

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

  
  EXT_SUBDIRS="$EXT_SUBDIRS ircg"
  
  if test -d "$abs_srcdir/ext/ircg"; then
    ext_builddir=ext/ircg
    ext_srcdir=$abs_srcdir/ext/ircg
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libircg.la"
    EXT_STATIC="$EXT_STATIC ircg"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_IRCG 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi

# $Id: config.m4,v 1.25 2001/05/12 11:08:51 sas Exp $
# config.m4 for extension java

echo $ac_n "checking for Java support""... $ac_c" 1>&6
echo "configure:26911: checking for Java support" >&5
# Check whether --with-java or --without-java was given.
if test "${with_java+set}" = set; then
  withval="$with_java"
  
  if test "$withval" != "no"; then
    JAVA_SHARED=libphp_java.la

    pltform=`uname -s 2>/dev/null`
    java_libext=libjava.so
    case $pltform in
      AIX) java_libext=libjava.a ;;
      HP-UX) java_libext=libjava.sl ;;
    esac  
    # substitute zip for systems which don't have jar in the PATH
    if JAVA_JAR=`which jar 2>/dev/null`; then
      JAVA_JAR="$JAVA_JAR cf"
    else
      JAVA_JAR='zip -q0'
    fi

    if test "$withval" = "yes"; then
      withval=`cd \`dirname \\\`which javac\\\`\`/..;pwd`
    fi

    if test -d $withval/lib/kaffe; 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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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

      
  if test "$withval/lib/kaffe" != "/usr/lib"; then
    
  if test -z "$withval/lib/kaffe" || echo "$withval/lib/kaffe" | grep '^/' >/dev/null ; then
    ai_p=$withval/lib/kaffe
  else
    
    ep_dir="`echo $withval/lib/kaffe|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$withval/lib/kaffe\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib/kaffe -L$withval/lib/kaffe $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
        LDFLAGS="$LDFLAGS -L$ai_p"
        PHP_RPATHS="$PHP_RPATHS $ai_p"
      
  fi

    fi
  fi


      JAVA_CFLAGS=-DKAFFE
      JAVA_INCLUDE=-I$withval/include/kaffe
      JAVA_CLASSPATH=$withval/share/kaffe/Klasses.jar
      JAVA_LIB=kaffevm
      java_libext=kaffevm

      test -f $withval/lib/$JAVA_LIB && JAVA_LIBPATH=$withval/lib
      test -f $withval/lib/kaffe/$JAVA_LIB && JAVA_LIBPATH=$withval/lib/kaffe

      # accomodate old versions of kaffe which don't support jar
      if kaffe -version 2>&1 | grep 1.0b > /dev/null; then
        JAVA_JAR='zip -q0'
      fi

    elif test -f $withval/lib/$java_libext; then
      JAVA_LIB=java
      JAVA_LIBPATH=$withval/lib
      JAVA_INCLUDE=-I$withval/include
      test -f $withval/lib/classes.zip && JAVA_CFLAGS=-DJNI_11
      test -f $withval/lib/jvm.jar     && JAVA_CFLAGS=-DJNI_12
      test -f $withval/lib/classes.zip && JAVA_CLASSPATH=$withval/lib/classes.zip
      test -f $withval/lib/jvm.jar     && JAVA_CLASSPATH=$withval/lib/jvm.jar
      for i in $JAVA_INCLUDE/*; do
	test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE $i"
      done

    else

      for i in `find $withval/include -type d`; do
        test -f $i/jni.h && JAVA_INCLUDE=-I$i
        test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
      done

      for i in `find $withval -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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/hotspot -L$i/hotspot $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
        LDFLAGS="$LDFLAGS -L$ai_p"
        PHP_RPATHS="$PHP_RPATHS $ai_p"
      
  fi

    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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/classic -L$i/classic $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
        LDFLAGS="$LDFLAGS -L$ai_p"
        PHP_RPATHS="$PHP_RPATHS $ai_p"
      
  fi

    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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/server -L$i/server $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
        LDFLAGS="$LDFLAGS -L$ai_p"
        PHP_RPATHS="$PHP_RPATHS $ai_p"
      
  fi

    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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/native_threads -L$i/native_threads $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
      done

      if test -z "$JAVA_INCLUDE"; then
        echo "$ac_t""no" 1>&6
        { echo "configure: error: unable to find Java VM libraries" 1>&2; exit 1; }
      fi

      JAVA_CFLAGS="$JAVA_CFLAGS -D_REENTRANT"
    fi

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

    
  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$JAVA_LIBPATH -L$JAVA_LIBPATH $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
        LDFLAGS="$LDFLAGS -L$ai_p"
        PHP_RPATHS="$PHP_RPATHS $ai_p"
      
  fi

    fi
  fi

    JAVA_CFLAGS="$JAVA_CFLAGS '-DJAVALIB=\"$JAVA_LIBPATH/$java_libext\"'"

    if test "$PHP_SAPI" != "servlet"; then
      
  EXT_SUBDIRS="$EXT_SUBDIRS java"
  
  if test -d "$abs_srcdir/ext/java"; then
    ext_builddir=ext/java
    ext_srcdir=$abs_srcdir/ext/java
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "shared" != "shared" && test "shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libjava.la"
    EXT_STATIC="$EXT_STATIC java"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_JAVA 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



      if test "$PHP_SAPI" = "cgi"; then
        
 case $JAVA_LIB in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$JAVA_LIB $LIBS"


  ;;
  esac

      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

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

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

fi



  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_CFLAGS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_CLASSPATH"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_INCLUDE"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_SHARED"


  PHP_VAR_SUBST="$PHP_VAR_SUBST JAVA_JAR"




                          


echo $ac_n "checking whether to include LDAP support""... $ac_c" 1>&6
echo "configure:27418: checking whether to include LDAP support" >&5
# 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
fi


case $PHP_LDAP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LDAP=`echo "$PHP_LDAP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LDAP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_LDAP" = "no" && PHP_LDAP=yes
fi

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




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

  
  EXT_SUBDIRS="$EXT_SUBDIRS ldap"
  
  if test -d "$abs_srcdir/ext/ldap"; then
    ext_builddir=ext/ldap
    ext_srcdir=$abs_srcdir/ext/ldap
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libldap.la"
    EXT_STATIC="$EXT_STATIC ldap"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_LDAP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



  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=$i
    LDAP_INCDIR=$PHP_LDAP/include/umich-ldap
    LDAP_LIBDIR=$PHP_LDAP/lib
  elif test -f $PHP_LDAP/ldap/public/ldap.h; then
    LDAP_DIR=$i
    LDAP_INCDIR=$PHP_LDAP/ldap/public
    LDAP_LIBDIR=$PHP_LDAP/lib
  fi

  fi

  if test -z "$LDAP_DIR"; then
    { echo "configure: error: Cannot find ldap.h" 1>&2; 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.so -o -f $LDAP_LIBDIR/liblber.sl; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ldap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lldap $LIBS"


  ;;
  esac



  fi



  elif test -f $LDAP_LIBDIR/libldap.so.3; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ldap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lldap $LIBS"


  ;;
  esac



  fi



  elif test -f $LDAP_LIBDIR/libldapssl41.so -o -f $LDAP_LIBDIR/libldapssl41.sl; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ldapssl41 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lldapssl41 $LIBS"


  ;;
  esac



  fi


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


  elif test -f $LDAP_LIBDIR/libldapssl30.so -o -f $LDAP_LIBDIR/libldapssl30.sl; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ldapssl30 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lldapssl30 $LIBS"


  ;;
  esac



  fi


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


  elif test -f $LDAP_LIBDIR/libldap30.so -o -f $LDAP_LIBDIR/libldap30.sl; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ldap30 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lldap30 $LIBS"


  ;;
  esac



  fi


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


  elif test -f $LDAP_LIBDIR/libumich_ldap.so; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case umich_ldap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lumich_ldap $LIBS"


  ;;
  esac



  fi



  elif test -f $LDAP_LIBDIR/libclntsh.so; 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" && test -n "LDAP_SHARED_LIBADD"; then
      LDAP_SHARED_LIBADD="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LDAP_LIBDIR -L$LDAP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case clntsh in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lclntsh $LIBS"


  ;;
  esac



  fi


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

  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 <<\EOF
#define HAVE_LDAP 1
EOF

fi 




echo $ac_n "checking whether to enable mailparse support""... $ac_c" 1>&6
echo "configure:28890: checking whether to enable mailparse support" >&5
# Check whether --enable-mailparse or --disable-mailparse was given.
if test "${enable_mailparse+set}" = set; then
  enableval="$enable_mailparse"
  PHP_MAILPARSE=$enableval
else
  PHP_MAILPARSE=no
fi


case $PHP_MAILPARSE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MAILPARSE=`echo "$PHP_MAILPARSE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MAILPARSE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MAILPARSE" = "no" && PHP_MAILPARSE=yes
fi

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




if test "$PHP_MAILPARSE" != "no"; then
  if test "$ext_shared" != "yes" && test "$enable_mbstring" != "yes"; then
	  echo "configure: warning: Activating mbstring" 1>&2
	  enable_mbstring=yes
  fi
  
  EXT_SUBDIRS="$EXT_SUBDIRS mailparse"
  
  if test -d "$abs_srcdir/ext/mailparse"; then
    ext_builddir=ext/mailparse
    ext_srcdir=$abs_srcdir/ext/mailparse
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmailparse.la"
    EXT_STATIC="$EXT_STATIC mailparse"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MAILPARSE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to enable multibyte string support""... $ac_c" 1>&6
echo "configure:29078: checking whether to enable multibyte string support" >&5
# 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
fi


case $PHP_MBSTRING in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MBSTRING=`echo "$PHP_MBSTRING"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MBSTRING=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MBSTRING" = "no" && PHP_MBSTRING=yes
fi

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




if test "$PHP_MBSTRING" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_MBSTRING 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS mbstring"
  
  if test -d "$abs_srcdir/ext/mbstring"; then
    ext_builddir=ext/mbstring
    ext_srcdir=$abs_srcdir/ext/mbstring
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmbstring.la"
    EXT_STATIC="$EXT_STATIC mbstring"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MBSTRING 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi

echo $ac_n "checking whether to enable japanese encoding translation""... $ac_c" 1>&6
echo "configure:29263: checking whether to enable japanese encoding translation" >&5
# Check whether --enable-mbstr_enc_trans or --disable-mbstr_enc_trans was given.
if test "${enable_mbstr_enc_trans+set}" = set; then
  enableval="$enable_mbstr_enc_trans"
  
  if test "$enableval" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define MBSTR_ENC_TRANS 1
EOF

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

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

fi





echo $ac_n "checking for MCAL support""... $ac_c" 1>&6
echo "configure:29289: checking for MCAL support" >&5
# 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
fi


case $PHP_MCAL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MCAL=`echo "$PHP_MCAL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MCAL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MCAL" = "no" && PHP_MCAL=yes
fi

echo "$ac_t""$ext_output" 1>&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

  if test ! -f "$MCAL_INCLUDE/mcal.h"; then
    { echo "configure: error: Unable to locate your libmcal header files - mcal.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" 1>&2; exit 1; }
  fi

  if test ! -f "$MCAL_INCLUDE/cal_misc.h"; then
    { echo "configure: error: Unable to locate your libmcal header files - cal_misc.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" 1>&2; exit 1; }
  fi

  if test ! -f "$MCAL_INCLUDE/icalroutines.h"; then
    { echo "configure: error: Unable to locate your libmcal header files - icalroutines.h should be in the directory you specify or in the include/ subdirectory below it - default search location is $MCAL_DEFAULT_SEARCH" 1>&2; exit 1; }
  fi

  if test ! -f "$MCAL_LIBRARY/libmcal.a"; then
    { echo "configure: 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" 1>&2; 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 "$ext_shared" = "yes"; then
    MCAL_SHARED_LIBADD="-lmcal $MCAL_SHARED_LIBADD"
    if test -n "$MCAL_LIBRARY"; then
      
  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" && test -n "MCAL_SHARED_LIBADD"; then
      MCAL_SHARED_LIBADD="-R$MCAL_LIBRARY -L$MCAL_LIBRARY $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

    fi
  else
    

  if test -n "$MCAL_LIBRARY"; then
    
  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" && test -n ""; then
      ="-R$MCAL_LIBRARY -L$MCAL_LIBRARY $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case mcal in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lmcal $LIBS"


  ;;
  esac



  fi


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MCAL_SHARED_LIBADD"

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

  
  EXT_SUBDIRS="$EXT_SUBDIRS mcal"
  
  if test -d "$abs_srcdir/ext/mcal"; then
    ext_builddir=ext/mcal
    ext_srcdir=$abs_srcdir/ext/mcal
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmcal.la"
    EXT_STATIC="$EXT_STATIC mcal"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MCAL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi





echo $ac_n "checking for mcrypt support""... $ac_c" 1>&6
echo "configure:29651: checking for mcrypt support" >&5
# 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
fi


case $PHP_MCRYPT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MCRYPT=`echo "$PHP_MCRYPT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MCRYPT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MCRYPT" = "no" && PHP_MCRYPT=yes
fi

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




if test "$PHP_MCRYPT" != "no"; then
  for i in /usr/local /usr $PHP_MCRYPT; do
    if test -f $i/include/mcrypt.h; then
      MCRYPT_DIR=$i
    fi
  done

  if test -z "$MCRYPT_DIR"; then
    { echo "configure: error: mcrypt.h not found. Please reinstall libmcrypt." 1>&2; exit 1; }
  fi

  echo $ac_n "checking for mcrypt_module_open in -lmcrypt""... $ac_c" 1>&6
echo "configure:29705: checking for mcrypt_module_open in -lmcrypt" >&5
ac_lib_var=`echo mcrypt'_'mcrypt_module_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmcrypt 
    -L$MCRYPT_DIR/lib -lltdl
   $LIBS"
cat > conftest.$ac_ext <<EOF
#line 29715 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mcrypt_module_open();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    
 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 <<\EOF
#define HAVE_LIBMCRYPT24 1
EOF

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

    echo $ac_n "checking for init_mcrypt in -lmcrypt""... $ac_c" 1>&6
echo "configure:29778: checking for init_mcrypt in -lmcrypt" >&5
ac_lib_var=`echo mcrypt'_'init_mcrypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lmcrypt 
      -L$MCRYPT_DIR/lib
     $LIBS"
cat > conftest.$ac_ext <<EOF
#line 29788 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char init_mcrypt();

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

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

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

      { echo "configure: error: Sorry" 1>&2; exit 1; }
    
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" && test -n "MCRYPT_SHARED_LIBADD"; then
      MCRYPT_SHARED_LIBADD="-R$MCRYPT_DIR/lib -L$MCRYPT_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MCRYPT_DIR/lib -L$MCRYPT_DIR/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
  
 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

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


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MCRYPT_SHARED_LIBADD"

  
  EXT_SUBDIRS="$EXT_SUBDIRS mcrypt"
  
  if test -d "$abs_srcdir/ext/mcrypt"; then
    ext_builddir=ext/mcrypt
    ext_srcdir=$abs_srcdir/ext/mcrypt
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmcrypt.la"
    EXT_STATIC="$EXT_STATIC mcrypt"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MCRYPT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for mhash support""... $ac_c" 1>&6
echo "configure:30105: checking for mhash support" >&5
# 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
fi


case $PHP_MHASH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MHASH=`echo "$PHP_MHASH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MHASH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MHASH" = "no" && PHP_MHASH=yes
fi

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




if test "$PHP_MHASH" != "no"; then
  for i in /usr/local /usr /opt/mhash $PHP_MHASH; do
    if test -f $i/include/mhash.h; then
      MHASH_DIR=$i
    fi
  done

  if test -z "$MHASH_DIR"; then
    { echo "configure: error: Please reinstall libmhash - I cannot find mhash.h" 1>&2; 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" && test -n "MHASH_SHARED_LIBADD"; then
      MHASH_SHARED_LIBADD="-R$MHASH_DIR/lib -L$MHASH_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MHASH_DIR/lib -L$MHASH_DIR/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
  
 case mhash in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lmhash $LIBS"


  ;;
  esac



  fi


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MHASH_SHARED_LIBADD"


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


  
  EXT_SUBDIRS="$EXT_SUBDIRS mhash"
  
  if test -d "$abs_srcdir/ext/mhash"; then
    ext_builddir=ext/mhash
    ext_srcdir=$abs_srcdir/ext/mhash
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmhash.la"
    EXT_STATIC="$EXT_STATIC mhash"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MHASH 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to include ming support""... $ac_c" 1>&6
echo "configure:30432: checking whether to include ming support" >&5
# 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
fi


case $PHP_MING in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MING=`echo "$PHP_MING"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MING=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MING" = "no" && PHP_MING=yes
fi

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




if test "$PHP_MING" != "no"; then
  for i in $PHP_MING /usr/local /usr; do
    if test -r $i/lib/libming.so; then
      MING_DIR=$i
    fi
  done

  if test -z "$MING_DIR"; then
    { echo "configure: error: Please reinstall libming.so - I cannot find libming.so" 1>&2; exit 1; }
  fi

  
  if test "$MING_DIR/include" != "/usr/include"; then
    
  if test -z "$MING_DIR/include" || echo "$MING_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$MING_DIR/include
  else
    
    ep_dir="`echo $MING_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MING_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 MING_SHARED_LIBADD"

  

  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" && test -n "MING_SHARED_LIBADD"; then
      MING_SHARED_LIBADD="-R$MING_DIR/lib -L$MING_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MING_DIR/lib -L$MING_DIR/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
  
 case ming in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lming $LIBS"


  ;;
  esac



  fi



  echo $ac_n "checking for Ming_setScale in -lming""... $ac_c" 1>&6
echo "configure:30616: checking for Ming_setScale in -lming" >&5
ac_lib_var=`echo ming'_'Ming_setScale | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lming  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 30624 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Ming_setScale();

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

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

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

    { echo "configure: error: Ming library 0.1.0 or greater required." 1>&2; exit 1; }
  
fi


  
  EXT_SUBDIRS="$EXT_SUBDIRS ming"
  
  if test -d "$abs_srcdir/ext/ming"; then
    ext_builddir=ext/ming
    ext_srcdir=$abs_srcdir/ext/ming
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libming.la"
    EXT_STATIC="$EXT_STATIC ming"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MING 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for mnoGoSearch support""... $ac_c" 1>&6
echo "configure:30805: checking for mnoGoSearch support" >&5
# 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
fi


case $PHP_MNOGOSEARCH in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MNOGOSEARCH=`echo "$PHP_MNOGOSEARCH"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MNOGOSEARCH=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MNOGOSEARCH" = "no" && PHP_MNOGOSEARCH=yes
fi

echo "$ac_t""$ext_output" 1>&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 $ac_n "checking for mnoGoSearch version""... $ac_c" 1>&6
echo "configure:30860: checking for mnoGoSearch version" >&5    
    
    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 "$ac_t""<= 3.1.9" 1>&6    
		{ echo "configure: error: mnoGoSearch 3.1.10 at least required" 1>&2; exit 1; }
	fi
	
	if test "$MNOGOSEARCH_VERSION_ID" -lt 30110; then
		echo "$ac_t""<= 3.1.9" 1>&6
		{ echo "configure: error: mnoGoSearch 3.1.10 at least required" 1>&2; exit 1; }
	fi
	
	echo "$ac_t""$MNOGOSEARCH_VERSION" 1>&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="-l$ac_ii $MNOGOSEARCH_SHARED_LIBADD"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "MNOGOSEARCH_SHARED_LIBADD"; then
      MNOGOSEARCH_SHARED_LIBADD="-R$ac_ii -L$ac_ii $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 "configure: error: udm-config script not found in $MNOGOSEARCH_BINDIR" 1>&2; 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 <<\EOF
#define HAVE_MNOGOSEARCH 1
EOF

    
    
  PHP_VAR_SUBST="$PHP_VAR_SUBST MNOGOSEARCH_SHARED_LIBADD"

    
  EXT_SUBDIRS="$EXT_SUBDIRS mnogosearch"
  
  if test -d "$abs_srcdir/ext/mnogosearch"; then
    ext_builddir=ext/mnogosearch
    ext_srcdir=$abs_srcdir/ext/mnogosearch
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmnogosearch.la"
    EXT_STATIC="$EXT_STATIC mnogosearch"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MNOGOSEARCH 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


    
  fi






echo $ac_n "checking for mSQL support""... $ac_c" 1>&6
echo "configure:31138: checking for mSQL support" >&5
# 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
fi


case $PHP_MSQL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MSQL=`echo "$PHP_MSQL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MSQL" = "no" && PHP_MSQL=yes
fi

echo "$ac_t""$ext_output" 1>&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" && test -n "MSQL_SHARED_LIBADD"; then
      MSQL_SHARED_LIBADD="-R$MSQL_LIBDIR -L$MSQL_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MSQL_LIBDIR -L$MSQL_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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 <<\EOF
#define HAVE_MSQL 1
EOF

    
  PHP_VAR_SUBST="$PHP_VAR_SUBST MSQL_SHARED_LIBADD"

    
  EXT_SUBDIRS="$EXT_SUBDIRS msql"
  
  if test -d "$abs_srcdir/ext/msql"; then
    ext_builddir=ext/msql
    ext_srcdir=$abs_srcdir/ext/msql
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmsql.la"
    EXT_STATIC="$EXT_STATIC msql"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MSQL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


    
  echo $ac_n "checking mSQL version""... $ac_c" 1>&6
echo "configure:31457: checking mSQL version" >&5
  ac_php_oldcppflags=$CPPFLAGS
  CPPFLAGS="$INCLUDES $CPPFLAGS"
  cat > conftest.$ac_ext <<EOF
#line 31461 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include "msql.h"
int main() {
int i = IDX_TYPE
; return 0; }
EOF
if { (eval echo configure:31469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MSQL1 0
EOF

    MSQL_VERSION="2.0 or newer"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat >> confdefs.h <<\EOF
#define MSQL1 1
EOF

    MSQL_VERSION=1.0
  
fi
rm -f conftest*
  CPPFLAGS=$ac_php_oldcppflags
  echo "$ac_t""$MSQL_VERSION" 1>&6

  fi




echo $ac_n "checking for Muscat support""... $ac_c" 1>&6
echo "configure:31500: checking for Muscat support" >&5
# Check whether --with-muscat or --without-muscat was given.
if test "${with_muscat+set}" = set; then
  withval="$with_muscat"
  PHP_MUSCAT=$withval
else
  PHP_MUSCAT=no
fi


case $PHP_MUSCAT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MUSCAT=`echo "$PHP_MUSCAT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MUSCAT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MUSCAT" = "no" && PHP_MUSCAT=yes
fi

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




if test "$PHP_MUSCAT" != "no"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS muscat"
  
  if test -d "$abs_srcdir/ext/muscat"; then
    ext_builddir=ext/muscat
    ext_srcdir=$abs_srcdir/ext/muscat
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmuscat.la"
    EXT_STATIC="$EXT_STATIC muscat"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MUSCAT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  for i in $PHP_MUSCAT /usr/local /usr /usr/local/empower /usr/local/empower/developer; do
    if test -f $i/include/Muscat.h; then
      MUSCAT_INCDIR=$i/include
      MUSCAT_DIR=$i
    fi
    if test -f $i/libs/libhdmuscat3.6.a; then
      MUSCAT_LIBDIR=$i/libs
      MUSCAT_DIR=$i
    elif test -f $i/lib/libhdmuscat3.6.a; then
      MUSCAT_LIBDIR=$i/lib
      MUSCAT_DIR=$i
    fi
  done

  if test -z "$MUSCAT_INCDIR"; then
    { echo "configure: error: Cannot find Muscat include dir" 1>&2; exit 1; }
  fi

  if test -z "$MUSCAT_LIBDIR"; then
    { echo "configure: error: Cannot find Muscat lib dir" 1>&2; exit 1; }
  fi

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

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MUSCAT_SHARED_LIBADD"

  cat >> confdefs.h <<EOF
#define PHP_MUSCAT_DIR "$MUSCAT_DIR"
EOF

  

  if test "$ext_shared" = "yes"; then
    MUSCAT_SHARED_LIBADD="-lhdmuscat3.6 $MUSCAT_SHARED_LIBADD"
    if test -n "$MUSCAT_LIBDIR"; then
      
  if test "$MUSCAT_LIBDIR" != "/usr/lib"; then
    
  if test -z "$MUSCAT_LIBDIR" || echo "$MUSCAT_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MUSCAT_LIBDIR
  else
    
    ep_dir="`echo $MUSCAT_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MUSCAT_LIBDIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "MUSCAT_SHARED_LIBADD"; then
      MUSCAT_SHARED_LIBADD="-R$MUSCAT_LIBDIR -L$MUSCAT_LIBDIR $MUSCAT_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 "$MUSCAT_LIBDIR"; then
    
  if test "$MUSCAT_LIBDIR" != "/usr/lib"; then
    
  if test -z "$MUSCAT_LIBDIR" || echo "$MUSCAT_LIBDIR" | grep '^/' >/dev/null ; then
    ai_p=$MUSCAT_LIBDIR
  else
    
    ep_dir="`echo $MUSCAT_LIBDIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MUSCAT_LIBDIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MUSCAT_LIBDIR -L$MUSCAT_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case hdmuscat3.6 in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lhdmuscat3.6 $LIBS"


  ;;
  esac



  fi


  
  if test "$MUSCAT_INCDIR" != "/usr/include"; then
    
  if test -z "$MUSCAT_INCDIR" || echo "$MUSCAT_INCDIR" | grep '^/' >/dev/null ; then
    ai_p=$MUSCAT_INCDIR
  else
    
    ep_dir="`echo $MUSCAT_INCDIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$MUSCAT_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


# Local macros for automake & autoconf


















#---START: Used in for client configure


















	




echo $ac_n "checking for MySQL support""... $ac_c" 1>&6
echo "configure:31883: checking for MySQL support" >&5
# 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
fi


case $PHP_MYSQL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MYSQL=`echo "$PHP_MYSQL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MYSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MYSQL" = "no" && PHP_MYSQL=yes
fi

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




if test "$PHP_MYSQL" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_MYSQL 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS mysql"
  
  if test -d "$abs_srcdir/ext/mysql"; then
    ext_builddir=ext/mysql
    ext_srcdir=$abs_srcdir/ext/mysql
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libmysql.la"
    EXT_STATIC="$EXT_STATIC mysql"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_MYSQL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi

if test "$PHP_MYSQL" = "yes"; then
  
  echo $ac_n "checking for MySQL UNIX socket""... $ac_c" 1>&6
echo "configure:32070: checking for MySQL UNIX socket" >&5
  MYSQL_SOCK=/tmp/mysql.sock
  for i in  \
      /var/run/mysqld/mysqld.sock \
      /var/tmp/mysql.sock \
      /var/lib/mysql/mysql.sock \
      /var/mysql/mysql.sock \
      /Private/tmp/mysql.sock \
      ; do
    if test -r $i; then
      MYSQL_SOCK=$i
    fi
  done
  cat >> confdefs.h <<EOF
#define MYSQL_UNIX_ADDR "$MYSQL_SOCK"
EOF

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

  echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:32090: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat > conftest.$ac_ext <<EOF
#line 32097 "configure"
#include "confdefs.h"

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

fi

echo "$ac_t""$ac_cv_c_inline" 1>&6
case "$ac_cv_c_inline" in
  inline | yes) ;;
  no) cat >> confdefs.h <<\EOF
#define inline 
EOF
 ;;
  *)  cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF
 ;;
esac

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:32130: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32135 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

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

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


	





cat >> confdefs.h <<\EOF
#define UNDEF_THREADS_HACK 
EOF



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

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 32213 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 32231 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 32252 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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

fi
fi

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

fi

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






echo $ac_n "checking size of char""... $ac_c" 1>&6
echo "configure:32338: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_char=1
else
  cat > conftest.$ac_ext <<EOF
#line 32346 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(char));
  exit(0);
}
EOF
if { (eval echo configure:32357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_char=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_char=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_char" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
EOF



echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:32378: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=4
else
  cat > conftest.$ac_ext <<EOF
#line 32386 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:32397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:32417: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=4
else
  cat > conftest.$ac_ext <<EOF
#line 32425 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:32436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:32456: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_long=8
else
  cat > conftest.$ac_ext <<EOF
#line 32464 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:32475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF


echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:32495: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32500 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:32528: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32533 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:32542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:32563: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32568 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi

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

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

fi


echo $ac_n "checking for type ulong""... $ac_c" 1>&6
echo "configure:32598: checking for type ulong" >&5
if eval "test \"`echo '$''{'ac_cv_ulong'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_ulong=no
else
  cat > conftest.$ac_ext <<EOF
#line 32606 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  ulong foo;
  foo++;
  exit(0);
}
EOF
if { (eval echo configure:32617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_ulong=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_ulong=no
fi
rm -fr conftest*
fi

fi

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

fi

echo $ac_n "checking for type uchar""... $ac_c" 1>&6
echo "configure:32641: checking for type uchar" >&5
if eval "test \"`echo '$''{'ac_cv_uchar'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uchar=no
else
  cat > conftest.$ac_ext <<EOF
#line 32649 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  uchar foo;
  foo++;
  exit(0);
}
EOF
if { (eval echo configure:32660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_uchar=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_uchar=no
fi
rm -fr conftest*
fi

fi

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

fi

echo $ac_n "checking for type uint""... $ac_c" 1>&6
echo "configure:32684: checking for type uint" >&5
if eval "test \"`echo '$''{'ac_cv_uint'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_uint=no
else
  cat > conftest.$ac_ext <<EOF
#line 32692 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  uint foo;
  foo++;
  exit(0);
}
EOF
if { (eval echo configure:32703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_uint=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_uint=no
fi
rm -fr conftest*
fi

fi

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

fi

echo $ac_n "checking for int8""... $ac_c" 1>&6
echo "configure:32727: checking for int8" >&5
if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 32732 "configure"
#include "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;
}

EOF
if { (eval echo configure:32754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_INT_8_16_32 
EOF
 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6

fi
rm -fr conftest*
fi



ac_save_CXXFLAGS="$CXXFLAGS"
echo $ac_n "checking base type of last arg to accept""... $ac_c" 1>&6
echo "configure:32774: checking base type of last arg to accept" >&5
if eval "test \"`echo '$''{'mysql_cv_btype_last_arg_accept'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

if test "$ac_cv_prog_gxx" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
mysql_cv_btype_last_arg_accept=none
cat > conftest.$ac_ext <<EOF
#line 32792 "configure"
#include "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; }
EOF
if { (eval echo configure:32802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_btype_last_arg_accept=socklen_t
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test $mysql_cv_btype_last_arg_accept = none; then
cat > conftest.$ac_ext <<EOF
#line 32812 "configure"
#include "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; }
EOF
if { (eval echo configure:32822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_btype_last_arg_accept=size_t
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
if test $mysql_cv_btype_last_arg_accept = none; then
mysql_cv_btype_last_arg_accept=int
fi
fi

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

cat >> confdefs.h <<EOF
#define SOCKET_SIZE_TYPE $mysql_cv_btype_last_arg_accept
EOF

CXXFLAGS="$ac_save_CXXFLAGS"

echo $ac_n "checking return type of qsort""... $ac_c" 1>&6
echo "configure:32851: checking return type of qsort" >&5
if eval "test \"`echo '$''{'mysql_cv_type_qsort'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32856 "configure"
#include "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; }
EOF
if { (eval echo configure:32868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_type_qsort=void
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_type_qsort=int
fi
rm -f conftest*
fi

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

if test "$mysql_cv_type_qsort" = "void"
then
 cat >> confdefs.h <<EOF
#define QSORT_TYPE_IS_VOID 1
EOF

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 \
 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
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:32917: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32922 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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


# This is special for libmysql
for ac_func in strtok_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:32974: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 32979 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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



# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
ac_save_CXXFLAGS="$CXXFLAGS"
echo $ac_n "checking style of gethostname_r routines""... $ac_c" 1>&6
echo "configure:33031: checking style of gethostname_r routines" >&5
if eval "test \"`echo '$''{'mysql_cv_gethostname_style'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

if test "$ac_cv_prog_gxx" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
cat > conftest.$ac_ext <<EOF
#line 33048 "configure"
#include "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; }
EOF
if { (eval echo configure:33066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_gethostname_style=glibc2
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_gethostname_style=other
fi
rm -f conftest*
fi

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

CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_style" = "glibc2"
then
  cat >> confdefs.h <<\EOF
#define HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 
EOF

fi

# Check 3rd argument of getthostbyname_r
ac_save_CXXFLAGS="$CXXFLAGS"
echo $ac_n "checking 3 argument to gethostname_r routines""... $ac_c" 1>&6
echo "configure:33098: checking 3 argument to gethostname_r routines" >&5
if eval "test \"`echo '$''{'mysql_cv_gethostname_arg'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

if test "$ac_cv_prog_gxx" = "yes"
then
  CXXFLAGS="$CXXFLAGS -Werror"
fi
cat > conftest.$ac_ext <<EOF
#line 33115 "configure"
#include "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; }
EOF
if { (eval echo configure:33132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_gethostname_arg=hostent_data
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_gethostname_arg=char
fi
rm -f conftest*
fi

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

CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_arg" = "hostent_data"
then
  cat >> confdefs.h <<\EOF
#define HAVE_GETHOSTBYNAME_R_RETURN_INT 
EOF

fi



  # Check definition of pthread_getspecific
  echo $ac_n "checking "args to pthread_getspecific"""... $ac_c" 1>&6
echo "configure:33165: checking "args to pthread_getspecific"" >&5
if eval "test \"`echo '$''{'mysql_cv_getspecific_args'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 33170 "configure"
#include "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; }
EOF
if { (eval echo configure:33182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_getspecific_args=POSIX
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_getspecific_args=other
fi
rm -f conftest*
fi

echo "$ac_t""$mysql_cv_getspecific_args" 1>&6
  if test "$mysql_cv_getspecific_args" = "other"
  then
    cat >> confdefs.h <<\EOF
#define HAVE_NONPOSIX_PTHREAD_GETSPECIFIC 
EOF

  fi


  # Check definition of pthread_mutex_init
  echo $ac_n "checking "args to pthread_mutex_init"""... $ac_c" 1>&6
echo "configure:33206: checking "args to pthread_mutex_init"" >&5
if eval "test \"`echo '$''{'mysql_cv_mutex_init_args'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 33211 "configure"
#include "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; }
EOF
if { (eval echo configure:33225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mysql_cv_mutex_init_args=POSIX
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_mutex_init_args=other
fi
rm -f conftest*
fi

echo "$ac_t""$mysql_cv_mutex_init_args" 1>&6
  if test "$mysql_cv_mutex_init_args" = "other"
  then
    cat >> confdefs.h <<\EOF
#define HAVE_NONPOSIX_PTHREAD_MUTEX_INIT 
EOF

  fi


# Check definition of readdir_r
echo $ac_n "checking "args to readdir_r"""... $ac_c" 1>&6
echo "configure:33249: checking "args to readdir_r"" >&5
if eval "test \"`echo '$''{'mysql_cv_readdir_r'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 33254 "configure"
#include "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; }
EOF
if { (eval echo configure:33267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  mysql_cv_readdir_r=POSIX
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_readdir_r=other
fi
rm -f conftest*
fi

echo "$ac_t""$mysql_cv_readdir_r" 1>&6
if test "$mysql_cv_readdir_r" = "POSIX"
then
  cat >> confdefs.h <<\EOF
#define HAVE_READDIR_R 
EOF

fi


# Check definition av posix sigwait()
echo $ac_n "checking "style of sigwait"""... $ac_c" 1>&6
echo "configure:33291: checking "style of sigwait"" >&5
if eval "test \"`echo '$''{'mysql_cv_sigwait'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 33296 "configure"
#include "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; }
EOF
if { (eval echo configure:33312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  mysql_cv_sigwait=POSIX
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_sigwait=other
fi
rm -f conftest*
fi

echo "$ac_t""$mysql_cv_sigwait" 1>&6
if test "$mysql_cv_sigwait" = "POSIX"
then
  cat >> confdefs.h <<\EOF
#define HAVE_SIGWAIT 
EOF

fi

if test "$mysql_cv_sigwait" != "POSIX"
then
unset mysql_cv_sigwait
# Check definition av posix sigwait()
echo $ac_n "checking "style of sigwait"""... $ac_c" 1>&6
echo "configure:33338: checking "style of sigwait"" >&5
if eval "test \"`echo '$''{'mysql_cv_sigwait'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 33343 "configure"
#include "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; }
EOF
if { (eval echo configure:33357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  mysql_cv_sigwait=NONPOSIX
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mysql_cv_sigwait=other
fi
rm -f conftest*
fi

echo "$ac_t""$mysql_cv_sigwait" 1>&6
if test "$mysql_cv_sigwait" = "NONPOSIX"
then
  cat >> confdefs.h <<\EOF
#define HAVE_NONPOSIX_SIGWAIT 
EOF

fi
fi



  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/libmysql/Makefile"


  MYSQL_LIBADD=libmysql/libmysql_client.la
  MYSQL_SHARED_LIBADD=libmysql/libmysql_client.la
  MYSQL_SUBDIRS=libmysql
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_LIBADD"

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST MYSQL_SUBDIRS"

  
  lib_makefile="$ext_builddir/libmysql/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/libmysql
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

  
  if test "$ext_srcdir/libmysql" != "/usr/include"; then
    
  if test -z "$ext_srcdir/libmysql" || echo "$ext_srcdir/libmysql" | grep '^/' >/dev/null ; then
    ai_p=$ext_srcdir/libmysql
  else
    
    ep_dir="`echo $ext_srcdir/libmysql|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ext_srcdir/libmysql\"`"
  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_MODULE_TYPE=builtin
elif test "$PHP_MYSQL" != "no"; then
  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 "configure: error: Cannot find header files under $PHP_MYSQL" 1>&2; exit 1; }
  fi

  MYSQL_MODULE_TYPE=external

  for i in lib lib/mysql; do
    
  str="$MYSQL_DIR/$i/libmysqlclient.*"
  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 "configure: error: Cannot find mysqlclient library under $MYSQL_DIR" 1>&2; exit 1; }
  fi

  if test "$PHP_ZLIB_DIR" != "no"; then
    
 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

    MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -z"
  fi

  

  if test "$ext_shared" = "yes"; then
    MYSQL_SHARED_LIBADD="-lmysqlclient $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" && test -n "MYSQL_SHARED_LIBADD"; then
      MYSQL_SHARED_LIBADD="-R$MYSQL_LIB_DIR -L$MYSQL_LIB_DIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MYSQL_LIB_DIR -L$MYSQL_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case mysqlclient in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lmysqlclient $LIBS"


  ;;
  esac



  fi


  MYSQL_LIBS="-L$MYSQL_LIB_DIR -lmysqlclient $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"
  
  echo $ac_n "checking for MySQL UNIX socket""... $ac_c" 1>&6
echo "configure:33674: checking for MySQL UNIX socket" >&5
  MYSQL_SOCK=/tmp/mysql.sock
  for i in  \
      /var/run/mysqld/mysqld.sock \
      /var/tmp/mysql.sock \
      /var/lib/mysql/mysql.sock \
      /var/mysql/mysql.sock \
      /Private/tmp/mysql.sock \
      ; do
    if test -r $i; then
      MYSQL_SOCK=$i
    fi
  done
  cat >> confdefs.h <<EOF
#define MYSQL_UNIX_ADDR "$MYSQL_SOCK"
EOF

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


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 $ac_n "checking for ncurses support""... $ac_c" 1>&6
echo "configure:33724: checking for ncurses support" >&5
# 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
fi


case $PHP_NCURSES in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_NCURSES=`echo "$PHP_NCURSES"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_NCURSES=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_NCURSES" = "no" && PHP_NCURSES=yes
fi

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




if test "$PHP_NCURSES" != "no"; then
   # --with-ncurses -> check with-path
	 SEARCH_PATH="/usr/local /usr"     
   SEARCH_FOR="/include/curses.h"
   if test -r $PHP_NCURSES/; then # path given as parameter
     NCURSES_DIR=$PHP_NCURSES
   else # search default path list
     echo $ac_n "checking for ncurses files in default path""... $ac_c" 1>&6
echo "configure:33774: checking for ncurses files in default path" >&5
     for i in $SEARCH_PATH ; do
       if test -r $i/$SEARCH_FOR; then
         NCURSES_DIR=$i
         echo "$ac_t""found in $i" 1>&6
       fi
     done
   fi
  
   if test -z "$NCURSES_DIR"; then
     echo "$ac_t""not found" 1>&6
     { echo "configure: error: Please reinstall the ncurses distribution" 1>&2; exit 1; }
   fi

   # --with-ncurses -> add include path
   
  if test "$NCURSES_DIR/include" != "/usr/include"; then
    
  if test -z "$NCURSES_DIR/include" || echo "$NCURSES_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$NCURSES_DIR/include
  else
    
    ep_dir="`echo $NCURSES_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$NCURSES_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


   # --with-ncurses -> chech for lib and symbol presence
   LIBNAME=ncurses 
   LIBSYMBOL=initscr 
   old_LIBS=$LIBS
   LIBS="$LIBS -L$NCURSES_DIR/lib -lm"
   echo $ac_n "checking for $LIBSYMBOL in -l$LIBNAME""... $ac_c" 1>&6
echo "configure:33827: checking for $LIBSYMBOL in -l$LIBNAME" >&5
ac_lib_var=`echo $LIBNAME'_'$LIBSYMBOL | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$LIBNAME  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 33835 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $LIBSYMBOL();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: wrong ncurses lib version or lib not found" 1>&2; exit 1; }
fi

   LIBS=$old_LIBS
  
   
  PHP_VAR_SUBST="$PHP_VAR_SUBST NCURSES_SHARED_LIBADD"

   

  if test "$ext_shared" = "yes"; then
    SAPRFC_SHARED_LIBADD="-l$LIBNAME $SAPRFC_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" && test -n "SAPRFC_SHARED_LIBADD"; then
      SAPRFC_SHARED_LIBADD="-R$NCURSES_DIR/lib -L$NCURSES_DIR/lib $SAPRFC_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$NCURSES_DIR/lib -L$NCURSES_DIR/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
  
 case $LIBNAME in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$LIBNAME $LIBS"


  ;;
  esac



  fi



  
  EXT_SUBDIRS="$EXT_SUBDIRS ncurses"
  
  if test -d "$abs_srcdir/ext/ncurses"; then
    ext_builddir=ext/ncurses
    ext_srcdir=$abs_srcdir/ext/ncurses
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libncurses.la"
    EXT_STATIC="$EXT_STATIC ncurses"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_NCURSES 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi


                                                                                                                                                                



echo $ac_n "checking for Oracle-OCI8 support""... $ac_c" 1>&6
echo "configure:34113: checking for Oracle-OCI8 support" >&5
# 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
fi


case $PHP_OCI8 in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OCI8=`echo "$PHP_OCI8"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OCI8=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_OCI8" = "no" && PHP_OCI8=yes
fi

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




if test "$PHP_OCI8" != "no"; then
  echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6
echo "configure:34157: checking Oracle Install-Dir" >&5
  if test "$PHP_OCI8" = "yes"; then
  	OCI8_DIR=$ORACLE_HOME
  else
  	OCI8_DIR=$PHP_OCI8
  fi
  echo "$ac_t""$OCI8_DIR" 1>&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

  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

  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

  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

  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="-l$ac_ii $OCI8_SYSLIB"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "OCI8_SYSLIB"; then
      OCI8_SYSLIB="-R$ac_ii -L$ac_ii $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="-l$ac_ii $OCI8_SYSLIB"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "OCI8_SYSLIB"; then
      OCI8_SYSLIB="-R$ac_ii -L$ac_ii $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 $ac_n "checking Oracle version""... $ac_c" 1>&6
echo "configure:34448: checking Oracle version" >&5
  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.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 "configure: error: Oracle-OCI8 needed libraries not found" 1>&2; exit 1; }
  fi
  echo "$ac_t""$OCI8_VERSION" 1>&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" && test -n "OCI8_SHARED_LIBADD"; then
      OCI8_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "OCI8_SHARED_LIBADD"; then
      OCI8_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "OCI8_SHARED_LIBADD"; then
      OCI8_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "OCI8_SHARED_LIBADD"; then
      OCI8_SHARED_LIBADD="-R$OCI8_DIR/lib -L$OCI8_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$OCI8_DIR/lib -L$OCI8_DIR/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
  
 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
     
  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" && test -n "OCI8_SHARED_LIBADD"; then
      OCI8_SHARED_LIBADD="-R$OCI8_DIR/lib -L$OCI8_DIR/lib $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 <<\EOF
#define HAVE_OCI8_TEMP_LOB 1
EOF

	  ;;

	*)
      { echo "configure: error: Unsupported Oracle version!" 1>&2; exit 1; }
	  ;;
  esac

  
  EXT_SUBDIRS="$EXT_SUBDIRS oci8"
  
  if test -d "$abs_srcdir/ext/oci8"; then
    ext_builddir=ext/oci8
    ext_srcdir=$abs_srcdir/ext/oci8
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/liboci8.la"
    EXT_STATIC="$EXT_STATIC oci8"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_OCI8 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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


  
  
  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 $ac_n "checking for Adabas support""... $ac_c" 1>&6
echo "configure:35093: checking for Adabas support" >&5
# Check whether --with-adabas or --without-adabas was given.
if test "${with_adabas+set}" = set; then
  withval="$with_adabas"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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

    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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$abs_builddir/ext/odbc -L$abs_builddir/ext/odbc $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case odbc_adabas in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lodbc_adabas $LIBS"


  ;;
  esac



    ODBC_TYPE=adabas
    cat >> confdefs.h <<\EOF
#define HAVE_ADABAS 1
EOF

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for SAP DB support""... $ac_c" 1>&6
echo "configure:35284: checking for SAP DB support" >&5
# Check whether --with-sapdb or --without-sapdb was given.
if test "${with_sapdb+set}" = set; then
  withval="$with_sapdb"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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

	
 case sqlod in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsqlod $LIBS"


  ;;
  esac

	
 case sqlrte in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsqlrte $LIBS"


  ;;
  esac

    ODBC_TYPE=sapdb
    cat >> confdefs.h <<\EOF
#define HAVE_SAPDB 1
EOF

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

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

fi

fi


if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Solid support""... $ac_c" 1>&6
echo "configure:35420: checking for Solid support" >&5
# Check whether --with-solid or --without-solid was given.
if test "${with_solid+set}" = set; then
  withval="$with_solid"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 <<\EOF
#define HAVE_SOLID_35 1
EOF

	elif test -f $ODBC_LIBDIR/scl*30.a; then
	  cat >> confdefs.h <<\EOF
#define HAVE_SOLID_30 1
EOF

	elif test -f $ODBC_LIBDIR/scl*23.a; then
      cat >> confdefs.h <<\EOF
#define HAVE_SOLID 1
EOF

    fi
    echo "$ac_t""yes" 1>&6
    
  echo $ac_n "checking Solid library file""... $ac_c" 1>&6
echo "configure:35470: checking Solid library file" >&5  
  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 <<\EOF
#define SS_LINUX 1
EOF

		ac_solid_os=l2x
	else
		cat >> confdefs.h <<\EOF
#define SS_LINUX 1
EOF

		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 <<\EOF
#define SS_FBX 1
EOF

		ac_solid_os=fex
   else 
		cat >> confdefs.h <<\EOF
#define SS_FBX 1
EOF

		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 "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for IBM DB2 support""... $ac_c" 1>&6
echo "configure:35554: checking for IBM DB2 support" >&5
# Check whether --with-ibm-db2 or --without-ibm-db2 was given.
if test "${with_ibm_db2+set}" = set; then
  withval="$with_ibm_db2"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_TYPE=db2
    ODBC_LIBS="-ldb2"
    cat >> confdefs.h <<\EOF
#define HAVE_IBMDB2 1
EOF


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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Empress support""... $ac_c" 1>&6
echo "configure:35609: checking for Empress support" >&5
# Check whether --with-empress or --without-empress was given.
if test "${with_empress+set}" = set; then
  withval="$with_empress"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 <<\EOF
#define HAVE_EMPRESS 1
EOF

    echo "$ac_t""yes" 1>&6
    
  echo $ac_n "checking Empress library file""... $ac_c" 1>&6
echo "configure:35650: checking Empress library file" >&5
  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 "$ac_t""`echo $ODBC_LIBS | sed -e 's!.*/!!'`" 1>&6

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Empress local access support""... $ac_c" 1>&6
echo "configure:35671: checking for Empress local access support" >&5
# Check whether --with-empress-bcs or --without-empress-bcs was given.
if test "${with_empress_bcs+set}" = set; then
  withval="$with_empress_bcs"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 <<\EOF
#define HAVE_EMPRESS 1
EOF

    echo "$ac_t""yes" 1>&6
    
  echo $ac_n "checking Empress local access library file""... $ac_c" 1>&6
echo "configure:35728: checking Empress local access library file" >&5
  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 "$ac_t""`echo $ODBCBCS_LIBS | sed -e 's!.*/!!'`" 1>&6

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Velocis support""... $ac_c" 1>&6
echo "configure:35749: checking for Velocis support" >&5
# Check whether --with-velocis or --without-velocis was given.
if test "${with_velocis+set}" = set; then
  withval="$with_velocis"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi


  if test "$withval" != "no"; then
    if test "$withval" = "yes"; then
        ODBC_INCDIR=/usr/local/velocis/include
        ODBC_LIBDIR=/usr/local/velocis/lib
    else
        ODBC_INCDIR=$withval/include
        ODBC_LIBDIR=$withval/lib
    fi
    ODBC_INCLUDE=-I$ODBC_INCDIR
    ODBC_TYPE=velocis
    ODBC_LFLAGS=-L$ODBC_LIBDIR
    ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"
    cat >> confdefs.h <<\EOF
#define HAVE_VELOCIS 1
EOF


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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for a custom ODBC support""... $ac_c" 1>&6
echo "configure:35805: checking for a custom ODBC support" >&5
# 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 <<\EOF
#define HAVE_CODBC 1
EOF

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for iODBC support""... $ac_c" 1>&6
echo "configure:35839: checking for iODBC support" >&5
# Check whether --with-iodbc or --without-iodbc was given.
if test "${with_iodbc+set}" = set; then
  withval="$with_iodbc"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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
  
 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 <<\EOF
#define HAVE_IODBC 1
EOF

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for Easysoft ODBC-ODBC Bridge support""... $ac_c" 1>&6
echo "configure:35971: checking for Easysoft ODBC-ODBC Bridge support" >&5
# Check whether --with-esoob or --without-esoob was given.
if test "${with_esoob+set}" = set; then
  withval="$with_esoob"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 <<\EOF
#define HAVE_ESOOB 1
EOF

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for unixODBC support""... $ac_c" 1>&6
echo "configure:36023: checking for unixODBC support" >&5
# Check whether --with-unixODBC or --without-unixODBC was given.
if test "${with_unixODBC+set}" = set; then
  withval="$with_unixODBC"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 <<\EOF
#define HAVE_UNIXODBC 1
EOF

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

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for OpenLink ODBC support""... $ac_c" 1>&6
echo "configure:36075: checking for OpenLink ODBC support" >&5
# Check whether --with-openlink or --without-openlink was given.
if test "${with_openlink+set}" = set; then
  withval="$with_openlink"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$withval/lib -L$withval/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
  
 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 <<\EOF
#define HAVE_IODBC 1
EOF

    echo "$ac_t""yes" 1>&6
	echo "****************************************************************"
	echo "  --with-openlink will not be valid in future releases.  Please "
	echo " update your configure script to use --with-iodbc instead.      "
	echo "****************************************************************"
  else
    echo "$ac_t""no" 1>&6
  fi

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

fi

fi

if test -z "$ODBC_TYPE"; then
echo $ac_n "checking for DBMaker support""... $ac_c" 1>&6
echo "configure:36211: checking for DBMaker support" >&5
# Check whether --with-dbmaker or --without-dbmaker was given.
if test "${with_dbmaker+set}" = set; then
  withval="$with_dbmaker"
  
  
    case $withval in
	shared)
	    shared=yes
	    withval=yes
	    ;;
	shared,*)
	    shared=yes
	    withval=`echo $withval | sed -e 's/^shared,//'`      
	    ;;
	*)
	    shared=no
	    ;;
    esac
    if test -n "$php_always_shared"; then
		shared=yes
	fi

  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 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 <<\EOF
#define HAVE_DBMAKER 1
EOF


    if test "$shared" = "yes"; then
        echo "$ac_t""yes (shared)" 1>&6
        ODBC_LIBS="-ldmapic -lc -lm"
        ODBC_SHARED="odbc.la"
    else
        echo "$ac_t""yes (static)" 1>&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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ODBC_LIBDIR -L$ODBC_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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 "$ac_t""yes" 1>&6
  else
    echo "$ac_t""no" 1>&6
  fi

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

fi

fi

if test -n "$ODBC_TYPE"; then
  INCLUDES="$INCLUDES $ODBC_INCLUDE"
  if test "$ODBC_TYPE" != "dbmaker"; then
    if test $shared != "yes"; then
      EXTRA_LIBS="$EXTRA_LIBS $ODBC_LFLAGS $ODBC_LIBS"
    fi
  fi
  cat >> confdefs.h <<\EOF
#define HAVE_UODBC 1
EOF

  
  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_SUBDIRS="$EXT_SUBDIRS odbc"
  
  if test -d "$abs_srcdir/ext/odbc"; then
    ext_builddir=ext/odbc
    ext_srcdir=$abs_srcdir/ext/odbc
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$shared" != "shared" && test "$shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libodbc.la"
    EXT_STATIC="$EXT_STATIC odbc"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ODBC 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi


if test "$OPENSSL_DIR"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS openssl"
  
  if test -d "$abs_srcdir/ext/openssl"; then
    ext_builddir=ext/openssl
    ext_srcdir=$abs_srcdir/ext/openssl
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libopenssl.la"
    EXT_STATIC="$EXT_STATIC openssl"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_OPENSSL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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

fi






echo $ac_n "checking for Oracle-ORACLE support""... $ac_c" 1>&6
echo "configure:36704: checking for Oracle-ORACLE support" >&5
# 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
fi


case $PHP_ORACLE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ORACLE=`echo "$PHP_ORACLE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ORACLE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ORACLE" = "no" && PHP_ORACLE=yes
fi

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




if test "$PHP_ORACLE" != "no"; then
  echo $ac_n "checking Oracle Install-Dir""... $ac_c" 1>&6
echo "configure:36748: checking Oracle Install-Dir" >&5
  if test "$PHP_ORACLE" = "yes"; then
  	ORACLE_DIR=$ORACLE_HOME
  else
  	ORACLE_DIR=$PHP_ORACLE
  fi
  echo "$ac_t""$ORACLE_DIR" 1>&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="-l$ac_ii $ORACLE_SHARED_LIBADD"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ac_ii -L$ac_ii $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="-l$ac_ii $ORACLE_SHARED_LIBADD"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ac_ii -L$ac_ii $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 $ac_n "checking Oracle version""... $ac_c" 1>&6
echo "configure:37039: checking Oracle version" >&5
  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.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 "configure: error: Oracle needed libraries not found" 1>&2; exit 1; }
  fi
  echo "$ac_t""$ORACLE_VERSION" 1>&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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R"" -L"" $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R"" -L"" $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ORACLE_DIR/lib -L$ORACLE_DIR/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
  
 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
     
  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" && test -n "ORACLE_SHARED_LIBADD"; then
      ORACLE_SHARED_LIBADD="-R$ORACLE_DIR/lib -L$ORACLE_DIR/lib $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 "configure: error: Unsupported Oracle version!" 1>&2; exit 1; }
	  ;;
  esac

  
  EXT_SUBDIRS="$EXT_SUBDIRS oracle"
  
  if test -d "$abs_srcdir/ext/oracle"; then
    ext_builddir=ext/oracle
    ext_srcdir=$abs_srcdir/ext/oracle
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/liboracle.la"
    EXT_STATIC="$EXT_STATIC oracle"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ORACLE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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


  
  
  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 $ac_n "checking for Ovrimos SQL Server support""... $ac_c" 1>&6
echo "configure:41558: checking for Ovrimos SQL Server support" >&5
# Check whether --with-ovrimos or --without-ovrimos was given.
if test "${with_ovrimos+set}" = set; then
  withval="$with_ovrimos"
  PHP_OVRIMOS=$withval
else
  PHP_OVRIMOS=no
fi


case $PHP_OVRIMOS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OVRIMOS=`echo "$PHP_OVRIMOS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_OVRIMOS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_OVRIMOS" = "no" && PHP_OVRIMOS=yes
fi

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




if test "$PHP_OVRIMOS" != "no"; then
  for i in /usr/local /usr $PHP_OVRIMOS; do
    if test -f $i/include/sqlcli.h; then
      OVRIMOS_DIR=$i
    fi
  done

  if test -z "$OVRIMOS_DIR"; then
    { echo "configure: error: Please reinstall Ovrimos' libsqlcli - I cannot find sqlcli.h" 1>&2; exit 1; }
  fi

  
  if test "$OVRIMOS_DIR/include" != "/usr/include"; then
    
  if test -z "$OVRIMOS_DIR/include" || echo "$OVRIMOS_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$OVRIMOS_DIR/include
  else
    
    ep_dir="`echo $OVRIMOS_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OVRIMOS_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 OVRIMOS_SHARED_LIBADD"

  LDFLAGS="$LDFLAGS $ld_runpath_switch$OVRIMOS_DIR/lib -L$OVRIMOS_DIR/lib"
  echo $ac_n "checking for main in -lsqlcli""... $ac_c" 1>&6
echo "configure:41647: checking for main in -lsqlcli" >&5
ac_lib_var=`echo sqlcli'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsqlcli  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 41655 "configure"
#include "confdefs.h"

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo sqlcli | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsqlcli $LIBS"

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

  

  if test "$ext_shared" = "yes"; then
    OVRIMOS_SHARED_LIBADD="-lsqlcli $OVRIMOS_SHARED_LIBADD"
    if test -n "$OVRIMOS_DIR/lib"; then
      
  if test "$OVRIMOS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$OVRIMOS_DIR/lib" || echo "$OVRIMOS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OVRIMOS_DIR/lib
  else
    
    ep_dir="`echo $OVRIMOS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OVRIMOS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "OVRIMOS_SHARED_LIBADD"; then
      OVRIMOS_SHARED_LIBADD="-R$OVRIMOS_DIR/lib -L$OVRIMOS_DIR/lib $OVRIMOS_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 "$OVRIMOS_DIR/lib"; then
    
  if test "$OVRIMOS_DIR/lib" != "/usr/lib"; then
    
  if test -z "$OVRIMOS_DIR/lib" || echo "$OVRIMOS_DIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$OVRIMOS_DIR/lib
  else
    
    ep_dir="`echo $OVRIMOS_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$OVRIMOS_DIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$OVRIMOS_DIR/lib -L$OVRIMOS_DIR/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
  
 case sqlcli in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsqlcli $LIBS"


  ;;
  esac



  fi


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


  
  EXT_SUBDIRS="$EXT_SUBDIRS ovrimos"
  
  if test -d "$abs_srcdir/ext/ovrimos"; then
    ext_builddir=ext/ovrimos
    ext_srcdir=$abs_srcdir/ext/ovrimos
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libovrimos.la"
    EXT_STATIC="$EXT_STATIC ovrimos"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_OVRIMOS 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking whether to enable pcntl support""... $ac_c" 1>&6
echo "configure:41929: checking whether to enable pcntl support" >&5
# 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
fi


case $PHP_PCNTL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PCNTL=`echo "$PHP_PCNTL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PCNTL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PCNTL" = "no" && PHP_PCNTL=yes
fi

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




if test "$PHP_PCNTL" != "no"; then
  if test "$PHP_SAPI" != "cgi"; then
      { echo "configure: error: pcntl currently only accepts the CGI SAPI" 1>&2; exit 1; }
  fi
 
  for ac_func in fork
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:41979: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 41984 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
  cat >> confdefs.h <<\EOF
#define HAVE_FORK 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } 
fi
done

  for ac_func in waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:42038: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 42043 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
  cat >> confdefs.h <<\EOF
#define HAVE_WAITPID 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: pcntl: fork() not supported by this platform" 1>&2; exit 1; } 
fi
done

  for ac_func in sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:42097: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 42102 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
  cat >> confdefs.h <<\EOF
#define HAVE_SIGACTION 1
EOF
 
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: pcntl: sigaction() not supported by this platform" 1>&2; exit 1; } 
fi
done

  
  
  EXT_SUBDIRS="$EXT_SUBDIRS pcntl"
  
  if test -d "$abs_srcdir/ext/pcntl"; then
    ext_builddir=ext/pcntl
    ext_srcdir=$abs_srcdir/ext/pcntl
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpcntl.la"
    EXT_STATIC="$EXT_STATIC pcntl"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PCNTL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
fi





echo $ac_n "checking whether to include PCRE support""... $ac_c" 1>&6
echo "configure:42297: checking whether to include PCRE support" >&5
# 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
fi


case $PHP_PCRE_REGEX in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PCRE_REGEX=`echo "$PHP_PCRE_REGEX"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PCRE_REGEX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PCRE_REGEX" = "no" && PHP_PCRE_REGEX=yes
fi

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




if test "$PHP_PCRE_REGEX" != "no"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS pcre"
  
  if test -d "$abs_srcdir/ext/pcre"; then
    ext_builddir=ext/pcre
    ext_srcdir=$abs_srcdir/ext/pcre
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpcre.la"
    EXT_STATIC="$EXT_STATIC pcre"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PCRE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  if test "$PHP_PCRE_REGEX" = "yes"; then
    PCRE_LIBADD=pcrelib/libpcre.la
    PCRE_SHARED_LIBADD=pcrelib/libpcre.la
    PCRE_SUBDIRS=pcrelib
    
  PHP_VAR_SUBST="$PHP_VAR_SUBST PCRE_LIBADD"

    
  PHP_VAR_SUBST="$PHP_VAR_SUBST PCRE_SUBDIRS"

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

    
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/pcrelib/Makefile"

    
  lib_makefile="$ext_builddir/pcrelib/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/pcrelib
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

  else
    test -f $PHP_PCRE_REGEX/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX
    test -f $PHP_PCRE_REGEX/include/pcre.h && PCRE_INCDIR=$PHP_PCRE_REGEX/include
    
    if test -z "$PCRE_INCDIR"; then
      echo "$ac_t""Could not find pcre.h in $PHP_PCRE_REGEX" 1>&6
    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 "configure: error: The PCRE extension requires PCRE library version >= 2.08" 1>&2; exit 1; }
    fi

    test -f $PHP_PCRE_REGEX/libpcre.a && PCRE_LIBDIR=$PHP_PCRE_REGEX
    test -f $PHP_PCRE_REGEX/lib/libpcre.a && PCRE_LIBDIR=$PHP_PCRE_REGEX/lib

    if test -z "$PCRE_LIBDIR" ; then
      { echo "configure: error: Could not find libpcre.a in $PHP_PCRE_REGEX" 1>&2; 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" && test -n "PCRE_SHARED_LIBADD"; then
      PCRE_SHARED_LIBADD="-R$PCRE_LIBDIR -L$PCRE_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PCRE_LIBDIR -L$PCRE_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case pcre in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpcre $LIBS"


  ;;
  esac



  fi


    
    
  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

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

  fi
fi

  PHP_VAR_SUBST="$PHP_VAR_SUBST PCRE_SHARED_LIBADD"



echo $ac_n "checking for memmove""... $ac_c" 1>&6
echo "configure:42713: checking for memmove" >&5
if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 42718 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char memmove(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char memmove();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_memmove) || defined (__stub___memmove)
choke me
#else
memmove();
#endif

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

if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
cat >> confdefs.h <<\EOF
#define USE_BCOPY 1
EOF

fi





echo $ac_n "checking whether to include PDFlib support""... $ac_c" 1>&6
echo "configure:42769: checking whether to include PDFlib support" >&5
# 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
fi


case $PHP_PDFLIB in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PDFLIB=`echo "$PHP_PDFLIB"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PDFLIB=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PDFLIB" = "no" && PHP_PDFLIB=yes
fi

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




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

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST PDFLIB_SHARED_LIBADD"

  
  EXT_SUBDIRS="$EXT_SUBDIRS pdf"
  
  if test -d "$abs_srcdir/ext/pdf"; then
    ext_builddir=ext/pdf
    ext_srcdir=$abs_srcdir/ext/pdf
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpdf.la"
    EXT_STATIC="$EXT_STATIC pdf"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PDF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



  case $PHP_PDFLIB in
    yes)
      echo $ac_n "checking for PDF_show_boxed in -lpdf""... $ac_c" 1>&6
echo "configure:42955: checking for PDF_show_boxed in -lpdf" >&5
ac_lib_var=`echo pdf'_'PDF_show_boxed | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpdf 
        -ltiff -ljpeg -lpng -lz
       $LIBS"
cat > conftest.$ac_ext <<EOF
#line 42965 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PDF_show_boxed();

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

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

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

        { echo "configure: error: pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so" 1>&2; exit 1; }
      
fi


      
 case pdf in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-lpdf $PDFLIB_SHARED_LIBADD"

   else
     
 case pdf in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpdf $LIBS"


  ;;
  esac

   fi

  ;;
  esac

      
 case tiff in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-ltiff $PDFLIB_SHARED_LIBADD"

   else
     
 case tiff in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltiff $LIBS"


  ;;
  esac

   fi

  ;;
  esac

      
 case png in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-lpng $PDFLIB_SHARED_LIBADD"

   else
     
 case png in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpng $LIBS"


  ;;
  esac

   fi

  ;;
  esac

      
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-ljpeg $PDFLIB_SHARED_LIBADD"

   else
     
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac

   fi

  ;;
  esac

      
 case z in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-lz $PDFLIB_SHARED_LIBADD"

   else
     
 case z in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lz $LIBS"


  ;;
  esac

   fi

  ;;
  esac

    ;;
    *)
      test -f $PHP_PDFLIB/include/pdflib.h && PDFLIB_INCLUDE=$PHP_PDFLIB/include
      if test -n "$PDFLIB_INCLUDE" ; then

        if test "$PHP_ZLIB_DIR" = "no"; then
          { echo "configure: error: PDF extension requires ZLIB. Use --with-zlib-dir=<DIR>" 1>&2; exit 1; }
        fi

        

  if test "$ext_shared" = "yes"; then
    PDFLIB_SHARED_LIBADD="-lz $PDFLIB_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" && test -n "PDFLIB_SHARED_LIBADD"; then
      PDFLIB_SHARED_LIBADD="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/lib $PDFLIB_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_ZLIB_DIR/lib -L$PHP_ZLIB_DIR/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
  
 case z in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lz $LIBS"


  ;;
  esac



  fi


 
        

echo $ac_n "checking for the location of libjpeg""... $ac_c" 1>&6
echo "configure:43247: checking for the location of libjpeg" >&5
# 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
fi


case $PHP_JPEG_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_JPEG_DIR=`echo "$PHP_JPEG_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_JPEG_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_JPEG_DIR" = "no" && PHP_JPEG_DIR=yes
fi

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




        if test "$PHP_JPEG_DIR" != "no"; then
          echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
echo "configure:43291: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ljpeg 
            -L$PHP_JPEG_DIR/lib
           $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43301 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char jpeg_read_header();

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

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

  if test "$ext_shared" = "yes"; then
    PDFLIB_SHARED_LIBADD="-ljpeg $PDFLIB_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" && test -n "PDFLIB_SHARED_LIBADD"; then
      PDFLIB_SHARED_LIBADD="-R$PHP_JPEG_DIR/lib -L$PHP_JPEG_DIR/lib $PDFLIB_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_JPEG_DIR/lib -L$PHP_JPEG_DIR/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
  
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac



  fi


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

            { echo "configure: error: libjpeg not found!" 1>&2; exit 1; }
          
fi

        else
          echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
echo "configure:43432: checking for jpeg_read_header in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ljpeg  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43440 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char jpeg_read_header();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   
            
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-ljpeg $PDFLIB_SHARED_LIBADD"

   else
     
 case jpeg in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ljpeg $LIBS"


  ;;
  esac

   fi

  ;;
  esac

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

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

        fi

 
        

echo $ac_n "checking for the location of libpng""... $ac_c" 1>&6
echo "configure:43508: checking for the location of libpng" >&5
# 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
fi


case $PHP_PNG_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PNG_DIR=`echo "$PHP_PNG_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PNG_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes
fi

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



        
        if test "$PHP_PNG_DIR" != "no"; then
          echo $ac_n "checking for png_create_info_struct in -lpng""... $ac_c" 1>&6
echo "configure:43552: checking for png_create_info_struct in -lpng" >&5
ac_lib_var=`echo png'_'png_create_info_struct | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpng 
            -L$PHP_PNG_DIR/lib
           $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43562 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_create_info_struct();

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

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

  if test "$ext_shared" = "yes"; then
    PDFLIB_SHARED_LIBADD="-lpng $PDFLIB_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" && test -n "PDFLIB_SHARED_LIBADD"; then
      PDFLIB_SHARED_LIBADD="-R$PHP_PNG_DIR/lib -L$PHP_PNG_DIR/lib $PDFLIB_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_PNG_DIR/lib -L$PHP_PNG_DIR/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
  
 case png in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpng $LIBS"


  ;;
  esac



  fi


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

            { echo "configure: error: libpng not found!" 1>&2; exit 1; }
          
fi

        else
          echo $ac_n "checking for png_create_info_struct in -lpng""... $ac_c" 1>&6
echo "configure:43693: checking for png_create_info_struct in -lpng" >&5
ac_lib_var=`echo png'_'png_create_info_struct | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpng  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43701 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_create_info_struct();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   
            
 case png in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-lpng $PDFLIB_SHARED_LIBADD"

   else
     
 case png in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpng $LIBS"


  ;;
  esac

   fi

  ;;
  esac

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

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

        fi
        

        

echo $ac_n "checking for the location of libtiff""... $ac_c" 1>&6
echo "configure:43769: checking for the location of libtiff" >&5
# 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
fi


case $PHP_TIFF_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TIFF_DIR=`echo "$PHP_TIFF_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TIFF_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_TIFF_DIR" = "no" && PHP_TIFF_DIR=yes
fi

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




        if test "$PHP_TIFF_DIR" != "no"; then
          echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:43813: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltiff 
            -L$PHP_TIFF_DIR/lib
           $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43823 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

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

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

  if test "$ext_shared" = "yes"; then
    PDFLIB_SHARED_LIBADD="-ltiff $PDFLIB_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" && test -n "PDFLIB_SHARED_LIBADD"; then
      PDFLIB_SHARED_LIBADD="-R$PHP_TIFF_DIR/lib -L$PHP_TIFF_DIR/lib $PDFLIB_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_TIFF_DIR/lib -L$PHP_TIFF_DIR/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
  
 case tiff in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltiff $LIBS"


  ;;
  esac



  fi


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

            { echo "configure: error: libtiff not found!" 1>&2; exit 1; }
          
fi

        else
          echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
echo "configure:43954: checking for TIFFOpen in -ltiff" >&5
ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltiff  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 43962 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char TIFFOpen();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
            
 case tiff in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  PDFLIB_SHARED_LIBADD="-ltiff $PDFLIB_SHARED_LIBADD"

   else
     
 case tiff in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltiff $LIBS"


  ;;
  esac

   fi

  ;;
  esac

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

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

        fi


        echo $ac_n "checking for PDF_show_boxed in -lpdf""... $ac_c" 1>&6
echo "configure:44028: checking for PDF_show_boxed in -lpdf" >&5
ac_lib_var=`echo pdf'_'PDF_show_boxed | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpdf 
          -L$PHP_PDFLIB/lib
         $LIBS"
cat > conftest.$ac_ext <<EOF
#line 44038 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PDF_show_boxed();

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

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

  if test "$ext_shared" = "yes"; then
    PDFLIB_SHARED_LIBADD="-lpdf $PDFLIB_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" && test -n "PDFLIB_SHARED_LIBADD"; then
      PDFLIB_SHARED_LIBADD="-R$PHP_PDFLIB/lib -L$PHP_PDFLIB/lib $PDFLIB_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PHP_PDFLIB/lib -L$PHP_PDFLIB/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
  
 case pdf in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpdf $LIBS"


  ;;
  esac



  fi


          
  if test "$PDFLIB_INCLUDE" != "/usr/include"; then
    
  if test -z "$PDFLIB_INCLUDE" || echo "$PDFLIB_INCLUDE" | grep '^/' >/dev/null ; then
    ai_p=$PDFLIB_INCLUDE
  else
    
    ep_dir="`echo $PDFLIB_INCLUDE|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$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
  echo "$ac_t""no" 1>&6

          { echo "configure: error: pdflib extension requires at least pdflib 3.x." 1>&2; exit 1; }
        
fi

      fi 
    ;;
  esac
fi




echo $ac_n "checking whether to include Verisign Payflow Pro support""... $ac_c" 1>&6
echo "configure:44211: checking whether to include Verisign Payflow Pro support" >&5
# 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
fi


case $PHP_PFPRO in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PFPRO=`echo "$PHP_PFPRO"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PFPRO=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PFPRO" = "no" && PHP_PFPRO=yes
fi

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




if test "$PHP_PFPRO" != "no"; then
  PFPRO_LIB=libpfpro.so
  PFPRO_HDR=pfpro.h

  for i in /usr/local /usr $PHP_PFPRO; 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
  done

  if test -z "$PFPRO_INC_DIR"; then
    { echo "configure: 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" 1>&2; exit 1; }
  fi

  if test -z "$PFPRO_LIB_DIR"; then
    { echo "configure: 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" 1>&2; exit 1; }
  fi

  PFPRO_VERSION3=`nm $PFPRO_LIB_DIR/$PFPRO_LIB | awk '{print $3}' | grep '^pfpro' > /dev/null && echo 1 || echo 0`
  PFPRO_VERSION2=`nm $PFPRO_LIB_DIR/$PFPRO_LIB | awk '{print $3}' | grep '^PN' > /dev/null && echo 1 || echo 0`

  if test "$PFPRO_VERSION3" -eq 1 ; then
	PFPRO_VERSION=3
  elif test "$PFPRO_VERSION2" -eq 1 ; then
	PFPRO_VERSION=2
  else
  	{ echo "configure: error: The pfpro extension requires version 2 or 3 of the SDK" 1>&2; exit 1; }
  fi
  
  cat >> confdefs.h <<EOF
#define PFPRO_VERSION $PFPRO_VERSION
EOF

  
  
  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


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST PFPRO_SHARED_LIBADD"

  

  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" && test -n "PFPRO_SHARED_LIBADD"; then
      PFPRO_SHARED_LIBADD="-R$PFPRO_LIB_DIR -L$PFPRO_LIB_DIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PFPRO_LIB_DIR -L$PFPRO_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case pfpro in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpfpro $LIBS"


  ;;
  esac



  fi



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


  
  EXT_SUBDIRS="$EXT_SUBDIRS pfpro"
  
  if test -d "$abs_srcdir/ext/pfpro"; then
    ext_builddir=ext/pfpro
    ext_srcdir=$abs_srcdir/ext/pfpro
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpfpro.la"
    EXT_STATIC="$EXT_STATIC pfpro"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PFPRO 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi






echo $ac_n "checking for PostgreSQL support""... $ac_c" 1>&6
echo "configure:44581: checking for PostgreSQL support" >&5
# 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
fi


case $PHP_PGSQL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PGSQL=`echo "$PHP_PGSQL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PGSQL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PGSQL" = "no" && PHP_PGSQL=yes
fi

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




if test "$PHP_PGSQL" != "no"; then
  
  if test -z "$PHP_PGSQL" || echo "$PHP_PGSQL" | grep '^/' >/dev/null ; then
    PHP_PGSQL=$PHP_PGSQL
  else
    
    ep_dir="`echo $PHP_PGSQL|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    PHP_PGSQL="$ep_realdir/`basename \"$PHP_PGSQL\"`"
  fi

  for i in /usr /usr/local /usr/local/pgsql $PHP_PGSQL; do
    if test -r $i/include/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i/include
    elif test -r $i/include/pgsql/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i/include/pgsql
    elif test -r $i/include/postgresql/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i/include/postgresql
    fi
  done
  
  if test -z "$PGSQL_DIR"; then
    { echo "configure: error: Cannot find libpq-fe.h. Please specify the installation path of PostgreSQL" 1>&2; exit 1; }
  fi

  PGSQL_INCLUDE=-I$PGSQL_INCDIR
  PGSQL_LIBDIR=$PGSQL_DIR/lib
  test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql

  old_LIBS=$LIBS
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
  echo $ac_n "checking for PQcmdTuples in -lpq""... $ac_c" 1>&6
echo "configure:44654: checking for PQcmdTuples in -lpq" >&5
ac_lib_var=`echo pq'_'PQcmdTuples | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 44662 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQcmdTuples();

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

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

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

  echo $ac_n "checking for PQoidValue in -lpq""... $ac_c" 1>&6
echo "configure:44697: checking for PQoidValue in -lpq" >&5
ac_lib_var=`echo pq'_'PQoidValue | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 44705 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQoidValue();

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

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

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

  echo $ac_n "checking for PQclientEncoding in -lpq""... $ac_c" 1>&6
echo "configure:44740: checking for PQclientEncoding in -lpq" >&5
ac_lib_var=`echo pq'_'PQclientEncoding | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 44748 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQclientEncoding();

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

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

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

  echo $ac_n "checking for pg_encoding_to_char in -lpq""... $ac_c" 1>&6
echo "configure:44783: checking for pg_encoding_to_char in -lpq" >&5
ac_lib_var=`echo pq'_'pg_encoding_to_char | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 44791 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pg_encoding_to_char();

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

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

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

  LIBS=$old_LIBS
  LDFLAGS=$old_LDFLAGS
  
  cat >> confdefs.h <<\EOF
#define HAVE_PGSQL 1
EOF


  

  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" && test -n "PGSQL_SHARED_LIBADD"; then
      PGSQL_SHARED_LIBADD="-R$PGSQL_LIBDIR -L$PGSQL_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PGSQL_LIBDIR -L$PGSQL_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case pq in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpq $LIBS"


  ;;
  esac



  fi


  
  
  EXT_SUBDIRS="$EXT_SUBDIRS pgsql"
  
  if test -d "$abs_srcdir/ext/pgsql"; then
    ext_builddir=ext/pgsql
    ext_srcdir=$abs_srcdir/ext/pgsql
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpgsql.la"
    EXT_STATIC="$EXT_STATIC pgsql"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PGSQL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi


  PHP_VAR_SUBST="$PHP_VAR_SUBST PGSQL_INCLUDE"


  PHP_VAR_SUBST="$PHP_VAR_SUBST PGSQL_SHARED_LIBADD"





echo $ac_n "checking whether to include POSIX-like functions""... $ac_c" 1>&6
echo "configure:45076: checking whether to include POSIX-like functions" >&5
# 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
fi


case $PHP_POSIX in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_POSIX=`echo "$PHP_POSIX"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_POSIX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_POSIX" = "no" && PHP_POSIX=yes
fi

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




if test "$PHP_POSIX" = "yes"; then
  cat >> confdefs.h <<\EOF
#define HAVE_POSIX 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS posix"
  
  if test -d "$abs_srcdir/ext/posix"; then
    ext_builddir=ext/posix
    ext_srcdir=$abs_srcdir/ext/posix
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libposix.la"
    EXT_STATIC="$EXT_STATIC posix"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_POSIX 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



  for ac_func in seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo getrlimit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:45262: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 45267 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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

fi




echo $ac_n "checking whether to include pspell support""... $ac_c" 1>&6
echo "configure:45320: checking whether to include pspell support" >&5
# 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
fi


case $PHP_PSPELL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PSPELL=`echo "$PHP_PSPELL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_PSPELL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_PSPELL" = "no" && PHP_PSPELL=yes
fi

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




if test "$PHP_PSPELL" != "no"; then
	
  EXT_SUBDIRS="$EXT_SUBDIRS pspell"
  
  if test -d "$abs_srcdir/ext/pspell"; then
    ext_builddir=ext/pspell
    ext_srcdir=$abs_srcdir/ext/pspell
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libpspell.la"
    EXT_STATIC="$EXT_STATIC pspell"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_PSPELL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


	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 "configure: error: Cannot find pspell" 1>&2; exit 1; }
	fi

	PSPELL_LIBDIR=$PSPELL_DIR/lib

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

	
  PHP_VAR_SUBST="$PHP_VAR_SUBST PSPELL_SHARED_LIBADD"

	

  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" && test -n "PSPELL_SHARED_LIBADD"; then
      PSPELL_SHARED_LIBADD="-R$PSPELL_LIBDIR -L$PSPELL_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$PSPELL_LIBDIR -L$PSPELL_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case pspell in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lpspell $LIBS"


  ;;
  esac



  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

fi


echo $ac_n "checking whether to include QDOM support""... $ac_c" 1>&6
echo "configure:45655: checking whether to include QDOM support" >&5
# Check whether --with-qtdom or --without-qtdom was given.
if test "${with_qtdom+set}" = set; then
  withval="$with_qtdom"
  
case $withval in
    no)
      echo "$ac_t""no" 1>&6 ;;
    yes)
      if test -f $QTDIR/include/qdom.h; then
        echo "$ac_t""yes" 1>&6
        

  if test -n "$QTDIR/lib"; then
    
  if test "$QTDIR/lib" != "/usr/lib"; then
    
  if test -z "$QTDIR/lib" || echo "$QTDIR/lib" | grep '^/' >/dev/null ; then
    ai_p=$QTDIR/lib
  else
    
    ep_dir="`echo $QTDIR/lib|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$QTDIR/lib\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$QTDIR/lib -L$QTDIR/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
  
 case qt in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lqt $LIBS"


  ;;
  esac



        
  if test "$QTDIR/include" != "/usr/include"; then
    
  if test -z "$QTDIR/include" || echo "$QTDIR/include" | grep '^/' >/dev/null ; then
    ai_p=$QTDIR/include
  else
    
    ep_dir="`echo $QTDIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$QTDIR/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 <<\EOF
#define HAVE_QTDOM 1
EOF

        
  EXT_SUBDIRS="$EXT_SUBDIRS qtdom"
  
  if test -d "$abs_srcdir/ext/qtdom"; then
    ext_builddir=ext/qtdom
    ext_srcdir=$abs_srcdir/ext/qtdom
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libqtdom.la"
    EXT_STATIC="$EXT_STATIC qtdom"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_QTDOM 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


        
  if test -z "$php_cxx_done"; then
    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:45894: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:45926: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

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

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

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

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:45973: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:45982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

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

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:46001: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

    echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:46033: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 46046 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:46051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6

    php_cxx_done=yes
  fi

      elif test -f /usr/lib/qt2/include/qdom.h; then
        echo "$ac_t""yes" 1>&6
        
 case qt in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lqt $LIBS"


  ;;
  esac

        
  if test "/usr/lib/qt2/include" != "/usr/include"; then
    
  if test -z "/usr/lib/qt2/include" || echo "/usr/lib/qt2/include" | grep '^/' >/dev/null ; then
    ai_p=/usr/lib/qt2/include
  else
    
    ep_dir="`echo /usr/lib/qt2/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"/usr/lib/qt2/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 <<\EOF
#define HAVE_QTDOM 1
EOF

        
  EXT_SUBDIRS="$EXT_SUBDIRS qtdom"
  
  if test -d "$abs_srcdir/ext/qtdom"; then
    ext_builddir=ext/qtdom
    ext_srcdir=$abs_srcdir/ext/qtdom
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libqtdom.la"
    EXT_STATIC="$EXT_STATIC qtdom"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_QTDOM 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


        
  if test -z "$php_cxx_done"; then
    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:46269: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:46301: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

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

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

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

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:46348: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:46357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

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

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:46376: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

    echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:46408: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 46421 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:46426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6

    php_cxx_done=yes
  fi

      else
        echo "$ac_t""no" 1>&6
      fi
      ;;
  esac

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

fi





echo $ac_n "checking for libedit readline replacement""... $ac_c" 1>&6
echo "configure:46470: checking for libedit readline replacement" >&5
# 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
fi


case $PHP_LIBEDIT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LIBEDIT=`echo "$PHP_LIBEDIT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_LIBEDIT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_LIBEDIT" = "no" && PHP_LIBEDIT=yes
fi

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






echo $ac_n "checking for readline support""... $ac_c" 1>&6
echo "configure:46515: checking for readline support" >&5
# 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
fi


case $PHP_READLINE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_READLINE=`echo "$PHP_READLINE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_READLINE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_READLINE" = "no" && PHP_READLINE=yes
fi

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




if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then
  if test "$PHP_SAPI" != "cgi"; then
    { echo "configure: error: readline extension can only be used with CGI build!" 1>&2; exit 1; }
  fi
fi

if test "$PHP_READLINE" != "no"; then
  for i in /usr/local /usr $PHP_READLINE; do
    if test -f $i/include/readline/readline.h; then
      READLINE_DIR=$i
    fi
  done

  if test -z "$READLINE_DIR"; then
    { echo "configure: error: Please reinstall readline - I cannot find readline.h" 1>&2; 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


  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
echo "configure:46606: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lncurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 46614 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgetent();

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

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

  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-lncurses $READLINE_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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R -L $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 ""; 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" && test -n ""; then
      ="-R -L $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ncurses in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lncurses $LIBS"


  ;;
  esac



  fi


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

    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
echo "configure:46739: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltermcap  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 46747 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgetent();

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

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

  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-ltermcap $READLINE_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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R -L $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 ""; 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" && test -n ""; then
      ="-R -L $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case termcap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltermcap $LIBS"


  ;;
  esac



  fi


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

  
fi


  

  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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R$READLINE_DIR/lib -L$READLINE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$READLINE_DIR/lib -L$READLINE_DIR/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
  
 case history in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lhistory $LIBS"


  ;;
  esac



  fi


  

  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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R$READLINE_DIR/lib -L$READLINE_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$READLINE_DIR/lib -L$READLINE_DIR/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
  
 case readline in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lreadline $LIBS"


  ;;
  esac



  fi


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST READLINE_SHARED_LIBADD"


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

  
  EXT_SUBDIRS="$EXT_SUBDIRS readline"
  
  if test -d "$abs_srcdir/ext/readline"; then
    ext_builddir=ext/readline
    ext_srcdir=$abs_srcdir/ext/readline
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libreadline.la"
    EXT_STATIC="$EXT_STATIC readline"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_READLINE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi

if test "$PHP_LIBEDIT" != "no"; then
  for i in /usr/local /usr $PHP_LIBEDIT; do
    if test -f $i/include/readline/readline.h; then
      LIBEDIT_DIR=$i
    fi
  done

  if test -z "$LIBEDIT_DIR"; then
    { echo "configure: error: Please reinstall libedit - I cannot find readline.h" 1>&2; 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 $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
echo "configure:47252: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lncurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 47260 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgetent();

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

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

  if test "$ext_shared" = "yes"; then
    READLINE__SHARED_LIBADD="-lncurses $READLINE__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" && test -n "READLINE__SHARED_LIBADD"; then
      READLINE__SHARED_LIBADD="-R -L $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 ""; 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" && test -n ""; then
      ="-R -L $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case ncurses in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lncurses $LIBS"


  ;;
  esac



  fi


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

    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
echo "configure:47385: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltermcap  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 47393 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgetent();

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

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

  if test "$ext_shared" = "yes"; then
    READLINE_SHARED_LIBADD="-ltermcap $READLINE_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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R -L $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 ""; 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" && test -n ""; then
      ="-R -L $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case termcap in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ltermcap $LIBS"


  ;;
  esac



  fi


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

  
fi


  

  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" && test -n "READLINE_SHARED_LIBADD"; then
      READLINE_SHARED_LIBADD="-R$LIBEDIT_DIR/lib -L$LIBEDIT_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$LIBEDIT_DIR/lib -L$LIBEDIT_DIR/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
  
 case edit in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ledit $LIBS"


  ;;
  esac



  fi

  
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST READLINE_SHARED_LIBADD"


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

  
  EXT_SUBDIRS="$EXT_SUBDIRS readline"
  
  if test -d "$abs_srcdir/ext/readline"; then
    ext_builddir=ext/readline
    ext_srcdir=$abs_srcdir/ext/readline
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libreadline.la"
    EXT_STATIC="$EXT_STATIC readline"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_READLINE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for recode support""... $ac_c" 1>&6
echo "configure:47765: checking for recode support" >&5
# 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
fi


case $PHP_RECODE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_RECODE=`echo "$PHP_RECODE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_RECODE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_RECODE" = "no" && PHP_RECODE=yes
fi

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




	if test "$PHP_RECODE" != "no"; then
		RECODE_LIST="$PHP_RECODE /usr /usr/local /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
		done
		if test "$RECODE_DIR" = ""; then
			{ echo "configure: error: I cannot find recode.h anywhere below $RECODE_LIST. Is it installed?" 1>&2; exit 1; }
		fi

		old_LDFLAGS=$LDFLAGS
		old_LIBS=$LIBS
		LDFLAGS="$LDFLAGS -L$RECODE_DIR/$RECODE_LIB"
		LIBS="$LIBS -lrecode"
		cat > conftest.$ac_ext <<EOF
#line 47836 "configure"
#include "confdefs.h"

char *program_name;

int main() {

recode_format_table();

; return 0; }
EOF
if { (eval echo configure:47847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
				{ echo "configure: error: I cannot link librecode (-L$RECODE_DIR/$RECODE_LIB -lrecode). Is it installed?" 1>&2; exit 1; }

fi
rm -f conftest*
		LIBS=$old_LIBS
		LDFLAGS=$old_LDFLAGS

		if test "$RECODE_LIB" = ""; then
			{ echo "configure: error: Please reinstall recode - I cannot find librecode.a" 1>&2; exit 1; }
		fi

		
  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

		if test "$ext_shared" = "yes"; 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" && test -n "RECODE_SHARED_LIBADD"; then
      RECODE_SHARED_LIBADD="-R$RECODE_DIR/$RECODE_LIB -L$RECODE_DIR/$RECODE_LIB $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$RECODE_DIR/$RECODE_LIB -L$RECODE_DIR/$RECODE_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
  
 case recode in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lrecode $LIBS"


  ;;
  esac



  fi


			
  PHP_VAR_SUBST="$PHP_VAR_SUBST RECODE_SHARED_LIBADD"

		else
			
  
  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" && test -n ""; then
      ="-R$RECODE_DIR/$RECODE_LIB -L$RECODE_DIR/$RECODE_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

  
 case recode in
 c|c_r|pthread*) ;;
 *)

   
  DLIBS="-lrecode $DLIBS"


  ;;
  esac


		fi

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


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


		
  EXT_SUBDIRS="$EXT_SUBDIRS recode"
  
  if test -d "$abs_srcdir/ext/recode"; then
    ext_builddir=ext/recode
    ext_srcdir=$abs_srcdir/ext/recode
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/librecode.la"
    EXT_STATIC="$EXT_STATIC recode"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_RECODE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


	fi





echo $ac_n "checking whether to enable CORBA support via Satellite""... $ac_c" 1>&6
echo "configure:48232: checking whether to enable CORBA support via Satellite" >&5
# Check whether --with-satellite or --without-satellite was given.
if test "${with_satellite+set}" = set; then
  withval="$with_satellite"
  PHP_SATELLITE=$withval
else
  PHP_SATELLITE=no
fi


case $PHP_SATELLITE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SATELLITE=`echo "$PHP_SATELLITE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SATELLITE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SATELLITE" = "no" && PHP_SATELLITE=yes
fi

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




if test "$PHP_SATELLITE" != "no"; then
  
  	
  EXT_SUBDIRS="$EXT_SUBDIRS satellite"
  
  if test -d "$abs_srcdir/ext/satellite"; then
    ext_builddir=ext/satellite
    ext_srcdir=$abs_srcdir/ext/satellite
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsatellite.la"
    EXT_STATIC="$EXT_STATIC satellite"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SATELLITE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"



    
  PHP_VAR_SUBST="$PHP_VAR_SUBST SATELLITE_SHARED_LIBADD"


    echo $ac_n "checking for ORBit""... $ac_c" 1>&6
echo "configure:48417: checking for ORBit" >&5

    for i in $PHP_SATELLITE /usr/local/orbit /usr/local /usr; do

        if test -e $i/include/orb/orbit.h; then

            ORBIT_PATH=$i
      echo "$ac_t""found in $i" 1>&6

    fi
  done

    if test -z "$ORBIT_PATH"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please (re)install ORBit" 1>&2; exit 1; }
  fi

				
	
	

				# Extract the first word of "orbit-config", so it can be a program name with args.
set dummy orbit-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:48441: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_satellite_orbit'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$satellite_orbit" in
  /*)
  ac_cv_path_satellite_orbit="$satellite_orbit" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_satellite_orbit="$satellite_orbit" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$ORBIT_PATH/bin"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_satellite_orbit="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
satellite_orbit="$ac_cv_path_satellite_orbit"
if test -n "$satellite_orbit"; then
  echo "$ac_t""$satellite_orbit" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

		if test -z "$satellite_orbit"; then 
			{ echo "configure: error: Please (re)install ORBit" 1>&2; exit 1; }
		fi

				satellite_cflags=`$satellite_orbit --cflags client`
		if test -z "$satellite_cflags"; then
			{ echo "configure: error: Please (re)install ORBit" 1>&2; exit 1; }
		fi
		
  for ac_i in $satellite_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

	
				satellite_libs=`$satellite_orbit --libs client`
		if test -z "$satellite_libs"; then
			{ echo "configure: error: Please (re)install ORBit" 1>&2; exit 1; }
		fi
		
  for ac_i in $satellite_libs; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`
      
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n ""; then
      ="-R$ac_ii -L$ac_ii $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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

	
	

				# Extract the first word of "libIDL-config", so it can be a program name with args.
set dummy libIDL-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:48589: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_satellite_libIDL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$satellite_libIDL" in
  /*)
  ac_cv_path_satellite_libIDL="$satellite_libIDL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_satellite_libIDL="$satellite_libIDL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$ORBIT_PATH/bin"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_satellite_libIDL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
satellite_libIDL="$ac_cv_path_satellite_libIDL"
if test -n "$satellite_libIDL"; then
  echo "$ac_t""$satellite_libIDL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

		if test -z "$satellite_libIDL"; then 
			{ echo "configure: error: Please (re)install libIDL" 1>&2; exit 1; }
		fi

				satellite_cflags=`$satellite_libIDL --cflags `
		if test -z "$satellite_cflags"; then
			{ echo "configure: error: Please (re)install libIDL" 1>&2; exit 1; }
		fi
		
  for ac_i in $satellite_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

	
				satellite_libs=`$satellite_libIDL --libs `
		if test -z "$satellite_libs"; then
			{ echo "configure: error: Please (re)install libIDL" 1>&2; exit 1; }
		fi
		
  for ac_i in $satellite_libs; do
    case $ac_i in
    -l*)
      ac_ii=`echo $ac_i|cut -c 3-`
      
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n ""; then
      ="-R$ac_ii -L$ac_ii $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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 $ac_n "checking for giop_skip_atexit in -lIIOP""... $ac_c" 1>&6
echo "configure:48734: checking for giop_skip_atexit in -lIIOP" >&5
ac_lib_var=`echo IIOP'_'giop_skip_atexit | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lIIOP "$ORBIT_LIBS"  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 48742 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char giop_skip_atexit();

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

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

		{ echo "configure: error: You need a CVS version of ORBit, please read ext/satellite/README" 1>&2; exit 1; }
		
fi


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

fi




echo $ac_n "checking for mm support""... $ac_c" 1>&6
echo "configure:48787: checking for mm support" >&5
# 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
fi


case $PHP_MM in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MM=`echo "$PHP_MM"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_MM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_MM" = "no" && PHP_MM=yes
fi

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






echo $ac_n "checking whether to enable transparent session id propagation""... $ac_c" 1>&6
echo "configure:48832: checking whether to enable transparent session id propagation" >&5
# Check whether --enable-trans-sid or --disable-trans-sid was given.
if test "${enable_trans_sid+set}" = set; then
  enableval="$enable_trans_sid"
  PHP_TRANS_SID=$enableval
else
  PHP_TRANS_SID=no
fi


case $PHP_TRANS_SID in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TRANS_SID=`echo "$PHP_TRANS_SID"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_TRANS_SID=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_TRANS_SID" = "no" && PHP_TRANS_SID=yes
fi

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






echo $ac_n "checking whether to enable session support""... $ac_c" 1>&6
echo "configure:48877: checking whether to enable session support" >&5
# 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
fi


case $PHP_SESSION in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SESSION=`echo "$PHP_SESSION"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SESSION=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SESSION" = "no" && PHP_SESSION=yes
fi

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




if test "$PHP_MM" != "no"; then
  for i in /usr/local /usr $PHP_MM; do
    if test -f "$i/include/mm.h"; then
      MM_DIR=$i
    fi
  done

  if test -z "$MM_DIR" ; then
    { echo "configure: error: cannot find mm library" 1>&2; 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" && test -n "SESSION_SHARED_LIBADD"; then
      SESSION_SHARED_LIBADD="-R$MM_DIR/lib -L$MM_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$MM_DIR/lib -L$MM_DIR/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
  
 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 <<\EOF
#define HAVE_LIBMM 1
EOF

  
  EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS phpext_ps_mm_ptr,"

fi

if test "$PHP_TRANS_SID" = "yes"; then
  cat >> confdefs.h <<\EOF
#define TRANS_SID 1
EOF

fi

if test "$PHP_SESSION" != "no"; then
  for ac_func in pread pwrite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:49075: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 49080 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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

  
  echo $ac_n "checking whether pwrite works without custom declaration""... $ac_c" 1>&6
echo "configure:49129: checking whether pwrite works without custom declaration" >&5
if eval "test \"`echo '$''{'ac_cv_pwrite'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  cat > conftest.$ac_ext <<EOF
#line 49135 "configure"
#include "confdefs.h"
#include <unistd.h>
int main() {
size_t (*func)() = pwrite
; return 0; }
EOF
if { (eval echo configure:49142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    ac_cv_pwrite=yes
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 49156 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
      main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); }
    
EOF
if { (eval echo configure:49165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_pwrite=yes
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 49179 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
        ssize_t pwrite(int, void *, size_t, off64_t);
        main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); }
      
EOF
if { (eval echo configure:49190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
        ac_cv_pwrite=64
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
        ac_cv_pwrite=no
      
fi
rm -fr conftest*
fi

    
fi
rm -fr conftest*
fi

  
fi
rm -f conftest*
  
fi

echo "$ac_t""$ac_cv_pwrite" 1>&6
  case $ac_cv_pwrite in
  no) ac_cv_func_pwrite=no;;
  64) cat >> confdefs.h <<\EOF
#define PHP_PWRITE_64 1
EOF
;;
  esac

  
  echo $ac_n "checking whether pread works without custom declaration""... $ac_c" 1>&6
echo "configure:49228: checking whether pread works without custom declaration" >&5
if eval "test \"`echo '$''{'ac_cv_pread'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  cat > conftest.$ac_ext <<EOF
#line 49234 "configure"
#include "confdefs.h"
#include <unistd.h>
int main() {
size_t (*func)() = pread
; return 0; }
EOF
if { (eval echo configure:49241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
    ac_cv_pread=yes
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    echo test > conftest_in
    if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 49256 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
      main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); }
    
EOF
if { (eval echo configure:49265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_pread=yes
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      echo test > conftest_in
      if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 49280 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
        ssize_t pread(int, void *, size_t, off64_t);
        main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); }
      
EOF
if { (eval echo configure:49291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
        ac_cv_pread=64
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
        ac_cv_pread=no
      
fi
rm -fr conftest*
fi

    
fi
rm -fr conftest*
fi

  
fi
rm -f conftest*
  
fi

echo "$ac_t""$ac_cv_pread" 1>&6
  case $ac_cv_pread in
  no) ac_cv_func_pread=no;;
  64) cat >> confdefs.h <<\EOF
#define PHP_PREAD_64 1
EOF
;;
  esac

  
  EXT_SUBDIRS="$EXT_SUBDIRS session"
  
  if test -d "$abs_srcdir/ext/session"; then
    ext_builddir=ext/session
    ext_srcdir=$abs_srcdir/ext/session
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsession.la"
    EXT_STATIC="$EXT_STATIC session"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SESSION 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST SESSION_SHARED_LIBADD"

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

fi



echo $ac_n "checking whether to enable shmop support""... $ac_c" 1>&6
echo "configure:49474: checking whether to enable shmop support" >&5
# 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
fi


case $PHP_SHMOP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SHMOP=`echo "$PHP_SHMOP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SHMOP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SHMOP" = "no" && PHP_SHMOP=yes
fi

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




if test "$PHP_SHMOP" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_SHMOP 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS shmop"
  
  if test -d "$abs_srcdir/ext/shmop"; then
    ext_builddir=ext/shmop
    ext_srcdir=$abs_srcdir/ext/shmop
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libshmop.la"
    EXT_STATIC="$EXT_STATIC shmop"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SHMOP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for SNMP support""... $ac_c" 1>&6
echo "configure:49662: checking for SNMP support" >&5
# 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
fi


case $PHP_SNMP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SNMP=`echo "$PHP_SNMP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SNMP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SNMP" = "no" && PHP_SNMP=yes
fi

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




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

    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 "configure: error: snmp.h not found. Check your SNMP installation." 1>&2; exit 1; }
    elif test -z "$SNMP_LIBDIR"; then
      { echo "configure: error: libsnmp not found. Check your SNMP installation." 1>&2; exit 1; }
    fi

    old_CPPFLAGS=$CPPFLAGS
    CPPFLAGS=-I$SNMP_INCDIR
    for ac_hdr in default_store.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:49734: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 49739 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:49744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

    if test "$ac_cv_header_default_store_h" = "yes"; then
      echo $ac_n "checking for OpenSSL support in SNMP libraries""... $ac_c" 1>&6
echo "configure:49772: checking for OpenSSL support in SNMP libraries" >&5
      cat > conftest.$ac_ext <<EOF
#line 49774 "configure"
#include "confdefs.h"

        #include <ucd-snmp-config.h>
        #if USE_OPENSSL
        yes
        #endif
      
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  
        SNMP_SSL=yes
      
else
  rm -rf conftest*
  
        SNMP_SSL=no
      
fi
rm -f conftest*

    fi
    CPPFLAGS=$old_CPPFLAGS
    echo "$ac_t""$SNMP_SSL" 1>&6
  
    if test "$SNMP_SSL" = "yes"; then
      if test "$PHP_OPENSSL" != "no"; then
        
 case ssl in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -lssl"

   else
     
 case ssl in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="$LIBS -lssl"


  ;;
  esac

   fi

  ;;
  esac

        
 case crypto in
 c|c_r|pthread*) ;;
 *)

   if test "$ext_shared" = "yes"; then
     
  SNMP_SHARED_LIBADD="$SNMP_SHARED_LIBADD -lcrypto"

   else
     
 case crypto in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="$LIBS -lcrypto"


  ;;
  esac

   fi

  ;;
  esac

      else
        { echo "configure: error: The UCD-SNMP in this system is build with SSL support. 

        Add --with-openssl<=DIR> to your configure line." 1>&2; exit 1; }
      fi
    fi

    echo $ac_n "checking for kstat_read in -lkstat""... $ac_c" 1>&6
echo "configure:49865: checking for kstat_read in -lkstat" >&5
ac_lib_var=`echo kstat'_'kstat_read | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lkstat  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 49873 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char kstat_read();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
   
 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
 
else
  echo "$ac_t""no" 1>&6
fi


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

    
  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" && test -n "SNMP_SHARED_LIBADD"; then
      SNMP_SHARED_LIBADD="-R$SNMP_LIBDIR -L$SNMP_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$SNMP_LIBDIR -L$SNMP_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case snmp in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsnmp $LIBS"


  ;;
  esac



  fi



    
  EXT_SUBDIRS="$EXT_SUBDIRS snmp"
  
  if test -d "$abs_srcdir/ext/snmp"; then
    ext_builddir=ext/snmp
    ext_srcdir=$abs_srcdir/ext/snmp
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsnmp.la"
    EXT_STATIC="$EXT_STATIC snmp"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SNMP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


    
  PHP_VAR_SUBST="$PHP_VAR_SUBST SNMP_SHARED_LIBADD"

  fi


echo $ac_n "checking whether to enable UCD SNMP hack""... $ac_c" 1>&6
echo "configure:50203: checking whether to enable UCD SNMP hack" >&5
# 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 <<\EOF
#define UCD_SNMP_HACK 1
EOF

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

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

fi





echo $ac_n "checking whether to enable sockets support""... $ac_c" 1>&6
echo "configure:50229: checking whether to enable sockets support" >&5
# 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
fi


case $PHP_SOCKETS in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SOCKETS=`echo "$PHP_SOCKETS"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SOCKETS=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SOCKETS" = "no" && PHP_SOCKETS=yes
fi

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




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

  for ac_func in hstrerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:50276: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 50281 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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

  for ac_hdr in netdb.h netinet/tcp.h sys/un.h errno.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:50332: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 50337 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:50342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

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


  
  EXT_SUBDIRS="$EXT_SUBDIRS sockets"
  
  if test -d "$abs_srcdir/ext/sockets"; then
    ext_builddir=ext/sockets
    ext_srcdir=$abs_srcdir/ext/sockets
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsockets.la"
    EXT_STATIC="$EXT_STATIC sockets"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SOCKETS 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi







echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:50517: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 50522 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dlopen(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_dlopen) || defined (__stub___dlopen)
choke me
#else
dlopen();
#endif

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

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

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


echo $ac_n "checking for pam_start in -lpam""... $ac_c" 1>&6
echo "configure:50569: checking for pam_start in -lpam" >&5
ac_lib_var=`echo pam'_'pam_start | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lpam  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 50577 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pam_start();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
  EXTRA_LIBS="$EXTRA_LIBS -lpam"
  cat >> confdefs.h <<\EOF
#define HAVE_LIBPAM 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
 

for ac_func in getcwd getwd
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:50617: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 50622 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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




  echo $ac_n "checking for standard DES crypt""... $ac_c" 1>&6
echo "configure:50673: checking for standard DES crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_des'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
    ac_cv_crypt_des=yes
  
else
  cat > conftest.$ac_ext <<EOF
#line 50684 "configure"
#include "confdefs.h"

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

  
fi

echo "$ac_t""$ac_cv_crypt_des" 1>&6
  if test "$ac_cv_crypt_des" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi
  cat >> confdefs.h <<EOF
#define PHP_STD_DES_CRYPT $ac_result
EOF


  echo $ac_n "checking for extended DES crypt""... $ac_c" 1>&6
echo "configure:50730: checking for extended DES crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_ext_des'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
    ac_cv_crypt_ext_des=no
  
else
  cat > conftest.$ac_ext <<EOF
#line 50741 "configure"
#include "confdefs.h"

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

  
fi

echo "$ac_t""$ac_cv_crypt_ext_des" 1>&6
  if test "$ac_cv_crypt_ext_des" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi
  cat >> confdefs.h <<EOF
#define PHP_EXT_DES_CRYPT $ac_result
EOF


  echo $ac_n "checking for MD5 crypt""... $ac_c" 1>&6
echo "configure:50787: checking for MD5 crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_md5'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
    ac_cv_crypt_md5=no
  
else
  cat > conftest.$ac_ext <<EOF
#line 50798 "configure"
#include "confdefs.h"

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

  
fi

echo "$ac_t""$ac_cv_crypt_md5" 1>&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 <<EOF
#define PHP_MD5_CRYPT $ac_result
EOF


  echo $ac_n "checking for Blowfish crypt""... $ac_c" 1>&6
echo "configure:50882: checking for Blowfish crypt" >&5
if eval "test \"`echo '$''{'ac_cv_crypt_blowfish'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
    ac_cv_crypt_blowfish=no
  
else
  cat > conftest.$ac_ext <<EOF
#line 50893 "configure"
#include "confdefs.h"

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

  
fi

echo "$ac_t""$ac_cv_crypt_blowfish" 1>&6
  if test "$ac_cv_crypt_blowfish" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi
  cat >> confdefs.h <<EOF
#define PHP_BLOWFISH_CRYPT $ac_result
EOF



  echo $ac_n "checking whether flush should be called explicitly after a bufferered io""... $ac_c" 1>&6
echo "configure:50946: checking whether flush should be called explicitly after a bufferered io" >&5
if eval "test \"`echo '$''{'ac_cv_flush_io'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  if test "$cross_compiling" = yes; then
  
  ac_cv_flush_io=no

else
  cat > conftest.$ac_ext <<EOF
#line 50957 "configure"
#include "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);
}

EOF
if { (eval echo configure:50995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
  ac_cv_flush_io=no

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  ac_cv_flush_io=yes

fi
rm -fr conftest*
fi

fi

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

  fi



# Check whether --with-regex or --without-regex was given.
if test "${with_regex+set}" = set; then
  withval="$with_regex"
  
  case $withval in 
    system)
      REGEX_TYPE=system
      ;;
    apache)
      REGEX_TYPE=apache
      ;;
    php)
      REGEX_TYPE=php
      ;;
    *)
      REGEX_TYPE=php
      echo "configure: warning: Invalid regex library type. Using default value: php" 1>&2
      ;;
  esac

else
  
  REGEX_TYPE=php

fi

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

fi



  EXT_SUBDIRS="$EXT_SUBDIRS standard"
  
  if test -d "$abs_srcdir/ext/standard"; then
    ext_builddir=ext/standard
    ext_srcdir=$abs_srcdir/ext/standard
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "" != "shared" && test "" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libstandard.la"
    EXT_STATIC="$EXT_STATIC standard"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_STANDARD 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"






echo $ac_n "checking for libswf support""... $ac_c" 1>&6
echo "configure:51203: checking for libswf support" >&5
# 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
fi


case $PHP_SWF in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SWF=`echo "$PHP_SWF"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SWF=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SWF" = "no" && PHP_SWF=yes
fi

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




if test "$PHP_SWF" != "no"; then
  if test -r $PHP_SWF/lib/libswf.a; then
    SWF_DIR=$PHP_SWF
  else
    echo $ac_n "checking for libswf in default path""... $ac_c" 1>&6
echo "configure:51250: checking for libswf in default path" >&5
    for i in /usr/local /usr; do
      if test -r $i/lib/libswf.a; then
        SWF_DIR=$i
        echo "$ac_t""found in $i" 1>&6
      fi
    done
  fi

  if test -z "$SWF_DIR"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the libswf distribution -
   swf.h should be <swf-dir>/include and
   libswf.a should be in <swf-dir>/lib" 1>&2; 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" && test -n "SWF_SHARED_LIBADD"; then
      SWF_SHARED_LIBADD="-R$SWF_DIR/lib -L$SWF_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$SWF_DIR/lib -L$SWF_DIR/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
  
 case swf in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lswf $LIBS"


  ;;
  esac



  fi


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


  
  EXT_SUBDIRS="$EXT_SUBDIRS swf"
  
  if test -d "$abs_srcdir/ext/swf"; then
    ext_builddir=ext/swf
    ext_srcdir=$abs_srcdir/ext/swf
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libswf.la"
    EXT_STATIC="$EXT_STATIC swf"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SWF 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for Sybase support""... $ac_c" 1>&6
echo "configure:51541: checking for Sybase support" >&5
# 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
fi


case $PHP_SYBASE in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYBASE=`echo "$PHP_SYBASE"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYBASE=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SYBASE" = "no" && PHP_SYBASE=yes
fi

echo "$ac_t""$ext_output" 1>&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" && test -n "SYBASE_SHARED_LIBADD"; then
      SYBASE_SHARED_LIBADD="-R$SYBASE_LIBDIR -L$SYBASE_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$SYBASE_LIBDIR -L$SYBASE_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case sybdb in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lsybdb $LIBS"


  ;;
  esac



  fi


  
  EXT_SUBDIRS="$EXT_SUBDIRS sybase"
  
  if test -d "$abs_srcdir/ext/sybase"; then
    ext_builddir=ext/sybase
    ext_srcdir=$abs_srcdir/ext/sybase
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsybase.la"
    EXT_STATIC="$EXT_STATIC sybase"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SYBASE 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  echo $ac_n "checking for dnet_addr in -ldnet_stub""... $ac_c" 1>&6
echo "configure:51853: checking for dnet_addr in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_addr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 51861 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dnet_addr();

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

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

  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" && test -n "SYBASE_SHARED_LIBADD"; then
      SYBASE_SHARED_LIBADD="-R -L $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R -L $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case dnet_stub in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-ldnet_stub $LIBS"


  ;;
  esac



  fi


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

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

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

  echo $ac_n "checking for tdsdbopen in -lsybdb""... $ac_c" 1>&6
echo "configure:51995: checking for tdsdbopen in -lsybdb" >&5
ac_lib_var=`echo sybdb'_'tdsdbopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsybdb  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 52003 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tdsdbopen();

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

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

       cat >> confdefs.h <<\EOF
#define DBMFIX 1
EOF
 
else
  echo "$ac_t""no" 1>&6
 cat >> confdefs.h <<\EOF
#define PHP_SYBASE_DBOPEN dbopen
EOF
 
fi

fi




echo $ac_n "checking for Sybase-CT support""... $ac_c" 1>&6
echo "configure:52051: checking for Sybase-CT support" >&5
# 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
fi


case $PHP_SYBASE_CT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYBASE_CT=`echo "$PHP_SYBASE_CT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYBASE_CT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SYBASE_CT" = "no" && PHP_SYBASE_CT=yes
fi

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




if test "$PHP_SYBASE_CT" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_SYBASE_CT 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS sybase_ct"
  
  if test -d "$abs_srcdir/ext/sybase_ct"; then
    ext_builddir=ext/sybase_ct
    ext_srcdir=$abs_srcdir/ext/sybase_ct
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsybase_ct.la"
    EXT_STATIC="$EXT_STATIC sybase_ct"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SYBASE_CT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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

  
  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" && test -n "SYBASE_CT_SHARED_LIBADD"; then
      SYBASE_CT_SHARED_LIBADD="-R$SYBASE_CT_LIBDIR -L$SYBASE_CT_LIBDIR $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

  
 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"

  echo $ac_n "checking for netg_errstr in -ltcl""... $ac_c" 1>&6
echo "configure:52421: checking for netg_errstr in -ltcl" >&5
ac_lib_var=`echo tcl'_'netg_errstr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ltcl  
    $SYBASE_CT_LIBS 
   $LIBS"
cat > conftest.$ac_ext <<EOF
#line 52431 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char netg_errstr();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    
 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
  echo "$ac_t""no" 1>&6
 
    
 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


  echo $ac_n "checking for insck__getVdate in -linsck""... $ac_c" 1>&6
echo "configure:52521: checking for insck__getVdate in -linsck" >&5
ac_lib_var=`echo insck'_'insck__getVdate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-linsck -L$SYBASE_CT_LIBDIR $LIBS"
cat > conftest.$ac_ext <<EOF
#line 52529 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char insck__getVdate();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 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
  echo "$ac_t""no" 1>&6
fi

  echo $ac_n "checking for bsd_tcp in -linsck""... $ac_c" 1>&6
echo "configure:52587: checking for bsd_tcp in -linsck" >&5
ac_lib_var=`echo insck'_'bsd_tcp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-linsck -L$SYBASE_CT_LIBDIR $LIBS"
cat > conftest.$ac_ext <<EOF
#line 52595 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char bsd_tcp();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
 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
  echo "$ac_t""no" 1>&6
fi

fi




echo $ac_n "checking whether to enable System V semaphore support""... $ac_c" 1>&6
echo "configure:52658: checking whether to enable System V semaphore support" >&5
# 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
fi


case $PHP_SYSVSEM in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYSVSEM=`echo "$PHP_SYSVSEM"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYSVSEM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SYSVSEM" = "no" && PHP_SYSVSEM=yes
fi

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




if test "$PHP_SYSVSEM" != "no"; then
 
  EXT_SUBDIRS="$EXT_SUBDIRS sysvsem"
  
  if test -d "$abs_srcdir/ext/sysvsem"; then
    ext_builddir=ext/sysvsem
    ext_srcdir=$abs_srcdir/ext/sysvsem
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsysvsem.la"
    EXT_STATIC="$EXT_STATIC sysvsem"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SYSVSEM 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


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

 echo $ac_n "checking for union semun""... $ac_c" 1>&6
echo "configure:52841: checking for union semun" >&5
if eval "test \"`echo '$''{'php_cv_semun'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 52846 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
   
int main() {
union semun x;
; return 0; }
EOF
if { (eval echo configure:52857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
     php_cv_semun=yes
   
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
     php_cv_semun=no
   
fi
rm -f conftest*
 
fi

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

 else
   cat >> confdefs.h <<\EOF
#define HAVE_SEMUN 0
EOF

 fi
fi




echo $ac_n "checking whether to enable System V shared memory support""... $ac_c" 1>&6
echo "configure:52892: checking whether to enable System V shared memory support" >&5
# 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
fi


case $PHP_SYSVSHM in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYSVSHM=`echo "$PHP_SYSVSHM"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_SYSVSHM=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_SYSVSHM" = "no" && PHP_SYSVSHM=yes
fi

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




if test "$PHP_SYSVSHM" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_SYSVSHM 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS sysvshm"
  
  if test -d "$abs_srcdir/ext/sysvshm"; then
    ext_builddir=ext/sysvshm
    ext_srcdir=$abs_srcdir/ext/sysvshm
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libsysvshm.la"
    EXT_STATIC="$EXT_STATIC sysvshm"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_SYSVSHM 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for vpopmail support""... $ac_c" 1>&6
echo "configure:53080: checking for vpopmail support" >&5
# Check whether --with-vpopmail or --without-vpopmail was given.
if test "${with_vpopmail+set}" = set; then
  withval="$with_vpopmail"
  PHP_VPOPMAIL=$withval
else
  PHP_VPOPMAIL=no
fi


case $PHP_VPOPMAIL in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_VPOPMAIL=`echo "$PHP_VPOPMAIL"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_VPOPMAIL=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_VPOPMAIL" = "no" && PHP_VPOPMAIL=yes
fi

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




if test "$PHP_VPOPMAIL" != "no"; then
	echo $ac_n "checking for vpopmail install directory""... $ac_c" 1>&6
echo "configure:53124: checking for vpopmail install directory" >&5
	for i in ~vpopmail /home/vpopmail /home/popmail /var/qmail/vpopmail /var/qmail/popmail $PHP_VPOPMAIL; do
		if test -r $i/vpopmail.h; then
			VPOPMAIL_INC_DIR=$i
			VPOPMAIL_DIR=$i
		elif test -r $i/include/vpopmail.h; then
			VPOPMAIL_INC_DIR=$i/include
			VPOPMAIL_DIR=$i
		fi

		if test -r $i/libvpopmail.a; then
			VPOPMAIL_LIB_DIR=$i
		elif test -r $i/lib/libvpopmail.a; then
			VPOPMAIL_LIB_DIR=$i/lib
		fi

		if test -r $i/vadddomain; then
			VPOPMAIL_BIN_DIR=$i
		elif test -r $i/bin/vadddomain; then
			VPOPMAIL_BIN_DIR=$i/bin
		fi
	done

	for i in "$VPOPMAIL_INC_DIR/vpopmail.h" "$VPOPMAIL_INC_DIR/vpopmail_config.h" "$VPOPMAIL_LIB_DIR/libvpopmail.a" "$VPOPMAIL_BIN_DIR/vadddomain" "$VPOPMAIL_BIN_DIR/vaddaliasdomain" "$VPOPMAIL_BIN_DIR/vdeldomain" ; do
		if test ! -r "$i"; then
			{ echo "configure: error: Could not find '$i'. Please make sure you have
				vpopmail installed. Use
				./configure --with-vpopmail=<vpopmail-home-dir> if necessary" 1>&2; exit 1; }
		fi
	done

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

		if test -r $VPOPMAIL_INC_DIR/vauth.h; then
		cat >> confdefs.h <<\EOF
#define HAVE_VPOPMAIL_VAUTH 1
EOF

	fi
		echo $ac_n "checking for valias_select in -lvpopmail""... $ac_c" 1>&6
echo "configure:53164: checking for valias_select in -lvpopmail" >&5
ac_lib_var=`echo vpopmail'_'valias_select | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lvpopmail  -L$VPOPMAIL_LIB_DIR  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 53172 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char valias_select();

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

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


	
  if test "$VPOPMAIL_INC_DIR" != "/usr/include"; then
    
  if test -z "$VPOPMAIL_INC_DIR" || echo "$VPOPMAIL_INC_DIR" | grep '^/' >/dev/null ; then
    ai_p=$VPOPMAIL_INC_DIR
  else
    
    ep_dir="`echo $VPOPMAIL_INC_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$VPOPMAIL_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


	
  PHP_VAR_SUBST="$PHP_VAR_SUBST VPOPMAIL_SHARED_LIBADD"

	

  if test "$ext_shared" = "yes"; then
    VPOPMAIL_SHARED_LIBADD="-lvpopmail $VPOPMAIL_SHARED_LIBADD"
    if test -n "$VPOPMAIL_LIB_DIR"; then
      
  if test "$VPOPMAIL_LIB_DIR" != "/usr/lib"; then
    
  if test -z "$VPOPMAIL_LIB_DIR" || echo "$VPOPMAIL_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$VPOPMAIL_LIB_DIR
  else
    
    ep_dir="`echo $VPOPMAIL_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$VPOPMAIL_LIB_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n "VPOPMAIL_SHARED_LIBADD"; then
      VPOPMAIL_SHARED_LIBADD="-R$VPOPMAIL_LIB_DIR -L$VPOPMAIL_LIB_DIR $VPOPMAIL_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 "$VPOPMAIL_LIB_DIR"; then
    
  if test "$VPOPMAIL_LIB_DIR" != "/usr/lib"; then
    
  if test -z "$VPOPMAIL_LIB_DIR" || echo "$VPOPMAIL_LIB_DIR" | grep '^/' >/dev/null ; then
    ai_p=$VPOPMAIL_LIB_DIR
  else
    
    ep_dir="`echo $VPOPMAIL_LIB_DIR|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$VPOPMAIL_LIB_DIR\"`"
  fi

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$VPOPMAIL_LIB_DIR -L$VPOPMAIL_LIB_DIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 case vpopmail in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lvpopmail $LIBS"


  ;;
  esac



  fi



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

	cat >> confdefs.h <<EOF
#define VPOPMAIL_BIN_DIR "$VPOPMAIL_BIN_DIR"
EOF


	
  EXT_SUBDIRS="$EXT_SUBDIRS vpopmail"
  
  if test -d "$abs_srcdir/ext/vpopmail"; then
    ext_builddir=ext/vpopmail
    ext_srcdir=$abs_srcdir/ext/vpopmail
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libvpopmail.la"
    EXT_STATIC="$EXT_STATIC vpopmail"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_VPOPMAIL 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi




echo $ac_n "checking for WDDX support""... $ac_c" 1>&6
echo "configure:53487: checking for WDDX support" >&5
# 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
fi


case $PHP_WDDX in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_WDDX=`echo "$PHP_WDDX"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_WDDX=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_WDDX" = "no" && PHP_WDDX=yes
fi

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




if test "$PHP_WDDX" != "no"; then
  if test "$ext_shared" != "yes" && test "$enable_xml" = "no"; then
    echo "configure: warning: Activating XML" 1>&2
    enable_xml=yes
  fi
  cat >> confdefs.h <<\EOF
#define HAVE_WDDX 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS wddx"
  
  if test -d "$abs_srcdir/ext/wddx"; then
    ext_builddir=ext/wddx
    ext_srcdir=$abs_srcdir/ext/wddx
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libwddx.la"
    EXT_STATIC="$EXT_STATIC wddx"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_WDDX 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


fi

# $Source: /repository/php4/ext/xml/config.m4,v $
# $Id: config.m4,v 1.31.2.1 2001/09/07 00:28:27 sniper Exp $

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


echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:53686: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
#line 53693 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 bogus endian macros
#endif
; return 0; }
EOF
if { (eval echo configure:53704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  # It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
#line 53708 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if BYTE_ORDER != BIG_ENDIAN
 not big endian
#endif
; return 0; }
EOF
if { (eval echo configure:53719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_bigendian=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_bigendian=no
fi
rm -f conftest*
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test $ac_cv_c_bigendian = unknown; then
if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 53739 "configure"
#include "confdefs.h"
main () {
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
EOF
if { (eval echo configure:53752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_bigendian=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_bigendian=yes
fi
rm -fr conftest*
fi

fi
fi

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

fi


if test "$ac_cv_c_bigendian" = "yes"; then
  order=21
else
  order=12
fi



echo $ac_n "checking for XML support""... $ac_c" 1>&6
echo "configure:53785: checking for XML support" >&5
# 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
fi


case $PHP_XML in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XML=`echo "$PHP_XML"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XML=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_XML" = "no" && PHP_XML=yes
fi

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






echo $ac_n "checking external libexpat install dir""... $ac_c" 1>&6
echo "configure:53830: checking external libexpat install dir" >&5
# 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
fi


case $PHP_EXPAT_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=`echo "$PHP_EXPAT_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_EXPAT_DIR" = "no" && PHP_EXPAT_DIR=yes
fi

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




if test "$PHP_XML" = "yes"; then
if test "$PHP_EXPAT_DIR" = "no"; then

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

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

    XML_CPPFLAGS=-DXML_BYTE_ORDER=$order
    EXPAT_INTERNAL_LIBADD=expat/libexpat.la
    
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXPAT_INTERNAL_LIBADD"

    
  PHP_VAR_SUBST="$PHP_VAR_SUBST XML_CPPFLAGS"

    EXPAT_SUBDIRS=expat
    
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXPAT_SUBDIRS"

    
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXPAT_SHARED_LIBADD"

    
  EXT_SUBDIRS="$EXT_SUBDIRS xml"
  
  if test -d "$abs_srcdir/ext/xml"; then
    ext_builddir=ext/xml
    ext_srcdir=$abs_srcdir/ext/xml
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libxml.la"
    EXT_STATIC="$EXT_STATIC xml"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_XML 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


    
  lib_makefile="$ext_builddir/expat/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/expat
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    
  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

    
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/expat/Makefile"


else
  
  
  EXT_SUBDIRS="$EXT_SUBDIRS xml"
  
  if test -d "$abs_srcdir/ext/xml"; then
    ext_builddir=ext/xml
    ext_srcdir=$abs_srcdir/ext/xml
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libxml.la"
    EXT_STATIC="$EXT_STATIC xml"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_XML 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXPAT_SHARED_LIBADD"

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


  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 "configure: error: not found. Please reinstall the expat distribution." 1>&2; 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
    EXPAT_SHARED_LIBADD="-lexpat $EXPAT_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" && test -n "EXPAT_SHARED_LIBADD"; then
      EXPAT_SHARED_LIBADD="-R$EXPAT_DIR/lib -L$EXPAT_DIR/lib $EXPAT_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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$EXPAT_DIR/lib -L$EXPAT_DIR/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
  
 case expat in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lexpat $LIBS"


  ;;
  esac



  fi


fi
fi


# Local macros for automake & autoconf














echo $ac_n "checking for XMLRPC-EPI support""... $ac_c" 1>&6
echo "configure:54423: checking for XMLRPC-EPI support" >&5
# 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
fi


case $PHP_XMLRPC in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XMLRPC=`echo "$PHP_XMLRPC"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XMLRPC=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_XMLRPC" = "no" && PHP_XMLRPC=yes
fi

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






echo $ac_n "checking libexpat dir for XMLRPC-EPI""... $ac_c" 1>&6
echo "configure:54468: checking libexpat dir for XMLRPC-EPI" >&5
# 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
fi


case $PHP_EXPAT_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=`echo "$PHP_EXPAT_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_EXPAT_DIR" = "no" && PHP_EXPAT_DIR=yes
fi

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




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

  
  EXT_SUBDIRS="$EXT_SUBDIRS xmlrpc"
  
  if test -d "$abs_srcdir/ext/xmlrpc"; then
    ext_builddir=ext/xmlrpc
    ext_srcdir=$abs_srcdir/ext/xmlrpc
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libxmlrpc.la"
    EXT_STATIC="$EXT_STATIC xmlrpc"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_XMLRPC 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SHARED_LIBADD"

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


  testval=no
  for i in $PHP_EXPAT_DIR $XMLRPC_DIR; do
    if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME; then
      cat >> confdefs.h <<\EOF
#define HAVE_LIBEXPAT2 1
EOF

      

  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" && test -n "XMLRPC_SHARED_LIBADD"; then
      XMLRPC_SHARED_LIBADD="-R$i/lib -L$i/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 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
    fi
  done


  echo $ac_n "checking for iconv_open in -lc""... $ac_c" 1>&6
echo "configure:54793: checking for iconv_open in -lc" >&5
ac_lib_var=`echo c'_'iconv_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 54801 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv_open();

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

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

  if test "$found_iconv" = "no"; then
      for i in /usr /usr/local $ICONV_DIR; do
        if test -f $i/lib/libconv.a -o -f $i/lib/libiconv.$SHLIB_SUFFIX_NAME; then
          

  if test "$ext_shared" = "yes"; then
    XMLRPC_SHARED_LIBADD="-liconv $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" && test -n "XMLRPC_SHARED_LIBADD"; then
      XMLRPC_SHARED_LIBADD="-R$i/lib -L$i/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case iconv in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-liconv $LIBS"


  ;;
  esac



  fi


          found_iconv=yes
        fi
      done
  fi
  
  if test "$found_iconv" = "no"; then
    { echo "configure: error: iconv not found" 1>&2; exit 1; }
  fi
  
fi


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





cat >> confdefs.h <<\EOF
#define UNDEF_THREADS_HACK 
EOF



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

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 54985 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 55003 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 55024 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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

fi
fi

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

fi

for ac_hdr in xmlparse.h xmltok.h stdlib.h strings.h string.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:55062: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 55067 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:55072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done






echo $ac_n "checking size of char""... $ac_c" 1>&6
echo "configure:55104: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_char=1
else
  cat > conftest.$ac_ext <<EOF
#line 55112 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(char));
  exit(0);
}
EOF
if { (eval echo configure:55123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_char=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_char=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_char" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
EOF



echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:55144: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=4
else
  cat > conftest.$ac_ext <<EOF
#line 55152 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:55163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:55183: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=4
else
  cat > conftest.$ac_ext <<EOF
#line 55191 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:55202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:55222: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_long=8
else
  cat > conftest.$ac_ext <<EOF
#line 55230 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:55241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF


echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:55261: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 55266 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:55294: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 55299 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:55308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:55329: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 55334 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi

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

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

fi






# Standard XMLRPC list
for ac_func in \
 strtoul strtoull snprintf \
 strstr strpbrk strerror\
 memcpy memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:55374: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 55379 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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





  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/libxmlrpc/Makefile"


  XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
  XMLRPC_SHARED_LIBADD=libxmlrpc/libxmlrpc.la
  XMLRPC_SUBDIRS=libxmlrpc
  
  PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_LIBADD"

  
  PHP_VAR_SUBST="$PHP_VAR_SUBST XMLRPC_SUBDIRS"

  
  lib_makefile="$ext_builddir/libxmlrpc/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir/libxmlrpc
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "$ext_shared" = "shared" || test "$ext_shared" = "yes"; then
    lib_build_shared=yes
    if test -n "yes"; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

  
  if test "$ext_srcdir/libxmlrpc" != "/usr/include"; then
    
  if test -z "$ext_srcdir/libxmlrpc" || echo "$ext_srcdir/libxmlrpc" | grep '^/' >/dev/null ; then
    ai_p=$ext_srcdir/libxmlrpc
  else
    
    ep_dir="`echo $ext_srcdir/libxmlrpc|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$ext_srcdir/libxmlrpc\"`"
  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

  XMLRPC_MODULE_TYPE=builtin

elif test "$PHP_XMLRPC" != "no"; then

  if test -r $PHP_XMLRPC/include/xmlrpc.h; then
    XMLRPC_DIR=$PHP_XMLRPC
  else
    echo $ac_n "checking for XMLRPC-EPI in default path""... $ac_c" 1>&6
echo "configure:55536: checking for XMLRPC-EPI in default path" >&5
    for i in /usr/local /usr; do
      if test -r $i/include/xmlrpc.h; then
        XMLRPC_DIR=$i
        echo "$ac_t""found in $i" 1>&6
      fi
    done
  fi

  if test -z "$XMLRPC_DIR"; then
    echo "$ac_t""not found" 1>&6
    { echo "configure: error: Please reinstall the XMLRPC-EPI distribution" 1>&2; exit 1; }
  fi

  
  if test "$XMLRPC_DIR/include" != "/usr/include"; then
    
  if test -z "$XMLRPC_DIR/include" || echo "$XMLRPC_DIR/include" | grep '^/' >/dev/null ; then
    ai_p=$XMLRPC_DIR/include
  else
    
    ep_dir="`echo $XMLRPC_DIR/include|sed 's%/*[^/][^/]*/*$%%'`"
    
    ep_realdir="`(cd \"$ep_dir\" && pwd)`"
    ai_p="$ep_realdir/`basename \"$XMLRPC_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
    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" && test -n "XMLRPC_SHARED_LIBADD"; then
      XMLRPC_SHARED_LIBADD="-R$XMLRPC_DIR/lib -L$XMLRPC_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$XMLRPC_DIR/lib -L$XMLRPC_DIR/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
  
 case xmlrpc in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lxmlrpc $LIBS"


  ;;
  esac



  fi


  
fi






echo $ac_n "checking whether to enable xslt support""... $ac_c" 1>&6
echo "configure:55684: checking whether to enable xslt support" >&5
# 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
fi


case $PHP_XSLT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XSLT=`echo "$PHP_XSLT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XSLT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_XSLT" = "no" && PHP_XSLT=yes
fi

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






echo $ac_n "checking whether to enable the XSLT Sablotron backend""... $ac_c" 1>&6
echo "configure:55729: checking whether to enable the XSLT Sablotron backend" >&5
# 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
fi


case $PHP_XSLT_SABLOT in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XSLT_SABLOT=`echo "$PHP_XSLT_SABLOT"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_XSLT_SABLOT=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_XSLT_SABLOT" = "no" && PHP_XSLT_SABLOT=yes
fi

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






echo $ac_n "checking libexpat dir for Sablotron XSL support""... $ac_c" 1>&6
echo "configure:55774: checking libexpat dir for Sablotron XSL support" >&5
# 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
fi


case $PHP_EXPAT_DIR in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=`echo "$PHP_EXPAT_DIR"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_EXPAT_DIR=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_EXPAT_DIR" = "no" && PHP_EXPAT_DIR=yes
fi

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




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

  
  EXT_SUBDIRS="$EXT_SUBDIRS xslt"
  
  if test -d "$abs_srcdir/ext/xslt"; then
    ext_builddir=ext/xslt
    ext_srcdir=$abs_srcdir/ext/xslt
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libxslt.la"
    EXT_STATIC="$EXT_STATIC xslt"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_XSLT 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  
  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 "configure: error: No backend specified for XSLT extension." 1>&2; exit 1; }
  fi

  condition="$XSLT_CHECK_DIR$XSLT_TEST_FILE"

  if test -r $condition; then
    XSLT_DIR=$XSLT_CHECK_DIR
  else
    echo $ac_n "checking for $XSLT_BACKEND_NAME libraries in the default path""... $ac_c" 1>&6
echo "configure:55974: checking for $XSLT_BACKEND_NAME libraries in the default path" >&5
    for i in /usr /usr/local; do
      condition="$i$XSLT_TEST_FILE"
      if test -r $condition; then
        XSLT_DIR=$i
        echo "$ac_t""found $XSLT_BACKEND_NAME in $i" 1>&6
      fi
    done
  fi

  if test -z "$XSLT_DIR"; then
    { echo "configure: error: not found. Please re-install the $XSLT_BACKEND_NAME distribution" 1>&2; exit 1; }
  fi
					
  if test "$PHP_XSLT_SABLOT" != "no"; then
    found_expat=no
    for i in $PHP_EXPAT_DIR $XSLT_DIR; do
      if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.so; then
        cat >> confdefs.h <<\EOF
#define HAVE_LIBEXPAT2 1
EOF

        
  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" && test -n "XSLT_SHARED_LIBADD"; then
      XSLT_SHARED_LIBADD="-R$i/lib -L$i/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case expat in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lexpat $LIBS"


  ;;
  esac



  fi


        found_expat=yes
      fi
    done

    if test "$found_expat" = "no"; then
      
 case xmlparse in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lxmlparse $LIBS"


  ;;
  esac

      
 case xmltok in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-lxmltok $LIBS"


  ;;
  esac

    fi

    found_iconv=no
    echo $ac_n "checking for iconv_open in -lc""... $ac_c" 1>&6
echo "configure:56154: checking for iconv_open in -lc" >&5
ac_lib_var=`echo c'_'iconv_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 56162 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv_open();

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

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

    if test "$found_iconv" = "no"; then
        for i in /usr /usr/local $ICONV_DIR; do
          if test -f $i/lib/libconv.a -o -f $i/lib/libiconv.so; then
            

  if test "$ext_shared" = "yes"; then
    XSLT_SHARED_LIBADD="-liconv $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" && test -n "XSLT_SHARED_LIBADD"; then
      XSLT_SHARED_LIBADD="-R$i/lib -L$i/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$i/lib -L$i/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
  
 case iconv in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-liconv $LIBS"


  ;;
  esac



  fi


            found_iconv=yes
          fi
        done
    fi

    if test "$found_iconv" = "no"; then
      { echo "configure: error: iconv not found" 1>&2; exit 1; }
    fi
 
    cat >> confdefs.h <<\EOF
#define HAVE_SABLOT_BACKEND 1
EOF

    echo $ac_n "checking for SablotSetEncoding in -lsablot""... $ac_c" 1>&6
echo "configure:56304: checking for SablotSetEncoding in -lsablot" >&5
ac_lib_var=`echo sablot'_'SablotSetEncoding | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsablot  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 56312 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SablotSetEncoding();

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

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

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


  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" && test -n "XSLT_SHARED_LIBADD"; then
      XSLT_SHARED_LIBADD="-R$XSLT_DIR/lib -L$XSLT_DIR/lib $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$XSLT_DIR/lib -L$XSLT_DIR/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
  
 case $XSLT_LIBNAME in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$XSLT_LIBNAME $LIBS"


  ;;
  esac



  fi



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

fi




echo $ac_n "checking for YAZ support""... $ac_c" 1>&6
echo "configure:56485: checking for YAZ support" >&5
# 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
fi


case $PHP_YAZ in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_YAZ=`echo "$PHP_YAZ"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_YAZ=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_YAZ" = "no" && PHP_YAZ=yes
fi

echo "$ac_t""$ext_output" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:56534: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_yazconfig'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$yazconfig" in
  /*)
  ac_cv_path_yazconfig="$yazconfig" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_yazconfig="$yazconfig" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_yazconfig="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_yazconfig" && ac_cv_path_yazconfig="NONE"
  ;;
esac
fi
yazconfig="$ac_cv_path_yazconfig"
if test -n "$yazconfig"; then
  echo "$ac_t""$yazconfig" 1>&6
else
  echo "$ac_t""no" 1>&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 <<\EOF
#define HAVE_YAZ 1
EOF

    . $yazconfig
    YAZLIB=`echo $YAZLIB|sed 's%/.libs%%'`
    
  for ac_i in $YAZLIB; 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="-l$ac_ii $YAZ_SHARED_LIBADD"

   else
     
 case $ac_ii in
 c|c_r|pthread*) ;;
 *)

   
  LIBS="-l$ac_ii $LIBS"


  ;;
  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" && test -n "YAZ_SHARED_LIBADD"; then
      YAZ_SHARED_LIBADD="-R$ac_ii -L$ac_ii $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

    
  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_SUBDIRS="$EXT_SUBDIRS yaz"
  
  if test -d "$abs_srcdir/ext/yaz"; then
    ext_builddir=ext/yaz
    ext_srcdir=$abs_srcdir/ext/yaz
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libyaz.la"
    EXT_STATIC="$EXT_STATIC yaz"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_YAZ 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  fi
fi




echo $ac_n "checking whether to include YP support""... $ac_c" 1>&6
echo "configure:56839: checking whether to include YP support" >&5
# 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
fi


case $PHP_YP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_YP=`echo "$PHP_YP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_YP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_YP" = "no" && PHP_YP=yes
fi

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




if test "$PHP_YP" != "no"; then
  cat >> confdefs.h <<\EOF
#define HAVE_YP 1
EOF

  
  EXT_SUBDIRS="$EXT_SUBDIRS yp"
  
  if test -d "$abs_srcdir/ext/yp"; then
    ext_builddir=ext/yp
    ext_srcdir=$abs_srcdir/ext/yp
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libyp.la"
    EXT_STATIC="$EXT_STATIC yp"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_YP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  case $host_alias in
  *solaris*)
    cat >> confdefs.h <<\EOF
#define SOLARIS_YP 1
EOF
 ;;
  esac
fi




echo $ac_n "checking whether to include zziplib support""... $ac_c" 1>&6
echo "configure:57034: checking whether to include zziplib support" >&5
# 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
fi


case $PHP_ZIP in
shared,*)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZIP=`echo "$PHP_ZIP"|sed 's/^shared,//'`
  ;;
shared)
  ext_output="yes, shared"
  ext_shared=yes
  PHP_ZIP=yes
  ;;
no)
  ext_output=no
  ext_shared=no
  ;;
*)
  ext_output=yes
  ext_shared=no
  ;;
esac

if test "$php_always_shared" = "yes"; then
  ext_output="yes, shared"
  ext_shared=yes
  test "$PHP_ZIP" = "no" && PHP_ZIP=yes
fi

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





if test "$PHP_ZIP" != "no"; then
  
  EXT_SUBDIRS="$EXT_SUBDIRS zip"
  
  if test -d "$abs_srcdir/ext/zip"; then
    ext_builddir=ext/zip
    ext_srcdir=$abs_srcdir/ext/zip
  else
    ext_builddir=.
    ext_srcdir=$abs_srcdir
  fi

  if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "" = "shared" || test "" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/libzip.la"
    EXT_STATIC="$EXT_STATIC zip"
  else 
    
  lib_makefile="$ext_builddir/libs.mk"
  lib_target=""
  
  $php_shtool mkdir -p $ext_builddir
  if test "$BSD_MAKEFILE" = "yes"; then
    lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  else
    lib_include_conf="include \$(top_builddir)/config_vars.mk"
  fi
  cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF

  if test "yes" = "shared" || test "yes" = "yes"; then
    lib_build_shared=yes
    if test -n ""; then
      
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)

EOF

    else
      
  lib_target="\$(LTLIBRARY_SHARED_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \$@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
	\$(SHARED_LIBTOOL) --mode=install cp \$@ \$(phplibdir)

EOF

    fi
  else
    
  lib_target="\$(LTLIBRARY_NAME)"
  cat >>$lib_makefile<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
	\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)

EOF

  fi

  if test -n "$lib_target"; then
    cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
  fi

    cat >> confdefs.h <<EOF
#define COMPILE_DL_ZIP 1
EOF

  fi

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $ext_builddir/Makefile"


  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 "configure: error: Cannot find libzzip" 1>&2; exit 1; }
  fi

  ZZIPLIB_LIBDIR=$ZZIPLIB_DIR/lib

  
  old_LDFLAGS=$LDFLAGS
  LDFLAGS="-L$ZZIPLIB_LIBDIR $LDFLAGS"
  
  echo $ac_n "checking for zzip_open in -lzzip""... $ac_c" 1>&6
echo "configure:57234: checking for zzip_open in -lzzip" >&5
ac_lib_var=`echo zzip'_'zzip_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lzzip  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 57242 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char zzip_open();

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

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

else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: zziplib module requires zzlib >= 0.10.6." 1>&2; exit 1; }
fi

  
  LDFLAGS=$old_LDFLAGS


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST ZIP_SHARED_LIBADD"

  

  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" && test -n "ZIP_SHARED_LIBADD"; then
      ZIP_SHARED_LIBADD="-R$ZZIPLIB_LIBDIR -L$ZZIPLIB_LIBDIR $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

    if test "$ext_shared" = "yes" && test -n ""; then
      ="-R$ZZIPLIB_LIBDIR -L$ZZIPLIB_LIBDIR $"
    else
      
  
  unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'`
  
  cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\""
  if test -n "$unique" && test "`eval $cmd`" = "" ; then
    eval "LIBPATH$unique=set"
    
        test -n "$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
  
 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


  
	echo $ac_n "checking for fopencookie""... $ac_c" 1>&6
echo "configure:57413: checking for fopencookie" >&5
if eval "test \"`echo '$''{'ac_cv_func_fopencookie'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57418 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char fopencookie(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fopencookie();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_fopencookie) || defined (__stub___fopencookie)
choke me
#else
fopencookie();
#endif

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

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


	if test "$have_glibc_fopencookie" = "yes" ; then
	  	            		  cat > conftest.$ac_ext <<EOF
#line 57463 "configure"
#include "confdefs.h"
 #define _GNU_SOURCE
                       #include <stdio.h>
									   
int main() {
 cookie_io_functions_t cookie; 
; return 0; }
EOF
if { (eval echo configure:57472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   have_cookie_io_functions_t=yes 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
    
fi
rm -f conftest*

		  if test "$have_cookie_io_functions_t" = "yes" ; then
        cookie_io_functions_t=cookie_io_functions_t
	      have_fopen_cookie=yes
      else
  	            		    cat > conftest.$ac_ext <<EOF
#line 57488 "configure"
#include "confdefs.h"
 #define _GNU_SOURCE
                       #include <stdio.h>
									   
int main() {
 _IO_cookie_io_functions_t cookie; 
; return 0; }
EOF
if { (eval echo configure:57497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
   have_IO_cookie_io_functions_t=yes 
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
   
fi
rm -f conftest*
		    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 <<\EOF
#define HAVE_FOPENCOOKIE 1
EOF

			  cat >> confdefs.h <<EOF
#define COOKIE_IO_FUNCTIONS_T $cookie_io_functions_t
EOF

      fi      

  	fi

fi




  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES sapi/$PHP_SAPI/Makefile"


echo $ac_n "checking whether to enable versioning""... $ac_c" 1>&6
echo "configure:57535: checking whether to enable versioning" >&5
# Check whether --enable-versioning or --disable-versioning was given.
if test "${enable_versioning+set}" = set; then
  enableval="$enable_versioning"
  
  PHP_VERSIONING=$enableval

else
  
  PHP_VERSIONING=no

fi

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

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



enable_shared=yes
enable_static=yes
unset with_pic

case $php_build_target in
program|static)
    standard_libtool_flag='-prefer-non-pic -static'
    if test "$lib_build_shared" != "yes"; then
        enable_shared=no
    fi
    PHP_COMPILE='$(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c $< && touch $@'
    CXX_PHP_COMPILE='$(CXX) $(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)  -c $< && touch $@'
;;
shared)
    enable_static=no
    standard_libtool_flag=-prefer-pic
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version"
;;
esac

if test "$PHP_SAPI" = "cgi"; then
  PHP_PROGRAM=php
fi

if test "$PHP_SAPI" = "fastcgi"; then
  PHP_PROGRAM=php
fi




if test "$REGEX_TYPE" = "php"; then
  REGEX_LIB=regex/libregex.la
  REGEX_DIR=regex
  cat >> confdefs.h <<\EOF
#define HSREGEX 1
EOF

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

  
  PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES regex/Makefile"

elif test "$REGEX_TYPE" = "system"; then
  cat >> confdefs.h <<\EOF
#define REGEX 0
EOF

fi

echo $ac_n "checking which regex library to use""... $ac_c" 1>&6
echo "configure:57612: checking which regex library to use" >&5
echo "$ac_t""$REGEX_TYPE" 1>&6


  PHP_VAR_SUBST="$PHP_VAR_SUBST REGEX_DIR"


  PHP_VAR_SUBST="$PHP_VAR_SUBST REGEX_LIB"


  PHP_VAR_SUBST="$PHP_VAR_SUBST HSREGEX"




  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Configuring Zend${T_ME}" 1>&6











if test "$YACC" != "bison -y"; then
    echo "configure: warning: You will need bison if you want to regenerate the Zend parser." 1>&2
else
    echo $ac_n "checking bison version""... $ac_c" 1>&6
echo "configure:57644: checking bison version" >&5
    set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
    if test "${1}" = "1" -a "${2}" -lt "28"; then
        echo "configure: warning: You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2})." 1>&2
    fi
    echo "$ac_t""${1}.${2} (ok)" 1>&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_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
        CPPFLAGS="$CPPFLAGS -traditional-cpp"
fi

for ac_hdr in limits.h \
malloc.h \
string.h \
unistd.h \
stdarg.h \
sys/types.h \
sys/time.h \
signal.h \
unix.h \
dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:57676: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57681 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:57686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:57714: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57719 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:57747: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57752 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

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

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



echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:57789: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 57797 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

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

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

echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:57829: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57834 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dlopen(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_dlopen) || defined (__stub___dlopen)
choke me
#else
dlopen();
#endif

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

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

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


echo $ac_n "checking for uint""... $ac_c" 1>&6
echo "configure:57881: checking for uint" >&5
if eval "test \"`echo '$''{'ac_cv_type_uint'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57886 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])uint[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uint=yes
else
  rm -rf conftest*
  ac_cv_type_uint=no
fi
rm -f conftest*

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

fi

echo $ac_n "checking for ulong""... $ac_c" 1>&6
echo "configure:57914: checking for ulong" >&5
if eval "test \"`echo '$''{'ac_cv_type_ulong'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57919 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])ulong[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_ulong=yes
else
  rm -rf conftest*
  ac_cv_type_ulong=no
fi
rm -f conftest*

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

fi



echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:57949: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 57954 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char vprintf(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char vprintf();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_vprintf) || defined (__stub___vprintf)
choke me
#else
vprintf();
#endif

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

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

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

if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:58001: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58006 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char _doprnt(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char _doprnt();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub__doprnt) || defined (__stub____doprnt)
choke me
#else
_doprnt();
#endif

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

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

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

fi

echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
echo "configure:58054: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_memcmp_clean=no
else
  cat > conftest.$ac_ext <<EOF
#line 58062 "configure"
#include "confdefs.h"

main()
{
  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
}

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

fi

echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"

# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:58092: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58097 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:58104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:58125: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58130 "configure"
#include "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; }
EOF
if { (eval echo configure:58158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi

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

fi

if test $ac_cv_func_alloca_works = no; then
  # 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 <<\EOF
#define C_ALLOCA 1
EOF


echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:58190: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58195 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "webecray" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_os_cray=yes
else
  rm -rf conftest*
  ac_cv_os_cray=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:58220: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58225 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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

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

done
fi

echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:58275: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat > conftest.$ac_ext <<EOF
#line 58283 "configure"
#include "confdefs.h"
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;
}
main ()
{
  exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:58302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_stack_direction=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi

fi

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

fi

for ac_func in memcpy strdup getpid kill strtod strtol finite fpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:58326: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58331 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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


  echo $ac_n "checking whether sprintf is broken""... $ac_c" 1>&6
echo "configure:58380: checking whether sprintf is broken" >&5
if eval "test \"`echo '$''{'ac_cv_broken_sprintf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test "$cross_compiling" = yes; then
  
      ac_cv_broken_sprintf=no
    
else
  cat > conftest.$ac_ext <<EOF
#line 58391 "configure"
#include "confdefs.h"
main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }
EOF
if { (eval echo configure:58395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
      ac_cv_broken_sprintf=no
    
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
      ac_cv_broken_sprintf=yes
    
fi
rm -fr conftest*
fi

  
fi

echo "$ac_t""$ac_cv_broken_sprintf" 1>&6
  if test "$ac_cv_broken_sprintf" = "yes"; then
    ac_result=1
  else
    ac_result=0
  fi
  cat >> confdefs.h <<EOF
#define ZEND_BROKEN_SPRINTF $ac_result
EOF



for ac_func in finite isfinite isinf isnan
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:58429: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58434 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

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

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



  echo $ac_n "checking whether fp_except is defined""... $ac_c" 1>&6
echo "configure:58484: checking whether fp_except is defined" >&5
if eval "test \"`echo '$''{'ac_cv_type_fp_except'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 58490 "configure"
#include "confdefs.h"

#include <floatingpoint.h>

int main() {

fp_except x = (fp_except) 0;

; return 0; }
EOF
if { (eval echo configure:58501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
     ac_cv_type_fp_except=yes

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

fi
rm -f conftest*
fi

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

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

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


echo $ac_n "checking whether to enable experimental ZTS""... $ac_c" 1>&6
echo "configure:58569: checking whether to enable experimental ZTS" >&5
echo "$ac_t""$ZEND_EXPERIMENTAL_ZTS" 1>&6

echo $ac_n "checking whether to enable inline optimization for GCC""... $ac_c" 1>&6
echo "configure:58573: checking whether to enable inline optimization for GCC" >&5
echo "$ac_t""$ZEND_INLINE_OPTIMIZATION" 1>&6

echo $ac_n "checking whether to enable a memory limit""... $ac_c" 1>&6
echo "configure:58577: checking whether to enable a memory limit" >&5
echo "$ac_t""$ZEND_MEMORY_LIMIT" 1>&6

echo $ac_n "checking whether to enable Zend debugging""... $ac_c" 1>&6
echo "configure:58581: checking whether to enable Zend debugging" >&5
echo "$ac_t""$ZEND_DEBUG" 1>&6
	
if test "$ZEND_DEBUG" = "yes"; then
  cat >> confdefs.h <<\EOF
#define ZEND_DEBUG 1
EOF

  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 <<\EOF
#define ZEND_DEBUG 0
EOF

fi

test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"

if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
  cat >> confdefs.h <<\EOF
#define ZTS 1
EOF

  CFLAGS="$CFLAGS -DZTS"
  


fi  

if test "$ZEND_MEMORY_LIMIT" = "yes"; then
  cat >> confdefs.h <<\EOF
#define MEMORY_LIMIT 1
EOF

else
  cat >> confdefs.h <<\EOF
#define MEMORY_LIMIT 0
EOF

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 $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:58638: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat > conftest.$ac_ext <<EOF
#line 58645 "configure"
#include "confdefs.h"

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

fi

echo "$ac_t""$ac_cv_c_inline" 1>&6
case "$ac_cv_c_inline" in
  inline | yes) ;;
  no) cat >> confdefs.h <<\EOF
#define inline 
EOF
 ;;
  *)  cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF
 ;;
esac






TSRM_LIB='TSRM/libtsrm.la'
TSRM_DIR=TSRM
CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/TSRM"

if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
  cat >> confdefs.h <<\EOF
#define ZTS 1
EOF

  PHP_THREAD_SAFETY=yes
else
  PHP_THREAD_SAFETY=no
fi

if test "$abs_srcdir" != "$abs_builddir"; then
  INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
  INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
fi

EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
unset LIBS LDFLAGS


  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Configuring TSRM${T_ME}" 1>&6




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



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 $ac_n "checking for GNU Pth""... $ac_c" 1>&6
echo "configure:58802: checking for GNU Pth" >&5
PTH_PREFIX="`$TSRM_PTH --prefix`"
if test -z "$PTH_PREFIX"; then
  echo "$ac_t""Please check your Pth installation" 1>&6
fi

CPPFLAGS="$CPPFLAGS `$TSRM_PTH --cflags`"
LDFLAGS="$LDFLAGS `$TSRM_PTH --ldflags`"
LIBS="$LIBS `$TSRM_PTH --libs`"

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

echo "$ac_t""yes - installed in $PTH_PREFIX" 1>&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_hdr in st.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:58832: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 58837 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:58842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
  
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: Sorry, I was unable to locate the State Threads header file.  Please specify the prefix using --with-tsrm-st=/prefix" 1>&2; exit 1; }
  
fi
done

  LIBS="$LIBS -lst"
  echo $ac_n "checking for SGI's State Threads""... $ac_c" 1>&6
echo "configure:58872: checking for SGI's State Threads" >&5
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define TSRM_ST 1
EOF


elif test "$TSRM_PTHREADS" != "no"; then
  
		


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" 
else
  cat > conftest.$ac_ext <<EOF
#line 58900 "configure"
#include "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);
} 
EOF
if { (eval echo configure:58918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"

echo $ac_n "checking for pthreads_cflags""... $ac_c" 1>&6
echo "configure:58938: checking for pthreads_cflags" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_cflags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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" 
else
  cat > conftest.$ac_ext <<EOF
#line 58953 "configure"
#include "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);
} 
EOF
if { (eval echo configure:58971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
    CFLAGS="$ac_save"
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_cflags="$flag"
      break
    fi
  done
fi

fi

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

echo $ac_n "checking for pthreads_lib""... $ac_c" 1>&6
echo "configure:59000: checking for pthreads_lib" >&5
if eval "test \"`echo '$''{'ac_cv_pthreads_lib'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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" 
else
  cat > conftest.$ac_ext <<EOF
#line 59015 "configure"
#include "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);
} 
EOF
if { (eval echo configure:59033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
   
  pthreads_working="yes"
  
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  
  pthreads_working="no"
  
fi
rm -fr conftest*
fi
  
    LIBS="$ac_save"
    if test "$pthreads_working" = "yes"; then
      ac_cv_pthreads_lib="$lib"
      break
    fi
  done
fi

fi

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

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

		
if test "$pthreads_working" != "yes"; then
  { echo "configure: error: Your system seems to lack POSIX threads." 1>&2; exit 1; }
fi
		
cat >> confdefs.h <<\EOF
#define PTHREADS 1
EOF


echo $ac_n "checking for POSIX threads""... $ac_c" 1>&6
echo "configure:59078: checking for POSIX threads" >&5
echo "$ac_t""yes" 1>&6

fi


fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
unset LIBS LDFLAGS

test "$prefix" = "NONE" && prefix=/usr/local
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'

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

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"`
INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR

exec_prefix=$old_exec_prefix
libdir=$old_libdir
datadir=$old_datadir












  if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
    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
  fi



  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


EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"

PHP_BUILD_DATE=`date '+%Y-%m-%d'`
cat >> confdefs.h <<EOF
#define PHP_BUILD_DATE "$PHP_BUILD_DATE"
EOF

PHP_UNAME=`uname -a`
cat >> confdefs.h <<EOF
#define PHP_UNAME "$PHP_UNAME"
EOF

PHP_OS=`uname`
cat >> confdefs.h <<EOF
#define PHP_OS "$PHP_OS"
EOF




  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_SUBDIRS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_STATIC"


  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_SHARED"


  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_LIBS"


  PHP_VAR_SUBST="$PHP_VAR_SUBST EXT_LTLIBS"



  
  PHP_VAR_SUBST="$PHP_VAR_SUBST abs_builddir"

  


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST abs_srcdir"

  


  PHP_VAR_SUBST="$PHP_VAR_SUBST bindir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST exec_prefix"


  PHP_VAR_SUBST="$PHP_VAR_SUBST includedir"


  PHP_VAR_SUBST="$PHP_VAR_SUBST libdir"


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


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTENSION_DIR"

  


  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LDFLAGS"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LIBS"

  


  PHP_VAR_SUBST="$PHP_VAR_SUBST 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_DIR"


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


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


  PHP_VAR_SUBST="$PHP_VAR_SUBST SHARED_LIBTOOL"


  PHP_VAR_SUBST="$PHP_VAR_SUBST TSRM_DIR"


  PHP_VAR_SUBST="$PHP_VAR_SUBST TSRM_LIB"


  PHP_VAR_SUBST="$PHP_VAR_SUBST WARNING_LEVEL"


  
  PHP_VAR_SUBST="$PHP_VAR_SUBST YACC"

  



  echo "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Configuring libtool${T_ME}" 1>&6


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

# 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

echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:59474: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 59479 "configure"
#include "confdefs.h"

int main() {

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

echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:59507: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 59512 "configure"
#include "confdefs.h"

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

echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes
# 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

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

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

# 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 $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
echo "configure:59634: checking for ld used by GCC" >&5
  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 $ac_n "checking for GNU ld""... $ac_c" 1>&6
echo "configure:59664: checking for GNU ld" >&5
else
  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
echo "configure:59667: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
echo "configure:59702: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
with_gnu_ld=$lt_cv_prog_gnu_ld


echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
echo "configure:59719: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  lt_cv_ld_reload_flag='-r'
fi

echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"

echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
echo "configure:59731: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$NM" 1>&6

echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
echo "configure:59769: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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*)
  case $host_os in
  irix5*)
    # 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 | powerpc* | sparc* | ia64* )
    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
  ;;

sysv5uw[78]* | sysv4*uw2*)
  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
    ;;
  esac
  ;;
esac

fi

echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method

echo $ac_n "checking for object suffix""... $ac_c" 1>&6
echo "configure:59952: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
if { (eval echo configure:59958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  for ac_file in conftest.*; do
    case $ac_file in
    *.c) ;;
    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
    esac
  done
else
  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_objext" 1>&6
OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext



echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:59978: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  ac_cv_exeext=.exe
else
  rm -f conftest*
  echo 'int main () { return 0; }' > conftest.$ac_ext
  ac_cv_exeext=
  if { (eval echo configure:59988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    for file in conftest.*; do
      case $file in
      *.c | *.o | *.obj) ;;
      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
      esac
    done
  else
    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
  fi
  rm -f conftest*
  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
fi

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

if test $host != $build; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi




# Check for command to grab the raw symbol name followed by C symbol from nm.
echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
echo "configure:60019: checking command to parse $NM output" >&5
if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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*)
  symcode='[BCDEGRST]'
  ;;
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 configure:60099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    # Now try to grab the symbols.
    nlist=conftest.nm
    if { (eval echo configure:60102: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && 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 configure:60153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 "$ac_t""failed" 1>&6
else
  echo "$ac_t""ok" 1>&6
fi

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





# 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 $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
echo "configure:60247: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$MAGIC_CMD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$lt_cv_path_MAGIC_CMD"; then
  if test -n "$ac_tool_prefix"; then
    echo $ac_n "checking for file""... $ac_c" 1>&6
echo "configure:60309: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$MAGIC_CMD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  else
    MAGIC_CMD=:
  fi
fi

  fi
  ;;
esac

# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:60380: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_RANLIB"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:60412: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  RANLIB=":"
fi
fi

# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:60447: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_STRIP="${ac_tool_prefix}strip"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
STRIP="$ac_cv_prog_STRIP"
if test -n "$STRIP"; then
  echo "$ac_t""$STRIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_STRIP"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:60479: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$STRIP"; then
  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_STRIP="strip"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
fi
fi
STRIP="$ac_cv_prog_STRIP"
if test -n "$STRIP"; then
  echo "$ac_t""$STRIP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  STRIP=":"
fi
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 60528 "configure"' > conftest.$ac_ext
  if { (eval echo configure:60529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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 $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
echo "configure:60550: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
     ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

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

int main() {

; return 0; }
EOF
if { (eval echo configure:60570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  lt_cv_cc_needs_belf=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lt_cv_cc_needs_belf=no
fi
rm -f conftest*
     ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

fi

echo "$ac_t""$lt_cv_cc_needs_belf" 1>&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"

echo $ac_n "checking for objdir""... $ac_c" 1>&6
echo "configure:60690: checking for objdir" >&5
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 "$ac_t""$objdir" 1>&6


# 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 $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
echo "configure:60717: checking for $compiler option to produce PIC" >&5
if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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* | 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*)
      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'
      if test "x$host_vendor" = xsni; then
	lt_cv_prog_cc_wl='-LD'
      else
	lt_cv_prog_cc_wl='-Wl,'
      fi
      ;;

    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 "$ac_t""none" 1>&6
else
  echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6

  # Check to make sure the pic_flag actually works.
  echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
echo "configure:60869: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
  if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
    cat > conftest.$ac_ext <<EOF
#line 60876 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:60883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
        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 "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
        lt_cv_prog_cc_pic_works=no
    
fi
rm -f conftest*
    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 "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
fi

# Check for any special shared library compilation flags.
if test -n "$lt_cv_prog_cc_shlib"; then
  echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$lt_cv_prog_cc_shlib[ 	]" >/dev/null; then :
  else
   echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
    lt_cv_prog_cc_can_build_shared=no
  fi
fi

echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
echo "configure:60935: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    lt_cv_prog_cc_static_works=no
  save_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
  cat > conftest.$ac_ext <<EOF
#line 60943 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:60950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  lt_cv_prog_cc_static_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  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 "$ac_t""$lt_cv_prog_cc_static_works" 1>&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"


# Check to see if options -o and -c are simultaneously supported by compiler
echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
echo "configure:60977: checking if $compiler supports -c -o file.$ac_objext" >&5
if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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:60996: \"$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 "$ac_t""$compiler_c_o" 1>&6

if test x"$compiler_c_o" = x"yes"; then
  # Check to see if we can write to a .lo
  echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
echo "configure:61025: checking if $compiler supports -c -o file.lo" >&5
  if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 <<EOF
#line 61036 "configure"
#include "confdefs.h"

int main() {
int some_variable = 0;
; return 0; }
EOF
if { (eval echo configure:61043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
      # 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 "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  ac_objext="$save_objext"
  CFLAGS="$save_CFLAGS"
  
fi

  compiler_o_lo=$lt_cv_compiler_o_lo
  echo "$ac_t""$compiler_o_lo" 1>&6
else
  compiler_o_lo=no
fi

# 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 $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
echo "configure:61074: checking if we can lock with hard links" >&5
  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 "$ac_t""$hard_links" 1>&6
  if test "$hard_links" = no; then
    echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
    need_locks=warn
  fi
else
  need_locks=no
fi

if test "$GCC" = yes; then
  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
echo "configure:61093: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  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 <<EOF
#line 61099 "configure"
#include "confdefs.h"

int main() {
int some_variable = 0;
; return 0; }
EOF
if { (eval echo configure:61106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
      # 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 "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  CFLAGS="$save_CFLAGS"
  echo "$ac_t""$compiler_rtti_exceptions" 1>&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

# See if the linker supports building shared libraries.
echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
echo "configure:61133: checking whether the linker ($LD) supports shared libraries" >&5

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`head -1 $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;;
	   *) 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* | sysv5*)
    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
	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
	    aix_use_runtimelinking=yes
	    break
	  fi
	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.
    archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -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*)
    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'
    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'
    fi
    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
    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 $linker_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 $linker_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)
    if test "x$host_vendor" = xsno; then
      archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
      hardcode_direct=yes # is this really true???
    else
      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
    fi
    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'
    ;;

  sysv5*)
    no_undefined_flag=' -z text'
    # $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=
    hardcode_shlibpath_var=no
    runpath_var='LD_RUN_PATH'
    ;;

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

  sysv5uw7* | 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 "$ac_t""$ld_shlibs" 1>&6
test "$ld_shlibs" = no && can_build_shared=no

# Check hardcoding attributes.
echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
echo "configure:61817: checking how to hardcode library paths into programs" >&5
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 "$ac_t""$hardcode_action" 1>&6

striplib=
old_striplib=
echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
echo "configure:61845: checking whether stripping libraries is possible" >&5
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 "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

reload_cmds='$LD$reload_flag -o $output$reload_objs'
test -z "$deplibs_check_method" && deplibs_check_method=unknown

# PORTME Fill in your ld.so characteristics
echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
echo "configure:61859: checking dynamic linker characteristics" >&5
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
  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
  ;;

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"`
    ;;
  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*)
  version_type=irix
  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*)
    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'
  ;;

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'
  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $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"
  ;;

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
      ;;
    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 "$ac_t""$dynamic_linker" 1>&6
test "$dynamic_linker" = no && can_build_shared=no

# Report the final consequences.
echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
echo "configure:62256: checking if libtool supports shared libraries" >&5
echo "$ac_t""$can_build_shared" 1>&6

echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
echo "configure:62260: checking whether to build shared libraries" >&5
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 "$ac_t""$enable_shared" 1>&6

echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
echo "configure:62283: checking whether to build static libraries" >&5
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
echo "$ac_t""$enable_static" 1>&6

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 $ac_n "checking for shl_load""... $ac_c" 1>&6
echo "configure:62324: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 62329 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char shl_load(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shl_load();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_shl_load) || defined (__stub___shl_load)
choke me
#else
shl_load();
#endif

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

if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="shl_load"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "configure:62370: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 62378 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shl_load();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:62408: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 62413 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dlopen(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_dlopen) || defined (__stub___dlopen)
choke me
#else
dlopen();
#endif

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

if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="dlopen"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:62454: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 62462 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
echo "configure:62492: checking for dlopen in -lsvld" >&5
ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsvld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 62500 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
echo "configure:62530: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 62538 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dld_link();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
else
  echo "$ac_t""no" 1>&6
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 $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
echo "configure:62605: checking whether a program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 62615 "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 configure:62676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && 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 "$ac_t""$lt_cv_dlopen_self" 1>&6

    if test "x$lt_cv_dlopen_self" = xyes; then
      LDFLAGS="$LDFLAGS $link_static_flag"
      echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
echo "configure:62699: checking whether a statically linked program can dlopen itself" >&5
if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&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 62709 "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 configure:62770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && 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 "$ac_t""$lt_cv_dlopen_self_static" 1>&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


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 $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
echo "configure:62819: checking whether -lc should be explicitly linked in" >&5
    if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  $rm conftest*
    echo 'static int dummy;' > conftest.$ac_ext

    if { (eval echo configure:62826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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 configure:62839: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
      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 "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
    ;;
  esac
fi
need_lc=${lt_cv_archive_cmds_need_lc-yes}

# 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 \
    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.

# 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





# 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
  
  LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'

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 "$ac_t""" 1>&6
  echo "$ac_t""${T_MD}Generating files${T_ME}" 1>&6


CXXFLAGS_CLEAN=$CXXFLAGS
CFLAGS_CLEAN=$CFLAGS
CFLAGS="$CFLAGS $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"


  
  echo $ac_n "checking for working mkdir -p""... $ac_c" 1>&6
echo "configure:63447: checking for working mkdir -p" >&5
if eval "test \"`echo '$''{'ac_cv_mkdir_p'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    test -d conftestdir && rm -rf conftestdir
    mkdir -p conftestdir/somedir >/dev/null 2>&1
    mkdir -p conftestdir/somedir >/dev/null 2>&1
    if test "$?" = "0" && test -d conftestdir/somedir; then
      ac_cv_mkdir_p=yes
    else
      ac_cv_mkdir_p=no
    fi
    rm -rf conftestdir
  
fi

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

  echo creating config_vars.mk
  > config_vars.mk
  for i in $PHP_VAR_SUBST; do
    eval echo "$i = \$$i" >> config_vars.mk
  done


$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h \
pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \
pear/scripts/pearize pear/scripts/phptar TSRM/Makefile $PHP_OUTPUT_FILES"

trap '' 1 2 15
cat > confcache <<\EOF
# 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.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# 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 \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

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

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "$ALL_OUTPUT_FILES main/php_config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
s%@AUTOCONF@%$AUTOCONF%g
s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@AWK@%$AWK%g
s%@YACC@%$YACC%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@RANLIB@%$RANLIB%g
s%@LN_S@%$LN_S%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
s%@PROG_SENDMAIL@%$PROG_SENDMAIL%g
s%@LIBOBJS@%$LIBOBJS%g
s%@ALLOCA@%$ALLOCA%g
s%@MYSQL_MODULE_TYPE@%$MYSQL_MODULE_TYPE%g
s%@MYSQL_LIBS@%$MYSQL_LIBS%g
s%@MYSQL_INCLUDE@%$MYSQL_INCLUDE%g
s%@OCI8_SHARED_LIBADD@%$OCI8_SHARED_LIBADD%g
s%@OCI8_DIR@%$OCI8_DIR%g
s%@OCI8_VERSION@%$OCI8_VERSION%g
s%@ODBC_INCLUDE@%$ODBC_INCLUDE%g
s%@ODBC_LIBS@%$ODBC_LIBS%g
s%@ODBC_LFLAGS@%$ODBC_LFLAGS%g
s%@ODBC_TYPE@%$ODBC_TYPE%g
s%@ORACLE_SHARED_LIBADD@%$ORACLE_SHARED_LIBADD%g
s%@ORACLE_DIR@%$ORACLE_DIR%g
s%@ORACLE_VERSION@%$ORACLE_VERSION%g
s%@CXX@%$CXX%g
s%@CXXCPP@%$CXXCPP%g
s%@satellite_orbit@%$satellite_orbit%g
s%@satellite_libIDL@%$satellite_libIDL%g
s%@yazconfig@%$yazconfig%g
s%@INLINE_CFLAGS@%$INLINE_CFLAGS%g
s%@INCLUDE_PATH@%$INCLUDE_PATH%g
s%@EXPANDED_PEAR_INSTALLDIR@%$EXPANDED_PEAR_INSTALLDIR%g
s%@EXPANDED_EXTENSION_DIR@%$EXPANDED_EXTENSION_DIR%g
s%@EXPANDED_BINDIR@%$EXPANDED_BINDIR%g
s%@EXPANDED_LIBDIR@%$EXPANDED_LIBDIR%g
s%@EXPANDED_DATADIR@%$EXPANDED_DATADIR%g
s%@EXPANDED_SYSCONFDIR@%$EXPANDED_SYSCONFDIR%g
s%@EXPANDED_LOCALSTATEDIR@%$EXPANDED_LOCALSTATEDIR%g
s%@EXPANDED_PHP_CONFIG_FILE_PATH@%$EXPANDED_PHP_CONFIG_FILE_PATH%g
s%@abs_builddir@%$abs_builddir%g
s%@abs_srcdir@%$abs_srcdir%g
s%@CONFIGURE_COMMAND@%$CONFIGURE_COMMAND%g
s%@DEBUG_CFLAGS@%$DEBUG_CFLAGS%g
s%@EXTENSION_DIR@%$EXTENSION_DIR%g
s%@EXTRA_LIBS@%$EXTRA_LIBS%g
s%@INSTALL_IT@%$INSTALL_IT%g
s%@NATIVE_RPATHS@%$NATIVE_RPATHS%g
s%@PEAR_INSTALLDIR@%$PEAR_INSTALLDIR%g
s%@PHP_LDFLAGS@%$PHP_LDFLAGS%g
s%@PHP_LIBS@%$PHP_LIBS%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@OBJEXT@%$OBJEXT%g
s%@EXEEXT@%$EXEEXT%g
s%@ECHO@%$ECHO%g
s%@STRIP@%$STRIP%g
s%@LIBTOOL@%$LIBTOOL%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"$ALL_OUTPUT_FILES"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="main/php_config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF



if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES"; then
  REDO_ALL=yes
fi

if test -n "\$REDO_ALL"; then
  
  $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $PHP_FAST_OUTPUT_FILES

fi
		   
if test ! -f $srcdir/ext/bcmath/number.c; then
	echo "creating number.c"
	echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
	echo "creating number.h"
	echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
fi

################################################################
# Create configuration headers
#

if test -d TSRM; then
  echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
fi

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

  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/manual/en/faq.build.php#AEN61338 |"
    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 "$MYSQL_MODULE_TYPE" = "builtin" ; 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.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

X

fi

EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > main/stamp-h

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1


