[net.bugs.4bsd] libdbm is broken in 4.2

mark@cbosgd.UUCP (11/22/83)

If you try to compile any program in 4.2BSD using -ldbm, you'll
get the following diagnostics:
	_environ: ld:/usr/lib/libdbm.a: multiply defined
	start: /usr/lib/libdbm.a: multiply defined
	_moncontrol: /usr/lib/libdbm.a: multiply defined
	mcount: /usr/lib/libdbm.a: multiply defined
It turns out the problem is the makefile, which loads (with libc)
the dbm.o file and installs that as libdbm.a instead of the usual
archive of object files.  Here is the fix:

*** 2,10
  #
  CFLAGS=-O
  
! libdbm.a: dbm.c
! libdbm.a: dbm.h
! 	${CC} -o libdbm.a ${CFLAGS} dbm.c
  
  install:
  	install -m 644 libdbm.a $(DESTDIR)/usr/lib

--- 2,12 -----
  #
  CFLAGS=-O
  
! libdbm.a: dbm.o
! 	ar rv libdbm.a dbm.o
! 
! dbm.o: dbm.h dbm.c
! 	${CC} -c ${CFLAGS} dbm.c
  
  install:
  	install -m 644 libdbm.a $(DESTDIR)/usr/lib

pag@hao.UUCP (Peter Gross) (11/30/83)

In Mark's fix to the libdbm Makefile, he omitted the ranlib of the
created archive.  Thus,

change
	libdbm.a: dbm.o
		ar rv libdbm.a dbm.o
to
	libdbm.a: dbm.o
		ar rv libdbm.a dbm.o
		ranlib libdbm.a

--peter