blob: cf55b9480840913a170865e7833b00679ea64fcd [file] [log] [blame]
Andrew Geisslerd5838332022-05-27 11:33:10 -05001From 502c01e180d9085fcbeaf2fb46239999c4f335d2 Mon Sep 17 00:00:00 2001
2From: 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]
20
Andrew Geisslerd5838332022-05-27 11:33:10 -050021---
22 Makefile | 2 +-
23 lib/configure | 14 ++++++++++----
24 2 files changed, 11 insertions(+), 5 deletions(-)
25
26diff --git a/Makefile b/Makefile
27index 9319bb4..78a2d54 100644
28--- a/Makefile
29+++ b/Makefile
30@@ -108,7 +108,7 @@ example$(EXEEXT): example.o lib/$(PCILIB)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031 example.o: example.c $(PCIINC)
32
Andrew Geisslerd5838332022-05-27 11:33:10 -050033 %$(EXEEXT): %.o
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050035+ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 %.8 %.7 %.5: %.man
Andrew Geisslerd5838332022-05-27 11:33:10 -050038 M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#;s#@PCI_IDS@#$(PCI_IDS)#"
39diff --git a/lib/configure b/lib/configure
40index 45a416a..1afdaa6 100755
41--- a/lib/configure
42+++ b/lib/configure
Brad Bishop316dfdd2018-06-25 12:45:53 -040043@@ -9,6 +9,10 @@ echo_n() {
44 printf '%s' "$*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 }
46
47+VERSION=$1
48+IDSDIR=$2
49+DNS=yes
50+
Andrew Geisslerd5838332022-05-27 11:33:10 -050051 if [ -z "$VERSION" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 echo >&2 "Please run the configure script from the top-level Makefile"
53 exit 1
Brad Bishop316dfdd2018-06-25 12:45:53 -040054@@ -16,8 +20,8 @@ fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
56 echo_n "Configuring libpci for your system..."
57 if [ -z "$HOST" ] ; then
58- sys=`uname -s`
59- rel=`uname -r`
60+ sys=${3:-`uname -s`}
61+ rel=
62 realsys="$sys"
63 if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
64 then
Brad Bishop316dfdd2018-06-25 12:45:53 -040065@@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
67 cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
68 else
Andrew Geisslerd5838332022-05-27 11:33:10 -050069- 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/'`
70+ 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 -050071 fi
Andrew Geisslerd5838332022-05-27 11:33:10 -050072 if [ "$sys" = "DragonFly" ]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 then
Andrew Geisslerd5838332022-05-27 11:33:10 -050074@@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075 then
76 sys=cygwin
77 fi
78- HOST=${3:-$cpu-$sys}
79+ HOST=$cpu-$sys
80 fi
81 [ -n "$RELEASE" ] && rel="${RELEASE}"
82 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
Andrew Geisslerd5838332022-05-27 11:33:10 -050083@@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
85 echo " $host $rel $cpu $sys"
86
Brad Bishopd7bf8c12018-02-25 22:55:05 -050087+{ echo "$host" | grep linux; } && sys=linux
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088+
89 c=config.h
90 m=config.mk
91 echo >$c '#define PCI_CONFIG_H'