]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blob - sane/patches/sane-1.0.21-pkgconfig.patch
hplip: Drop package
[people/stevee/ipfire-3.x.git] / sane / patches / sane-1.0.21-pkgconfig.patch
1 From de99bb00b0084e8a1862398270278a14e099b22b Mon Sep 17 00:00:00 2001
2 From: Nils Philippsen <nils@redhat.com>
3 Date: Wed, 5 May 2010 13:23:40 +0200
4 Subject: [PATCH] patch: pkgconfig
5
6 Squashed commit of the following:
7
8 commit d615848c499842c5923c3274370d2536dc650916
9 Author: Nils Philippsen <nils@redhat.com>
10 Date: Fri Feb 26 17:51:14 2010 +0100
11
12 pkgconfig file is data
13 (cherry picked from commit 1f0e85c705a42c7e6ccd938eaad69f531c63f63d)
14
15 Signed-off-by: Nils Philippsen <nils@redhat.com>
16
17 commit 119d5af1ddd82dac034d0106a1d86b6d7564f25e
18 Author: Nils Philippsen <nils@redhat.com>
19 Date: Wed Jun 17 13:09:51 2009 +0200
20
21 make sane-config multilib-aware on Linux
22 (cherry picked from commit 52ef5f47ccc0128c78ab3ad38ac7b7918dd7ac88)
23
24 Signed-off-by: Nils Philippsen <nils@redhat.com>
25
26 commit 7ee1cbef01d851aca95d86145ac5dda02d9e7354
27 Author: Nils Philippsen <nils@redhat.com>
28 Date: Wed May 5 10:22:15 2010 +0200
29
30 use pkg-config in sane-config
31 ---
32 tools/Makefile.am | 14 ++++++++++-
33 tools/sane-config.in | 66 ++++++++++++++++++++++++++++++++++++++-----------
34 2 files changed, 64 insertions(+), 16 deletions(-)
35
36 diff --git a/tools/Makefile.am b/tools/Makefile.am
37 index f52a39a..ab4e1b7 100644
38 --- a/tools/Makefile.am
39 +++ b/tools/Makefile.am
40 @@ -7,6 +7,10 @@
41 AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include \
42 -I$(top_srcdir)/include
43
44 +SUFFIXES = .pc.in .pc
45 +
46 +pkgconfigdir = ${libdir}/pkgconfig
47 +
48 bin_PROGRAMS = sane-find-scanner gamma4scanimage
49 noinst_PROGRAMS = sane-desc umax_pp
50
51 @@ -26,8 +30,14 @@ noinst_SCRIPTS = $(HOTPLUG)
52 BUILT_SOURCES = $(HOTPLUG_DIR)
53 CLEANFILES = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS)
54
55 +pkgconfig_DATA = sane-backends.pc
56 +
57 +.pc.in.pc:
58 + cd $(top_builddir) \
59 + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
60 +
61 EXTRA_DIST = check-po.awk libtool-get-dll-ext mustek600iin-off.c \
62 - RenSaneDlls.cmd README xerox
63 + RenSaneDlls.cmd README xerox sane-backends.pc.in
64
65 sane_find_scanner_SOURCES = sane-find-scanner.c check-usb-chip.c \
66 ../backend/sane_strstatus.c
67 @@ -72,5 +82,7 @@ hal/libsane.fdi: $(wildcard ${top_srcdir}/doc/descriptions/*.desc) $(wildcard ${
68 @./sane-desc -m hal -s ${top_srcdir}/doc/descriptions:${top_srcdir}/doc/descriptions-external \
69 -d 0 > $@
70
71 +sane-backends.pc: $(top_builddir)/config.status
72 +
73 clean-local:
74 rm -f $(HOTPLUG)
75 diff --git a/tools/sane-config.in b/tools/sane-config.in
76 index 22c02b5..a9ce6fb 100644
77 --- a/tools/sane-config.in
78 +++ b/tools/sane-config.in
79 @@ -19,7 +19,7 @@ pkglibdir="@pkglibdir@"
80 includedir="@includedir@"
81 mandir="@mandir@"
82 infodir="@infodir@"
83 -libdir="@libdir@"
84 +#libdir=
85 localstatedir="@localstatedir@"
86 sysconfdir="@sysconfdir@"
87 datarootdir="@datarootdir@"
88 @@ -33,6 +33,30 @@ srcdir="@srcdir@"
89 top_srcdir="@top_srcdir@"
90 cflags=
91
92 +pkgconfig_package=sane-backends
93 +use_pkgconfig=0
94 +if test -x "@bindir@/pkg-config" && "@bindir@/pkg-config" --exists "$pkgconfig_package"; then
95 + use_pkgconfig=1
96 +else
97 + libdir=
98 + if kernel="`uname -s 2>/dev/null`"; then
99 + case "$kernel" in
100 + Linux)
101 + if hw="`uname -i 2>/dev/null`"; then
102 + case "$hw" in
103 + *64)
104 + libdir="@exec_prefix@/lib64"
105 + ;;
106 + esac
107 + fi
108 + ;;
109 + esac
110 + fi
111 + if test "x$libdir" = "x"; then
112 + libdir="@exec_prefix@/lib"
113 + fi
114 +fi
115 +
116 usage ()
117 {
118 echo "Usage: " 1>&2
119 @@ -60,7 +84,7 @@ if test $# -gt 0; then
120 if test $# -eq 1; then
121 usage
122 elif test $# -eq 2; then
123 - case $2 in
124 + case $2 in
125 --cflags)
126 echo "Usage: $0 --cflags"
127 echo " Print C compiler flags for compiling code that uses SANE."
128 @@ -86,26 +110,38 @@ if test $# -gt 0; then
129 ;;
130 --ldflags)
131
132 - if test -z "$LINKER_RPATH"; then
133 - echo "-L${libdir} @LDFLAGS@"
134 + if test "x$use_pkgconfig" = "x0"; then
135 + if test -z "$LINKER_RPATH"; then
136 + echo "-L${libdir} @LDFLAGS@"
137 + else
138 + echo "-L${libdir} @LDFLAGS@ ${LINKER_RPATH}${libdir}"
139 + fi
140 else
141 - echo "-L${libdir} @LDFLAGS@ ${LINKER_RPATH}${libdir}"
142 + pkg-config --libs-only-L "$pkgconfig_package"
143 fi
144 ;;
145 --libs)
146 - echo "-lsane ${LIBS}"
147 + if test "x$use_pkgconfig" = "x0"; then
148 + echo "-lsane ${LIBS}"
149 + else
150 + pkg-config --libs "$pkgconfig_package"
151 + fi
152 ;;
153 --cflags)
154 - unique_cflags=
155 - if test "${includedir}" != "/usr/include"; then
156 - unique_cflags="${unique_cflags} -I${includedir}"
157 - fi
158 - for i in $cflags; do
159 - if test "${i}" != "-I${includedir}"; then
160 - unique_cflags="${unique_cflags} $i"
161 + if test "x$use_pkgconfig" = "x0"; then
162 + unique_cflags=
163 + if test "${includedir}" != "/usr/include"; then
164 + unique_cflags="${unique_cflags} -I${includedir}"
165 fi
166 - done
167 - echo ${unique_cflags}
168 + for i in $cflags; do
169 + if test "${i}" != "-I${includedir}"; then
170 + unique_cflags="${unique_cflags} $i"
171 + fi
172 + done
173 + echo ${unique_cflags}
174 + else
175 + pkg-config --cflags "$pkgconfig_package"
176 + fi
177 ;;
178 --prefix)
179 echo ${prefix}
180 --
181 1.6.6.1
182