it into its own configure.in .
dnl #######################################################################
dnl #
-dnl # Look for Oracle in a variety of places.
-dnl #
-AC_DEFUN(ORACLE_CHECKS, [
- AC_SUBST(ORACLE_LIBS)
- AC_SUBST(ORACLE_INCLUDE)
-
-AC_MSG_CHECKING([for oci.h])
-
-dnl #
-dnl # First, see if we can build it WITHOUT using any special includes
-dnl #
-AC_TRY_COMPILE([#include <oci.h>],
- [ int a = 1;],
- ORACLE_INCLUDE=" ",
- ORACLE_INCLUDE=)
-
-dnl #
-dnl # If not, look for it in a number of directories.
-dnl #
-if test "x$ORACLE_INCLUDE" = "x"; then
- old_CFLAGS="$CFLAGS"
-
- AC_LOCATE_DIR(oracle_include_dir,oci.h)
-
- for try in /usr/local/include/oracle /usr/local/oracle/include $oracle_include_dir; do
- CFLAGS="$old_CFLAGS -I$try"
- AC_TRY_COMPILE([#include <oci.h>],
- [ int a = 1;],
- ORACLE_INCLUDE="-I$try",
- ORACLE_INCLUDE=)
- if test "x$ORACLE_INCLUDE" != "x"; then
- break;
- fi
- done
- CFLAGS="$old_CFLAGS"
-fi
-
-if test "x$ORACLE_INCLUDE" = "x"; then
- AC_MSG_RESULT(no)
-else
- AC_MSG_RESULT(yes)
-
-dnl #
-dnl # Now do the same thing, looking for the Oracle library directory
-dnl #
- AC_MSG_CHECKING([for oracle_init in -loracleclient])
-
-dnl #
-dnl # Look for it in a number of directories.
-dnl #
- old_LIBS="$LIBS"
-
- AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.so])
- AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.a])
-
- for try in /usr/lib/oracle /usr/local/lib/oracle /usr/local/oracle/lib $oracle_lib_dir; do
- LIBS="$old_LIBS -L$try -loracleclient"
- AC_TRY_LINK([extern char oracle_init();],
- [ oracle_init()],
- ORACLE_LIBS="-L$try -loracleclient",
- ORACLE_LIBS=)
- if test "x$ORACLE_LIBS" != "x"; then
- break;
- fi
- done
- LIBS="$old_LIBS"
-
- dnl #
- dnl # If one or the other isn't found, disable them both..
- dnl # If both are found, enable them both.
- dnl #
- if test "x$ORACLE_LIBS" = "x"; then
- AC_MSG_RESULT(no)
- ORACLE_INCLUDE=
- else
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_OCI_H)
- fi
-fi
-])
-
-dnl #######################################################################
-dnl #
dnl # Look for ODBC in a variety of places.
dnl #
AC_DEFUN(ODBC_CHECKS, [
-# From configure.in Revision: 1.116
+# From configure.in Revision: 1.117
RADIUSD_VERSION=0.1
-echo $ac_n "checking for oci.h""... $ac_c" 1>&6
-echo "configure:4092: checking for oci.h" >&5
-
-cat > conftest.$ac_ext <<EOF
-#line 4095 "configure"
-#include "confdefs.h"
-#include <oci.h>
-int main() {
- int a = 1;
-; return 0; }
-EOF
-if { (eval echo configure:4102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ORACLE_INCLUDE=" "
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ORACLE_INCLUDE=
-fi
-rm -f conftest*
-
-if test "x$ORACLE_INCLUDE" = "x"; then
- old_CFLAGS="$CFLAGS"
-
-
-
-if test "x$LOCATE" != "x"; then
- DIRS=
- file=oci.h
-
- for x in `${LOCATE} $file 2>/dev/null`; do
- base=`echo $x | sed "s%/${file}%%"`
- if test "x$x" = "x$base"; then
- continue;
- fi
-
- dir=`${DIRNAME} $x 2>/dev/null`
- exclude=`echo ${dir} | ${GREP} /home`
- if test "x$exclude" != "x"; then
- continue
- fi
-
- already=`echo \$oracle_include_dir ${DIRS} | ${GREP} ${dir}`
- if test "x$already" = "x"; then
- DIRS="$DIRS $dir"
- fi
- done
-fi
-
-eval "oracle_include_dir=\"\$oracle_include_dir $DIRS\""
-
-
- for try in /usr/local/include/oracle /usr/local/oracle/include $oracle_include_dir; do
- CFLAGS="$old_CFLAGS -I$try"
- cat > conftest.$ac_ext <<EOF
-#line 4147 "configure"
-#include "confdefs.h"
-#include <oci.h>
-int main() {
- int a = 1;
-; return 0; }
-EOF
-if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ORACLE_INCLUDE="-I$try"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ORACLE_INCLUDE=
-fi
-rm -f conftest*
- if test "x$ORACLE_INCLUDE" != "x"; then
- break;
- fi
- done
- CFLAGS="$old_CFLAGS"
-fi
-
-if test "x$ORACLE_INCLUDE" = "x"; then
- echo "$ac_t""no" 1>&6
-else
- echo "$ac_t""yes" 1>&6
-
- echo $ac_n "checking for oracle_init in -loracleclient""... $ac_c" 1>&6
-echo "configure:4177: checking for oracle_init in -loracleclient" >&5
-
- old_LIBS="$LIBS"
-
-
-
-if test "x$LOCATE" != "x"; then
- DIRS=
- file=liboracleclient.so
-
- for x in `${LOCATE} $file 2>/dev/null`; do
- base=`echo $x | sed "s%/${file}%%"`
- if test "x$x" = "x$base"; then
- continue;
- fi
-
- dir=`${DIRNAME} $x 2>/dev/null`
- exclude=`echo ${dir} | ${GREP} /home`
- if test "x$exclude" != "x"; then
- continue
- fi
-
- already=`echo \$oracle_lib_dir ${DIRS} | ${GREP} ${dir}`
- if test "x$already" = "x"; then
- DIRS="$DIRS $dir"
- fi
- done
-fi
-
-eval "oracle_lib_dir=\"\$oracle_lib_dir $DIRS\""
-
-
-
-if test "x$LOCATE" != "x"; then
- DIRS=
- file=liboracleclient.a
-
- for x in `${LOCATE} $file 2>/dev/null`; do
- base=`echo $x | sed "s%/${file}%%"`
- if test "x$x" = "x$base"; then
- continue;
- fi
-
- dir=`${DIRNAME} $x 2>/dev/null`
- exclude=`echo ${dir} | ${GREP} /home`
- if test "x$exclude" != "x"; then
- continue
- fi
-
- already=`echo \$oracle_lib_dir ${DIRS} | ${GREP} ${dir}`
- if test "x$already" = "x"; then
- DIRS="$DIRS $dir"
- fi
- done
-fi
-
-eval "oracle_lib_dir=\"\$oracle_lib_dir $DIRS\""
-
-
- for try in /usr/lib/oracle /usr/local/lib/oracle /usr/local/oracle/lib $oracle_lib_dir; do
- LIBS="$old_LIBS -L$try -loracleclient"
- cat > conftest.$ac_ext <<EOF
-#line 4239 "configure"
-#include "confdefs.h"
-extern char oracle_init();
-int main() {
- oracle_init()
-; return 0; }
-EOF
-if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ORACLE_LIBS="-L$try -loracleclient"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ORACLE_LIBS=
-fi
-rm -f conftest*
- if test "x$ORACLE_LIBS" != "x"; then
- break;
- fi
- done
- LIBS="$old_LIBS"
-
- if test "x$ORACLE_LIBS" = "x"; then
- echo "$ac_t""no" 1>&6
- ORACLE_INCLUDE=
- else
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_OCI_H 1
-EOF
-
- fi
-fi
-
-
-
-
-
echo $ac_n "checking for isql.h""... $ac_c" 1>&6
-echo "configure:4279: checking for isql.h" >&5
+echo "configure:4092: checking for isql.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 4282 "configure"
+#line 4095 "configure"
#include "confdefs.h"
#include <isql.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:4289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ODBC_INCLUDE=" "
else
for try in /usr/include /usr/local/include/odbc /usr/local/odbc/include $odbc_include_dir; do
CFLAGS="$old_CFLAGS -I$try"
cat > conftest.$ac_ext <<EOF
-#line 4334 "configure"
+#line 4147 "configure"
#include "confdefs.h"
#include <isql.h>
int main() {
int a = 1;
; return 0; }
EOF
-if { (eval echo configure:4341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ODBC_INCLUDE="-I$try"
else
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for odbc_init in -lodbcclient""... $ac_c" 1>&6
-echo "configure:4364: checking for odbc_init in -lodbcclient" >&5
+echo "configure:4177: checking for odbc_init in -lodbcclient" >&5
old_LIBS="$LIBS"
for try in /usr/lib /usr/lib/odbc /usr/local/lib/odbc /usr/local/odbc/lib $odbc_lib_dir; do
LIBS="$old_LIBS -L$try -lodbcclient"
cat > conftest.$ac_ext <<EOF
-#line 4426 "configure"
+#line 4239 "configure"
#include "confdefs.h"
extern char odbc_init();
int main() {
odbc_init()
; return 0; }
EOF
-if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ODBC_LIBS="-L$try -lodbcclient"
else
s%@PGROOT@%$PGROOT%g
s%@PQ_LIBS@%$PQ_LIBS%g
s%@PG_INCLUDE_DIR@%$PG_INCLUDE_DIR%g
-s%@ORACLE_LIBS@%$ORACLE_LIBS%g
-s%@ORACLE_INCLUDE@%$ORACLE_INCLUDE%g
s%@ODBC_LIBS@%$ODBC_LIBS%g
s%@ODBC_INCLUDE@%$ODBC_INCLUDE%g
s%@LIBLTDL@%$LIBLTDL%g
fi
POSTGRESQL_CHECKS
-ORACLE_CHECKS
ODBC_CHECKS
dnl #############################################################
+++ /dev/null
-include ../../../../../Make.inc
-
-TARGET = rlm_sql_oracle
-SRCS = sql_oracle.c
-HEADERS = sql_oracle.h
-RLM_SQL_CFLAGS = $(SQL_ORACLE_INCLUDE) $(INCLTDL)
-RLM_SQL_LIBS = $(SQL_ORACLE_LIBS)
-
-$(DYNAMIC_OBJS): $(HEADERS)
-
-###
-# over-ride the previous assignment if we're not building anything
-ifeq ($(SQL_ORACLE_LIBS),)
-TARGET =
-endif
-
-include ../rules.mak
-
--- /dev/null
+include ../../../../../Make.inc
+
+TARGET = @targetname@
+SRCS = sql_oracle.c
+HEADERS = sql_oracle.h
+RLM_SQL_CFLAGS = @sql_oracle_cflags@ $(INCLTDL)
+RLM_SQL_LIBS = @sql_oracle_ldflags@
+
+include ../rules.mak
+
+$(DYNAMIC_OBJS): $(HEADERS)
--- /dev/null
+AC_INIT(sql_oracle.c)
+AC_REVISION($Revision$)
+AC_DEFUN(modname,[rlm_sql_oracle])
+
+
+if test x$with_[]modname != xno; then
+
+ targetname=modname # we might change this later.
+
+ AC_SUBST(ORACLE_LIBS)
+ AC_SUBST(ORACLE_INCLUDE)
+
+ AC_MSG_CHECKING([for oci.h])
+
+ dnl #
+ dnl # First, see if we can build it WITHOUT using any special includes
+ dnl #
+ AC_TRY_COMPILE([#include <oci.h>],
+ [ int a = 1;],
+ ORACLE_INCLUDE=" ",
+ ORACLE_INCLUDE=
+ )
+
+ dnl #
+ dnl # If not, look for it in a number of directories.
+ dnl #
+ if test "x$ORACLE_INCLUDE" = "x"; then
+ old_CFLAGS="$CFLAGS"
+
+ AC_LOCATE_DIR(oracle_include_dir,oci.h)
+
+ for try in /usr/local/include/oracle /usr/local/oracle/include $oracle_include_dir; do
+ CFLAGS="$old_CFLAGS -I$try"
+ AC_TRY_COMPILE([#include <oci.h>],
+ [ int a = 1; ],
+ ORACLE_INCLUDE="-I$try",
+ ORACLE_INCLUDE=
+ )
+ if test "x$ORACLE_INCLUDE" != "x"; then
+ break;
+ fi
+ done
+ CFLAGS="$old_CFLAGS"
+ fi
+
+ if test "x$ORACLE_INCLUDE" = "x"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([oracle headers not found. Use --with-oracle-include-dir=<path>.])
+ targetname= # disabled module
+ else
+ sql_oracle_cflags="${sql_oracle_cflags} ${ORACLE_INCLUDE}"
+ AC_MSG_RESULT(yes)
+
+ dnl #
+ dnl # Now do the same thing, looking for the Oracle library directory
+ dnl #
+ AC_MSG_CHECKING([for oracle_init in -loracleclient])
+
+ dnl #
+ dnl # Look for it in a number of directories.
+ dnl #
+ old_LIBS="$LIBS"
+
+ AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.so])
+ AC_LOCATE_DIR(oracle_lib_dir,[liboracleclient.a])
+
+ for try in /usr/lib/oracle /usr/local/lib/oracle /usr/local/oracle/lib $oracle_lib_dir; do
+ LIBS="$old_LIBS -L$try -loracleclient"
+ AC_TRY_LINK([extern char oracle_init();],
+ [ oracle_init()],
+ ORACLE_LIBS="-L$try -loracleclient",
+ ORACLE_LIBS=
+ )
+ if test "x$ORACLE_LIBS" != "x"; then
+ break;
+ fi
+ done
+ LIBS="$old_LIBS"
+
+ dnl #
+ dnl # If one or the other isn't found, disable them both..
+ dnl # If both are found, enable them both.
+ dnl #
+ if test "x$ORACLE_LIBS" = "x"; then
+ AC_MSG_RESULT(no)
+ ORACLE_INCLUDE=
+ AC_MSG_WARN([oracle libraries not found. Use --with-oracle-lib-dir=<path>.])
+ targetname= # disabled module
+ else
+ sql_oracle_ldflags="$sql_oracle_ldflags $ORACLE_LIBS"
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OCI_H)
+ fi
+ fi
+
+ if test "x$targetname" = "x"; then
+ AC_MSG_WARN([sql submodule 'oracle' disabled])
+ fi
+
+else
+ targetname=
+ echo \*\*\* module modname is disabled.
+fi
+
+AC_SUBST(sql_oracle_ldflags)
+AC_SUBST(sql_oracle_cflags)
+AC_SUBST(targetname)
+AC_OUTPUT(Makefile)