- out if a typedef has been done. All of the typedef's are grouped
- at the top of compat.h, your compile errors will tell you which
- ones you need.
-
-Some other problems:
- You may see warning messages about illegal pointer combinations.
- It's because systems prototype malloc, calloc and realloc in
- different places. If you want to stop the warnings, find out
- where your system prototypes them, and include it in compat.h,
- or, just prototype them yourself.
-
- The dbopen(3) routines also use the snprintf(3) function. If
- you don't have this function, change the snprintf() call in
- btree/bt_open.c:tmp() from snprintf() to sprintf(), making sure
- to delete the SECOND argument, the size of the buffer.
-
-To install:
- Programs using the dbopen(3) interface have to include db.h.
- To install the library, you'll need to put db.h (found in the
- directory PORT/include) and the library libdb.a in some place
- accesible to your program.
+ out if a typedef has been done. Your compile errors should
+ give you a good indication of which ones you need.
+
+You may see warning messages about illegal pointer combinations. Systems
+prototype malloc, calloc and realloc in different places, and the missing
+prototypes will produce such warnings. You may also see lots of warning
+messages about #define's being redefined. These can mostly be ignored.
+In general, I ignore all warning messages until something doesn't work.
+Some systems produce thousands of lines of completely useless warnings.
+
+The other parts of the PORT directory are as follows:
+
+ The directory PORT/clib is a set of functions that the 4.4BSD
+ C library had and which your system may not have. They are
+ added to the MISC line of the Makefile if they aren't defined
+ when you try and load libdb.a.
+
+ The directory PORT/include is header files that the 4.4BSD
+ system had which your system may not have. There is also
+ one really important extra one, named compat.h, which is a
+ set of compatibility work-arounds that you'll almost certainly
+ have to copy and modify for a new system.
+
+ The symbolic link PORT/sys points to the PORT/include directory
+ so that includes of the form <sys/include.h> work.
+
+Some of the more common portability problems:
+
+ If you don't have:
+
+ memmove(3): add memmove.o
+ mkstemp(3): add mktemp.o
+
+ ... to the MISC line in the Makefile.
+
+ If realloc(3) of a NULL pointer on your system isn't the same
+ as a malloc(3) call, add realloc.o to the MISC line in the
+ Makefile.
+
+ If you don't have snprintf/vsnprintf(3), add snprintf.o to the
+ MISC line in the Makefile. This workaround depends on your
+ system having vsprintf(3) -- if you don't, there's no workaround
+ other than changing the source code to not use the snprintf calls.
+ If you have to make that change, check to see if your vsprintf
+ returns a length or a char *; if it's the latter, make sure you
+ set VSPRINTF_CHARSTAR in the MACH/include/compat.h file.
+
+Installing the DB library:
+
+ The Makefile builds a C library named libdb.a. This file needs
+ to be installed in a place where the loader will automatically
+ look for it (or, if you're building it for a single project,
+ wherever that project's Makefile loads it from).
+
+ In addition, the header file PORT/include/db.h must be copied to
+ a directory (often /usr/include/) where programs that use the
+ db package can include it in their source. (If you intend to use
+ the ndbm interface to libdb, you'll need to copy the header file
+ PORT/include/ndbm.h as well.)