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