From owner-svn-src-all@freebsd.org Fri May 27 17:40:30 2016 Return-Path: Delivered-To: svn-src-all@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 E019CB4C659; Fri, 27 May 2016 17:40:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29BF18EA; Fri, 27 May 2016 17:40:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RHeTd3074939; Fri, 27 May 2016 17:40:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RHeTBk074937; Fri, 27 May 2016 17:40:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605271740.u4RHeTBk074937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 17:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300855 - in head/sys: conf modules/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 17:40:31 -0000 Author: ian Date: Fri May 27 17:40:29 2016 New Revision: 300855 URL: https://svnweb.freebsd.org/changeset/base/300855 Log: When building modules, define make variable OPT_FDT if the kernel config includes the FDT option. Use OPT_FDT to conditionally compile modules that require FDT support. In the past we've gotten away with using the arch name as a proxy for FDT support in makefile conditional logic, but now mips has some platforms with fdt support and some without and we need a more direct test. Modified: head/sys/conf/kern.opts.mk head/sys/modules/gpio/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri May 27 17:31:02 2016 (r300854) +++ head/sys/conf/kern.opts.mk Fri May 27 17:40:29 2016 (r300855) @@ -150,3 +150,11 @@ MK_${var}_SUPPORT:= yes .endif .endif .endfor + +# Some modules only compile successfully if option FDT is set, due to #ifdef FDT +# wrapped around declarations. Module makefiles can optionally compile such +# things using .if !empty(OPT_FDT) +.if !defined(OPT_FDT) && defined(KERNBUILDDIR) +OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h +.export OPT_FDT +.endif Modified: head/sys/modules/gpio/Makefile ============================================================================== --- head/sys/modules/gpio/Makefile Fri May 27 17:31:02 2016 (r300854) +++ head/sys/modules/gpio/Makefile Fri May 27 17:40:29 2016 (r300855) @@ -25,6 +25,10 @@ # SUCH DAMAGE. # -SUBDIR = gpiobus gpioiic gpioled gpiopps gpiospi +SUBDIR = gpiobus gpioiic gpioled gpiospi + +.if !empty(OPT_FDT) +SUBDIR += gpiopps +.endif .include