>>>> "Travis" == Travis
<xemacs(a)castle.fastmail.fm> writes:
Travis> I'm trying to compile xemacs-21.5.11 on AIX 5.1 and am
Travis> stuck on this compiler error:
There is a generic bug in Berkeley db 4.1 that it does not handle use
of "const" with some "nearly conforming" compilers correctly. The
problem is that these compilers do not define __STDC__ at all. The
best we have come up with is to identify those compilers and special
case them in db.h.
The fix for AIX, if you can and wish to apply it to db.h in the
Berkeley db sources and rebuild libdb, is
*** dbinc/db.in.orig Fri Sep 6 09:31:57 2002
--- dbinc/db.in Thu Feb 20 14:57:38 2003
***************
*** 43,49 ****
* files won't compile.
*/
#undef __P
! #if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
#define __P(protos) protos /* ANSI C prototypes */
#else
#define const
--- 43,49 ----
* files won't compile.
*/
#undef __P
! #if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) || defined(_AIX)
#define __P(protos) protos /* ANSI C prototypes */
#else
#define const
I do not know if the libdb developers plan to do this in future
revisions of libdb. You'd have to ask them.
If you prefer to, or must, patch XEmacs, the following patch is
recommended as "safe" to apply to src/database.c. This patch will
probably be applied to future revisions of the 21.5 tree, but of
course patching XEmacs won't prevent similar problems from occurring
with other applications that use libdb.
2003-02-14 Martin Buchholz <martin(a)xemacs.org>
* database.c: Berkeley DB wants __STDC__ to be defined.
Index: src/database.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/database.c,v
retrieving revision 1.16.2.1
diff -u -r1.16.2.1 database.c
--- src/database.c 2002/12/12 06:21:31 1.16.2.1
+++ src/database.c 2003/02/14 15:41:44
@@ -53,6 +53,10 @@
#endif /* WE_DONT_NEED_QUADS */
#endif /* HAVE_INTTYPES_H */
#endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
+/* Berkeley DB wants __STDC__ to be defined; else if does `#define const' */
+#if ! defined (__STDC__) && ! defined(__cplusplus)
+#define __STDC__ 0
+#endif
#include DB_H_FILE /* Berkeley db's header file */
#ifndef DB_VERSION_MAJOR
# define DB_VERSION_MAJOR 1
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.