From owner-freebsd-arm@freebsd.org Sun Aug 7 22:13:58 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 835B8BB1F91 for ; Sun, 7 Aug 2016 22:13:58 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "raven.bwct.de", Issuer "BWCT" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 019F512B1 for ; Sun, 7 Aug 2016 22:13:57 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id u77MDPKN004828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 8 Aug 2016 00:13:33 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.5/8.14.4) with ESMTP id u77MDKbk020462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Aug 2016 00:13:20 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.15.2/8.15.2) with ESMTP id u77MDKxu035575; Mon, 8 Aug 2016 00:13:20 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.15.2/8.15.2/Submit) id u77MDK2R035574; Mon, 8 Aug 2016 00:13:20 +0200 (CEST) (envelope-from ticso) Date: Mon, 8 Aug 2016 00:13:20 +0200 From: Bernd Walter To: Adrian Chadd Cc: ticso@cicely.de, "freebsd-arm@freebsd.org" , Bernd Walter Subject: Re: out of tree kernel modules (was: compiling modules and FDT define) Message-ID: <20160807221319.GD34368@cicely7.cicely.de> Reply-To: ticso@cicely.de References: <20160805005433.GL18406@cicely7.cicely.de> <20160805134358.GN18406@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely7.cicely.de 10.2-RELEASE amd64 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2016 22:13:58 -0000 On Fri, Aug 05, 2016 at 08:20:11PM -0700, Adrian Chadd wrote: > Hi, > > Try adding opt_platform.h to SRCS in the module makefile? > > You don't need to add it to the tree. You just have to setup your path > to point things /at/ a kernel build tree withall the opt_xxx.h in > them. > > here's what I do: > > #!/bin/sh > > X_SRCDIR=${X_SRCDIR:="/home/adrian/work/freebsd/head/src/"} > X_KERNDIR=${X_KERNDIR:="/home/adrian/work/freebsd/head/obj/usr/home/adrian/work/freebsd/head/src/sys/GERTRUDE/"} > X_KMODOWN=${X_KMODOWN:="adrian"} > X_KMODGRP=${X_KMODGRP:="adrian"} > > # This allows for -HEAD includes for net80211 .. > env CFLAGS="-I../../../sys/" \ > make \ > MODULES_OVERRIDE="" \ > DEBUG_FLAGS="-g" \ > DEBUG_FLAGS="-g" \ > KMODDIR="/home/adrian/git/github/erikarn/athp/otus/freebsd/modules/" \ > KMODOWN="${X_KMODOWN}" \ > KMODGRP="${X_KMODGRP}" \ > MAKESYSPATH="${X_SRCDIR}/share/mk" \ > SYSDIR="${X_SRCDIR}/sys/" \ > KERNBUILDDIR="${X_KERNDIR}" \ > KERN_DEBUGDIR="" \ > $@ > > That gets me all the bits I need to be able to run make in module > directories and get the correct includes/links setup. Oh damn - it used to be much easier than that. I'm still used to "make all install" for out of tree kernel modules. How is it handled for the few kmods in ports? -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.