2010/6/14 Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:<br>
> On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:<br>
><br>
>> Override incompatible CONFIG_FOO settings for DOS. This allows you to<br>
>> specify CONFIG_FOO=yes for all drivers and still get only those which<br>
>> compile under DOS.<br>
>><br>
>><br>
><br>
> Silently disabling explicitly requested features is a really bad idea.<br>
> This new patch instead warns the user if any impossible (i.e. not<br>
> compilable on this platform) features were specified. Such a warning<br>
> will look like this:<br>
><br>
> The following features are unavailable on your machine: CONFIG_NIC3COM=yes<br>
><br>
> If a user does not explicitly request an impossible feature, such a<br>
> feature will be automatically disabled, so just typing "make" will get<br>
> you the common subset of default and possible features.<br>
><br>
<br>
</div>Fixed a few minor bugs. Should be ready for merge.<br>
<div class="im"><br>
Signed-off-by: Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>><br></div></blockquote><div><br>Acked-by: Idwer Vollering <<a href="mailto:vidwer%2Blists.flashrom@gmail.com">vidwer+lists.flashrom@gmail.com</a>> <br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br>
Index: flashrom-dos_override_incompatible_config_foo/Makefile<br>
===================================================================<br>
</div>--- flashrom-dos_override_incompatible_config_foo/Makefile      (Revision 1047)<br>
<div class="im">+++ flashrom-dos_override_incompatible_config_foo/Makefile      (Arbeitskopie)<br>
</div>@@ -53,10 +53,29 @@<br>
<div class="im"> CPPFLAGS += -I../libgetopt -I../libpci/include<br>
</div> # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt<br>
 LIBS += ../libgetopt/libgetopt.a<br>
<div><div></div><div class="h5">-# Bus Pirate and Serprog are not supported under DOS.<br>
-CONFIG_BUSPIRATE_SPI = no<br>
-CONFIG_SERPROG = no<br>
+# Bus Pirate and Serprog are not supported under DOS (missing serial support).<br>
+ifeq ($(CONFIG_BUSPIRATE_SPI), yes)<br>
+UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes<br>
+else<br>
+override CONFIG_BUSPIRATE_SPI = no<br>
 endif<br>
+ifeq ($(CONFIG_SERPROG), yes)<br>
+UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes<br>
+else<br>
+override CONFIG_SERPROG = no<br>
+endif<br>
+# Dediprog and FT2232 are not supported under DOS (missing USB support).<br>
+ifeq ($(CONFIG_DEDIPROG), yes)<br>
+UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes<br>
+else<br>
+override CONFIG_DEDIPROG = no<br>
+endif<br>
+ifeq ($(CONFIG_FT2232_SPI), yes)<br>
+UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes<br>
+else<br>
+override CONFIG_FT2232_SPI = no<br>
+endif<br>
+endif<br>
<br>
 CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \<br>
        sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \<br>
</div></div>@@ -279,7 +298,7 @@<br>
 strip: $(PROGRAM)$(EXEC_SUFFIX)<br>
        $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)<br>
<br>
-compiler:<br>
+compiler: featuresavailable<br>
        @printf "Checking for a C compiler... "<br>
        @$(shell ( echo "int main(int argc, char **argv)"; \<br>
                   echo "{ return 0; }"; ) > .test.c )<br>
@@ -318,6 +337,17 @@<br>
<div class="im"><br>
 .features: features<br>
<br>
+# If a user does not explicitly request a non-working feature, we should<br>
+# silently disable it. However, if a non-working (does not compile) feature<br>
+# is explicitly requested, we should bail out with a descriptive error message.<br>
+ifeq ($(UNSUPPORTED_FEATURES), )<br>
+featuresavailable:<br>
+else<br>
+featuresavailable:<br>
+       @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)"<br>
+       @false<br>
+endif<br>
+<br>
 ifeq ($(CONFIG_FT2232_SPI), yes)<br>
 features: compiler<br>
</div><div class="im">        @echo "FEATURES := yes" > .features.tmp<br>
</div>@@ -375,6 +405,6 @@<br>
 djgpp-dos: clean<br>
        make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS<br>
<br>
-.PHONY: all clean distclean compiler pciutils features export tarball dos<br>
+.PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable<br>
<br>
 -include $(OBJS:.o=.d)<br>
<div><div></div><div class="h5"><br>
<br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
<br>
_______________________________________________<br>
flashrom mailing list<br>
<a href="mailto:flashrom@flashrom.org">flashrom@flashrom.org</a><br>
<a href="http://www.flashrom.org/mailman/listinfo/flashrom" target="_blank">http://www.flashrom.org/mailman/listinfo/flashrom</a><br>
</div></div></blockquote></div><br>