This repository has been archived by the owner on Jun 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathltmain.sh-2.4.6.diff
150 lines (144 loc) · 4.72 KB
/
ltmain.sh-2.4.6.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# ltmain.sh.diff -- SANE backend library soname handling fixes
# Copyright (C) 2016 SEIKO EPSON CORPORATION
#
# License: GPL-2.0+ (same as ltmain.sh)
# Author : EPSON AVASYS CORPORATION
#
# Patch relative to: GNU libtool 2.4.6 Debian-2.4.6-0.1
--- ../upstream/ltmain.sh.orig 2016-06-13 17:25:24.944625684 +0900
+++ ../upstream/ltmain.sh 2016-06-13 17:32:46.125116789 +0900
@@ -3829,6 +3829,16 @@
exit $?
fi
+## Utsushi SANE modification (start)
+## Regular expression for SANE backend names (valid C identifier).
+## Note this regexp needs to be correct for use in shell globs as
+## well as with sed. It is used in link and execute modes.
+
+utsushi_alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+utsushi_digit='0123456789'
+utsushi_sane_backend_regexp=[_$utsushi_alpha][_$utsushi_alpha$utsushi_digit]*
+
+## Utsushi SANE modification (end)
# func_mode_execute arg...
func_mode_execute ()
@@ -5328,6 +5338,58 @@
func_exec_program_core ()
{
"
+## Utsushi SANE modification (start)
+ case $host in
+ *aix*) # rumoured not to work ...
+ ;;
+
+ *)
+ $ECHO "\
+ # Utsushi libtool modification (start)
+ # Make sure that programs can find the as of yet uninstalled
+ # libraries for which we changed the soname.
+ for lib in $notinst_deplibs \"$dlname\"; do
+ libdir=
+ dlname=
+ case \$lib in
+ libsane-$utsushi_sane_backend_regexp.*)
+ libdir=.
+ case \$lib in
+ *$std_shrext*)
+ dlname=\$lib
+ ;;
+ *.la)
+ dlname=\`${SED} -n -e \"s/^dlname='\\([^']*\\).*/\\1/p\" \$lib\`
+ ;;
+ esac
+ ;;
+ */libsane-$utsushi_sane_backend_regexp.la)
+ libdir=\`\$ECHO \$lib | ${SED} -e 's/\/[^/]*\$//'\`
+ if test -d \"\$libdir/$objdir\"; then
+ libdir=../\$libdir/$objdir
+ fi
+ dlname=\`${SED} -n -e \"s/^dlname='\\([^']*\\).*/\\1/p\" \$lib\`
+ ;;
+ esac
+ # Link the dlname library to its soname equivalent and make sure
+ # it is found before anything else.
+ if test x != x\"\$libdir\"; then
+ soname=\`\$ECHO \$dlname | ${SED} -e 's/libsane-$utsushi_sane_backend_regexp/libsane/'\`
+ $LN_S -f \$libdir/\$dlname \"\$progdir/\$soname\"
+ if test -n "\$$shlibpath_var"; then
+ $shlibpath_var="\$progdir:\$$shlibpath_var"
+ else
+ $shlibpath_var="\$progdir"
+ fi
+ export $shlibpath_var
+ break
+ fi
+ done
+ # Utsushi libtool modification (end)
+"
+ ;;
+ esac
+## Utsushi SANE modification (end)
case $host in
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2* | *-cegcc*)
@@ -9615,6 +9677,43 @@
dlname=$soname
fi
+## Utsushi SANE modification (start)
+## Moved here from just before the enclosing 'fi' statement so we can
+## safely rewrite the soname before anything gets run.
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+
+## The SANE API recommends/requires(?) that backends are made available
+## with a soname that does NOT contain the "-$backend" bit. The dlname
+## should contain this part for the SANE dll backend to work.
+## Note, there are several 'libname_spec' and 'soname_spec' definitions
+## and these combine to yield a number of different soname varieties at
+## this point in the code. Trying to catch them all but there's a fair
+## chance we dropping the ball on little used OSs. SANE's dll backend
+## tries to do the same in its implementation so its PREFIX definitions
+## may be helpful in identifying other soname patterns.
+##
+## Last versions checked: libtool-2.2.6b, sane-backends-1.0.21.
+## Last versions checked: libtool-2.4.2, sane-backends-1.0.24.
+
+ case $host in
+ *aix*) # rumoured not to work ...
+ ;;
+
+ *)
+ soname=`echo $soname \
+ | sed -e "s/^libsane-$utsushi_sane_backend_regexp/libsane/g" \
+ -e "s/^cygsane-$utsushi_sane_backend_regexp/cygsane/g" \
+ -e "s/^sane-$utsushi_sane_backend_regexp/sane/g"`
+ ;;
+ esac
+
+## Utsushi SANE modification (end)
+
lib=$output_objdir/$realname
linknames=
for link
@@ -10074,11 +10173,14 @@
fi
done
- # If -module or -export-dynamic was specified, set the dlname.
- if test yes = "$module" || test yes = "$export_dynamic"; then
- # On all known operating systems, these are identical.
- dlname=$soname
- fi
+## Utsushi SANE modification (start)
+## Moved before the soname modification needed by SANE.
+## # If -module or -export-dynamic was specified, set the dlname.
+## if test yes = "$module" || test yes = "$export_dynamic"; then
+## # On all known operating systems, these are identical.
+## dlname=$soname
+## fi
+## Utsushi SANE modification (end)
fi
;;