From owner-freebsd-ports@FreeBSD.ORG Tue Nov 9 22:08:49 2010 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFAC7106582C; Tue, 9 Nov 2010 22:08:49 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 23DD98FC0C; Tue, 9 Nov 2010 22:08:48 +0000 (UTC) Received: by eyb7 with SMTP id 7so4094592eyb.13 for ; Tue, 09 Nov 2010 14:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject :in-reply-to:references:user-agent:date:message-id:mime-version :content-type; bh=Yo/5d4R31J4MgucLyoFpnS0gR4k99hSWW3KhuxQfSMU=; b=EwQlAkUK2mgsBr5rqv/uDCOKg+Ucb0B8JFvlH2+K7Qc5ZACTN0UHHxl4w6Kkx5o1KR j4n0MDprA5BqFTTp/SQOb3F5/rd894IAWJC3uMX2qhcdZL/Zs1qkhY5GA0Gs2cTjaa/N zKyy4ZmRMXi5yN7krYu2fhWXTw8pU2L0H5EHk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; b=KVIUHBVFOzYKHvmYtIAMvgmDf0aPjv+RblA/iaOecWUxqG4h2RGsPgrMfocr7MICqL NZ35ovG8j7JfwJe9bhXhTg5ft/admssWmBPmMry1JBl/G68Lh6ff9tWFecS5+BCr4taY t5FtiI7yfKfORyPg3A2TCBxO53ZExl2V5xH2U= Received: by 10.14.53.67 with SMTP id f43mr3367950eec.25.1289338971287; Tue, 09 Nov 2010 13:42:51 -0800 (PST) Received: from localhost (c-cd6f70d5.017-62-6b73642.cust.bredbandsbolaget.se [213.112.111.205]) by mx.google.com with ESMTPS id v56sm1569641eeh.14.2010.11.09.13.42.47 (version=SSLv3 cipher=RC4-MD5); Tue, 09 Nov 2010 13:42:49 -0800 (PST) From: Anonymous To: Dmitry Marakasov In-Reply-To: <20101109203822.GA67706@hades.panopticon> (Dmitry Marakasov's message of "Tue, 9 Nov 2010 23:38:22 +0300") References: <241091055.20101109182834@serebryakov.spb.ru> <20101109203822.GA67706@hades.panopticon> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) Date: Wed, 10 Nov 2010 00:42:40 +0300 Message-ID: <86fwvaw4vj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Cc: ports@FreeBSD.org, Lev Serebryakov Subject: Re: Proper way to detect kernel / userland sources? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 22:08:49 -0000 Dmitry Marakasov writes: > * 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 Please, also define and export SYSDIR because that what is used by bsd.kmod.mk. And some ports only require kernel sources. I don't think there are many ports that need userland sources. SRC_BASE ?= /usr/src SYSDIR ?= ${SRC_BASE}/sys MAKE_ENV += SYSDIR="${SYSDIR}" > - 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