Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2016 17:40:29 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
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
Message-ID:  <201605271740.u4RHeTBk074937@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <bsd.subdir.mk>



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