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>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"