From owner-freebsd-current@FreeBSD.ORG Wed Sep 11 16:53:53 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C7249785; Wed, 11 Sep 2013 16:53:53 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4823286C; Wed, 11 Sep 2013 16:53:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8BGrkTh080512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Sep 2013 09:53:47 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8BGrkNl080511; Wed, 11 Sep 2013 09:53:46 -0700 (PDT) (envelope-from jmg) Date: Wed, 11 Sep 2013 09:53:46 -0700 From: John-Mark Gurney To: Lev Serebryakov Subject: Re: Chicken and egg problem when building (third-party) kernel modules with -- how to solve? Message-ID: <20130911165346.GA68682@funkthat.com> Mail-Followup-To: Lev Serebryakov , freebsd-current@freebsd.org References: <1510067821.20130911173716@serebryakov.spb.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1510067821.20130911173716@serebryakov.spb.ru> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 11 Sep 2013 09:53:47 -0700 (PDT) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Sep 2013 16:53:53 -0000 Lev Serebryakov wrote this message on Wed, Sep 11, 2013 at 17:37 +0400: > 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). > > How this loop could be broken? You don't set it as part of the module Makefile... It is expected that KERNBUILDDIR is set before invoking the module Makefile, such as when the module is built as part of the kernel... If you need to build it stand alone, you still need the opt_*.h files from the kernel you are going to run it with, and that directory is what you need to set KERNBUILDDIR... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."