Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | This patch: |
| 2 | * ensures we link correctly |
| 3 | * allows us to optionally pass target information to configure rather than using uname |
| 4 | * select linux as the platform in most cases we care about |
| 5 | |
| 6 | This is a merge of various tweaks to allow us to build pciutils including |
| 7 | work from: |
| 8 | |
| 9 | 7/30/2010 - Qing He <qing.he@intel.com> |
| 10 | 1/22/2012 - Shane Wang <shane.wang@intel.com> |
| 11 | Ionut Radu <ionutx.radu@intel.com> |
| 12 | 2017/6/15 - RP - Cleanups and merging patches |
| 13 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | Upstream-Status: Inappropriate [embedded specific] |
| 15 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 16 | Index: pciutils-3.5.6/Makefile |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 17 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | --- pciutils-3.5.6.orig/Makefile |
| 19 | +++ pciutils-3.5.6/Makefile |
| 20 | @@ -96,7 +96,7 @@ example: example.o lib/$(PCILIB) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | example.o: example.c $(PCIINC) |
| 22 | |
| 23 | %: %.o |
| 24 | - $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 27 | %.8 %.7 %.5: %.man |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | 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)#" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 29 | Index: pciutils-3.5.6/lib/configure |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 31 | --- pciutils-3.5.6.orig/lib/configure |
| 32 | +++ pciutils-3.5.6/lib/configure |
| 33 | @@ -9,6 +9,10 @@ echo_n() { |
| 34 | printf '%s' "$*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | +VERSION=$1 |
| 38 | +IDSDIR=$2 |
| 39 | +DNS=yes |
| 40 | + |
| 41 | if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then |
| 42 | echo >&2 "Please run the configure script from the top-level Makefile" |
| 43 | exit 1 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 44 | @@ -16,8 +20,8 @@ fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | |
| 46 | echo_n "Configuring libpci for your system..." |
| 47 | if [ -z "$HOST" ] ; then |
| 48 | - sys=`uname -s` |
| 49 | - rel=`uname -r` |
| 50 | + sys=${3:-`uname -s`} |
| 51 | + rel= |
| 52 | realsys="$sys" |
| 53 | if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ] |
| 54 | then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 55 | @@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1` |
| 57 | cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'` |
| 58 | else |
| 59 | - cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` |
| 60 | + cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} |
| 61 | fi |
| 62 | if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ] |
| 63 | then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | @@ -35,7 +39,7 @@ if [ -z "$HOST" ] ; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 65 | then |
| 66 | sys=cygwin |
| 67 | fi |
| 68 | - HOST=${3:-$cpu-$sys} |
| 69 | + HOST=$cpu-$sys |
| 70 | fi |
| 71 | [ -n "$RELEASE" ] && rel="${RELEASE}" |
| 72 | # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame^] | 73 | @@ -44,6 +48,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 74 | sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` |
| 75 | echo " $host $rel $cpu $sys" |
| 76 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 77 | +{ echo "$host" | grep linux; } && sys=linux |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | + |
| 79 | c=config.h |
| 80 | m=config.mk |
| 81 | echo >$c '#define PCI_CONFIG_H' |