cvs: /php4/ext/oci8 Makefile.in config.m4 oci8.c

From: Date: Thu, 27 Apr 2000 14:29:41 +0000
Subject: cvs: /php4/ext/oci8 Makefile.in config.m4 oci8.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-14076@lists.php.net to get a copy of this message
thies Thu Apr 27 07:29:41 2000 EDT Modified files: /php4/ext/oci8 Makefile.in config.m4 oci8.c Log: allow oci8 to be build as loadable module. Index: php4/ext/oci8/Makefile.in diff -u php4/ext/oci8/Makefile.in:1.1 php4/ext/oci8/Makefile.in:1.2 --- php4/ext/oci8/Makefile.in:1.1 Wed Dec 29 18:59:09 1999 +++ php4/ext/oci8/Makefile.in Thu Apr 27 07:29:11 2000 @@ -6,5 +6,7 @@ LTLIBRARY_NAME = liboci8.la LTLIBRARY_SOURCES = oci8.c +LTLIBRARY_SHARED_NAME = oci8.la +LTLIBRARY_SHARED_LIBADD = $(OCI8_LFLAGS) $(OCI8_LIBS) include $(topsrcdir)/build/ltlib.mk Index: php4/ext/oci8/config.m4 diff -u php4/ext/oci8/config.m4:1.12 php4/ext/oci8/config.m4:1.13 --- php4/ext/oci8/config.m4:1.12 Sun Mar 26 06:27:10 2000 +++ php4/ext/oci8/config.m4 Thu Apr 27 07:29:11 2000 @@ -1,175 +1,113 @@ -dnl $Id: config.m4,v 1.12 2000/03/26 14:27:10 thies Exp $ +dnl $Id: config.m4,v 1.13 2000/04/27 14:29:11 thies Exp $ -AC_DEFUN(AC_ORACLE_VERSION,[ +AC_DEFUN(AC_OCI8_VERSION,[ AC_MSG_CHECKING([Oracle version]) - if test -f "$ORACLEINST_TOP/orainst/unix.rgs" - then - changequote({,}) - ORACLE_VERSION=grep '"ocommon"' $ORACLEINST_TOP/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4 - changequote([,]) - test -z "$ORACLE_VERSION" && ORACLE_VERSION=7.3 + if test -f "$OCI8_HOME/lib/libclntsh.so.8.0"; then + OCI8_VERSION=8.1 + elif test -f "$OCI8_HOME/lib/libclntsh.so.1.0"; then + OCI8_VERSION=8.0 else - if test -f "$ORACLEINST_TOP/lib/libclntsh.so.8.0" - then - ORACLE_VERSION=8.1 - else - ORACLE_VERSION=8.0 - fi + AC_MSG_ERROR(Oracle-OCI8 needed libraries not found) fi - AC_MSG_RESULT($ORACLE_VERSION) + AC_MSG_RESULT($OCI8_VERSION) ]) AC_MSG_CHECKING(for Oracle-OCI8 support) AC_ARG_WITH(oci8, -[ --with-oci8[=DIR] Include Oracle database support. DIR is Oracle's +[ --with-oci8[=DIR] Include Oracle-OCI8 database support. DIR is Oracle's home directory, defaults to \$ORACLE_HOME.], [ - case "$withval" in - yes) - ORACLEINST_TOP=$ORACLE_HOME - AC_MSG_RESULT(yes) - PHP_EXTENSION(oci8) - ;; - no) - ORACLEINST_TOP= - AC_MSG_RESULT(no) - ;; - *) - AC_EXPAND_PATH($withval, ORACLEINST_TOP) - AC_MSG_RESULT(yes) - PHP_EXTENSION(oci8) - ;; + case $withval in + shared) + shared=yes + withval=yes + OCI8_HOME=$ORACLE_HOME + AC_MSG_RESULT(yes) + PHP_EXTENSION(oci8,yes) + ;; + shared,*) + shared=yes + withval=echo $withval | sed -e 's/^shared,//' + AC_EXPAND_PATH($withval, OCI8_HOME) + AC_MSG_RESULT(yes) + PHP_EXTENSION(oci8,yes) + ;; + *) + shared=no + OCI8_HOME=$ORACLE_HOME + AC_MSG_RESULT(yes) + PHP_EXTENSION(oci8,no) + ;; esac - - if test "$ORACLEINST_TOP" != "" - then - - # Oracle include files - if test -f "$ORACLEINST_TOP/rdbms/public/ocidfn.h" - then - # V8.0.5 - ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/rdbms/public" - elif test -f "$ORACLEINST_TOP/rdbms/demo/ocidfn.h" - then - # V7.[0123] - ORACLE_INCLUDE=-I$ORACLEINST_TOP/rdbms/demo + if test "$OCI8_HOME" != ""; then + if test -d "$OCI8_HOME/rdbms/public"; then + OCI8_INCLUDE="$OCI8_INCLUDE -I$OCI8_HOME/rdbms/public" fi - - if test -d "$ORACLEINST_TOP/rdbms/public" - then - ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/rdbms/public" + if test -d "$OCI8_HOME/rdbms/demo"; then + OCI8_INCLUDE="$OCI8_INCLUDE -I$OCI8_HOME/rdbms/demo" fi - - if test -d "$ORACLEINST_TOP/network/public" - then - ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/network/public" + if test -d "$OCI8_HOME/network/public"; then + OCI8_INCLUDE="$OCI8_INCLUDE -I$OCI8_HOME/network/public" fi - - if test -d "$ORACLEINST_TOP/plsql/public" - then - # V8 - ORACLE_INCLUDE="$ORACLE_INCLUDE -I$ORACLEINST_TOP/plsql/public" + if test -d "$OCI8_HOME/plsql/public"; then + OCI8_INCLUDE="$OCI8_INCLUDE -I$OCI8_HOME/plsql/public" fi # Need to know the version, otherwhise we will mixup nlsrtl - AC_ORACLE_VERSION($ORACLEINST_TOP) - - # Oracle libs - nightmare :-) + AC_OCI8_VERSION($OCI8_HOME) - ORACLE_LIBDIR=lib - ORACLE_LFLAGS="-L$ORACLEINST_TOP/$ORACLE_LIBDIR ${ld_runpath_switch}$ORACLEINST_TOP/$ORACLE_LIBDIR" - if test -f "$ORACLEINST_TOP/rdbms/lib/sysliblist" - then - ORA_SYSLIB="cat $ORACLEINST_TOP/rdbms/lib/sysliblist" + OCI8_LIBDIR=lib + OCI8_LFLAGS="-L$OCI8_HOME/$OCI8_LIBDIR ${ld_runpath_switch}$OCI8INST_TOP/$OCI8_LIBDIR" + if test -f "$OCI8_HOME/rdbms/lib/sysliblist"; then + ORA_SYSLIB="cat $OCI8_HOME/rdbms/lib/sysliblist" else ORA_SYSLIB="-lm" fi - # Oracle Static libs - case $ORACLE_VERSION in - 7.0|7.1) - ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \ - -lsqlnet -lora -lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcv6 \ - -lcore $ORA_SYSLIB -lcore $ORA_SYSLIB" - if test "uname -s 2>/dev/null" = "AIX"; then - ORACLE_STLIBS="$ORACLE_STLIBS -bI:$ORACLE_HOME/lib/mili.exp" - fi - ;; - 7.2) - ORACLE_STLIBS="-locic $ORACLEINST_TOP/$ORACLE_LIBDIR/osntab.o \ - -lsqlnet -lora -lsqlnet -lora -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 \ - -lcore3 $ORA_SYSLIB -lcore3 $ORA_SYSLIB" - ;; - 7.3) - ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \ - -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \ - -lepc -lnlsrtl3 -lc3v6 -lcore3 -lnlsrtl3 -lcore3 -lnlsrtl3 \ - $ORA_SYSLIB -lcore3 $ORA_SYSLIB" - ;; - 8.0) - ORACLE_STLIBS="-lclient -lsqlnet -lncr -lsqlnet -lclient -lcommon \ - -lgeneric -lsqlnet -lncr -lsqlnet -lclient -lcommon -lgeneric \ - -lepc -lnlsrtl3 -lc3v6 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 \ - $ORA_SYSLIB -lcore3 $ORA_SYSLIB" - ;; - *) - ORACLE_STLIBS= - ;; - esac - # Oracle shared libs - case $ORACLE_VERSION in - 7.0) - # shared libs not supported - ORACLE_SHLIBS="$ORACLE_STLIBS" - ;; - 7.1) - if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/liboracle.s? - then - ORACLE_SHLIBS="-loracle $ORA_SYSLIB" - else - ORACLE_SHLIBS="$ORACLE_STLIBS" - fi - ;; - 7.2|7.3) - if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s? - then - ORACLE_SHLIBS="-lclntsh $ORA_SYSLIB" - else - ORACLE_SHLIBS="$ORACLE_STLIBS" - fi - ;; + case $OCI8_VERSION in 8.0) - if test -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.s? -o \ - -f $ORACLEINST_TOP/$ORACLE_LIBDIR/libclntsh.a # AIX + if test -f $OCI8_HOME/$OCI8_LIBDIR/libclntsh.s? -o \ + -f $OCI8_HOME/$OCI8_LIBDIR/libclntsh.a # AIX then - if test "$CC" = "gcc" -a "uname -sv" = "AIX 4"; then - # for Oracle 8 on AIX 4 - ORA_SYSLIB="$ORA_SYSLIB -nostdlib /lib/crt0_r.o /usr/lib/libpthreads.a /usr/lib/libc_r.a -lgcc" - fi - ORACLE_SHLIBS="-lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh $ORA_SYSLIB" + if test "$CC" = "gcc" -a "uname -sv" = "AIX 4"; then + # for Oracle 8 on AIX 4 + ORA_SYSLIB="$ORA_SYSLIB -nostdlib /lib/crt0_r.o /usr/lib/libpthreads.a /usr/lib/libc_r.a -lgcc" + fi + + OCI8_SHLIBS="-lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh $ORA_SYSLIB" else - ORACLE_SHLIBS="$ORACLE_STLIBS" + OCI8_SHLIBS="$OCI8_STLIBS" fi AC_DEFINE(HAVE_OCI8,1,[ ]) ;; + 8.1) - ORACLE_SHLIBS="-lclntsh $ORA_SYSLIB" - AC_DEFINE(HAVE_OCI8,1,[ ]) - ;; + OCI8_SHLIBS="-lclntsh $ORA_SYSLIB" + AC_DEFINE(HAVE_OCI8,1,[ ]) + ;; *) - ORACLE_SHLIBS= - ;; + OCI8_SHLIBS= + ;; esac # only using shared libs right now - ORACLE_LIBS=$ORACLE_SHLIBS + OCI8_LIBS=$OCI8_SHLIBS fi - ],[AC_MSG_RESULT(no)]) -#EXTRA_LIBS="$EXTRA_LIBS $ORACLE_SHLIBS $ORACLE_STLIBS $ORACLE_LIBS $ORACLE_LFLAGS" -EXTRA_LIBS="$EXTRA_LIBS $ORACLE_LFLAGS $ORACLE_LIBS" -INCLUDES="$INCLUDES $ORACLE_INCLUDE" -PHP_SUBST(ORACLE_HOME) -PHP_SUBST(ORACLE_VERSION) + +if test "$shared" = yes; then + OCI8_LIBS="$OCI8_LFLAGS $OCI8_LIBS" +else + EXTRA_LIBS="$EXTRA_LIBS $OCI8_LFLAGS $OCI8_LIBS" + INCLUDES="$INCLUDES $OCI8_INCLUDE" +fi + +INCLUDES="$INCLUDES $OCI8_INCLUDE" + +PHP_SUBST(OCI8_HOME) +PHP_SUBST(OCI8_INCLUDE) +PHP_SUBST(OCI8_LFLAGS) +PHP_SUBST(OCI8_LIBS) + Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.73 php4/ext/oci8/oci8.c:1.74 --- php4/ext/oci8/oci8.c:1.73 Mon Apr 24 09:46:56 2000 +++ php4/ext/oci8/oci8.c Thu Apr 27 07:29:11 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: oci8.c,v 1.73 2000/04/24 16:46:56 thies Exp $ */ +/* $Id: oci8.c,v 1.74 2000/04/27 14:29:11 thies Exp $ */ /* TODO list: * @@ -48,9 +48,11 @@ /* {{{ includes & stuff */ +/* #if defined(COMPILE_DL) # include "dl/phpdl.h" #endif +*/ #include "php.h" @@ -97,7 +99,7 @@ /* }}} */ /* {{{ dynamically loadable module stuff */ -#if COMPILE_DL +#if COMPILE_DL_OCI8 DLEXPORT zend_module_entry *get_module() { return &oci8_module_entry; }; #endif /* COMPILE_DL */

« previous php.version4 (#14076) next »