[flashrom] [PATCH] Compile out FT2232 SPI if not selected

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Wed Aug 19 15:28:46 CEST 2009


On 19.08.2009 13:52, Stefan Reinauer wrote:
> On 8/17/09 5:57 PM, Carl-Daniel Hailfinger wrote:
>   
>> If FT2232H SPI is not enabled, it should be compiled out completely. We
>> can't remove ft2232_spi.o from unconditional OBJS yet due to our
>> makefile structure (make features), but this patch adds #ifdefs around
>> all FT2232H code, so the net effect is the same.
>>
>> This is 0.9.1 material.
>>
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>   
>>     
> Please address the one issue below.
>   

I worked on that thing for hours and didn't get it to work reliably.
Detailed explanation below.

> Acked-by: Stefan Reinauer <stepan at coresystems.de>
>   

Thanks, r691.

Once I know how to solve the makefile issue, I'll send a followup patch
addressing your comments.

> For serprog.c the mechanism is moved to the Makefile
>
> ifeq ($(CONFIG_SERPROG), yes)
> FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
> OBJS += serprog.o
> endif
>
>
> Maybe the two cases should be unified?
>   

CONFIG_SERPROG is not determined during make features, so we can use it
in ifeq easily.
FT2232_SPI support is determined during make features which is after any
ifeq statements have been parsed, and thus the ifeq solution will always
give the same result regardless of whether FT2232_SPI was actually
selected or not.

There are two ways out:
- Run make twice automatically (which also means running make features
and make compiler and make pciutils twice). I once had such a patch in
flashrom, but I was asked to convert this back to the run-once model so
I did that.
- Move make config to a separate configure.sh

Neither of these ways sounds great.

Any advice is appreciated.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list