Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Nov 2010 23:38:22 +0300
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: Proper way to detect kernel / userland sources?
Message-ID:  <20101109203822.GA67706@hades.panopticon>
In-Reply-To: <241091055.20101109182834@serebryakov.spb.ru>
References:  <241091055.20101109182834@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
* Lev Serebryakov (lev@FreeBSD.org) wrote:

>   I'm  preparing port which depends both on kernel source (it contains
> kernel module) and userland sources (it needs GEOM sources).
> 
>   I   see,   that  ports  with  kernel  modules  check  for  hardcoded
>   "/usr/src/sys/Makefile".  But it doesn't look good: sources could be
>   perfectly valid, but placed in other directory!
> 
>   Is  here  any  standerd  variable  which  should  be used instead of
>   hardcoded "/usr/src"?

Oh, that reminded me. For now, there's no other way than to hardcode
/usr/src (however some ports make that overridable). I've though
of that too and made a patch that has been lying here for some time
without purpose. As this topic is risen, I'd like to discuss it,
possibly improve and push into Mk.

http://people.freebsd.org/~amdmi3/USE_SRC.patch

- Introduces SRC_BASE which defaults to /usr/src and may be used in
  ports to access system sources
- Introduces USE_SRC (to be set in ports that require kernel source)
  that checks whether system sources are installed and whether their
  version corresponds to system version (overridable)
- Corrects a typo

While here, I'm worried about the fact that /usr/src is used as a
possible source for OSVERSION. Currently, in presence of freebsd-update,
it's really likely that system sources are out-of sync with installed
system, so getting OSVERSION from /usr/src should likely be removed.
osreldate is enough fallback if /usr/include/sys/param.h is absent
for some reason.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101109203822.GA67706>