Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-dos_override_incompatible_config_foo/Makefile =================================================================== --- flashrom-dos_override_incompatible_config_foo/Makefile (Revision 1031) +++ flashrom-dos_override_incompatible_config_foo/Makefile (Arbeitskopie) @@ -50,9 +50,12 @@ endif ifeq ($(OS_ARCH), DOS) CPPFLAGS += -I../libgetopt -I../libpci/include -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +override CONFIG_BUSPIRATE_SPI = no +override CONFIG_SERPROG = no +# Dediprog and FT2232 are not supported under DOS (missing USB support). +override CONFIG_DEDIPROG = no +override CONFIG_FT2232_SPI = no endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine: CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-dos_override_incompatible_config_foo/Makefile =================================================================== --- flashrom-dos_override_incompatible_config_foo/Makefile (Revision 1039) +++ flashrom-dos_override_incompatible_config_foo/Makefile (Arbeitskopie) @@ -50,10 +50,29 @@ endif ifeq ($(OS_ARCH), DOS) CPPFLAGS += -I../libgetopt -I../libpci/include -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \ @@ -316,8 +335,19 @@
.features: features
+# If a user does not explicitly request a non-working feature, we should +# silently disable it. However, if a non-working (does not compile) feature +# is explicitly requested, we should bail out with a descriptive error message. +ifeq ($(UNSUPPORTED_FEATURES), ) +featuresavailable: +else +featuresavailable: + @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)" + @false +endif + ifeq ($(CONFIG_FT2232_SPI), yes) -features: compiler +features: compiler featuresavailable @echo "FEATURES := yes" > .features.tmp @printf "Checking for FTDI support... " @$(shell ( echo "#include <ftdi.h>"; \ @@ -338,7 +368,7 @@ @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features @rm -f .featuretest.c .featuretest else -features: compiler +features: compiler featuresavailable @echo "FEATURES := yes" > .features.tmp @printf "Checking for utsname support... " @$(shell ( echo "#include <sys/utsname.h>"; \
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine: CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-dos_override_incompatible_config_foo/Makefile =================================================================== --- flashrom-dos_override_incompatible_config_foo/Makefile (Revision 1047) +++ flashrom-dos_override_incompatible_config_foo/Makefile (Arbeitskopie) @@ -53,10 +53,29 @@ CPPFLAGS += -I../libgetopt -I../libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt LIBS += ../libgetopt/libgetopt.a -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \ @@ -279,7 +298,7 @@ strip: $(PROGRAM)$(EXEC_SUFFIX) $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)
-compiler: +compiler: featuresavailable @printf "Checking for a C compiler... " @$(shell ( echo "int main(int argc, char **argv)"; \ echo "{ return 0; }"; ) > .test.c ) @@ -318,6 +337,17 @@
.features: features
+# If a user does not explicitly request a non-working feature, we should +# silently disable it. However, if a non-working (does not compile) feature +# is explicitly requested, we should bail out with a descriptive error message. +ifeq ($(UNSUPPORTED_FEATURES), ) +featuresavailable: +else +featuresavailable: + @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)" + @false +endif + ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @@ -375,6 +405,6 @@ djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS
-.PHONY: all clean distclean compiler pciutils features export tarball dos +.PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable
-include $(OBJS:.o=.d)
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine:
CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
I'm not sure about that, it breaks djgpp-dos' compilation:
$ make distclean CONFIG_SERPROG=yes djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' The following features are unavailable on your machine: CONFIG_SERPROG=yes make[1]: *** [featuresavailable] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
$ make distclean djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' Checking for a C compiler... found. Checking for libpci headers... found. Checking if libpci is present and sufficient... no. Checking if libz+libpci are present and sufficient...no.
Please install libpci (package pciutils) and/or libz. See README for more information.
make[1]: *** [pciutils] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-dos_override_incompatible_config_foo/Makefile
--- flashrom-dos_override_incompatible_config_foo/Makefile (Revision 1047) +++ flashrom-dos_override_incompatible_config_foo/Makefile (Arbeitskopie) @@ -53,10 +53,29 @@ CPPFLAGS += -I../libgetopt -I../libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt LIBS += ../libgetopt/libgetopt.a -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \ @@ -279,7 +298,7 @@ strip: $(PROGRAM)$(EXEC_SUFFIX) $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)
-compiler: +compiler: featuresavailable @printf "Checking for a C compiler... " @$(shell ( echo "int main(int argc, char **argv)"; \ echo "{ return 0; }"; ) > .test.c ) @@ -318,6 +337,17 @@
.features: features
+# If a user does not explicitly request a non-working feature, we should +# silently disable it. However, if a non-working (does not compile) feature +# is explicitly requested, we should bail out with a descriptive error message. +ifeq ($(UNSUPPORTED_FEATURES), ) +featuresavailable: +else +featuresavailable:
@echo "The following features are unavailable on your machine:
$(UNSUPPORTED_FEATURES)"
@false
+endif
ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @@ -375,6 +405,6 @@ djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS
-.PHONY: all clean distclean compiler pciutils features export tarball dos +.PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable
-include $(OBJS:.o=.d)
flashrom mailing list flashrom@flashrom.org http://www.flashrom.org/mailman/listinfo/flashrom
On 14.06.2010 17:38, Idwer Vollering wrote:
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine:
CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
I'm not sure about that, it breaks djgpp-dos' compilation:
$ make distclean CONFIG_SERPROG=yes djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' The following features are unavailable on your machine: CONFIG_SERPROG=yes
This is a desired effect of my patch, and we want that because serprog does not work on DOS (yet).
make[1]: *** [featuresavailable] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
$ make distclean djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' Checking for a C compiler... found. Checking for libpci headers... found. Checking if libpci is present and sufficient... no. Checking if libz+libpci are present and sufficient...no.
And this is a bug. Can you reproduce this bug with a clean (no local patches) tree with latest svn HEAD?
Please install libpci (package pciutils) and/or libz. See README for more information.
make[1]: *** [pciutils] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
Thanks for testing this.
Regards, Carl-Daniel
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 14.06.2010 17:38, Idwer Vollering wrote:
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine:
CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
I'm not sure about that, it breaks djgpp-dos' compilation:
$ make distclean CONFIG_SERPROG=yes djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
WARNERROR=no
OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' The following features are unavailable on your machine:
CONFIG_SERPROG=yes
This is a desired effect of my patch, and we want that because serprog does not work on DOS (yet).
make[1]: *** [featuresavailable] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
$ make distclean djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
WARNERROR=no
OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' Checking for a C compiler... found. Checking for libpci headers... found. Checking if libpci is present and sufficient... no. Checking if libz+libpci are present and sufficient...no.
And this is a bug. Can you reproduce this bug
No, I can only reproduce it when running "make distclean djgpp-dos" with http://patchwork.coreboot.org/patch/1509/ applied.
Index: Makefile =================================================================== --- Makefile (revision 1047) +++ Makefile (working copy) @@ -50,13 +50,32 @@ endif ifeq ($(OS_ARCH), DOS) EXEC_SUFFIX := .exe -CPPFLAGS += -I../libgetopt -I../libpci/include +CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt LIBS += ../libgetopt/libgetopt.a -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \ @@ -237,7 +256,7 @@ else ifeq ($(OS_ARCH), DOS) # FIXME There needs to be a better way to do this -LIBS += ../libpci/lib/libpci.a +LIBS += ../../../djgpp/libpci/lib/libpci.a else LIBS += -lpci endif @@ -279,7 +298,7 @@ strip: $(PROGRAM)$(EXEC_SUFFIX) $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)
-compiler: +compiler: featuresavailable @printf "Checking for a C compiler... " @$(shell ( echo "int main(int argc, char **argv)"; \ echo "{ return 0; }"; ) > .test.c ) @@ -318,6 +337,17 @@
.features: features
+# If a user does not explicitly request a non-working feature, we should +# silently disable it. However, if a non-working (does not compile) feature +# is explicitly requested, we should bail out with a descriptive error message. +ifeq ($(UNSUPPORTED_FEATURES), ) +featuresavailable: +else +featuresavailable: + @echo "The following features are unavailable on your machine: $(UNSUPPORTED_FEATURES)" + @false +endif + ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @@ -375,6 +405,6 @@ djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS
-.PHONY: all clean distclean compiler pciutils features export tarball dos +.PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable
-include $(OBJS:.o=.d)
with a clean (no local patches) tree with latest svn HEAD?
These are the local modifications I apply/applied against HEAD:
Index: Makefile =================================================================== --- Makefile (revision 1047) +++ Makefile (working copy) @@ -49,10 +49,9 @@ LDFLAGS += -L/usr/local/lib endif ifeq ($(OS_ARCH), DOS) -EXEC_SUFFIX := .exe -CPPFLAGS += -I../libgetopt -I../libpci/include +CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt -LIBS += ../libgetopt/libgetopt.a +LIBS += ../../../djgpp/libgetopt/libgetopt.a # Bus Pirate and Serprog are not supported under DOS. CONFIG_BUSPIRATE_SPI = no CONFIG_SERPROG = no @@ -237,7 +236,7 @@ else ifeq ($(OS_ARCH), DOS) # FIXME There needs to be a better way to do this -LIBS += ../libpci/lib/libpci.a +LIBS += ../../../djgpp/libpci/lib/libpci.a else LIBS += -lpci endif @@ -374,6 +373,7 @@
djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS +# upx $(PROGRAM).exe
.PHONY: all clean distclean compiler pciutils features export tarball dos
Please install libpci (package pciutils) and/or libz. See README for more information.
make[1]: *** [pciutils] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
Thanks for testing this.
Regards, Carl-Daniel
On 14.06.2010 17:59, Idwer Vollering wrote:
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 14.06.2010 17:38, Idwer Vollering wrote:
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine:
CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
I'm not sure about that, it breaks djgpp-dos' compilation:
$ make distclean CONFIG_SERPROG=yes djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
WARNERROR=no
OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' The following features are unavailable on your machine:
CONFIG_SERPROG=yes
This is a desired effect of my patch, and we want that because serprog does not work on DOS (yet).
make[1]: *** [featuresavailable] Error 1 make[1]: Leaving directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' make: *** [djgpp-dos] Error 2
$ make distclean djgpp-dos rm -f flashrom flashrom.exe *.o *.d rm -f .features .libdeps make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
WARNERROR=no
OS_ARCH=DOS make[1]: Entering directory `/home/idwer/coreboot/svn/flashrom/trunk-r1047-patchwork-1509' Checking for a C compiler... found. Checking for libpci headers... found. Checking if libpci is present and sufficient... no. Checking if libz+libpci are present and sufficient...no.
And this is a bug. Can you reproduce this bug
No, I can only reproduce it when running "make distclean djgpp-dos" with http://patchwork.coreboot.org/patch/1509/ applied.
Index: Makefile
--- Makefile (revision 1047) +++ Makefile (working copy) @@ -50,13 +50,32 @@ endif ifeq ($(OS_ARCH), DOS) EXEC_SUFFIX := .exe -CPPFLAGS += -I../libgetopt -I../libpci/include +CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt LIBS += ../libgetopt/libgetopt.a
I think this is the reason why compilation fails. This LIBS statement has the wrong path for your installation.
-# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \
with a clean (no local patches) tree with latest svn HEAD?
These are the local modifications I apply/applied against HEAD:
Index: Makefile
--- Makefile (revision 1047) +++ Makefile (working copy) @@ -49,10 +49,9 @@ LDFLAGS += -L/usr/local/lib endif ifeq ($(OS_ARCH), DOS) -EXEC_SUFFIX := .exe
Hm. Is this EXEC_SUFFIX removal intentional?
-CPPFLAGS += -I../libgetopt -I../libpci/include +CPPFLAGS += -I../../../djgpp/libgetopt -I../../../djgpp/libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt -LIBS += ../libgetopt/libgetopt.a +LIBS += ../../../djgpp/libgetopt/libgetopt.a # Bus Pirate and Serprog are not supported under DOS. CONFIG_BUSPIRATE_SPI = no CONFIG_SERPROG = no
Regards, Carl-Daniel
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
On 12.06.2010 22:35, Carl-Daniel Hailfinger wrote:
On 05.06.2010 00:06, Carl-Daniel Hailfinger wrote:
Override incompatible CONFIG_FOO settings for DOS. This allows you to specify CONFIG_FOO=yes for all drivers and still get only those which compile under DOS.
Silently disabling explicitly requested features is a really bad idea. This new patch instead warns the user if any impossible (i.e. not compilable on this platform) features were specified. Such a warning will look like this:
The following features are unavailable on your machine:
CONFIG_NIC3COM=yes
If a user does not explicitly request an impossible feature, such a feature will be automatically disabled, so just typing "make" will get you the common subset of default and possible features.
Fixed a few minor bugs. Should be ready for merge.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.comvidwer%2Blists.flashrom@gmail.com>
Index: flashrom-dos_override_incompatible_config_foo/Makefile
--- flashrom-dos_override_incompatible_config_foo/Makefile (Revision 1047) +++ flashrom-dos_override_incompatible_config_foo/Makefile (Arbeitskopie) @@ -53,10 +53,29 @@ CPPFLAGS += -I../libgetopt -I../libpci/include # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt LIBS += ../libgetopt/libgetopt.a -# Bus Pirate and Serprog are not supported under DOS. -CONFIG_BUSPIRATE_SPI = no -CONFIG_SERPROG = no +# Bus Pirate and Serprog are not supported under DOS (missing serial support). +ifeq ($(CONFIG_BUSPIRATE_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes +else +override CONFIG_BUSPIRATE_SPI = no endif +ifeq ($(CONFIG_SERPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_SERPROG=yes +else +override CONFIG_SERPROG = no +endif +# Dediprog and FT2232 are not supported under DOS (missing USB support). +ifeq ($(CONFIG_DEDIPROG), yes) +UNSUPPORTED_FEATURES += CONFIG_DEDIPROG=yes +else +override CONFIG_DEDIPROG = no +endif +ifeq ($(CONFIG_FT2232_SPI), yes) +UNSUPPORTED_FEATURES += CONFIG_FT2232_SPI=yes +else +override CONFIG_FT2232_SPI = no +endif +endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ sst28sf040.o m29f400bt.o 82802ab.o pm49fl00x.o \ @@ -279,7 +298,7 @@ strip: $(PROGRAM)$(EXEC_SUFFIX) $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)
-compiler: +compiler: featuresavailable @printf "Checking for a C compiler... " @$(shell ( echo "int main(int argc, char **argv)"; \ echo "{ return 0; }"; ) > .test.c ) @@ -318,6 +337,17 @@
.features: features
+# If a user does not explicitly request a non-working feature, we should +# silently disable it. However, if a non-working (does not compile) feature +# is explicitly requested, we should bail out with a descriptive error message. +ifeq ($(UNSUPPORTED_FEATURES), ) +featuresavailable: +else +featuresavailable:
@echo "The following features are unavailable on your machine:
$(UNSUPPORTED_FEATURES)"
@false
+endif
ifeq ($(CONFIG_FT2232_SPI), yes) features: compiler @echo "FEATURES := yes" > .features.tmp @@ -375,6 +405,6 @@ djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS
-.PHONY: all clean distclean compiler pciutils features export tarball dos +.PHONY: all clean distclean compiler pciutils features export tarball dos featuresavailable
-include $(OBJS:.o=.d)
flashrom mailing list flashrom@flashrom.org http://www.flashrom.org/mailman/listinfo/flashrom
On 14.06.2010 20:00, Idwer Vollering wrote:
2010/6/14 Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.comvidwer%2Blists.flashrom@gmail.com>
It seems gmail is messing up your Acked-by line.
Thanks for the review and for testing. Committed in r1048.
Regards, Carl-Daniel