summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch')
-rw-r--r--meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch b/meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch
new file mode 100644
index 0000000000..7268d531d9
--- /dev/null
+++ b/meta/recipes-bsp/pciutils/pciutils-3.1.9/lib-build-fix.patch
@@ -0,0 +1,94 @@
1Link directly to lib/libpci.so.3.1.5 will hard code this versioned
2string into lspci and other utilities, which is not desirable and
3won't work. In the other hand, linking to a symbolic link lib/libpci.so
4doesn't have this issue.
5
6Upstream-Status: Pending
7
87/30/2010 - created by Qing He <qing.he@intel.com>
9
10diff --git a/Makefile b/Makefile
11index 1b48e18..21af4b3 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -51,9 +51,9 @@ PCIINC_INS=lib/config.h lib/header.h lib/pci.h lib/types.h
15
16 export
17
18-all: lib/$(PCILIB) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS) pcimodules pcimodules.8
19+all: lib/$(PCILIB_DEV) lspci setpci example lspci.8 setpci.8 pcilib.7 update-pciids update-pciids.8 $(PCI_IDS) pcimodules pcimodules.8
20
21-lib/$(PCILIB): $(PCIINC) force
22+lib/$(PCILIB) lib/$(PCILIB_DEV): $(PCIINC) force
23 $(MAKE) -C lib all
24
25 force:
26@@ -61,9 +61,9 @@ force:
27 lib/config.h lib/config.mk:
28 cd lib && ./configure
29
30-pcimodules: pcimodules.o common.o lib/$(PCILIB)
31-lspci: lspci.o ls-vpd.o ls-caps.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/$(PCILIB)
32-setpci: setpci.o common.o lib/$(PCILIB)
33+pcimodules: pcimodules.o common.o lib/$(PCILIB_DEV)
34+lspci: lspci.o ls-vpd.o ls-caps.o ls-ecaps.o ls-kernel.o ls-tree.o ls-map.o common.o lib/$(PCILIB_DEV)
35+setpci: setpci.o common.o lib/$(PCILIB_DEV)
36
37 pcimodules.o: pcimodules.c pciutils.h
38 LSPCIINC=lspci.h pciutils.h $(PCIINC)
39@@ -83,7 +83,7 @@ update-pciids: update-pciids.sh
40 chmod +x $@
41
42 # The example of use of libpci
43-example: example.o lib/$(PCILIB)
44+example: example.o lib/$(PCILIB_DEV)
45 example.o: example.c $(PCIINC)
46
47 %: %.o
48diff --git a/lib/Makefile b/lib/Makefile
49index 1eb06a5..a8dab56 100644
50--- a/lib/Makefile
51+++ b/lib/Makefile
52@@ -42,7 +42,7 @@ ifdef PCI_HAVE_PM_NBSD_LIBPCI
53 OBJS += nbsd-libpci
54 endif
55
56-all: $(PCILIB) $(PCILIBPC)
57+all: $(PCILIB_DEV) $(PCILIBPC)
58
59 ifeq ($(SHARED),no)
60 $(PCILIB): $(addsuffix .o,$(OBJS))
61@@ -53,6 +53,9 @@ else
62 CFLAGS += -fPIC -fvisibility=hidden
63 $(PCILIB): $(addsuffix .o,$(OBJS))
64 $(CC) -shared $(LDFLAGS) $(SONAME) -Wl,--version-script=libpci.ver -o $@ $^ $(LIB_LDLIBS)
65+
66+$(PCILIB_DEV): $(PCILIB)
67+ ln -s $< $@
68 endif
69
70 $(PCILIBPC): libpci.pc.in
71diff --git a/lib/configure b/lib/configure
72index eec225a..4318b05 100755
73--- a/lib/configure
74+++ b/lib/configure
75@@ -174,16 +193,18 @@ fi
76 echo "Checking whether to build a shared library... $SHARED (set manually)"
77 if [ "$SHARED" = no ] ; then
78 echo >>$m 'PCILIB=$(LIBNAME).a'
79+ echo >>$m 'PCILIB_DEV=$(LIBNAME).a'
80 echo >>$m 'LDLIBS=$(WITH_LIBS)'
81 echo >>$m 'LIB_LDLIBS='
82 else
83 echo >>$m 'PCILIB=$(LIBNAME).so.$(VERSION)'
84+ echo >>$m 'PCILIB_DEV=$(LIBNAME).so'
85 # We link the dependencies _to_ the library, so we do not need explicit deps in .pc
86 echo >>$m 'LDLIBS='
87 echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)'
88 echo >>$c '#define PCI_SHARED_LIB'
89 if [ "$SHARED" = yes ] ; then
90- echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).so$(ABI_VERSION)'
91+ echo >>$m 'SONAME=-Wl,-soname -Wl,$(LIBNAME).so$(ABI_VERSION)'
92 fi
93 fi
94 echo >>$m 'PCILIBPC=$(LIBNAME).pc'