From owner-freebsd-ports Mon Apr 22 02:35:01 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA25208 for ports-outgoing; Mon, 22 Apr 1996 02:35:01 -0700 (PDT) Received: from nixpbe.pdb.sni.de (mail.sni.de [192.109.2.33]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id CAA25197 for ; Mon, 22 Apr 1996 02:34:47 -0700 (PDT) Received: (from nerv@localhost) by nixpbe.pdb.sni.de (8.6.12/8.6.12) id LAA07455 for freebsd-ports@freebsd.org; Mon, 22 Apr 1996 11:34:37 +0200 Message-Id: <199604220934.LAA07455@nixpbe.pdb.sni.de> Subject: Re: Berkeley DB 1.8.5 To: michael@memra.com (Michael Dillon) Date: Mon, 22 Apr 96 11:34:35 MDT From: Greg Lehey Cc: freebsd-ports@freebsd.org In-Reply-To: ; from "Michael Dillon" at Apr 21, 96 11:19 pm X-Mailer: xmail 2.4 (based on ELM 2.2 PL16) Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > Has anyone ported this to 2.1R? I unpack the source code from > ftp.cs.berkeley.edu, go into the PORT/bsd.4.4 and type "make". > It dies quickly with a bunch of errors like... > > cc -c -D__DBINTERFACE_PRIVATE -O -I. -Iinclude -I../../hash > ../../hash/hash.c > In file included from ../../hash/hash.c:48: > /usr/include/stdlib.h:80: parse error before `__dead2' > /usr/include/stdlib.h:80: warning: data definition has no type or storage > class > (etc) > > I can't figure out what is happening. I realize that this is integrated > into the libc for -current but I don't want to upgrade my whole system > just to get this one library. If it needs some different treatment than > BSD 4.4, why doesn't somebody send them patches so they can add a freebsd > option in their PORT directory? This has nothing to do with the library itself. For some reason, the compiler is getting confused by the definitions in the library header files. Try looking at the preprocessor output: cc -c -D__DBINTERFACE_PRIVATE -O -I. -Iinclude -I../../hash -C -E -dD >junk.c junk.c will contain all the header files, and will have the #defines substituted. Search for the string '@(#)stdlib.h', and then further occurrences of the name 'stdlib.h'. The lines starting with # specify line numbers within the source files. I'd guess that you'll find something obvious about the definitions at line 80 and on. For further details, see page 99-102 of my book "Porting UNIX Software" (O'Reilly). Unfortunately, the production department "embellished" this section somewhat: it contains a number of \/ sequences, which shouldn't be there and which confuse the issue somewhat. > Actually, the linux PORT seems to compile better. I get the following > errors but I think I can deal with them.... > > cc -c -D__DBINTERFACE_PRIVATE -O -I. -Iinclude -I../../hash > ../../hash/hash.c > In file included from ../../hash/hash.c:55: > include/db.h:54: redefinition of `int8_t' > /usr/include/machine/types.h:57: `int8_t' previously declared here > include/db.h:55: redefinition of `u_int8_t' > /usr/include/machine/types.h:58: `u_int8_t' previously declared here > include/db.h:56: redefinition of `int16_t' > /usr/include/machine/types.h:59: `int16_t' previously declared here > include/db.h:57: redefinition of `u_int16_t' > /usr/include/machine/types.h:60: `u_int16_t' previously declared here > include/db.h:58: redefinition of `int32_t' > /usr/include/machine/types.h:61: `int32_t' previously declared here > include/db.h:59: redefinition of `u_int32_t' > /usr/include/machine/types.h:62: `u_int32_t' previously declared here > *** Error code 1 > > I'm not on the list so you'll need to Cc: me if you want to ask anything. This one should be pretty obvious: the Linux version includes definitions in include/db.h which have already been made in the system header files. Remove them, or, better, #ifdef them out (#ifdef Linux, or whatever Linux uses to recognize its environment). Greg