2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_sql_oracle])
6 if test x$with_[]modname != xno; then
11 targetname=modname # we might change this later.
14 AC_SUBST(ORACLE_INCLUDE)
16 AC_MSG_CHECKING([for oci.h])
19 dnl # See if the user passed in the oracle_home_dir option and
20 dnl # use that first. If not, use $ORACLE_HOME. If that's
21 dnl # not defined, give up. There's no point in blindly
22 dnl # hunting around for Oracle - there's no standard place
23 dnl # for it. Any sane Oracle user/developer should have $ORACLE_HOME
24 dnl # defined anyways.
27 AC_TRY_COMPILE([#include <oci.h>],
33 # Look for Oracle10g "Instant Client" installed from RPM
34 if test "x$ORACLE_INCLUDE" = "x"; then
37 AC_MSG_WARN([PETER XXXXXXXXXXXXXXXX1.])
38 FR_LOCATE_DIR(oracle_include_dir,oci.h)
40 for try in /usr/include/oracle/10.1.0.3/client $oracle_include_dir; do
41 CFLAGS="$old_CFLAGS -I$try"
42 AC_TRY_COMPILE([#include <oci.h>],
44 ORACLE_INCLUDE="-I$try",
47 if test "x$ORACLE_INCLUDE" != "x"; then
48 ORACLE_LIBS="-L$/usr/lib/oracle/10.1.0.3/client/lib -lclntsh -lm"
54 # Finish Looking for Oracle10g includes installed from RPM
57 if test "x$ORACLE_INCLUDE" = "x"; then
60 FR_LOCATE_DIR(oracle_home_dir,oci.h)
62 for try in $oracle_home_dir $oracle_include_dir; do
63 CFLAGS="$old_CFLAGS -I${try}/rdbms/demo -I${try}/rdbms/public -I${try}/plsql/public -I${try}/network/public -I${try}/oci/include"
64 AC_TRY_COMPILE([#include <oci.h>],
69 if test "x$OHOME" != "x"; then
74 if test "x$OHOME" = "x" -a "x$ORACLE_HOME" != "x"; then
75 CFLAGS="$old_CFLAGS -I${ORACLE_HOME}/rdbms/demo -I${ORACLE_HOME}/rdbms/public -I${ORACLE_HOME}/plsql/public -I${ORACLE_HOME}/network/public -I${ORACLE_HOME}/oci/include"
76 AC_TRY_COMPILE([#include <oci.h>],
85 if test "x$OHOME" != "x"; then
87 ORACLE_INCLUDE="-I${ORACLE_HOME}/rdbms/demo -I${ORACLE_HOME}/rdbms/public -I${ORACLE_HOME}/plsql/public -I${ORACLE_HOME}/network/public -I${ORACLE_HOME}/oci/include"
89 fi ## this section sets $ORACLE_HOME, if found.
91 # not Oracle8i, try older.
92 if test "x$ORACLE_INCLUDE" = "x"; then
95 FR_LOCATE_DIR(oracle_include_dir,oci.h)
97 for try in /usr/local/include/oracle /usr/local/oracle/include $oracle_include_dir; do
98 CFLAGS="$old_CFLAGS -I$try"
99 AC_TRY_COMPILE([#include <oci.h>],
101 ORACLE_INCLUDE="-I$try",
104 if test "x$ORACLE_INCLUDE" != "x"; then
111 if test "x$ORACLE_INCLUDE" = "x"; then
113 AC_MSG_WARN([oracle headers not found. Use --with-oracle-home-dir=<path>.])
114 targetname= # disabled module
116 sql_oracle_cflags="${sql_oracle_cflags} ${ORACLE_INCLUDE}"
120 ## is this set, from above?
121 if test "x$ORACLE_HOME" != "x"; then
122 ## we must have an Oracle8i tree
124 # FIXME: we might do some checking, just to be nice
125 ORACLE_LIBS="-L$ORACLE_HOME/lib -lclntsh -lm"
128 AC_MSG_CHECKING([for oracle_init in -loracleclient])
131 dnl # Look for it in a number of directories.
135 FR_LOCATE_DIR(oracle_lib_dir,[oracleclient.so])
136 FR_LOCATE_DIR(oracle_lib_dir,[oracleclient.a])
138 for try in /usr/lib/oracle /usr/local/lib/oracle /usr/local/oracle/lib $oracle_lib_dir; do
139 LIBS="$old_LIBS -L$try -loracleclient"
140 AC_TRY_LINK([extern char oracle_init();],
142 ORACLE_LIBS="-L$try -loracleclient",
145 if test "x$ORACLE_LIBS" != "x"; then
152 dnl # If one or the other isn't found, disable
154 dnl # If both are found, enable them both.
156 if test "x$ORACLE_LIBS" = "x"; then
162 if test "x$ORACLE_LIBS" = "x"; then
163 AC_MSG_WARN([oracle libraries not found. Use --with-oracle-lib-dir=<path>.])
164 targetname= # disabled module
166 sql_oracle_ldflags="$sql_oracle_ldflags $ORACLE_LIBS"
171 if test "x$targetname" = "x"; then
172 AC_MSG_WARN([sql submodule 'oracle' disabled])
177 echo \*\*\* module modname is disabled.
180 AC_SUBST(sql_oracle_ldflags)
181 AC_SUBST(sql_oracle_cflags)