php-src/ext/oci8/config.m4

85 lines
2.8 KiB
Plaintext
Raw Normal View History

dnl $Id$
AC_DEFUN(AC_OCI8_VERSION,[
AC_MSG_CHECKING([Oracle version])
2000-05-08 17:41:37 +08:00
if test -f "$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
2000-05-15 18:01:51 +08:00
elif test -f $OCI8_DIR/lib/libclntsh.s?.8.0; then
2000-05-08 17:41:37 +08:00
OCI8_VERSION=8.1
2000-05-15 18:01:51 +08:00
elif test -f $OCI8_DIR/lib/libclntsh.s?.1.0; then
2000-05-08 17:41:37 +08:00
OCI8_VERSION=8.0
2000-05-15 18:01:51 +08:00
elif test -f $OCI8_DIR/lib/libclntsh.a; then # AIX - XXX is this check still right for 8.1?
2000-05-08 17:41:37 +08:00
OCI8_VERSION=8.0
else
2000-05-08 17:41:37 +08:00
AC_MSG_ERROR(Oracle-OCI8 needed libraries not found)
fi
AC_MSG_RESULT($OCI8_VERSION)
2000-05-08 17:41:37 +08:00
])
2000-05-08 17:06:48 +08:00
PHP_ARG_WITH(oci8, for Oracle-OCI8 support,
[ --with-oci8[=DIR] Include Oracle-oci8 support. Default DIR is ORACLE_HOME.])
2000-05-08 17:06:48 +08:00
if test "$PHP_OCI8" != "no"; then
AC_MSG_CHECKING([Oracle Install-Dir])
if test "$PHP_OCI8" = "yes"; then
OCI8_DIR="$ORACLE_HOME"
else
OCI8_DIR="$PHP_OCI8"
fi
AC_MSG_RESULT($OCI8_DIR)
if test "$PHP_SIGCHILD" != "yes"; then
echo "+--------------------------------------------------------------------+"
echo "| Notice: |"
echo "| If you encounter <defunc> processes when using a local Oracle-DB |"
echo "| please recompile PHP and specify --enable-sigchild when configuring|"
echo "| (This problem has been reported un Linux using Oracle >= 8.1.5) |"
echo "+--------------------------------------------------------------------+"
fi
2000-05-08 17:06:48 +08:00
if test -d "$OCI8_DIR/rdbms/public"; then
AC_ADD_INCLUDE($OCI8_DIR/rdbms/public)
fi
if test -d "$OCI8_DIR/rdbms/demo"; then
AC_ADD_INCLUDE($OCI8_DIR/rdbms/demo)
fi
if test -d "$OCI8_DIR/network/public"; then
AC_ADD_INCLUDE($OCI8_DIR/network/public)
fi
if test -d "$OCI8_DIR/plsql/public"; then
AC_ADD_INCLUDE($OCI8_DIR/plsql/public)
fi
2000-05-08 17:06:48 +08:00
if test -f "$OCI8_DIR/lib/sysliblist"; then
2000-06-19 17:27:17 +08:00
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/lib/sysliblist`, OCI8_SYSLIB)
2000-05-08 17:06:48 +08:00
elif test -f "$OCI8_DIR/rdbms/lib/sysliblist"; then
2000-06-19 17:27:17 +08:00
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/lib/sysliblist`, OCI8_SYSLIB)
2000-05-08 17:06:48 +08:00
fi
2000-05-08 17:06:48 +08:00
AC_OCI8_VERSION($OCI8_DIR)
case $OCI8_VERSION in
8.0)
AC_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", OCI8_SHARED_LIBADD)
AC_ADD_LIBRARY_WITH_PATH(core4, "", OCI8_SHARED_LIBADD)
AC_ADD_LIBRARY_WITH_PATH(psa, "", OCI8_SHARED_LIBADD)
AC_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/lib, OCI8_SHARED_LIBADD)
;;
2000-05-08 17:06:48 +08:00
8.1)
AC_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
AC_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
2000-05-08 17:06:48 +08:00
;;
*)
AC_MSG_ERROR(Unsupported Oracle version!)
;;
esac
2000-05-08 17:06:48 +08:00
PHP_EXTENSION(oci8, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[ ])
2000-05-08 17:06:48 +08:00
PHP_SUBST(OCI8_SHARED_LIBADD)
PHP_SUBST(OCI8_DIR)
PHP_SUBST(OCI8_VERSION)
fi