⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acoracle.m4

📁 Linux下的操作oracle数据库的连接库
💻 M4
📖 第 1 页 / 共 2 页
字号:
dnl $Id: acoracle.m4,v 1.13 2004/05/28 03:04:15 kpoitschke Exp $dnldnl acoracle.m4dnldnl Author: Kai Poitschke <kai.poitschke@computer.org>dnldnl Defines the macros:dnl  ACX_LD_RUNPATH_SWITCH dnl  AM_PATH_ORACLEdnldnl  ACKP_ORACLE for backward compatibility (calls AM_PATH_ORACLE)dnl -------------------------------------------------------------------------dnl ACX_LD_RUNPATH_SWITCH([ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])dnl Sets the variable LD_RUNPATH_SWITCHdnl We try:dnl -Wl,-R dnl -Wl,-rpath dnl -Wl,+s,+bdnl If nothing works, the LD_RUNPATH_SWITCH is set to "".dnlAC_DEFUN([ACX_LD_RUNPATH_SWITCH], [  if test "x$LD_RUNPATH_SWITCH" = "x"; then    AC_CACHE_CHECK([if compiler supports -Wl,-R], ackp_cv_cc_dashr,[    ackp_save_libs="${LIBS}"    LIBS="-R/usr/lib ${LIBS}"    AC_TRY_LINK([], [], ackp_cv_cc_dashr=yes, ackp_cv_cc_dashr=no)    LIBS="${ackp_save_libs}"])      if test $ackp_cv_cc_dashr = "yes"; then        LD_RUNPATH_SWITCH="-Wl,-R"    else        AC_CACHE_CHECK([if compiler supports -Wl,-rpath,], ackp_cv_cc_rpath,[                ackp_save_libs="${LIBS}"                LIBS="-Wl,-rpath,/usr/lib ${LIBS}"                AC_TRY_LINK([], [], ackp_cv_cc_rpath=yes, ackp_cv_cc_rpath=no)                LIBS="${ackp_save_libs}"])        if test $ackp_cv_cc_rpath = "yes"; then            LD_RUNPATH_SWITCH="-Wl,-rpath,"        else            AC_CACHE_CHECK([if compiler supports -Wl,+s,+b,], ackp_cv_cc_plusb,[                ackp_save_libs="${LIBS}"                LIBS="-Wl,+s,+b,/usr/lib ${LIBS}"                AC_TRY_LINK([], [], ackp_cv_cc_plusb=yes, ackp_cv_cc_plusb=no)                LIBS="${ackp_save_libs}"])            if test $ackp_cv_cc_plusb = "yes" ; then                LD_RUNPATH_SWITCH="-Wl,+s,+b,"            else                LD_RUNPATH_SWITCH=""            fi        fi    fi  fi  if test "x$LD_RUNPATH_SWITCH" != "x"; then      # action-if-found      ifelse([$1], , :, [$1])  else      # action-if-not-found      ifelse([$2], , :, [$2])  fi])dnl -------------------------------------------------------------------------dnl ACX_ORACLE_VERSION([MINIMUM-VERSION [,ORACLE_HOME] [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])dnl Tries to find out which oracle version is installeddnl Returns the version in $ORACLE_VERSIONdnl Substitutes ORACLE_VERSIONdnlAC_DEFUN([ACX_ORACLE_VERSION], [AC_ARG_ENABLE(oraversion,   AC_HELP_STRING([--disable-oraversion], [Do not check for the minimum oracle version]),  [], [enable_oraversion=yes])AC_ARG_WITH(oraversion, AC_HELP_STRING([--with-oraversion=major.minor],                                        [Tells configure the oracle client version. Use this when it is not possible to detect the version automatically (client only installations).]                                      ),            [ackp_cv_user_oracle_version=$withval],             [ackp_cv_user_oracle_version=""])  ora_min_version=$1  if test "x$ackp_cv_user_oracle_version" = "x" ; then    AC_CACHE_CHECK([Oracle version >= $ora_min_version], ackp_cv_oracle_version, [    ackp_cv_oracle_version=""    acx_orahome=ifelse([$2], , $ORACLE_HOME, $2)    export acx_orahome    if test -f "$acx_orahome/bin/svrmgrl" ; then      ackp_cv_oracle_version=`$acx_orahome/bin/svrmgrl command=exit |\                  egrep '(PL/SQL|JServer) (Release|Version)' |\                  sed 's/  */:/g' | cut -d: -f3 | cut -c 1-7`    else      if test -f "$acx_orahome/bin/sqlplus" ; then        # Oracle 8i knows sqlplus -?        # and Oracle 9i knows only sqlplus -v         # Cannot use the return code, have to parse the output        n=`$acx_orahome/bin/sqlplus -? | grep -i -c Usage`        if test $n -eq 0 ; then          sqlplus_opt="-?"        else          sqlplus_opt="-v"        fi        ackp_cv_oracle_version=`$acx_orahome/bin/sqlplus $sqlplus_opt |\                      egrep '(Release|Version)' |\                      sed 's/  */:/g' | cut -d: -f4 | cut -c 1-7`      else         echo "Cannot detect your oracle version. Configure with: --with-oraversion=major.minor"      fi # endif test sqlplus    fi  # endif test svrmgrl    unset acx_orahome    unset sqlplus_opt    ])  else    echo "Using user specified oracle version: $ackp_cv_user_oracle_version"    ackp_cv_oracle_version=$ackp_cv_user_oracle_version  fi # endif test ackp_oracle_version  ORACLE_VERSION=$ackp_cv_oracle_version  AC_SUBST(ORACLE_VERSION)  if test "x$ORACLE_VERSION" != "x"; then      if test "x$enable_oraversion" = "xyes" ; then          # split the minumum          ora_min_major=`echo $ora_min_version. | cut -d. -f1`          test -z "$ora_min_major" && ora_min_major=0          ora_min_minor=`echo $ora_min_version. | cut -d. -f2`          test -z "$ora_min_minor" && ora_min_minor=0          ora_min_micro=`echo $ora_min_version. | cut -d. -f3`          test -z "$ora_min_micro" && ora_min_micro=0          ora_min_patchl=`echo $ora_min_version. | cut -d. -f4`          test -z "$ora_min_patchl" && ora_min_patchl=0          #split the detected version          ora_major=`echo $ORACLE_VERSION | cut -d. -f1`          test -z "$ora_major" && ora_major=0          ora_minor=`echo $ORACLE_VERSION | cut -d. -f2`          test -z "$ora_minor" && ora_minor=0          ora_micro=`echo $ORACLE_VERSION | cut -d. -f3`          test -z "$ora_micro" && ora_micro=0          ora_patchl=`echo $ORACLE_VERSION | cut -d. -f4`          test -z "$ora_patchl" && ora_patchl=0          if test \( \( $ora_major -gt $ora_min_major \) -o \                \( \( $ora_major -eq $ora_min_major \) -a \( $ora_minor -gt $ora_min_minor \) \) -o \                \( \( $ora_major -eq $ora_min_major \) -a \( $ora_minor -eq $ora_min_minor \) -a \( $ora_micro -gt $ora_min_micro \) \) -o \                \( \( $ora_major -eq $ora_min_major \) -a \( $ora_minor -eq $ora_min_minor \) -a \( $ora_micro -eq $ora_min_micro \) -a \( $ora_patchl -ge $ora_min_patchl \) \) \) ; then              # this is the minumum required version              # action-if-found              ifelse([$3], , :, [$3])           else              echo "*** Sorry your Oracle version is not sufficient"              # action-if-not-found              ifelse([$4], , :, [$4])          fi      else         # ignore version check. Do action-if-found         ifelse([$3],,:,[$3])      fi    else      echo "*** Could not detect your oracle version"      # action-if-not-found      ifelse([$4], , :, [$4])  fi])dnl-------------------------------------------------------------------------dnl AM_PATH_ORACLE([MINIMUM-VERSION [, ORACLE_HOME [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])dnl Sets all variables to support oraclednl Sets $ORACLE_SHLIBS, $ORACLE_STLIBS, $ORACLE_LDFLAGSdnl $ORACLE_CPPFLAGS, $ORACLE_HOME, $ORACLE_VERSION (vial ACKP_ORACLE_VERSION)dnl and $ORACLE_LIBDIRdnldnl Requires macro ACX_LD_RUNPATH_SWITHdnlAC_DEFUN([AM_PATH_ORACLE], [AC_ARG_WITH(oraclehome,  AC_HELP_STRING([--with-oraclehome=DIR], [DIR is Oracle's installation directory, defaults to $ORACLE_HOME.]),[ORACLEINST_TOP=$withval ackp_cv_user_oracle_home=yes], [ORACLEINST_TOP=ifelse([$2], , $ORACLE_HOME, [$2], yes, $ORACLE_HOME, [$1])])  NLS_LANG="American_America.WE8ISO8859P1"  export NLS_LANG  if test "$ORACLEINST_TOP" != ""  then    ACX_ORACLE_VERSION([$1], $ORACLEINST_TOP, [    # Check for ORACLEINST_TOP/lib. If this does not exist, ORACLE_HOME    # is set wrong, ora --with-oraclehome has a value    if ! test -d $ORACLEINST_TOP/lib    then       echo ""       echo "Cannot find Oracle library dir  $ORACLEINST_TOP/lib"        if test "x$ackp_cv_user_oracle_home" = "x"       then          echo "Your env. variable ORACLE_HOME points to the wrong directory"       else          echo "Wrong directory in --with-oraclehome=<dir>"       fi       echo ""       exit 1    fi    # Oracle include files    if test -f "$ORACLEINST_TOP/rdbms/public/ocidfn.h"    then      # V8.0.5      ORACLE_CPPFLAGS="-I$ORACLEINST_TOP/rdbms/public"    elif test -f "$ORACLEINST_TOP/rdbms/demo/ocidfn.h" ; then      # V7.[0123]      ORACLE_CPPFLAGS="-I$ORACLEINST_TOP/rdbms/demo"    fi    if test -d "$ORACLEINST_TOP/network/public"    then      # V8      ORACLE_CPPFLAGS="$ORACLE_CPPFLAGS -I$ORACLEINST_TOP/network/public"    fi    if test -d "$ORACLEINST_TOP/plsql/public"    then      # V8      ORACLE_CPPFLAGS="$ORACLE_CPPFLAGS -I$ORACLEINST_TOP/plsql/public"    fi    if test -d "$ORACLEINST_TOP/rdbms/public"    then      # V8      ORACLE_CPPFLAGS="$ORACLE_CPPFLAGS -I$ORACLEINST_TOP/rdbms/public"    fi    # Oracle libs - nightmare :-)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -