[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: db3 now in unstable



On Thu, Mar 15, 2001 at 10:49:59AM -0500, Richard A Nelson wrote:
> On Thu, 15 Mar 2001, Ben Collins wrote:
> 
> > The kernel does this because that is what redhat does. The default db3
> > install is in /usr/include. I really don't want to move it though.
> > People would really like to see libdb3-dev and libdb2-dev installable at
> > the same time, which I think is a bad thing because you never know which
> > one the configure script will pick up. I'd rather leave it as is.
> 
> I don't care if both are available, but with what (little) I know about
> autoconf, I don't see any other way for me to determine which version of
> db to use for compilation/linking.
> 
> I currently support building on sid, woody, potato, and it used to work
> on slink - but I no longer have a chroot for that (I do have the CD, is
> there still an archive to update slink?).
> 
> Detecting db2 vs db1 was trivial, but now I can't even do that - all I know
> is that it is:
>   db2 iff /usr/include/db2/db.h exists
>   db1 *or* db3 otherwise

I just showed you. How difficult is that? Also, you don't even need to
detect it in autoconf, you detect it in your code:

	#if DB_VERSION_MAJOR == 1
	...
	#elif DB_VERSION_MAJOR == 2
	...
	#elif DB_VERSION_MAJOR == 3
	...
	#else
	#error Cannot determine db major version
	#endif

Was that hard? Is it too complex? If you need to detect it in autoconf,
compile this code and use it's output:

	#include <db.h>
	#include <stdio.h>
	int main() { printf("%d\n", DB_VERSION_MAJOR); exit(0); }

Then use that output like this:

	db_ver=`./conftest`
	LIBS="$LIBS -ldb${db_ver}"

Let's show some creativity here.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: