build: prevent enabling aspeed and nuvoton

Tested: Verified that enabling both would fail to configure.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I3d85aeb0e4fe021eadf08cdb6b08bb4058e2bd44
diff --git a/configure.ac b/configure.ac
index 59b3d26..a704053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,6 +177,14 @@
     AX_APPEND_COMPILE_FLAGS([-DNUVOTON_LPC], [CXXFLAGS])
 ])
 
+AS_IF([test "x$enable_aspeed_lpc" = "xyes"], [
+    AS_IF([test "x$enable_nuvoton_lpc" = "xyes"], [
+        AS_IF([test "x$enable_tests" != "xyes"], [
+            AC_MSG_ERROR([Invalid configuration enabling both ASPEED and Nuvoton.])
+        ])
+    ])
+])
+
 AC_ARG_ENABLE([aspeed-p2a],
     AS_HELP_STRING([--enable-aspeed-p2a],
                    [Enable external transfers using Aspeed PCI-to-AHB]))
@@ -193,6 +201,14 @@
     AX_APPEND_COMPILE_FLAGS([-DASPEED_P2A], [CXXFLAGS])
 ])
 
+AS_IF([test "x$enable_aspeed_p2a" = "xyes"], [
+    AS_IF([test "x$enable_nuvoton_lpc" = "xyes"], [
+        AS_IF([test "x$enable_tests" != "xyes"], [
+            AC_MSG_ERROR([Invalid configuration enabling both ASPEED and Nuvoton.])
+        ])
+    ])
+])
+
 AC_ARG_VAR(
     STATIC_HANDLER_STAGED_NAME,
     [The file to use for staging the firmware update.]