mirror of
https://github.com/php/php-src.git
synced 2024-10-08 02:06:14 +00:00
b6e4841ec7
This is important, because the system checks will yield different results depending on whether POSIX threads are enabled or not. We also use PTHREADS_CFLAGS only in ZTS mode now. Using these flags in non-ZTS mode causes complete build failures on some platforms (i.e. FreeBSD 2.2.x). This will cause harmless warnings on some platforms (i.e. Solaris 2).
109 lines
3.4 KiB
Plaintext
109 lines
3.4 KiB
Plaintext
dnl $Id$
|
|
|
|
PHPIFXLIB=ext/informix/libphp_ifx.a
|
|
|
|
AC_MSG_CHECKING(for Informix support)
|
|
AC_ARG_WITH(informix,
|
|
[ --with-informix[=DIR] Include Informix support. DIR is the Informix base
|
|
install directory, defaults to ${INFORMIXDIR:-nothing}.],
|
|
[
|
|
if test "$withval" != "no"; then
|
|
if test "$INFORMIXDIR" = ""; then
|
|
INFORMIX_WARNING="
|
|
WARNING: You asked for Informix support, but don't have \\\$INFORMIXDIR
|
|
environment value set up. Configuring and compiling Informix
|
|
support to PHP is impossible and has been turned off. Please
|
|
try again after setting up your environment."
|
|
AC_MSG_RESULT(no)
|
|
else
|
|
if test "$withval" = "yes"; then
|
|
IFX_INCDIR=$INFORMIXDIR/incl/esql
|
|
if test -z "$IFX_LIBDIR"; then
|
|
AC_ADD_LIBPATH($INFORMIXDIR/lib)
|
|
AC_ADD_LIBPATH($INFORMIXDIR/lib/esql)
|
|
else
|
|
IFX_LIBDIR="$IFX_LIBDIR"
|
|
fi
|
|
else
|
|
IFX_INCDIR=$withval/incl/esql
|
|
if test -z "$IFX_LIBDIR"; then
|
|
AC_ADD_LIBPATH($withval/lib)
|
|
AC_ADD_LIBPATH($withval/lib/esql)
|
|
else
|
|
IFX_LIBDIR="$IFX_LIBDIR"
|
|
fi
|
|
if test "$withval" != "$INFORMIXDIR"; then
|
|
INFORMIX_WARNING="
|
|
WARNING: You specified Informix base install directory that is different
|
|
than your \\\$INFORMIXDIR environment variable. You'd better know
|
|
exactly what you are doing."
|
|
fi
|
|
fi
|
|
IFX_INCLUDE=-I$IFX_INCDIR
|
|
IFX_LFLAGS=$IFX_LIBDIR
|
|
if test -z "$IFX_LIBS"; then
|
|
IFX_LIBS=`esql -libs | sed -e 's/-lm$//'`
|
|
dnl -lm twice otherwise?
|
|
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.
|
|
else
|
|
dnl Allow override to use static and/or threaded libs
|
|
:
|
|
fi
|
|
CFLAGS="$CFLAGS $IFX_INCLUDE"
|
|
LDFLAGS="$LDFLAGS $IFX_LFLAGS"
|
|
|
|
if test "`uname -s 2>/dev/null`" = "AIX"; then
|
|
CFLAGS="$CFLAGS -D__H_LOCALEDEF"
|
|
fi
|
|
AC_DEFINE(HAVE_IFX,1,[ ])
|
|
AC_MSG_CHECKING([Informix version])
|
|
IFX_VERSION=[`esql -V | sed -ne '1 s/^[^0-9]*\([0-9]\)\.\([0-9]*\).*/\1\2/p'`]
|
|
if test $IFX_VERSION -ge "900"; then
|
|
AC_DEFINE(HAVE_IFX_IUS,1,[ ])
|
|
IFX_ESQL_FLAGS="-EDHAVE_IFX_IUS"
|
|
else
|
|
IFX_ESQL_FLAGS="-EUHAVE_IFX_IUS"
|
|
fi
|
|
PHP_SUBST(IFX_ESQL_FLAGS)
|
|
AC_DEFINE_UNQUOTED(IFX_VERSION, $IFX_VERSION, [ ])
|
|
AC_MSG_RESULT(yes)
|
|
PHP_EXTENSION(informix)
|
|
for i in $IFX_LIBS; do
|
|
case "$i" in
|
|
*.o)
|
|
AC_ADD_LIBPATH($abs_builddir/ext/informix)
|
|
AC_ADD_LIBRARY(php_ifx, 1)
|
|
$srcdir/build/shtool mkdir -f -p ext/informix
|
|
cd ext/informix
|
|
ar r libphp_ifx.a $i
|
|
ranlib libphp_ifx.a
|
|
cd ../..;;
|
|
-l*)
|
|
lib=`echo $i|sed 's/^-l//'`
|
|
AC_ADD_LIBRARY($lib, 1);;
|
|
*)
|
|
IFX_LIBADD="$IFX_LIBADD $i";;
|
|
esac
|
|
done
|
|
IFX_LIBS="$IFX_LFLAGS $IFX_LIBADD"
|
|
INCLUDES="$INCLUDES $IFX_INCLUDE"
|
|
fi
|
|
else
|
|
INFORMIXDIR=
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
],[
|
|
AC_MSG_RESULT(no)
|
|
])
|
|
PHP_SUBST(INFORMIXDIR)
|
|
PHP_SUBST(IFX_LIBS)
|
|
|
|
divert(7)dnl
|
|
|
|
dnl Warn if Informix support was requested but environment is not set up correctly.
|
|
if test "$INFORMIX_WARNING" != ""; then
|
|
echo "$INFORMIX_WARNING"
|
|
fi
|