Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 1 | From 502c01e180d9085fcbeaf2fb46239999c4f335d2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Richard Purdie <rpurdie@linux.intel.com> |
| 3 | Date: Wed, 31 Dec 2008 17:20:38 +0000 |
| 4 | Subject: [PATCH] pciutils: Upgarde 2.2.4 -> 3.0.3 |
| 5 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | This 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 11 | This is a merge of various tweaks to allow us to build pciutils including |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | work from: |
| 13 | |
| 14 | 7/30/2010 - Qing He <qing.he@intel.com> |
| 15 | 1/22/2012 - Shane Wang <shane.wang@intel.com> |
| 16 | Ionut Radu <ionutx.radu@intel.com> |
| 17 | 2017/6/15 - RP - Cleanups and merging patches |
| 18 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | Upstream-Status: Inappropriate [embedded specific] |
| 20 | |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 21 | --- |
| 22 | Makefile | 2 +- |
| 23 | lib/configure | 14 ++++++++++---- |
| 24 | 2 files changed, 11 insertions(+), 5 deletions(-) |
| 25 | |
| 26 | diff --git a/Makefile b/Makefile |
| 27 | index 9319bb4..78a2d54 100644 |
| 28 | --- a/Makefile |
| 29 | +++ b/Makefile |
| 30 | @@ -108,7 +108,7 @@ example$(EXEEXT): example.o lib/$(PCILIB) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | example.o: example.c $(PCIINC) |
| 32 | |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 33 | %$(EXEEXT): %.o |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | - $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 35 | + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 37 | %.8 %.7 %.5: %.man |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 38 | 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)#" |
| 39 | diff --git a/lib/configure b/lib/configure |
| 40 | index 45a416a..1afdaa6 100755 |
| 41 | --- a/lib/configure |
| 42 | +++ b/lib/configure |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 43 | @@ -9,6 +9,10 @@ echo_n() { |
| 44 | printf '%s' "$*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | +VERSION=$1 |
| 48 | +IDSDIR=$2 |
| 49 | +DNS=yes |
| 50 | + |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 51 | if [ -z "$VERSION" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | echo >&2 "Please run the configure script from the top-level Makefile" |
| 53 | exit 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 54 | @@ -16,8 +20,8 @@ fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | |
| 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 65 | @@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 69 | - 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | fi |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 72 | if [ "$sys" = "DragonFly" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 74 | @@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 83 | @@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 84 | sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` |
| 85 | echo " $host $rel $cpu $sys" |
| 86 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 87 | +{ echo "$host" | grep linux; } && sys=linux |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | + |
| 89 | c=config.h |
| 90 | m=config.mk |
| 91 | echo >$c '#define PCI_CONFIG_H' |