From ppp Sat Aug 19 23:50:39 1995 From: gertjan@cs.vu.nl (Wingerde van GR) Subject: Patch for db 1.85 To: linux-gcc@vger.rutgers.edu Date: Fri, 18 Aug 1995 13:26:35 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL24alpha3] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 15869 Sender: owner-gcc@vger.rutgers.edu Precedence: bulk Hi everybody, Hereby I release the patch to allow all of us to compile a static and shared library of db 1.85. I have called the shared one libdb.so.1.85.2 to keep the version number compatible to the last one that was released with the libc package. I will upload binaries and the patched sources to sunsite and tsx-11. Gertjan. -- Gertjan van Wingerde home address: Student Computer Science Vrije Universiteit J.H. Dunantstraat 44 Amsterdam 1561 BD Krommenie The Netherlands e-mail: gertjan@cs.vu.nl URL: http://www.cs.vu.nl/~gertjan/ Here is the patch: diff -u --recursive --new-file db.1.85/PORT/linux/Makefile db.1.85.2/PORT/linux/Makefile --- db.1.85/PORT/linux/Makefile Wed Jul 13 21:43:16 1994 +++ db.1.85.2/PORT/linux/Makefile Thu Aug 17 22:52:50 1995 @@ -1,102 +1,229 @@ # @(#)Makefile 8.9 (Berkeley) 7/14/94 +prefix = /usr +libdir = ${prefix}/lib +includedir = ${prefix}/include + +INSTALL = install -c + +MAJ_VERSION = 1 +MIN_VERSION = 85 +TINY_VERSION = 2 +VERSION = ${MAJ_VERSION}.${MIN_VERSION}.${TINY_VERSION} + LIBDB= libdb.a -OBJ1= hash.o hash_bigkey.o hash_buf.o hash_func.o hash_log2.o hash_page.o \ - hsearch.o ndbm.o -OBJ2= bt_close.o bt_conv.o bt_debug.o bt_delete.o bt_get.o bt_open.o \ - bt_overflow.o bt_page.o bt_put.o bt_search.o bt_seq.o bt_split.o \ - bt_utils.o -OBJ3= db.o -OBJ4= mpool.o -OBJ5= rec_close.o rec_delete.o rec_get.o rec_open.o rec_put.o rec_search.o \ - rec_seq.o rec_utils.o +SHLIBDB= libdb.so + +OBJ1= static/hash.o static/hash_bigkey.o static/hash_buf.o \ + static/hash_func.o static/hash_log2.o static/hash_page.o \ + static/hsearch.o static/ndbm.o +OBJ2= static/bt_close.o static/bt_conv.o static/bt_debug.o \ + static/bt_delete.o static/bt_get.o static/bt_open.o \ + static/bt_overflow.o static/bt_page.o static/bt_put.o \ + static/bt_search.o static/bt_seq.o static/bt_split.o static/bt_utils.o +OBJ3= static/db.o +OBJ4= static/mpool.o +OBJ5= static/rec_close.o static/rec_delete.o static/rec_get.o \ + static/rec_open.o static/rec_put.o static/rec_search.o \ + static/rec_seq.o static/rec_utils.o +MISC= static/snprintf.o + +SHOBJ1= shared/hash.o shared/hash_bigkey.o shared/hash_buf.o \ + shared/hash_func.o shared/hash_log2.o shared/hash_page.o \ + shared/hsearch.o shared/ndbm.o +SHOBJ2= shared/bt_close.o shared/bt_conv.o shared/bt_debug.o \ + shared/bt_delete.o shared/bt_get.o shared/bt_open.o \ + shared/bt_overflow.o shared/bt_page.o shared/bt_put.o \ + shared/bt_search.o shared/bt_seq.o shared/bt_split.o shared/bt_utils.o +SHOBJ3= shared/db.o +SHOBJ4= shared/mpool.o +SHOBJ5= shared/rec_close.o shared/rec_delete.o shared/rec_get.o \ + shared/rec_open.o shared/rec_put.o shared/rec_search.o \ + shared/rec_seq.o shared/rec_utils.o +SHMISC= shared/snprintf.o -MISC= snprintf.o +all: ${LIBDB} ${SHLIBDB} ${LIBDB}: ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} rm -f $@ - ar cq $@ \ - `lorder ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} | tsort` + ar cq $@ ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} ranlib $@ +${SHLIBDB}: ${SHOBJ1} ${SHOBJ2} ${SHOBJ3} ${SHOBJ4} ${SHOBJ5} ${SHMISC} + rm -f $@.${VERSION} + gcc -shared -o $@.${VERSION} \ + ${SHOBJ1} ${SHOBJ2} ${SHOBJ3} ${SHOBJ4} ${SHOBJ5} ${SHMISC} \ + -Wl,-soname,$@.${MAJ_VERSION} + +install: + -mkdir ${libdir} + -mkdir ${includedir} + ${INSTALL} -m 644 ${LIBDB} ${libdir}/${LIBDB} + ${INSTALL} -m 755 ${SHLIBDB}.${VERSION} ${libdir}/${SHLIBDB}.${VERSION} + ldconfig -n ${libdir} + ${INSTALL} -m 644 include/mpool.h ${includedir}/mpool.h + ${INSTALL} -m 644 include/db.h ${includedir}/db.h + ${INSTALL} -m 644 include/ndbm.h ${includedir}/ndbm.h + ${INSTALL} -m 644 include/compat.h ${includedir}/compat.h + clean: - rm -f ${LIBDB} ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} + rm -f ${LIBDB} ${SHLIBDB}.${VERSION} + rm -f ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} + rm -f ${SHOBJ1} ${SHOBJ2} ${SHOBJ3} ${SHOBJ3} ${SHOBJ4} ${SHOBJ5} \ + ${SHMISC} -OORG= -O +OORG= -O2 CL= ${CC} -c -D__DBINTERFACE_PRIVATE ${OORG} -I. -Iinclude +CS= ${CC} -fPIC -c -D__DBINTERFACE_PRIVATE ${OORG} -I. -Iinclude -hash.o: ../../hash/hash.c - ${CL} -I../../hash ../../hash/hash.c -hash_bigkey.o: ../../hash/hash_bigkey.c - ${CL} -I../../hash ../../hash/hash_bigkey.c -hash_buf.o: ../../hash/hash_buf.c - ${CL} -I../../hash ../../hash/hash_buf.c -hash_func.o: ../../hash/hash_func.c - ${CL} -I../../hash ../../hash/hash_func.c -hash_log2.o: ../../hash/hash_log2.c - ${CL} -I../../hash ../../hash/hash_log2.c -hash_page.o: ../../hash/hash_page.c - ${CL} -I../../hash ../../hash/hash_page.c -hsearch.o: ../../hash/hsearch.c - ${CL} -I../../hash ../../hash/hsearch.c -ndbm.o: ../../hash/ndbm.c - ${CL} -I../../hash ../../hash/ndbm.c - -bt_close.o: ../../btree/bt_close.c - ${CL} -I../../btree ../../btree/bt_close.c -bt_conv.o: ../../btree/bt_conv.c - ${CL} -I../../btree ../../btree/bt_conv.c -bt_debug.o: ../../btree/bt_debug.c - ${CL} -I../../btree ../../btree/bt_debug.c -bt_delete.o: ../../btree/bt_delete.c - ${CL} -I../../btree ../../btree/bt_delete.c -bt_get.o: ../../btree/bt_get.c - ${CL} -I../../btree ../../btree/bt_get.c -bt_open.o: ../../btree/bt_open.c - ${CL} -I../../btree ../../btree/bt_open.c -bt_overflow.o: ../../btree/bt_overflow.c - ${CL} -I../../btree ../../btree/bt_overflow.c -bt_page.o: ../../btree/bt_page.c - ${CL} -I../../btree ../../btree/bt_page.c -bt_put.o: ../../btree/bt_put.c - ${CL} -I../../btree ../../btree/bt_put.c -bt_search.o: ../../btree/bt_search.c - ${CL} -I../../btree ../../btree/bt_search.c -bt_seq.o: ../../btree/bt_seq.c - ${CL} -I../../btree ../../btree/bt_seq.c -bt_split.o: ../../btree/bt_split.c - ${CL} -I../../btree ../../btree/bt_split.c -bt_stack.o: ../../btree/bt_stack.c - ${CL} -I../../btree ../../btree/bt_stack.c -bt_utils.o: ../../btree/bt_utils.c - ${CL} -I../../btree ../../btree/bt_utils.c - -db.o: ../../db/db.c - ${CL} ../../db/db.c - -mpool.o: ../../mpool/mpool.c - ${CL} -I../../mpool ../../mpool/mpool.c - -rec_close.o: ../../recno/rec_close.c - ${CL} -I../../recno ../../recno/rec_close.c -rec_delete.o: ../../recno/rec_delete.c - ${CL} -I../../recno ../../recno/rec_delete.c -rec_get.o: ../../recno/rec_get.c - ${CL} -I../../recno ../../recno/rec_get.c -rec_open.o: ../../recno/rec_open.c - ${CL} -I../../recno ../../recno/rec_open.c -rec_put.o: ../../recno/rec_put.c - ${CL} -I../../recno ../../recno/rec_put.c -rec_search.o: ../../recno/rec_search.c - ${CL} -I../../recno ../../recno/rec_search.c -rec_seq.o: ../../recno/rec_seq.c - ${CL} -I../../recno ../../recno/rec_seq.c -rec_utils.o: ../../recno/rec_utils.c - ${CL} -I../../recno ../../recno/rec_utils.c - -memmove.o: - ${CC} -DMEMMOVE -c -O -I. -Iinclude clib/memmove.c -mktemp.o: - ${CC} -c -O -I. -Iinclude clib/mktemp.c -snprintf.o: - ${CC} -c -O -I. -Iinclude clib/snprintf.c +static/hash.o: ../../hash/hash.c + ${CL} -I../../hash ../../hash/hash.c -o $@ +static/hash_bigkey.o: ../../hash/hash_bigkey.c + ${CL} -I../../hash ../../hash/hash_bigkey.c -o $@ +static/hash_buf.o: ../../hash/hash_buf.c + ${CL} -I../../hash ../../hash/hash_buf.c -o $@ +static/hash_func.o: ../../hash/hash_func.c + ${CL} -I../../hash ../../hash/hash_func.c -o $@ +static/hash_log2.o: ../../hash/hash_log2.c + ${CL} -I../../hash ../../hash/hash_log2.c -o $@ +static/hash_page.o: ../../hash/hash_page.c + ${CL} -I../../hash ../../hash/hash_page.c -o $@ +static/hsearch.o: ../../hash/hsearch.c + ${CL} -I../../hash ../../hash/hsearch.c -o $@ +static/ndbm.o: ../../hash/ndbm.c + ${CL} -I../../hash ../../hash/ndbm.c -o $@ + +static/bt_close.o: ../../btree/bt_close.c + ${CL} -I../../btree ../../btree/bt_close.c -o $@ +static/bt_conv.o: ../../btree/bt_conv.c + ${CL} -I../../btree ../../btree/bt_conv.c -o $@ +static/bt_debug.o: ../../btree/bt_debug.c + ${CL} -I../../btree ../../btree/bt_debug.c -o $@ +static/bt_delete.o: ../../btree/bt_delete.c + ${CL} -I../../btree ../../btree/bt_delete.c -o $@ +static/bt_get.o: ../../btree/bt_get.c + ${CL} -I../../btree ../../btree/bt_get.c -o $@ +static/bt_open.o: ../../btree/bt_open.c + ${CL} -I../../btree ../../btree/bt_open.c -o $@ +static/bt_overflow.o: ../../btree/bt_overflow.c + ${CL} -I../../btree ../../btree/bt_overflow.c -o $@ +static/bt_page.o: ../../btree/bt_page.c + ${CL} -I../../btree ../../btree/bt_page.c -o $@ +static/bt_put.o: ../../btree/bt_put.c + ${CL} -I../../btree ../../btree/bt_put.c -o $@ +static/bt_search.o: ../../btree/bt_search.c + ${CL} -I../../btree ../../btree/bt_search.c -o $@ +static/bt_seq.o: ../../btree/bt_seq.c + ${CL} -I../../btree ../../btree/bt_seq.c -o $@ +static/bt_split.o: ../../btree/bt_split.c + ${CL} -I../../btree ../../btree/bt_split.c -o $@ +static/bt_stack.o: ../../btree/bt_stack.c + ${CL} -I../../btree ../../btree/bt_stack.c -o $@ +static/bt_utils.o: ../../btree/bt_utils.c + ${CL} -I../../btree ../../btree/bt_utils.c -o $@ + +static/db.o: ../../db/db.c + ${CL} ../../db/db.c -o $@ + +static/mpool.o: ../../mpool/mpool.c + ${CL} -I../../mpool ../../mpool/mpool.c -o $@ + +static/rec_close.o: ../../recno/rec_close.c + ${CL} -I../../recno ../../recno/rec_close.c -o $@ +static/rec_delete.o: ../../recno/rec_delete.c + ${CL} -I../../recno ../../recno/rec_delete.c -o $@ +static/rec_get.o: ../../recno/rec_get.c + ${CL} -I../../recno ../../recno/rec_get.c -o $@ +static/rec_open.o: ../../recno/rec_open.c + ${CL} -I../../recno ../../recno/rec_open.c -o $@ +static/rec_put.o: ../../recno/rec_put.c + ${CL} -I../../recno ../../recno/rec_put.c -o $@ +static/rec_search.o: ../../recno/rec_search.c + ${CL} -I../../recno ../../recno/rec_search.c -o $@ +static/rec_seq.o: ../../recno/rec_seq.c + ${CL} -I../../recno ../../recno/rec_seq.c -o $@ +static/rec_utils.o: ../../recno/rec_utils.c + ${CL} -I../../recno ../../recno/rec_utils.c -o $@ + +static/memmove.o: + ${CC} -DMEMMOVE -c -O -I. -Iinclude clib/memmove.c -o $@ +static/mktemp.o: + ${CC} -c -O -I. -Iinclude clib/mktemp.c -o $@ +static/snprintf.o: + ${CC} -c -O -I. -Iinclude clib/snprintf.c -o $@ + +shared/hash.o: ../../hash/hash.c + ${CS} -I../../hash ../../hash/hash.c -o $@ +shared/hash_bigkey.o: ../../hash/hash_bigkey.c + ${CS} -I../../hash ../../hash/hash_bigkey.c -o $@ +shared/hash_buf.o: ../../hash/hash_buf.c + ${CS} -I../../hash ../../hash/hash_buf.c -o $@ +shared/hash_func.o: ../../hash/hash_func.c + ${CS} -I../../hash ../../hash/hash_func.c -o $@ +shared/hash_log2.o: ../../hash/hash_log2.c + ${CS} -I../../hash ../../hash/hash_log2.c -o $@ +shared/hash_page.o: ../../hash/hash_page.c + ${CS} -I../../hash ../../hash/hash_page.c -o $@ +shared/hsearch.o: ../../hash/hsearch.c + ${CS} -I../../hash ../../hash/hsearch.c -o $@ +shared/ndbm.o: ../../hash/ndbm.c + ${CS} -I../../hash ../../hash/ndbm.c -o $@ + +shared/bt_close.o: ../../btree/bt_close.c + ${CS} -I../../btree ../../btree/bt_close.c -o $@ +shared/bt_conv.o: ../../btree/bt_conv.c + ${CS} -I../../btree ../../btree/bt_conv.c -o $@ +shared/bt_debug.o: ../../btree/bt_debug.c + ${CS} -I../../btree ../../btree/bt_debug.c -o $@ +shared/bt_delete.o: ../../btree/bt_delete.c + ${CS} -I../../btree ../../btree/bt_delete.c -o $@ +shared/bt_get.o: ../../btree/bt_get.c + ${CS} -I../../btree ../../btree/bt_get.c -o $@ +shared/bt_open.o: ../../btree/bt_open.c + ${CS} -I../../btree ../../btree/bt_open.c -o $@ +shared/bt_overflow.o: ../../btree/bt_overflow.c + ${CS} -I../../btree ../../btree/bt_overflow.c -o $@ +shared/bt_page.o: ../../btree/bt_page.c + ${CS} -I../../btree ../../btree/bt_page.c -o $@ +shared/bt_put.o: ../../btree/bt_put.c + ${CS} -I../../btree ../../btree/bt_put.c -o $@ +shared/bt_search.o: ../../btree/bt_search.c + ${CS} -I../../btree ../../btree/bt_search.c -o $@ +shared/bt_seq.o: ../../btree/bt_seq.c + ${CS} -I../../btree ../../btree/bt_seq.c -o $@ +shared/bt_split.o: ../../btree/bt_split.c + ${CS} -I../../btree ../../btree/bt_split.c -o $@ +shared/bt_stack.o: ../../btree/bt_stack.c + ${CS} -I../../btree ../../btree/bt_stack.c -o $@ +shared/bt_utils.o: ../../btree/bt_utils.c + ${CS} -I../../btree ../../btree/bt_utils.c -o $@ + +shared/db.o: ../../db/db.c + ${CS} ../../db/db.c -o $@ + +shared/mpool.o: ../../mpool/mpool.c + ${CS} -I../../mpool ../../mpool/mpool.c -o $@ + +shared/rec_close.o: ../../recno/rec_close.c + ${CS} -I../../recno ../../recno/rec_close.c -o $@ +shared/rec_delete.o: ../../recno/rec_delete.c + ${CS} -I../../recno ../../recno/rec_delete.c -o $@ +shared/rec_get.o: ../../recno/rec_get.c + ${CS} -I../../recno ../../recno/rec_get.c -o $@ +shared/rec_open.o: ../../recno/rec_open.c + ${CS} -I../../recno ../../recno/rec_open.c -o $@ +shared/rec_put.o: ../../recno/rec_put.c + ${CS} -I../../recno ../../recno/rec_put.c -o $@ +shared/rec_search.o: ../../recno/rec_search.c + ${CS} -I../../recno ../../recno/rec_search.c -o $@ +shared/rec_seq.o: ../../recno/rec_seq.c + ${CS} -I../../recno ../../recno/rec_seq.c -o $@ +shared/rec_utils.o: ../../recno/rec_utils.c + ${CS} -I../../recno ../../recno/rec_utils.c -o $@ + +shared/memmove.o: + ${CC} -fPIC -DMEMMOVE -c -O -I. -Iinclude clib/memmove.c -o $@ +shared/mktemp.o: + ${CC} -fPIC -c -O -I. -Iinclude clib/mktemp.c -o $@ +shared/snprintf.o: + ${CC} -fPIC -c -O -I. -Iinclude clib/snprintf.c -o $@ diff -u --recursive --new-file db.1.85/PORT/linux/shared/.shared db.1.85.2/PORT/linux/shared/.shared --- db.1.85/PORT/linux/shared/.shared Wed Dec 31 19:00:00 1969 +++ db.1.85.2/PORT/linux/shared/.shared Thu Aug 17 09:23:33 1995 @@ -0,0 +1,2 @@ +File to make shared directory. + diff -u --recursive --new-file db.1.85/PORT/linux/static/.static db.1.85.2/PORT/linux/static/.static --- db.1.85/PORT/linux/static/.static Wed Dec 31 19:00:00 1969 +++ db.1.85.2/PORT/linux/static/.static Thu Aug 17 09:23:52 1995 @@ -0,0 +1 @@ +File to create static directory. diff -u --recursive --new-file db.1.85/README.linux db.1.85.2/README.linux --- db.1.85/README.linux Wed Dec 31 19:00:00 1969 +++ db.1.85.2/README.linux Thu Aug 17 10:04:05 1995 @@ -0,0 +1,18 @@ +INSTALLATION + +- cd to the directory PORT/linux + +- take a glance at the Makefile to set the installation prefix and the + other things. Check whether they are correct. If not change them. + +- make all + +- make install + +- Now everything is compiled and installed. + + Gertjan + +Gertjan van Wingerde + + diff -u --recursive --new-file db.1.85/changelog db.1.85.2/changelog --- db.1.85/changelog Thu Sep 1 18:07:47 1994 +++ db.1.85.2/changelog Thu Aug 17 10:05:53 1995 @@ -1,3 +1,8 @@ +1.85 -> 1.85.2 + PORT: Applied patch for linux. Made changes to the Makefile + of the linux directory to make shared library and to + install things. + 1.84 -> 1.85 recno: #ifdef out use of mmap, it's not portable enough. diff -u --recursive --new-file db.1.85/include/db.h db.1.85.2/include/db.h --- db.1.85/include/db.h Tue Jun 21 15:59:28 1994 +++ db.1.85.2/include/db.h Thu Aug 17 22:37:10 1995 @@ -36,8 +36,8 @@ #ifndef _DB_H_ #define _DB_H_ +#include #include -#include #include diff -u --recursive --new-file db.1.85/recno/rec_open.c db.1.85.2/recno/rec_open.c --- db.1.85/recno/rec_open.c Thu Sep 1 16:39:42 1994 +++ db.1.85.2/recno/rec_open.c Thu Aug 17 07:45:05 1995 @@ -167,9 +167,24 @@ * for now. */ t->bt_msize = sb.st_size; +/* + * hack : + * + * The Linux kernel mmap() semantics are broken : + * + * Under Linux, read only private mappings cause write only and read/write + * opens to fail with errno=ETXTBSY. Shared read only mappings should work + * fine though, but I'm not familiar enough with the code to ascertain that + * a MAP_SHARED mapping would be safe so I use the non-mmap'd version + * instead. + * + */ + +#if !defined(linux) if ((t->bt_smap = mmap(NULL, t->bt_msize, PROT_READ, MAP_PRIVATE, rfd, (off_t)0)) == (caddr_t)-1) +#endif goto slow; t->bt_cmap = t->bt_smap; t->bt_emap = t->bt_smap + sb.st_size;