From 39bd06642030c29b202ae52162de0f437cfffedc Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Fri, 17 Sep 2010 22:33:12 +0400 Subject: [PATCH 04/12] Use HAVE_LIBPCI from config.h instead of NEED_PCI Signed-off-by: Peter Lemenkov --- flashrom.c | 2 +- hwaccess.h | 6 ++++-- internal.c | 3 ++- programmer.h | 6 ++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/flashrom.c b/flashrom.c index dd6d6df..df4cc67 100644 --- a/flashrom.c +++ b/flashrom.c @@ -1388,7 +1388,7 @@ void print_sysinfo(void) msg_ginfo(" on unknown machine"); #endif msg_ginfo(", built with"); -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 #ifdef PCILIB_VERSION msg_ginfo(" libpci %s,", PCILIB_VERSION); #else diff --git a/hwaccess.h b/hwaccess.h index 63a2bf2..920b82c 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -24,13 +24,15 @@ #ifndef __HWACCESS_H__ #define __HWACCESS_H__ 1 +#include "config.h" + #if defined (__i386__) || defined (__x86_64__) #if defined(__GLIBC__) #include #endif #endif -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 /* * libpci headers use the variable name "index" which triggers shadowing * warnings on systems which have the index() function in a default #include @@ -160,7 +162,7 @@ cpu_to_be(64) #define le_to_cpu32 cpu_to_le32 #define le_to_cpu64 cpu_to_le64 -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 #if defined (__i386__) || defined (__x86_64__) #define __FLASHROM_HAVE_OUTB__ 1 diff --git a/internal.c b/internal.c index c96db99..8bc49b9 100644 --- a/internal.c +++ b/internal.c @@ -22,8 +22,9 @@ #include #include "flash.h" #include "programmer.h" +#include "config.h" -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 struct pci_dev *pci_dev_find_filter(struct pci_filter filter) { struct pci_dev *temp; diff --git a/programmer.h b/programmer.h index 6407695..dfd99b4 100644 --- a/programmer.h +++ b/programmer.h @@ -24,6 +24,8 @@ #ifndef __PROGRAMMER_H__ #define __PROGRAMMER_H__ 1 +#include "config.h" + enum programmer { #if CONFIG_INTERNAL == 1 PROGRAMMER_INTERNAL, @@ -198,7 +200,7 @@ void myusec_delay(int usecs); void myusec_calibrate_delay(void); void internal_delay(int usecs); -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 /* pcidev.c */ extern uint32_t io_base_addr; extern struct pci_access *pacc; @@ -253,7 +255,7 @@ void dmi_init(void); int dmi_match(const char *pattern); /* internal.c */ -#if NEED_PCI == 1 +#if HAVE_LIBPCI == 1 struct superio { uint16_t vendor; uint16_t port; -- 1.7.3.1