for a in $modules $dynmodules
do
case "$a" in
+ oracle|goracle)
+ needoracle=yes
+ ;;
gmysql )
needmysql=yes
;;
esac
done
+AM_CONDITIONAL(ORACLE,test x"$needoracle" = "xyes")
+
+if test "$needoracle"
+then
+ AC_ARG_WITH(oracle_includes, [--with-oracle-includes=<path> instantclient sdk include dir])
+ AC_ARG_WITH(oracle_libs, [--with-oracle-libs=<path> instantclient oracle library dir])
+
+ if test x"$with_oracle_includes" = "x"
+ then
+ # check possible locations
+ for p1 in /usr/include/oracle /usr/local/include/oracle
+ do
+ for p2 in $p1/*/client*
+ do
+if test -d "$p2"
+then
+with_oracle_includes=$p2
+fi
+ done
+ done
+ fi
+
+ if test x"$with_oracle_includes" = x && test "$ORACLE_HOME/rdbms/public" != "/rdbms/public"; then
+if test -d $ORACLE_HOME/rdbms/public; then
+ with_oracle_includes=$ORACLE_HOME/rdbms/public
+fi
+ fi
+
+ # test header
+ old_CXXFLAGS="$CXXFLAGS"
+ old_CFLAGS="$CFLAGS"
+ CXXFLAGS="$CXXFLAGS -I$with_oracle_includes"
+ CPPFLAGS="$CPPFLAGS -I$with_oracle_includes"
+ AC_CHECK_HEADER([oci.h], ORACLE_CFLAGS="-I$with_oracle_includes", AC_MSG_ERROR([Could not find oci.h]))
+ CXXFLAGS="$old_CXXFLAGS"
+ CPPFLAGS="$old_CPPFLAGS"
+ AC_SUBST([ORACLE_CFLAGS])
+ AC_SUBST([ORACLE_LIBS])
+
+ if test x"$with_oracle_libs" = "x"
+ then
+ # check possible locationse
+ for p1 in /usr/lib/oracle /usr/local/lib/oracle
+ do
+ for p2 in $p1/*/client*/lib
+ do
+if test -d "$p2"
+then
+with_oracle_libs=$p2
+fi
+ done
+ done
+ fi
+
+ if test x"$with_oracle_libs" = x && test "$ORACLE_HOME/lib" != "/lib"; then
+if test -d $ORACLE_HOME/lib; then
+ with_oracle_libs=$ORACLE_HOME/lib
+fi
+ fi
+
+ # we have to check for client9 as well...
+
+ # test -lclntsh
+ old_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-L$with_oracle_libs -lnnz11 -locci"
+ AC_CHECK_LIB([clntsh],[OCIEnvInit],ORACLE_LIBS="-L$with_oracle_libs -lnnz11 -lclntsh -locci",
+ AC_CHECK_LIB([client9], [OCIEnvInit],ORACLE_LIBS="-L$with_oracle_libs -lclient9 -lclntsh9",AC_MSG_ERROR([Could not find client libraries])))
+ LDFLAGS="$old_LDFLAGS"
+fi
if test "$needmysql"
then
EXTRA_DIST=OBJECTFILES OBJECTLIBS
-ORACLE_HOME ?= /opt/oracle
-
-INCLUDES= -I$(ORACLE_HOME)/rdbms/demo \
- -I$(ORACLE_HOME)/rdbms/public
+INCLUDES= $(ORACLE_CFLAGS)
libgoraclebackend_la_SOURCES=goraclebackend.cc goraclebackend.hh \
soracle.hh soracle.cc
-libgoraclebackend_la_LDFLAGS=-module -avoid-version -L$(ORACLE_HOME)/lib -lclient9 -lclntst9
+libgoraclebackend_la_LDFLAGS=-module -avoid-version $(ORACLE_LIBS)
#soracle_LDFLAGS=-module -L$(ORACLE_HOME)/lib -lclient9 -lclntst9 -ldl -pthread
# -Wl,-Bstatic -lpq++ -lpq -Wl,-Bdynamic -lssl -lcrypt -lcrypto
EXTRA_DIST=OBJECTFILES OBJECTLIBS schema.sql dropschema.sql
-INCLUDES= -I$(ORACLE_HOME)/rdbms/public
+INCLUDES= $(ORACLE_CFLAGS)
liboraclebackend_la_SOURCES=oraclebackend.cc oraclebackend.hh
-liboraclebackend_la_LDFLAGS=-module -avoid-version -L$(ORACLE_HOME)/lib
+liboraclebackend_la_LDFLAGS=-module -avoid-version $(ORACLE_LIBS)
liboraclebackend_la_LIBADD=-lclntsh
if SQLITE3
pdns_server_SOURCES += ssqlite3.cc ssqlite3.hh
endif
+
+if ORACLE
+pdns_server_LDADD += $(ORACLE_LIBS)
+endif
pdnssec_SOURCES=pdnssec.cc dbdnsseckeeper.cc sstuff.hh dnsparser.cc dnsparser.hh dnsrecords.cc dnswriter.cc dnswriter.hh \
misc.cc misc.hh rcpgenerator.cc rcpgenerator.hh base64.cc base64.hh unix_utility.cc \
pdnssec_SOURCES += ssqlite3.cc ssqlite3.hh
endif
+if ORACLE
+pdnssec_LDADD += $(ORACLE_LIBS)
+endif
+
sdig_SOURCES=sdig.cc sstuff.hh dnsparser.cc dnsparser.hh dnsrecords.cc dnswriter.cc dnslabeltext.cc dnswriter.hh \
misc.cc misc.hh rcpgenerator.cc rcpgenerator.hh base64.cc base64.hh unix_utility.cc \
logger.cc statbag.cc qtype.cc sillyrecords.cc nsecrecords.cc base32.cc