From ca011a164b5f170ff50a0ce1728077c70e031760 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 17 Sep 2010 22:33:12 +0400
Subject: [PATCH 04/10] Use HAVE_LIBPCI from config.h instead of NEED_PCI
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
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 410c3a4..fac9cf4 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1654,7 +1654,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 a58194f..d4dd155 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 <sys/io.h>
#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 c9f62c1..cbdb326 100644
--- a/internal.c
+++ b/internal.c
@@ -22,8 +22,9 @@
#include <stdlib.h>
#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 b68aa88..2948e4c 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,
@@ -212,7 +214,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;
@@ -277,7 +279,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.5.1