Subject: Re: The infamous hidden dependencies problem
To: Johnny C. Lam <lamj@stat.cmu.edu>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-pkg
Date: 06/12/2001 16:46:59
On Thu, 7 Jun 2001, Johnny C. Lam wrote:

: > Have you thought about possibly using autoconf (on packages that use GNU
: > autoconf -- a huge number of them) to change the CHECK_LIB macro to default
: > to not finding a library unless --enable-libfoo is specified?
: >
: > Then just run autoconf as a build dependency, specify explicit
: > --enable-libfoo switches, and voila, clean build.
:
: This is a relatively cool idea, though I see some minor problems with
: it.  Firstly, you'd need to list every single library that is used by
: a package, which seems to be slightly onerous.

That's deliberate.  You *want* to do this.  Autodetection is a bad thing, as
you'll read below.

:  Secondly, you'd still have to patch a lot of configure scripts since
: not all authors use the AC_CHECK_LIB macro;

Known issue, but not very many people do this.  AC_CHECK_LIB was
specifically invented because there are some platform dependencies involved
in finding available libraries.

: Thirdly, this only solves the problem for GNU
: autoconf-based packages.

Yes, which won't all be helped by the buildlink.mk stuff either.  Some
packages explicitly add directories to the -L path, like /usr/local/lib.
Also, a little known fact is that a gcc compiled out-of-the-box (rather than
shipped with NetBSD) will check /usr/local/lib automatically too[!], without
needing a -L to do it.

Modifying autoconf's AC_CHECK_LIB provides a neat and easy way to avoid all
of these problems for those packages which do use autoconf and depend on
other libraries, which is the vast majority of them these days.

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/