Patchwork Allow single-programmer compilation

login
register
about
Submitter Carl-Daniel Hailfinger
Date 2010-01-08 20:14:18
Message ID <4B47921A.4080907@gmx.net>
Download mbox | patch
Permalink /patch/753/
State Accepted
Commit r858
Headers show

Comments

Carl-Daniel Hailfinger - 2010-01-08 20:14:18
If neither internal (old default) nor dummy (safe default) programmer
are selected, we must pick a sensible default programmer. Since there is
no reason to prefer a particular external programmer, we abort
compilation if more than one of them is selected. If only one is
selected, it is clear that the user wants that one to become the default.
This fixes single-programmer compilation.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Sean Nelson - 2010-01-10 09:06:56
Works for me!
Acked-by: Sean Nelson <audiohacked@gmail.com>
Carl-Daniel Hailfinger - 2010-01-10 13:29:29
On 10.01.2010 10:06, Sean Nelson wrote:
> Works for me!
> Acked-by: Sean Nelson <audiohacked@gmail.com>

Thanks, r858.

Regards,
Carl-Daniel

Patch

Index: flashrom-allow_single_programmer/flashrom.c
===================================================================
--- flashrom-allow_single_programmer/flashrom.c	(Revision 837)
+++ flashrom-allow_single_programmer/flashrom.c	(Arbeitskopie)
@@ -39,9 +39,38 @@ 
 #elif DUMMY_SUPPORT == 1
 enum programmer programmer = PROGRAMMER_DUMMY;
 #else
-/* Activating the #error explodes on make dep. */
-//#error Neither internal nor dummy selected
+/* If neither internal nor dummy are selected, we must pick a sensible default.
+ * Since there is no reason to prefer a particular external programmer, we fail
+ * if more than one of them is selected. If only one is selected, it is clear
+ * that the user wants that one to become the default.
+ */
+#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT > 1
+#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one.
 #endif
+enum programmer programmer =
+#if NIC3COM_SUPPORT == 1
+	PROGRAMMER_NIC3COM
+#endif
+#if GFXNVIDIA_SUPPORT == 1
+	PROGRAMMER_GFXNVIDIA
+#endif
+#if DRKAISER_SUPPORT == 1
+	PROGRAMMER_DRKAISER
+#endif
+#if SATASII_SUPPORT == 1
+	PROGRAMMER_SATASII
+#endif
+#if FT2232_SPI_SUPPORT == 1
+	PROGRAMMER_FT2232SPI
+#endif
+#if SERPROG_SUPPORT == 1
+	PROGRAMMER_SERPROG
+#endif
+#if BUSPIRATE_SPI_SUPPORT == 1
+	PROGRAMMER_BUSPIRATESPI
+#endif
+;
+#endif
 
 char *programmer_param = NULL;