[flashrom] [PATCH] More robust libpci detection

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Sat Feb 27 16:07:55 CET 2010


Am Freitag, den 26.02.2010, 15:01 +0100 schrieb Carl-Daniel Hailfinger:
> Idwer reported problems with the current libpci check on
> 
> FreeBSD 8.0-RELEASE i386
As I don't really know what the problem ist, I have to guess here. As I
understand it, linking against -lpci without linking -lz at the same
time yields a linker error on FreeBSD.

> -	@printf "Checking for libpci... "
> +	@printf "Checking for libpci (method 1)... "
>  	@$(shell ( echo "#include <pci/pci.h>";		   \
>  		   echo "int main(int argc, char **argv)"; \
>  		   echo "{ return 0; }"; ) > .test1.c )
> -	@$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test1.c -o .test1 -lpci $(LIBS) >/dev/null 2>&1 &&	\
> -		echo "found." || ( echo "not found."; echo;				\
> -		echo "Please install libpci (package pciutils).";			\
> -		echo "See README for more information."; echo;				\
> -		rm -f .test1.c .test1; exit 1)
> +	@$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test1.c -o .test1 $(LIBS) >/dev/null 2>&1 &&	\
> +		echo "found." || ( echo "not found.";		\
This does not include "-lpci" anymore. It should succeed on every system
where the include file pci/pci.h can be found. But that has already been
checked on the previous check. The "--print-file-name" calls thus never
seem to get executed.

Regards,
  Michael Karcher





More information about the flashrom mailing list