Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2013 01:17:55 +0400
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Chicken and egg problem when building (third-party) kernel modules with <bsd.kmod.mk> -- how to solve?
Message-ID:  <899884661.20130912011755@serebryakov.spb.ru>
In-Reply-To: <20130911165346.GA68682@funkthat.com>
References:  <1510067821.20130911173716@serebryakov.spb.ru> <20130911165346.GA68682@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello, John-Mark.
You wrote 11 =D1=81=D0=B5=D0=BD=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2013 =D0=B3.,=
 20:53:46:

>>  It is good idea to set KERNBUILDDIR when build module. But to set it you
>> need to know ${.OBJDIR} from ${SYSDIR} and ${SYSDIR} is set in bsd.kmod.=
mk,
>> which should be included last (after defining KERNBUILDDIR).
>>=20
>>  How this loop could be broken?

JMG> If you need to build it stand alone, you still need the opt_*.h files
 I'm speaking about making port with kernel module, but this port is using
bsd.*.mk infrastructure by itself.

JMG> from the kernel you are going to run it with, and that directory is
JMG> what you need to set KERNBUILDDIR...
 KERNBUILDDIR could be set automagically with:

KERNBUILDROOT!=3D make -C ${SYSDIR} -V .OBJDIR
KERNNAME!=3D              uname -i
.if exists(${KERNBUILDROOT}/${KERNNAME}/opt_global.h) && !defined(KERNBUILD=
DIR)
KERNBUILDDIR:=3D${KERNBUILDROOT}/${KERNNAME}
.endif

  But here is problem, which I'm speaking about: it should go BEFORE
 <bsd.kmod.mk> but it needs to use ${SYSDIR}.

--=20
// Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>




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