Re: better way to build libraries..

On Fri, Sep 29, 2006 at 02:22:33AM -0700, John-Mark Gurney wrote:
So as I had a big argument w/ Kris about this, are you saying that
we should go ahead and remove all the -I../../sys in places like
pciconf because building standalone isn't supported?

Yes, we've been doing this (removing them) for years now.
pciconf is special -- it needs this because we don't install
sys/dev/pci/pcireg.h into /usr/include.

My point is
that either we continue to attempt to support building things stand
alone, or we don't even pretend we attempt to...

Removing -I's doesn't generally affect standalone building, but
it does affect stanalone upgrading. That's the difference. If
your sources match your installed bits, you can still chdir into
a directory and type "make", and it will generally be built.
Yes, we should stop pretending we support standalone upgrades --
because in this case you need to handle it properly: track
dependencies, build and install dependencies (other headers and
libraries, this library's headers if this is a library) in the
correct order, etc. Some of them depend on the src.conf (or
make.conf) options, there's a lot to track.

Everyone points that oh, buildworld does that prefectly fine, but no
one wants to expand support of being able to build FreeBSD piecemeal
on a system....

I think you misunderstand the difference between upgrades and
standalone builds.

Take my 5.4-R box... I was unable to build libcrypto due to not
having done a make includes... I could do a make includes, but then
if either a) I forget to make and install the library, or b) the
library fails to build, I now have a broken install... It is
much better to do a build the library, then install both the new
library and includes...

This approach is doomed. You were lucky (or not, haven't actually
checked) that this particular upgrade didn't update .h files.
Because if it did, you'd still be forced to rebuild other bits that
use an updated header -- other crypto libraries, other stuff
that uses crypto, statically linked programs if there are any.

Well, if you absolutely want to, you could installed the headers
into a temporary location using DESTDIR,

make includes DESTDIR=/foo

then rebuilt the library with DEBUG_FLAGS=-I/foo. In any case,
even this broken approach doesn't require modifications to

Ruslan Ermilov
FreeBSD committer

Attachment: pgpkyzbR8ga35.pgp
Description: PGP signature