[v2,28/30] configure: Add conditional platform builds
diff mbox series

Message ID db4a399dc6c2a6c8db0b8540d19912b2bfbf713a.1533230644.git.geoff@infradead.org
State Accepted
Headers show
Series
  • [v2,01/30] docker: Add libfdt-dev
Related show

Commit Message

Geoff Levand Aug. 2, 2018, 5:29 p.m. UTC
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@infradead.org>
---
 configure.ac         | 38 ++++++++++++++++++++++++++++++++++++++
 discover/Makefile.am | 11 +++++++----
 2 files changed, 45 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/configure.ac b/configure.ac
index 290617b..38fe341 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 $@