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><div></div><div class="h5">On 14.06.2010 17:38, Idwer Vollering wrote:<br>
> 2010/6/14 Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>><br>
><br>
>> On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:<br>
>><br>
>>> On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:<br>
>>><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:<br>
>>><br>
>> 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>
>> Fixed a few minor bugs. Should be ready for merge.<br>
>><br>
>><br>
><br>
> I'm not sure about that, it breaks djgpp-dos' compilation:<br>
><br>
> $ make distclean CONFIG_SERPROG=yes djgpp-dos<br>
> rm -f flashrom flashrom.exe *.o *.d<br>
> rm -f .features .libdeps<br>
> make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no<br>
> OS_ARCH=DOS<br>
> make[1]: Entering directory<br>
> `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509'<br>
> The following features are unavailable on your machine: CONFIG_SERPROG=yes<br>
><br>
<br>
</div></div>This is a desired effect of my patch, and we want that because serprog<br>
does not work on DOS (yet).<br>
<div class="im"><br>
<br>
> make[1]: *** [featuresavailable] Error 1<br>
> make[1]: Leaving directory<br>
> `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509'<br>
> make: *** [djgpp-dos] Error 2<br>
><br>
> $ make distclean djgpp-dos<br>
> rm -f flashrom flashrom.exe *.o *.d<br>
> rm -f .features .libdeps<br>
> make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no<br>
> OS_ARCH=DOS<br>
> make[1]: Entering directory<br>
> `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509'<br>
> Checking for a C compiler... found.<br>
> Checking for libpci headers... found.<br>
> Checking if libpci is present and sufficient... no.<br>
> Checking if libz+libpci are present and sufficient...no.<br>
><br>
<br>
</div>And this is a bug. Can you reproduce this bug </blockquote><div><br>No, I can only reproduce it when running "make distclean djgpp-dos" with 
<a href="http://patchwork.coreboot.org/patch/1509/">http://patchwork.coreboot.org/patch/1509/</a> applied.<br>
<br>
Index: Makefile<br>
===================================================================<br>
--- Makefile    (revision 1047)<br>
+++ Makefile    (working copy)<br>
@@ -50,13 +50,32 @@<br>
 endif<br>
 ifeq ($(OS_ARCH), DOS)<br>
 EXEC_SUFFIX := .exe<br>
-CPPFLAGS += -I../libgetopt -I../libpci/include<br>
+CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include<br>
 # FIXME Check if we can achieve the same effect with -L../libgetopt 
-lgetopt<br>
 LIBS += ../libgetopt/libgetopt.a<br>
-# 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>
@@ -237,7 +256,7 @@<br>
 else<br>
 ifeq ($(OS_ARCH), DOS)<br>
 # FIXME There needs to be a better way to do this<br>
-LIBS += ../libpci/lib/libpci.a<br>
+LIBS += ../../../djgpp/libpci/lib/libpci.a<br>
 else<br>
 LIBS += -lpci<br>
 endif<br>
@@ -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>
<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>
        @echo "FEATURES := yes" > .features.tmp<br>
@@ -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>
<br> 
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">with a clean (no local
patches) tree with latest svn HEAD?<br></blockquote><div><br>These are the local modifications I apply/applied against HEAD:<br></div><div><br>Index: Makefile<br>===================================================================<br>
--- Makefile    (revision 1047)<br>+++ Makefile    (working copy)<br>@@ -49,10 +49,9 @@<br> LDFLAGS += -L/usr/local/lib<br> endif<br> ifeq ($(OS_ARCH), DOS)<br>-EXEC_SUFFIX := .exe<br>-CPPFLAGS += -I../libgetopt -I../libpci/include<br>
+CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include<br> # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt<br>-LIBS += ../libgetopt/libgetopt.a<br>+LIBS += ../../../djgpp/libgetopt/libgetopt.a<br>
 # Bus Pirate and Serprog are not supported under DOS.<br> CONFIG_BUSPIRATE_SPI = no<br> CONFIG_SERPROG = no<br>@@ -237,7 +236,7 @@<br> else<br> ifeq ($(OS_ARCH), DOS)<br> # FIXME There needs to be a better way to do this<br>
-LIBS += ../libpci/lib/libpci.a<br>+LIBS += ../../../djgpp/libpci/lib/libpci.a<br> else<br> LIBS += -lpci<br> endif<br>@@ -374,6 +373,7 @@<br><br> djgpp-dos: clean<br>        make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS<br>
+#      upx $(PROGRAM).exe<br><br> .PHONY: all clean distclean compiler pciutils features export tarball dos<br><br><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>
<br>
> Please install libpci (package pciutils) and/or libz.<br>
> See README for more information.<br>
><br>
> make[1]: *** [pciutils] Error 1<br>
> make[1]: Leaving directory<br>
> `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509'<br>
> make: *** [djgpp-dos] Error 2<br>
><br>
<br>
</div>Thanks for testing this.<br>
<br>
Regards,<br>
Carl-Daniel<br>
<font color="#888888"><br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
</font></blockquote></div><br>