[PATCH v1 27/30] configure: Add conditional platform builds

Geoff Levand geoff at infradead.org
Wed Jul 25 08:15:45 AEST 2018


Add configure --enable-platform-XXX options to allow specifying
which platform support to build.

--enable-platform-auto, the default, will use the host
triplet to guess which platforms to build.
--enable-platform-all will build all platforms.

Signed-off-by: Geoff Levand <geoff at infradead.org>
---
 configure.ac         | 38 ++++++++++++++++++++++++++++++++++++++
 discover/Makefile.am | 11 +++++++----
 2 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 408a569..5b7c7b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,6 +303,44 @@ AS_IF(
 	]
 )
 
+# platform choice
+AC_ARG_ENABLE(
+	[platform-all],
+	[AS_HELP_STRING(
+		[--enable-platform-all],
+		[build support for all platforms [default=no]]
+	)]
+)
+AS_IF(
+	[test "x$enable_platform_all" = "xyes"],
+	[enable_platform_powerpc="yes"; enable_platform_ps3="yes"]
+)
+
+AC_ARG_ENABLE(
+	[platform-auto],
+	[AS_HELP_STRING(
+		[--enable-platform-auto],
+		[auto detect platform support to build [default=yes]]
+	)],
+	[],
+	[enable_platform_auto="yes"]
+)
+AS_IF(
+	[test "x$enable_platform_auto" = "xyes"],
+	[AS_CASE([$host],
+		[powerpc*-*-*],  [enable_platform_powerpc="yes"],
+	)]
+)
+
+AC_ARG_ENABLE(
+	[platform-powerpc],
+	[AS_HELP_STRING(
+		[--enable-platform-powerpc],
+		[build support for powerpc platforms [default=no]]
+	)]
+)
+AM_CONDITIONAL([PLATFORM_POWERPC], [test "x$enable_platform_powerpc" = "xyes"])
+
 AC_ARG_ENABLE(
 	[platform-ps3],
 	[AS_HELP_STRING(
diff --git a/discover/Makefile.am b/discover/Makefile.am
index f9625ec..2b7c794 100644
--- a/discover/Makefile.am
+++ b/discover/Makefile.am
@@ -80,11 +80,11 @@ discover_platform_ro_SOURCES = \
 	discover/ipmi.h \
 	discover/dt.c \
 	discover/dt.h \
-	discover/hostboot.h \
-	discover/platform-powerpc.c
+	discover/hostboot.h
 
-discover_platform_ro_CPPFLAGS = \
-	$(AM_CPPFLAGS)
+if PLATFORM_POWERPC
+discover_platform_ro_SOURCES += discover/platform-powerpc.c
+endif
 
 # Build dummy last to put it at the end of the platforms section.
 discover_platform_ro_SOURCES += discover/platform-dummy.c
@@ -99,5 +99,8 @@ discover_platform_ro_LDFLAGS = \
 
 endif
 
+discover_platform_ro_CPPFLAGS = \
+	$(AM_CPPFLAGS)
+
 discover_platform_ro_LINK = \
 	$(LD) -r -o $@
-- 
2.14.1




More information about the Petitboot mailing list