libdbm is broken in 4.2

mark at cbosgd.UUCP mark at cbosgd.UUCP
Tue Nov 22 14:53:00 AEST 1983


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



More information about the Comp.bugs.4bsd.ucb-fixes mailing list