Dear Andrew,

you are right, nssha1 and nscache are built-in, no extra module is 
needed for these.
Currently, there is no separate oracle driver, but up to my knowlege, 
the aolserver driver
for oracle should work.

in order to give my guesswork more substance, i took the oracle driver from
https://github.com/aolserver/nsoracle

and modified it slightly to compile it for naviserver. With the 
modifications below,
it compiles and links fine with naviserver (tested on mac os x 10.9.4 with
Oracle client libs Version 11.2.0.4.0 (instant client package and 
instant client package
SDK, 64-bit).

However, this version of the nsoracle is NOT in a good state. Most of 
the changes
were necessary to compile the driver at all, the libraries referenced 
form the original
Makefile do not exist anymore, the compilation ends with 51 warnings 
(missing
qualifiers, converisons of pointers to integer, signedness problems, etc.).

Andrew, what version of nsoracle are you using?

-gustaf

================================
export ORACLE_HOME=/usr/local/src/oracle/instantclient_11_2/

# includes: under $ORACLE_HOME/sdk/include/
# libaries: $ORACLE_HOME/lib/

make CC=clang INST=/usr/local/ns

================================

diff --git a/Makefile b/Makefile
index b3d11d8..dab6b3e 100644
--- a/Makefile
+++ b/Makefile
@@ -48,11 +48,8 @@ OCI_VERSION=$(shell strings $(ORACLE_HOME)/lib/libclntsh.so 
| grep "^Version.[0-
  OCI_MAJOR_VERSION=$(shell echo $(OCI_VERSION) | cut -d ' ' -f2 | cut -d '.' 
-f1)
  NS_VERSION=$(shell grep NS_VERSION $(NSHOME)/include/ns.h)
  
-MODLIBS  =  -L$(ORACLE_HOME)/lib -lclntsh \
-           -lcore$(OCI_MAJOR_VERSION) \
-           -lcommon$(OCI_MAJOR_VERSION) \
-           -lgeneric$(OCI_MAJOR_VERSION) \
-           -lclient$(OCI_MAJOR_VERSION)
+MODLIBS  +=  -L$(ORACLE_HOME)/lib -lclntsh -locci -lnsthread -lnsd -lnsdb 
-ltcl8.5
+
  
  ifneq (,$(findstring NS_VERSION,$(NS_VERSION)))
  MODLIBS  +=  -lnsdb
@@ -69,10 +66,8 @@ include $(NSHOME)/include/Makefile.global
  
  # Tack on the oracle includes after Makefile.global stomps CFLAGS
  CFLAGS := \
-    -I$(ORACLE_HOME)/rdbms/demo \
-    -I$(ORACLE_HOME)/rdbms/public \
-    -I$(ORACLE_HOME)/network/public \
-    -I$(ORACLE_HOME)/plsql/public $(filter-out -Wconversion,$(CFLAGS))
+    -I$(ORACLE_HOME)/sdk/include \
+    $(filter-out -Wconversion,$(CFLAGS))
  
  all: $(MOD) $(MODCASS)
  
diff --git a/nsoracle.c b/nsoracle.c
index fd4b4af..94af40e 100644
--- a/nsoracle.c
+++ b/nsoracle.c
@@ -37,7 +37,7 @@ dvoid *Ns_OracleRealloc(dvoid *cxt, dvoid *buf, size_t size) {
  
  /*{{{ Ns_OracleFree */
  void Ns_OracleFree(dvoid *cxt, dvoid *buf) {
-    return Ns_Free(buf);
+    Ns_Free(buf);
  }
  /*}}}*/
  
@@ -5651,7 +5651,7 @@ ora_get_column_index(Tcl_Interp * interp, Ns_DbTableInfo 
* tinfo,
  /* re-implement the ns_column command */
  int
  ora_column_command(ClientData dummy, Tcl_Interp * interp,
-        int argc, char *argv[])
+        int argc, CONST84 char *argv[])
  {
      int result = TCL_ERROR;
      Ns_DbHandle *handle;
@@ -5776,7 +5776,7 @@ ora_column_command(ClientData dummy, Tcl_Interp * interp,
  /* re-implement the ns_table command */
  int
  ora_table_command(ClientData dummy, Tcl_Interp * interp,
-        int argc, char *argv[])
+        int argc, CONST84 char *argv[])
  {
      int result = TCL_ERROR;
      Ns_DString tables_string;
diff --git a/nsoracle.h b/nsoracle.h
index 1afe644..08e46c6 100644
--- a/nsoracle.h
+++ b/nsoracle.h
@@ -25,6 +25,14 @@
  #include <sys/stat.h>
  #include <ns.h>
  
+#if defined(NS_VERSION)
+# define NS_AOLSERVER_3_PLUS 1
+# define Ns_Free ns_free
+# define Ns_Malloc ns_malloc
+# define Ns_Realloc ns_realloc
+# define Ns_StrDup ns_strdup
+#endif
+
  #ifndef NS_DML
  #include <nsdb.h>
  #endif


Am 27.08.14 15:53, schrieb Andrew Piskorski:
> In my ancient AOLserver installations, I've been using the add-on
> modules nsoracle, nssha1, and nscache, none of which are in the main
> Naviserver Mercurial repository here:
>
>    https://bitbucket.org/naviserver/
>
> Can anyone tell me the status of those modules with Naviserver?
>
> I suspect the nssha1 and nscache functionality is now built into the
> core Naviserver, but what about the Oracle db driver?  Is its latest
> version still the code in the AOLserver SourceForge CVS, or is there a
> newer/better version around somewhere?
>

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to