Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 1 | From 561216c8cbc280aaa9aecf30cb11835a4a0a78ed Mon Sep 17 00:00:00 2001 |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 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] |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 20 | --- |
| 21 | Makefile | 2 +- |
| 22 | lib/configure | 14 ++++++++++---- |
| 23 | 2 files changed, 11 insertions(+), 5 deletions(-) |
| 24 | |
| 25 | diff --git a/Makefile b/Makefile |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 26 | index aaec04e..9c1dab0 100644 |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 27 | --- a/Makefile |
| 28 | +++ b/Makefile |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 29 | @@ -123,7 +123,7 @@ pcilmr$(EXEEXT): pcilmr.o $(LMROBJS) $(COMMON) lib/$(PCIIMPLIB) |
| 30 | pcilmr.o: pcilmr.c $(LMRINC) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 32 | %$(EXEEXT): %.o |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | - $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 34 | + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 36 | ifdef PCI_OS_WINDOWS |
| 37 | comma := , |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 38 | diff --git a/lib/configure b/lib/configure |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 39 | index 3df057a..c87e71c 100755 |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 40 | --- a/lib/configure |
| 41 | +++ b/lib/configure |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 42 | @@ -9,6 +9,10 @@ echo_n() { |
| 43 | printf '%s' "$*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | +VERSION=$1 |
| 47 | +IDSDIR=$2 |
| 48 | +DNS=yes |
| 49 | + |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 50 | if [ -z "$VERSION" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | echo >&2 "Please run the configure script from the top-level Makefile" |
| 52 | exit 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | @@ -16,8 +20,8 @@ fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | |
| 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | @@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 68 | - 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | fi |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 71 | if [ "$sys" = "DragonFly" ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 72 | then |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 73 | @@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | 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 Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 82 | @@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` |
| 84 | echo " $host $rel $cpu $sys" |
| 85 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 86 | +{ echo "$host" | grep linux; } && sys=linux |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 87 | + |
| 88 | c=config.h |
| 89 | m=config.mk |
| 90 | echo >$c '#define PCI_CONFIG_H' |