2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-04-22 08:25:57 +08:00
|
|
|
dnl $Id$
|
2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-04-22 08:25:57 +08:00
|
|
|
|
2000-05-24 07:13:34 +08:00
|
|
|
PHP_ARG_WITH(informix,for Informix support,
|
1999-04-22 08:25:57 +08:00
|
|
|
[ --with-informix[=DIR] Include Informix support. DIR is the Informix base
|
2000-05-24 07:13:34 +08:00
|
|
|
install directory, defaults to ${INFORMIXDIR:-nothing}.])
|
|
|
|
|
2001-06-01 20:49:50 +08:00
|
|
|
if test "$PHP_INFORMIX" != "no"; then
|
1999-04-22 08:25:57 +08:00
|
|
|
|
2001-06-01 20:49:50 +08:00
|
|
|
if test "$INFORMIXDIR" = ""; then
|
|
|
|
AC_MSG_ERROR([INFORMIXDIR environment variable is not set.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$PHP_INFORMIX" = "yes"; then
|
2002-06-14 08:01:49 +08:00
|
|
|
IFX_INCLUDE=-I$INFORMIXDIR/incl/esql
|
2001-06-01 20:49:50 +08:00
|
|
|
PHP_ADD_LIBPATH($INFORMIXDIR/lib, INFORMIX_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBPATH($INFORMIXDIR/lib/esql, INFORMIX_SHARED_LIBADD)
|
|
|
|
else
|
|
|
|
if test "$PHP_INFORMIX" != "$INFORMIXDIR"; then
|
|
|
|
AC_MSG_ERROR([Specified Informix base install directory is different than your INFORMIXDIR environment variable.])
|
1999-04-22 08:25:57 +08:00
|
|
|
fi
|
2002-06-14 08:01:49 +08:00
|
|
|
IFX_INCLUDE=-I$PHP_INFORMIX/incl/esql
|
2001-06-01 20:49:50 +08:00
|
|
|
PHP_ADD_LIBPATH($PHP_INFORMIX/lib, INFORMIX_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBPATH($PHP_INFORMIX/lib/esql, INFORMIX_SHARED_LIBADD)
|
|
|
|
fi
|
|
|
|
|
2001-07-30 18:09:53 +08:00
|
|
|
dnl Check if thread safety flags are needed
|
|
|
|
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`
|
2001-06-01 20:49:50 +08:00
|
|
|
IFX_LIBS=`echo $IFX_LIBS | sed -e 's/Libraries to be used://g' -e 's/esql: error -55923: No source or object file\.//g'`
|
|
|
|
dnl Seems to get rid of newlines.
|
|
|
|
dnl According to Perls DBD-Informix, might contain these strings.
|
|
|
|
|
|
|
|
case "$host_alias" in
|
|
|
|
*aix*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -D__H_LOCALEDEF";;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([Informix version])
|
|
|
|
IFX_VERSION=[`$INFORMIXDIR/bin/esql -V | sed -ne '1 s/^[^0-9]*\([0-9]\)\.\([0-9]*\).*/\1\2/p'`]
|
|
|
|
AC_MSG_RESULT($IFX_VERSION)
|
|
|
|
AC_DEFINE_UNQUOTED(IFX_VERSION, $IFX_VERSION, [ ])
|
|
|
|
|
|
|
|
if test $IFX_VERSION -ge "900"; then
|
|
|
|
AC_DEFINE(HAVE_IFX_IUS,1,[ ])
|
2001-07-30 18:09:53 +08:00
|
|
|
IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EDHAVE_IFX_IUS"
|
2001-06-01 20:49:50 +08:00
|
|
|
else
|
2001-07-30 18:09:53 +08:00
|
|
|
IFX_ESQL_FLAGS="$IFX_ESQL_FLAGS -EUHAVE_IFX_IUS"
|
1999-04-22 08:25:57 +08:00
|
|
|
fi
|
2002-06-14 08:01:49 +08:00
|
|
|
|
|
|
|
PHP_NEW_EXTENSION(informix, ifx.c, $ext_shared,, $IFX_INCLUDE)
|
|
|
|
PHP_ADD_MAKEFILE_FRAGMENT
|
1999-04-22 08:25:57 +08:00
|
|
|
|
2001-06-01 20:49:50 +08:00
|
|
|
for i in $IFX_LIBS; do
|
|
|
|
case "$i" in
|
|
|
|
*.o)
|
|
|
|
IFX_LIBOBJS="$IFX_LIBOBJS $i"
|
|
|
|
PHP_ADD_LIBPATH($ext_builddir, INFORMIX_SHARED_LIBADD)
|
2001-08-03 13:17:18 +08:00
|
|
|
PHP_ADD_LIBRARY_DEFER(phpifx, 1, INFORMIX_SHARED_LIBADD)
|
2001-07-30 18:09:53 +08:00
|
|
|
;;
|
|
|
|
-lm)
|
|
|
|
;;
|
|
|
|
-lc)
|
2001-06-01 20:49:50 +08:00
|
|
|
;;
|
|
|
|
-l*)
|
2001-07-30 18:09:53 +08:00
|
|
|
lib=`echo $i | cut -c 3-`
|
2001-08-03 13:17:18 +08:00
|
|
|
PHP_ADD_LIBRARY_DEFER($lib, 1, INFORMIX_SHARED_LIBADD)
|
2001-06-01 20:49:50 +08:00
|
|
|
;;
|
|
|
|
*.a)
|
2001-07-30 18:09:53 +08:00
|
|
|
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
|
2001-06-01 20:49:50 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2001-07-30 18:09:53 +08:00
|
|
|
|
2002-06-14 08:01:49 +08:00
|
|
|
PHP_SUBST(INFORMIX_SHARED_LIBADD)
|
2001-06-01 20:49:50 +08:00
|
|
|
PHP_SUBST(INFORMIXDIR)
|
|
|
|
PHP_SUBST(IFX_LIBOBJS)
|
2002-06-14 08:01:49 +08:00
|
|
|
PHP_SUBST(IFX_ESQL_FLAGS)
|
|
|
|
AC_DEFINE(HAVE_IFX,1,[ ])
|
1999-04-22 08:25:57 +08:00
|
|
|
fi
|