configure: Add conditional platform builds
authorGeoff Levand <geoff@infradead.org>
Thu, 2 Aug 2018 17:29:40 +0000 (17:29 +0000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 7 Aug 2018 01:30:36 +0000 (11:30 +1000)
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>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
configure.ac
discover/Makefile.am

index 290617b8ef332212d1144a5e17789b82345fdd23..38fe3419b21a9d658b8feb4d214d0905568fd52c 100644 (file)
@@ -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(
index f9625ec400b42811190ef2f31043371361714062..2b7c7940b051752b02d4d55d246872ea686c0dc8 100644 (file)
@@ -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 $@