Patchwork new windows port

login
register
about
Submitter Carl-Daniel Hailfinger
Date 2009-08-09 21:47:17
Message ID <4A7F43E5.80107@gmx.net>
Download mbox | patch
Permalink /patch/98/
State Superseded
Headers show

Comments

Carl-Daniel Hailfinger - 2009-08-09 21:47:17
On 09.08.2009 22:35, Carl-Daniel Hailfinger wrote:
> On 09.08.2009 18:01, Stefan Reinauer wrote:
>   
>> Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
>>     
>
> The Makefile change breaks compilation for me. The serprog.c change can
> be simplified a bit. If you leave out those two files, the patch is
> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
>   

Since the serprog stuff is mostly cosmetics, I can cover that in a
separate patch. Please commit your version.
Updated makefile patch (which works for me) follows below. The change is
basically the definition of CC. For Windows, you want to force gcc. On
other architectures, compilers like llvm-gcc and clang etc. work fine
with flashrom.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Carl-Daniel Hailfinger - 2009-08-12 13:36:21
On 09.08.2009 23:47, Carl-Daniel Hailfinger wrote:
> On 09.08.2009 22:35, Carl-Daniel Hailfinger wrote:
>   
>> On 09.08.2009 18:01, Stefan Reinauer wrote:
>>   
>>     
>>> Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
>>>     
>>>       
>> The Makefile change breaks compilation for me. The serprog.c change can
>> be simplified a bit. If you leave out those two files, the patch is
>> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
>>     

The serprog patch is no longer needed since r679.

Regards,
Carl-Daniel

Patch

Index: flashrom-windows_makefile/Makefile
===================================================================
--- flashrom-windows_makefile/Makefile	(Revision 671)
+++ flashrom-windows_makefile/Makefile	(Arbeitskopie)
@@ -19,7 +19,11 @@ 
 
 PROGRAM = flashrom
 
+ifeq ($(OS), Windows_NT)
+CC      = gcc
+else
 CC      ?= gcc
+endif
 STRIP   = strip
 INSTALL = install
 DIFF    = diff
@@ -41,7 +45,11 @@ 
 LDFLAGS += -L/usr/local/lib
 endif
 
+ifeq ($(OS), Windows_NT)
+LIBS += -L. -ldirectio
+else
 LIBS += -lpci -lz
+endif
 
 OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \
 	sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o pm29f002.o \
@@ -68,8 +76,10 @@ 
 	$(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS) $(FEATURE_LIBS)
 
 FEATURE_CFLAGS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
-# Always enable serprog for now. Needs to be disabled on Windows.
+
+ifneq ($(OS), Windows_NT)
 FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
+endif
 
 FEATURE_LIBS = $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-lftdi")
 
@@ -102,6 +112,7 @@ 
 		rm -f .test.c .test; exit 1)
 	@rm -f .test.c .test
 
+ifneq ($(OS), Windows_NT)
 pciutils: compiler
 	@printf "Checking for pciutils and zlib... "
 	@$(shell ( echo "#include <pci/pci.h>";		   \
@@ -114,6 +125,7 @@ 
 		echo "See README for more information."; echo;		\
 		rm -f .test.c .test; exit 1)
 	@rm -f .test.c .test
+endif
 
 .features: features