blob: e444c139756d75edd97a4bae679df62d53f7a9f6 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001This 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
6This is a merge of various tweaks to allow us to build pciutils including
7work from:
8
97/30/2010 - Qing He <qing.he@intel.com>
101/22/2012 - Shane Wang <shane.wang@intel.com>
11Ionut Radu <ionutx.radu@intel.com>
122017/6/15 - RP - Cleanups and merging patches
13
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014Upstream-Status: Inappropriate [embedded specific]
15
Brad Bishop316dfdd2018-06-25 12:45:53 -040016Index: pciutils-3.5.6/Makefile
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040018--- pciutils-3.5.6.orig/Makefile
19+++ pciutils-3.5.6/Makefile
20@@ -96,7 +96,7 @@ example: example.o lib/$(PCILIB)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 example.o: example.c $(PCIINC)
22
23 %: %.o
24- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025+ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
Andrew Geissler82c905d2020-04-13 13:39:40 -050027 %.8 %.7 %.5: %.man
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 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 Bishop316dfdd2018-06-25 12:45:53 -040029Index: pciutils-3.5.6/lib/configure
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040031--- 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 Williamsc124f4f2015-09-15 14:41:29 -050035 }
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 Bishop316dfdd2018-06-25 12:45:53 -040044@@ -16,8 +20,8 @@ fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045
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 Bishop316dfdd2018-06-25 12:45:53 -040055@@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050056 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 Bishop316dfdd2018-06-25 12:45:53 -040064@@ -35,7 +39,7 @@ if [ -z "$HOST" ] ; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050065 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 Geissler82c905d2020-04-13 13:39:40 -050073@@ -44,6 +48,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
75 echo " $host $rel $cpu $sys"
76
Brad Bishopd7bf8c12018-02-25 22:55:05 -050077+{ echo "$host" | grep linux; } && sys=linux
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078+
79 c=config.h
80 m=config.mk
81 echo >$c '#define PCI_CONFIG_H'