You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fu...@apache.org on 2007/06/29 20:08:58 UTC

svn commit: r551983 - in /apr/apr-util/branches/1.2.x: NWGNUmakefile dbd/apr_dbd.c include/apu.hnw

Author: fuankg
Date: Fri Jun 29 11:08:58 2007
New Revision: 551983

URL: http://svn.apache.org/viewvc?view=rev&rev=551983
Log:
enabled DSO driver for NetWare.

Modified:
    apr/apr-util/branches/1.2.x/NWGNUmakefile
    apr/apr-util/branches/1.2.x/dbd/apr_dbd.c
    apr/apr-util/branches/1.2.x/include/apu.hnw

Modified: apr/apr-util/branches/1.2.x/NWGNUmakefile
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/NWGNUmakefile?view=diff&rev=551983&r1=551982&r2=551983
==============================================================================
--- apr/apr-util/branches/1.2.x/NWGNUmakefile (original)
+++ apr/apr-util/branches/1.2.x/NWGNUmakefile Fri Jun 29 11:08:58 2007
@@ -7,6 +7,12 @@
 	xml \
 	$(EOLIST) 
 
+ifdef WITH_APR_DBD
+SUBDIRS += \
+	dbd \
+	$(EOLIST) 
+endif
+
 #
 # Get the 'head' of the build environment.  This includes default targets and
 # paths to tools
@@ -240,7 +246,6 @@
 	$(OBJDIR)/apr_date.o \
 	$(OBJDIR)/apr_dbm.o \
 	$(OBJDIR)/apr_dbd.o \
-	$(OBJDIR)/apr_dbd_pgsql.o \
 	$(OBJDIR)/apr_dbm_berkeleydb.o \
 	$(OBJDIR)/apr_dbm_sdbm.o \
 	$(OBJDIR)/apr_hooks.o \

Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/dbd/apr_dbd.c?view=diff&rev=551983&r1=551982&r2=551983
==============================================================================
--- apr/apr-util/branches/1.2.x/dbd/apr_dbd.c (original)
+++ apr/apr-util/branches/1.2.x/dbd/apr_dbd.c Fri Jun 29 11:08:58 2007
@@ -126,6 +126,8 @@
 
 #ifdef WIN32
     sprintf(path, "apr_dbd_%s.dll", name);
+#elif defined(NETWARE)
+    sprintf(path, "dbd%s.nlm", name);
 #else
     sprintf(path, "apr_dbd_%s.so", name);
 #endif

Modified: apr/apr-util/branches/1.2.x/include/apu.hnw
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/include/apu.hnw?view=diff&rev=551983&r1=551982&r2=551983
==============================================================================
--- apr/apr-util/branches/1.2.x/include/apu.hnw (original)
+++ apr/apr-util/branches/1.2.x/include/apu.hnw Fri Jun 29 11:08:58 2007
@@ -80,5 +80,10 @@
 #define APU_HAVE_ICONV         1
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+/* 
+ * Hack to enable dynamic loads within apr_dbd
+ */
+#define APR_DSO_BUILD APR_HAS_DSO
+
 #endif /* APU_H */
 /** @} */



Re: svn commit: r551983 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd.c

Posted by Guenter Knauf <fu...@apache.org>.
Hi,
if nobody objects I will soon commit the following patch to both 1.3.x / 1.2.x trunk;
this moves the dbd driver name to platform-own apu.h header files, and removes the ifdefs in apr_dbd.c:
############################################################################# 
--- dbd\apr_dbd.c.orig	Wed Jun 27 14:53:02 2007
+++ dbd\apr_dbd.c	Tue Jul 03 16:14:40 2007
@@ -150,19 +150,12 @@
     /* The driver DSO must have exactly the same lifetime as the
      * drivers hash table; ignore the passed-in pool */
     pool = apr_hash_pool_get(drivers);
-
-#ifdef WIN32
-    sprintf(path, "apr_dbd_%s.dll", name);
-#elif defined(NETWARE)
-    apr_snprintf(path, sizeof path, "dbd%s.nlm", name);
-#else
-    apr_snprintf(path, sizeof path, APU_DSO_LIBDIR "/apr_dbd_%s.so", name);
-#endif
+    apr_snprintf(path, sizeof path, APU_DBD_DRIVER_FMT, name);
     rv = apr_dso_load(&dlhandle, path, pool);
     if (rv != APR_SUCCESS) { /* APR_EDSOOPEN */
         goto unlock;
     }
-    sprintf(path, "apr_dbd_%s_driver", name);
+    apr_snprintf(path, sizeof path, "apr_dbd_%s_driver", name);
     rv = apr_dso_sym(&symbol, dlhandle, path);
     if (rv != APR_SUCCESS) { /* APR_ESYMNOTFOUND */
         apr_dso_unload(dlhandle);
############################################################################# 
--- include\apu.h.in.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.h.in	Tue Jul 03 16:13:06 2007
@@ -88,5 +88,7 @@
 #define APU_HAVE_ICONV         @have_iconv@
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT APU_DSO_LIBDIR "/apr_dbd_%s.so"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hnw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hnw	Tue Jul 03 16:12:34 2007
@@ -82,5 +82,7 @@
 #define APU_HAVE_ICONV         1
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT "dbd%s.nlm"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hw	Tue Jul 03 16:11:18 2007
@@ -109,5 +109,7 @@
 #define APU_HAVE_SQLITE3    0
 #endif
 
+#define APU_DBD_DRIVER_FMT "apr_dbd_%s.dll"
+
 #endif /* APU_H */
 #endif /* WIN32 */
############################################################################# 

Guenter.



Re: svn commit: r551983 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd.c

Posted by Guenter Knauf <fu...@apache.org>.
> --- apr/apr-util/branches/1.2.x/dbd/apr_dbd.c (original)
> +++ apr/apr-util/branches/1.2.x/dbd/apr_dbd.c Fri Jun 29 11:08:58 2007
> @@ -126,6 +126,8 @@

>  #ifdef WIN32
>      sprintf(path, "apr_dbd_%s.dll", name);
> +#elif defined(NETWARE)
> +    sprintf(path, "dbd%s.nlm", name);
>  #else
>      sprintf(path, "apr_dbd_%s.so", name);
>  #endif
this part looks in apr-util 1.3.x trunk:

#ifdef WIN32
    sprintf(path, "apr_dbd_%s.dll", name);
#elif defined(NETWARE)
    apr_snprintf(path, sizeof path, "dbd%s.nlm", name);
#else
    apr_snprintf(path, sizeof path, APU_DSO_LIBDIR "/apr_dbd_%s.so", name);
#endif

I think that we should use in 1.3.x also apr_snprintf() for the WIN32 load;
and that we use same in 1.2.x

Guenter.