blob: 5015cf48844ade0328414583f57878edd2ace607 [file] [log] [blame]
Patrick Williams39653562024-03-01 08:54:02 -06001From 561216c8cbc280aaa9aecf30cb11835a4a0a78ed Mon Sep 17 00:00:00 2001
Andrew Geisslerd5838332022-05-27 11:33:10 -05002From: Richard Purdie <rpurdie@linux.intel.com>
3Date: Wed, 31 Dec 2008 17:20:38 +0000
4Subject: [PATCH] pciutils: Upgarde 2.2.4 -> 3.0.3
5
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006This patch:
7* ensures we link correctly
8* allows us to optionally pass target information to configure rather than using uname
9* select linux as the platform in most cases we care about
10
Andrew Geisslerd5838332022-05-27 11:33:10 -050011This is a merge of various tweaks to allow us to build pciutils including
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012work from:
13
147/30/2010 - Qing He <qing.he@intel.com>
151/22/2012 - Shane Wang <shane.wang@intel.com>
16Ionut Radu <ionutx.radu@intel.com>
172017/6/15 - RP - Cleanups and merging patches
18
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019Upstream-Status: Inappropriate [embedded specific]
Andrew Geisslerd5838332022-05-27 11:33:10 -050020---
21 Makefile | 2 +-
22 lib/configure | 14 ++++++++++----
23 2 files changed, 11 insertions(+), 5 deletions(-)
24
25diff --git a/Makefile b/Makefile
Patrick Williams39653562024-03-01 08:54:02 -060026index aaec04e..9c1dab0 100644
Andrew Geisslerd5838332022-05-27 11:33:10 -050027--- a/Makefile
28+++ b/Makefile
Patrick Williams39653562024-03-01 08:54:02 -060029@@ -123,7 +123,7 @@ pcilmr$(EXEEXT): pcilmr.o $(LMROBJS) $(COMMON) lib/$(PCIIMPLIB)
30 pcilmr.o: pcilmr.c $(LMRINC)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031
Andrew Geisslerd5838332022-05-27 11:33:10 -050032 %$(EXEEXT): %.o
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050034+ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035
Andrew Geissler517393d2023-01-13 08:55:19 -060036 ifdef PCI_OS_WINDOWS
37 comma := ,
Andrew Geisslerd5838332022-05-27 11:33:10 -050038diff --git a/lib/configure b/lib/configure
Patrick Williams39653562024-03-01 08:54:02 -060039index 3df057a..c87e71c 100755
Andrew Geisslerd5838332022-05-27 11:33:10 -050040--- a/lib/configure
41+++ b/lib/configure
Brad Bishop316dfdd2018-06-25 12:45:53 -040042@@ -9,6 +9,10 @@ echo_n() {
43 printf '%s' "$*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050044 }
45
46+VERSION=$1
47+IDSDIR=$2
48+DNS=yes
49+
Andrew Geisslerd5838332022-05-27 11:33:10 -050050 if [ -z "$VERSION" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 echo >&2 "Please run the configure script from the top-level Makefile"
52 exit 1
Brad Bishop316dfdd2018-06-25 12:45:53 -040053@@ -16,8 +20,8 @@ fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054
55 echo_n "Configuring libpci for your system..."
56 if [ -z "$HOST" ] ; then
57- sys=`uname -s`
58- rel=`uname -r`
59+ sys=${3:-`uname -s`}
60+ rel=
61 realsys="$sys"
62 if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
63 then
Brad Bishop316dfdd2018-06-25 12:45:53 -040064@@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
66 cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
67 else
Andrew Geisslerd5838332022-05-27 11:33:10 -050068- cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
69+ cpu=${4:-`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 fi
Andrew Geisslerd5838332022-05-27 11:33:10 -050071 if [ "$sys" = "DragonFly" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072 then
Andrew Geisslerd5838332022-05-27 11:33:10 -050073@@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 then
75 sys=cygwin
76 fi
77- HOST=${3:-$cpu-$sys}
78+ HOST=$cpu-$sys
79 fi
80 [ -n "$RELEASE" ] && rel="${RELEASE}"
81 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
Andrew Geisslerd5838332022-05-27 11:33:10 -050082@@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
84 echo " $host $rel $cpu $sys"
85
Brad Bishopd7bf8c12018-02-25 22:55:05 -050086+{ echo "$host" | grep linux; } && sys=linux
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087+
88 c=config.h
89 m=config.mk
90 echo >$c '#define PCI_CONFIG_H'