2 AC_REVISION($Revision$)
3 AC_DEFUN(modname,[rlm_sql_oracle])
6 if test x$with_[]modname != xno; then
8 targetname=modname # we might change this later.
11 AC_SUBST(ORACLE_INCLUDE)
13 AC_MSG_CHECKING([for oci.h])
16 dnl # First, see if we can build it WITHOUT using any special includes
18 AC_TRY_COMPILE([#include <oci.h>],
25 dnl # If not, look for it in a number of directories.
27 if test "x$ORACLE_INCLUDE" = "x"; then
30 AC_LOCATE_DIR(oracle_include_dir,oci.h)
32 for try in /usr/local/include/oracle /usr/local/oracle/include $oracle_include_dir; do
33 CFLAGS="$old_CFLAGS -I$try"
34 AC_TRY_COMPILE([#include <oci.h>],
36 ORACLE_INCLUDE="-I$try",
39 if test "x$ORACLE_INCLUDE" != "x"; then
46 if test "x$ORACLE_INCLUDE" = "x"; then
48 AC_MSG_WARN([oracle headers not found. Use --with-oracle-include-dir=<path>.])
49 targetname= # disabled module
51 sql_oracle_cflags="${sql_oracle_cflags} ${ORACLE_INCLUDE}"
55 dnl # Now do the same thing, looking for the Oracle library directory
57 AC_MSG_CHECKING([for oracle_init in -loracleclient])
60 dnl # Look for it in a number of directories.
64 AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.so])
65 AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.a])
67 for try in /usr/lib/oracle /usr/local/lib/oracle /usr/local/oracle/lib $oracle_lib_dir; do
68 LIBS="$old_LIBS -L$try -loracleclient"
69 AC_TRY_LINK([extern char oracle_init();],
71 ORACLE_LIBS="-L$try -loracleclient",
74 if test "x$ORACLE_LIBS" != "x"; then
81 dnl # If one or the other isn't found, disable them both..
82 dnl # If both are found, enable them both.
84 if test "x$ORACLE_LIBS" = "x"; then
87 AC_MSG_WARN([oracle libraries not found. Use --with-oracle-lib-dir=<path>.])
88 targetname= # disabled module
90 sql_oracle_ldflags="$sql_oracle_ldflags $ORACLE_LIBS"
96 if test "x$targetname" = "x"; then
97 AC_MSG_WARN([sql submodule 'oracle' disabled])
102 echo \*\*\* module modname is disabled.
105 AC_SUBST(sql_oracle_ldflags)
106 AC_SUBST(sql_oracle_cflags)