Added autotools support which fixes annoying compilation issues on

non-x86 platforms

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This commit is contained in:
Peter Lemenkov 2010-09-24 14:58:44 +04:00
parent ebb066d53a
commit c17bb0a5e3
5 changed files with 1318 additions and 91 deletions

View File

@ -1,60 +0,0 @@
From 6023a9545efc976e37cc3e2444cdc7c18d987f8d Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Sat, 12 Jun 2010 22:13:53 +0400
Subject: [PATCH 1/1] Define dmidecode path at a build stage
This helps in case then user doesn't have dmidecode in his PATH.
For example, if user elevates his privileges with sudo, then he
may not inherit some superuser's environmental variables ($PATH,
contaning additional directories - /sbin, /usr/sbin and similar).
In case of failure to determine full path to dmidecode it just
fallbacks to the default value.
Tested only on Linux.
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
Makefile | 5 ++++-
dmi.c | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index e83fc0b..7919e10 100644
--- a/Makefile
+++ b/Makefile
@@ -169,6 +169,9 @@ CONFIG_DEDIPROG ?= no
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
+# Try to detect full path for dmidecode
+CONFIG_DMIDECODE_PATH ?= $(shell LC_ALL=C type -p dmidecode 2>/dev/null || echo "dmidecode")
+
ifeq ($(CONFIG_INTERNAL), yes)
FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1'
PROGRAMMER_OBJS += processor_enable.o chipset_enable.o board_enable.o cbtable.o dmi.o internal.o
@@ -323,7 +326,7 @@ $(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root")
%.o: %.c .features
- $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
+ $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -DCONFIG_DMIDECODE_PATH=\"$(CONFIG_DMIDECODE_PATH)\" -o $@ -c $<
# Make sure to add all names of generated binaries here.
# This includes all frontends and libflashrom.
diff --git a/dmi.c b/dmi.c
index f18907f..d483acb 100644
--- a/dmi.c
+++ b/dmi.c
@@ -55,7 +55,7 @@ static const char *dmidecode_names[] = {
};
#define DMI_COMMAND_LEN_MAX 260
-static const char *dmidecode_command = "dmidecode";
+static const char *dmidecode_command = CONFIG_DMIDECODE_PATH;
static char *dmistrings[ARRAY_SIZE(dmidecode_names)];
--
1.7.2.3

View File

@ -1,3 +1,79 @@
From 2b6eddb61699265ce89bc93c9523dd5658513019 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 24 Sep 2010 14:42:32 +0400
Subject: [PATCH 1/2] Sync with svn ver. 1180
---
82802ab.c | 2 -
Makefile | 230 +++--
README | 9 +
atahpt.c | 4 +-
bitbang_spi.c | 158 ++--
board_enable.c | 1248 ++++++++++++++++-------
buspirate_spi.c | 129 +--
cbtable.c | 3 +
chipdrivers.h | 23 +-
chipset_enable.c | 590 ++++-------
cli_classic.c | 90 +-
dediprog.c | 40 +-
dmi.c | 55 +-
drkaiser.c | 24 +-
dummyflasher.c | 51 +-
flash.h | 472 +--------
flashchips.c | 2698 ++++++++++++++++++++++++++++++++++++-----------
flashchips.h | 728 +++++++------
flashrom.8 | 255 ++++--
flashrom.c | 479 ++++++---
ft2232_spi.c | 191 ++--
gfxnvidia.c | 19 +-
hwaccess.c | 105 ++-
hwaccess.h | 163 +++-
ichspi.c | 346 +++++--
internal.c | 81 ++-
it87spi.c | 226 +++--
jedec.c | 20 +-
layout.c | 40 +-
m29f400bt.c | 53 -
mcp6x_spi.c | 176 +++
nic3com.c | 20 +-
nicintel_spi.c | 179 ++++
nicnatsemi.c | 95 ++
nicrealtek.c | 115 ++
pcidev.c | 12 +-
physmap.c | 40 +-
pm49fl00x.c | 2 +-
print.c | 638 +++++++-----
print_wiki.c | 480 ++-------
processor_enable.c | 46 +
programmer.c | 1 -
programmer.h | 602 +++++++++++
rayer_spi.c | 123 +++
satasii.c | 35 +-
sb600spi.c | 223 ++++-
serial.c | 11 +-
serprog.c | 100 ++-
sharplhf00l04.c | 1 -
spi.c | 134 ++-
spi.h | 14 +-
spi25.c | 626 +++++++++--
sst28sf040.c | 4 +-
sst49lfxxxc.c | 28 +-
sst_fwhub.c | 6 +-
stm50flw0x0x.c | 4 +-
udelay.c | 67 +-
util/z60_flashrom.rules | 55 +
w29ee011.c | 1 -
wbsio_spi.c | 28 +-
60 files changed, 8413 insertions(+), 3985 deletions(-)
create mode 100644 mcp6x_spi.c
create mode 100644 nicintel_spi.c
create mode 100644 nicnatsemi.c
create mode 100644 nicrealtek.c
create mode 100644 processor_enable.c
create mode 100644 programmer.h
create mode 100644 rayer_spi.c
create mode 100644 util/z60_flashrom.rules
diff --git a/82802ab.c b/82802ab.c diff --git a/82802ab.c b/82802ab.c
index c9d1a75..3935a7e 100644 index c9d1a75..3935a7e 100644
--- a/82802ab.c --- a/82802ab.c
@ -12,7 +88,7 @@ index c9d1a75..3935a7e 100644
#include "chipdrivers.h" #include "chipdrivers.h"
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index 6a9beb5..e83fc0b 100644 index 51ca084..e83fc0b 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -48,11 +48,37 @@ ifeq ($(OS_ARCH), FreeBSD) @@ -48,11 +48,37 @@ ifeq ($(OS_ARCH), FreeBSD)
@ -56,7 +132,7 @@ index 6a9beb5..e83fc0b 100644
endif endif
CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \ CHIP_OBJS = jedec.o stm50flw0x0x.o w39v040c.o w39v080fa.o w29ee011.o \
@@ -65,7 +91,7 @@ CLI_OBJS = flashrom.o cli_classic.o cli_output.o print.o @@ -65,13 +91,13 @@ CLI_OBJS = flashrom.o cli_classic.o cli_output.o print.o
PROGRAMMER_OBJS = udelay.o programmer.o PROGRAMMER_OBJS = udelay.o programmer.o
@ -65,6 +141,13 @@ index 6a9beb5..e83fc0b 100644
# Set the flashrom version string from the highest revision number # Set the flashrom version string from the highest revision number
# of the checked out flashrom files. # of the checked out flashrom files.
# Note to packagers: Any tree exported with "make export" or "make tarball"
# will not require subversion. The downloadable snapshots are already exported.
-SVNVERSION := 1001
+SVNVERSION := $(shell LC_ALL=C svnversion -cn . 2>/dev/null | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" || LC_ALL=C svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || LC_ALL=C git svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || echo unknown)
RELEASE := 0.9.2
VERSION := $(RELEASE)-r$(SVNVERSION)
@@ -85,14 +111,29 @@ CONFIG_INTERNAL ?= yes @@ -85,14 +111,29 @@ CONFIG_INTERNAL ?= yes
# Always enable serprog for now. Needs to be disabled on Windows. # Always enable serprog for now. Needs to be disabled on Windows.
CONFIG_SERPROG ?= yes CONFIG_SERPROG ?= yes
@ -19298,3 +19381,6 @@ index ca39322..acf9cb2 100644
- return spi_chip_write_1(flash, buf); - return spi_chip_write_1(flash, buf);
-} -}
+#endif +#endif
--
1.7.2.3

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
--- Makefile~ 2010-09-12 18:42:42.750110259 +0400
+++ Makefile 2010-09-12 18:57:47.557609365 +0400
@@ -97,7 +97,7 @@
# of the checked out flashrom files.
# Note to packagers: Any tree exported with "make export" or "make tarball"
# will not require subversion. The downloadable snapshots are already exported.
-SVNVERSION := 1001
+SVNVERSION := 1180
RELEASE := 0.9.2
VERSION := $(RELEASE)-r$(SVNVERSION)

View File

@ -1,17 +1,16 @@
%global svnrev 1180
Summary: Simple program for reading/writing BIOS chips content Summary: Simple program for reading/writing BIOS chips content
Name: flashrom Name: flashrom
Version: 0.9.2 Version: 0.9.2
Release: 5.svn1180%{?dist} Release: 6.svn1180%{?dist}
License: GPLv2 License: GPLv2
Group: Applications/System Group: Applications/System
URL: http://flashrom.org URL: http://flashrom.org
Source0: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2 Source0: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2
Source1: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2.asc Source1: http://qa.coreboot.org/releases/%{name}-%{version}.tar.bz2.asc
Patch0: flashrom-r1002-r%{svnrev}.diff Patch1: flashrom-0001-Sync-with-svn-ver.-1180.patch
Patch1: flashrom-svn_ver.diff Patch2: flashrom-0002-Initial-commit-of-autotools-related-files.patch
Patch2: flashrom-0001-Define-dmidecode-path-at-a-build-stage.patch BuildRequires: autoconf
BuildRequires: automake
BuildRequires: pciutils-devel BuildRequires: pciutils-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
%ifnarch ppc ppc64 %ifnarch ppc ppc64
@ -29,24 +28,18 @@ and write new contents on the chips ("flash the chip").
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch1 -p1
%patch1 -p0
%patch2 -p1 %patch2 -p1
%build %build
%ifarch ppc ppc64 autoreconf -ivf
CFLAGS="%{optflags}" make %{?_smp_mflags} CONFIG_RAYER_SPI=no CONFIG_NIC3COM=no CONFIG_NICREALTEK=no %configure
%else make %{?_smp_mflags}
CFLAGS="%{optflags}" make %{?_smp_mflags}
%endif
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%ifarch ppc ppc64 make install DESTDIR=$RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} CONFIG_RAYER_SPI=no CONFIG_NIC3COM=no CONFIG_NICREALTEK=no
%else
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix}
%endif
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -58,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/%{name}.* %{_mandir}/man8/%{name}.*
%changelog %changelog
* Fri Sep 24 2010 Peter Lemenkov <lemenkov@gmail.com> 0.9.2-6.svn1180
- Added autotools support
* Tue Sep 21 2010 Peter Lemenkov <lemenkov@gmail.com> 0.9.2-5.svn1180 * Tue Sep 21 2010 Peter Lemenkov <lemenkov@gmail.com> 0.9.2-5.svn1180
- Patch no.3 merged upstream - Patch no.3 merged upstream