[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] fix windows build (urgent)

From: Russell Yanofsky <rey4_at_columbia.edu>
Date: 2003-11-02 20:13:23 CET

Background:

In rev 7560, the fs library was changed to include the berkeley db header
indirectly through the apr-util library instead of directly through
"#include <db.h>" statements. This change allowed us to remove our
complicated and error prone bdb detection code from our configure script and
instead use information from apr-util.

Problem:

On Windows, apr-util is built without bdb, so trying to include bdb through
the apr-util headers has no effect.

Temporary Fix:

The attached patch changes fs library headers to detect when apu-util is
built without bdb (via the APU_HAVE_DB macro), and to fall back to the old
behavior of including <db.h> when it is.

Permanent Fix:

Branko has offered to write a perl script that will make it possible to
automatically build apr-util with bdb on windows. Also, it may be possible
to tweak the apr-util configure script so we can go back to saying #include
<db.h> instead of using the apr-util headers to do this for us. Either way,
we'll be able to remove the temporary fix when there's a new version of apr.

Log Message:

Allow fs library to include bdb headers on Windows even when the apr-util
library is built without bdb (the default behavior). These changes fix the
Windows build which got broken in rev 7560. They'll probably be able to be
removed when there's a new release of apr.

* subversion\libsvn_fs\bdb\bdb-err.c
* subversion\libsvn_fs\bdb\bdb_compat.h
* subversion\libsvn_fs\bdb\changes-table.h
* subversion\libsvn_fs\bdb\dbt.c
* subversion\libsvn_fs\bdb\dbt.h
* subversion\libsvn_fs\bdb\nodes-table.h
* subversion\libsvn_fs\bdb\reps-table.h
* subversion\libsvn_fs\bdb\rev-table.h
* subversion\libsvn_fs\bdb\strings-table.h
* subversion\libsvn_fs\bdb\uuids-table.h
* subversion\libsvn_fs\fs.c
* subversion\libsvn_fs\fs.h
* subversion\libsvn_fs\node-rev.c
* subversion\libsvn_fs\node-rev.h
* subversion\libsvn_fs\reps-strings.c
* subversion\libsvn_fs\reps-strings.h
* subversion\libsvn_fs\revs-txns.h
* subversion\libsvn_fs\trail.c
* subversion\libsvn_fs\trail.h
* subversion\libsvn_fs\util\fs_skels.h
    include <db.h> directory when apr-util is built without bdb

* build\generator\gen_win.py
  (WinGeneratorBase.get_win_defines):
    stop trying to define APU_HAVE_DB=1. This doesn't work because the
    value gets overwritten in apu.h

Patch:

Index: subversion/libsvn_fs/reps-strings.c
===================================================================
--- subversion/libsvn_fs/reps-strings.c (revision 7607)
+++ subversion/libsvn_fs/reps-strings.c (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"
 #include "svn_pools.h"
Index: subversion/libsvn_fs/reps-strings.h
===================================================================
--- subversion/libsvn_fs/reps-strings.h (revision 7607)
+++ subversion/libsvn_fs/reps-strings.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_io.h"
 #include "svn_fs.h"
Index: subversion/libsvn_fs/bdb/bdb_compat.h
===================================================================
--- subversion/libsvn_fs/bdb/bdb_compat.h (revision 7607)
+++ subversion/libsvn_fs/bdb/bdb_compat.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #ifdef __cplusplus
 extern "C" {
Index: subversion/libsvn_fs/bdb/changes-table.h
===================================================================
--- subversion/libsvn_fs/bdb/changes-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/changes-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_io.h"
 #include "svn_fs.h"
Index: subversion/libsvn_fs/bdb/nodes-table.h
===================================================================
--- subversion/libsvn_fs/bdb/nodes-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/nodes-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"
 #include "../trail.h"
Index: subversion/libsvn_fs/bdb/reps-table.h
===================================================================
--- subversion/libsvn_fs/bdb/reps-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/reps-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_io.h"
 #include "svn_fs.h"
Index: subversion/libsvn_fs/bdb/dbt.c
===================================================================
--- subversion/libsvn_fs/bdb/dbt.c (revision 7607)
+++ subversion/libsvn_fs/bdb/dbt.c (working copy)
@@ -21,6 +21,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "dbt.h"

Index: subversion/libsvn_fs/bdb/bdb-err.c
===================================================================
--- subversion/libsvn_fs/bdb/bdb-err.c (revision 7607)
+++ subversion/libsvn_fs/bdb/bdb-err.c (working copy)
@@ -23,6 +23,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_strings.h>

Index: subversion/libsvn_fs/bdb/dbt.h
===================================================================
--- subversion/libsvn_fs/bdb/dbt.h (revision 7607)
+++ subversion/libsvn_fs/bdb/dbt.h (working copy)
@@ -22,6 +22,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"
 #include "../util/skel.h"
Index: subversion/libsvn_fs/bdb/strings-table.h
===================================================================
--- subversion/libsvn_fs/bdb/strings-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/strings-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_io.h"
 #include "svn_fs.h"
Index: subversion/libsvn_fs/bdb/uuids-table.h
===================================================================
--- subversion/libsvn_fs/bdb/uuids-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/uuids-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_io.h"
 #include "svn_fs.h"
Index: subversion/libsvn_fs/bdb/rev-table.h
===================================================================
--- subversion/libsvn_fs/bdb/rev-table.h (revision 7607)
+++ subversion/libsvn_fs/bdb/rev-table.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"

Index: subversion/libsvn_fs/fs.c
===================================================================
--- subversion/libsvn_fs/fs.c (revision 7607)
+++ subversion/libsvn_fs/fs.c (working copy)
@@ -22,6 +22,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_general.h>
 #include <apr_pools.h>
Index: subversion/libsvn_fs/trail.c
===================================================================
--- subversion/libsvn_fs/trail.c (revision 7607)
+++ subversion/libsvn_fs/trail.c (working copy)
@@ -17,6 +17,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_pools.h>
 #include "svn_pools.h"
Index: subversion/libsvn_fs/fs.h
===================================================================
--- subversion/libsvn_fs/fs.h (revision 7607)
+++ subversion/libsvn_fs/fs.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_pools.h>
 #include <apr_hash.h>
Index: subversion/libsvn_fs/revs-txns.h
===================================================================
--- subversion/libsvn_fs/revs-txns.h (revision 7607)
+++ subversion/libsvn_fs/revs-txns.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"

Index: subversion/libsvn_fs/node-rev.c
===================================================================
--- subversion/libsvn_fs/node-rev.c (revision 7607)
+++ subversion/libsvn_fs/node-rev.c (working copy)
@@ -19,6 +19,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"
 #include "svn_pools.h"
Index: subversion/libsvn_fs/trail.h
===================================================================
--- subversion/libsvn_fs/trail.h (revision 7607)
+++ subversion/libsvn_fs/trail.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_pools.h>
 #include "svn_fs.h"
Index: subversion/libsvn_fs/node-rev.h
===================================================================
--- subversion/libsvn_fs/node-rev.h (revision 7607)
+++ subversion/libsvn_fs/node-rev.h (working copy)
@@ -20,6 +20,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include "svn_fs.h"
 #include "trail.h"
Index: subversion/libsvn_fs/util/fs_skels.h
===================================================================
--- subversion/libsvn_fs/util/fs_skels.h (revision 7607)
+++ subversion/libsvn_fs/util/fs_skels.h (working copy)
@@ -21,6 +21,10 @@

 #define APU_WANT_DB
 #include <apu_want.h>
+/* ### Temporary kludge to build with apr 0.9.5 and earlier on Windows */
+#if !APU_HAVE_DB
+#include <db.h>
+#endif

 #include <apr_pools.h>
 #include <apr_hash.h>
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py (revision 7607)
+++ build/generator/gen_win.py (working copy)
@@ -405,12 +405,6 @@
     elif cfg == 'Release':
       fakedefines.append("NDEBUG")

- # XXX: Check if db is present, and if so, let apr-util know
- # XXX: This is a hack until the apr build system is improved to
- # XXX: know these things for itself.
- if self.dblibname:
- fakedefines.append("APU_HAVE_DB=1")
-
     return fakedefines

   def get_win_includes(self, target, rootpath):

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 2 20:14:21 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.