Gentoo Archives: gentoo-dev

From: haubi@g.o
To: gentoo-dev@l.g.o
Cc: haubi@g.o
Subject: [gentoo-dev] [PATCH 1/4] add lt-2.4.6 winnt patches for use with parity-2
Date: Thu, 12 Mar 2020 08:07:59
Message-Id: 20200312080626.5163-2-haubi@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/4] elt-patches: support wrapped Win32 MSVC toolchain by haubi@gentoo.org
1 From: Michael Haubenwallner <haubi@g.o>
2
3 If a package does not have libtool-2.4.6 there is no guarantee things
4 will work, and the package should use eautoreconf instead.
5
6 Signed-off-by: Michael Haubenwallner <haubi@g.o>
7 ---
8 eltpatch.in | 3 +-
9 patches/winnt-conf/2.4.6-cmd-max-len | 15 +
10 patches/winnt-conf/2.4.6-deplibs-method | 15 +
11 patches/winnt-conf/2.4.6-dlload | 15 +
12 patches/winnt-conf/2.4.6-dlopen-deplibs | 16 +
13 patches/winnt-conf/2.4.6-dynlink | 46 ++
14 patches/winnt-conf/2.4.6-dynlink-c | 46 ++
15 patches/winnt-conf/2.4.6-global-syms | 129 +++++
16 patches/winnt-conf/2.4.6-pathconv | 21 +
17 patches/winnt-conf/2.4.6-pic-c | 19 +
18 patches/winnt-conf/2.4.6-pic-cxx | 18 +
19 patches/winnt-conf/2.4.6-setup | 23 +
20 patches/winnt-conf/2.4.6-shlibs | 15 +
21 patches/winnt-conf/2.4.6-shlibs-c | 20 +
22 patches/winnt-conf/2.4.6-shlibs-cxx | 33 ++
23 patches/winnt-conf/2.4.6-strip | 30 ++
24 patches/winnt-ltmain/2.4.6 | 683 ++++++++++++++++++++++++
25 17 files changed, 1146 insertions(+), 1 deletion(-)
26 create mode 100644 patches/winnt-conf/2.4.6-cmd-max-len
27 create mode 100644 patches/winnt-conf/2.4.6-deplibs-method
28 create mode 100644 patches/winnt-conf/2.4.6-dlload
29 create mode 100644 patches/winnt-conf/2.4.6-dlopen-deplibs
30 create mode 100644 patches/winnt-conf/2.4.6-dynlink
31 create mode 100644 patches/winnt-conf/2.4.6-dynlink-c
32 create mode 100644 patches/winnt-conf/2.4.6-global-syms
33 create mode 100644 patches/winnt-conf/2.4.6-pathconv
34 create mode 100644 patches/winnt-conf/2.4.6-pic-c
35 create mode 100644 patches/winnt-conf/2.4.6-pic-cxx
36 create mode 100644 patches/winnt-conf/2.4.6-setup
37 create mode 100644 patches/winnt-conf/2.4.6-shlibs
38 create mode 100644 patches/winnt-conf/2.4.6-shlibs-c
39 create mode 100644 patches/winnt-conf/2.4.6-shlibs-cxx
40 create mode 100644 patches/winnt-conf/2.4.6-strip
41 create mode 100644 patches/winnt-ltmain/2.4.6
42
43 diff --git a/eltpatch.in b/eltpatch.in
44 index d8c847b..6b69216 100644
45 --- a/eltpatch.in
46 +++ b/eltpatch.in
47 @@ -179,6 +179,7 @@ elibtoolize() {
48 *-hpux*) elt_patches+=" hpux-conf deplibs hc-flag-ld hardcode hardcode-relink relink-prog no-lc" ;;
49 *-irix*) elt_patches+=" irix-ltmain" ;;
50 *-mint*) elt_patches+=" mint-conf" ;;
51 + *-winnt*) elt_patches+=" winnt-conf winnt-ltmain" ;;
52 esac
53
54 if ${LD} --version 2>&1 | grep -qs 'GNU gold'; then
55 @@ -371,7 +372,7 @@ elibtoolize() {
56 ret=$?
57 fi
58 ;;
59 - aixrtl|hpux-conf)
60 + aixrtl|hpux-conf|winnt-conf)
61 ret=1
62 local subret=0
63 # apply multiple patches as often as they match
64 diff --git a/patches/winnt-conf/2.4.6-cmd-max-len b/patches/winnt-conf/2.4.6-cmd-max-len
65 new file mode 100644
66 index 0000000..0b7b290
67 --- /dev/null
68 +++ b/patches/winnt-conf/2.4.6-cmd-max-len
69 @@ -0,0 +1,15 @@
70 +--- configure
71 ++++ configure
72 +@@ -5915,11 +5915,11 @@
73 + # And add a safety zone
74 + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
75 + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
76 + ;;
77 +
78 +- interix*)
79 ++ interix* | winnt*)
80 + # We know the value 262144 and hardcode it with a safety zone (like BSD)
81 + lt_cv_sys_max_cmd_len=196608
82 + ;;
83 +
84 + os2*)
85 diff --git a/patches/winnt-conf/2.4.6-deplibs-method b/patches/winnt-conf/2.4.6-deplibs-method
86 new file mode 100644
87 index 0000000..92b2ac9
88 --- /dev/null
89 +++ b/patches/winnt-conf/2.4.6-deplibs-method
90 @@ -0,0 +1,15 @@
91 +--- configure
92 ++++ configure
93 +@@ -6285,11 +6285,11 @@
94 + # func_win32_libid is a shell function defined in ltmain.sh
95 + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
96 + lt_cv_file_magic_cmd='func_win32_libid'
97 + ;;
98 +
99 +-mingw* | pw32*)
100 ++mingw* | pw32* | winnt*)
101 + # Base MSYS/MinGW do not provide the 'file' command needed by
102 + # func_win32_libid shell function, so use a weaker test based on 'objdump',
103 + # unless we find 'file', for example because we are cross-compiling.
104 + if ( file / ) >/dev/null 2>&1; then
105 + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
106 diff --git a/patches/winnt-conf/2.4.6-dlload b/patches/winnt-conf/2.4.6-dlload
107 new file mode 100644
108 index 0000000..ea9b804
109 --- /dev/null
110 +++ b/patches/winnt-conf/2.4.6-dlload
111 @@ -0,0 +1,15 @@
112 +--- configure
113 ++++ configure
114 +@@ -13596,11 +13716,11 @@
115 +
116 + ;;
117 + beos*)
118 + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
119 + ;;
120 +-cygwin* | mingw* | pw32*)
121 ++cygwin* | mingw* | pw32* | winnt*)
122 + ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include <sys/cygwin.h>
123 + "
124 + if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then :
125 + ac_have_decl=1
126 + else
127 diff --git a/patches/winnt-conf/2.4.6-dlopen-deplibs b/patches/winnt-conf/2.4.6-dlopen-deplibs
128 new file mode 100644
129 index 0000000..c0b6404
130 --- /dev/null
131 +++ b/patches/winnt-conf/2.4.6-dlopen-deplibs
132 @@ -0,0 +1,16 @@
133 +--- configure
134 ++++ configure
135 +@@ -13935,10 +14055,13 @@
136 + lt_cv_sys_dlopen_deplibs=yes
137 + ;;
138 + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
139 + libltdl_cv_sys_dlopen_deplibs=yes
140 + ;;
141 ++ winnt*)
142 ++ lt_cv_sys_dlopen_deplibs=yes
143 ++ ;;
144 + esac
145 +
146 + fi
147 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5
148 + $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; }
149 diff --git a/patches/winnt-conf/2.4.6-dynlink b/patches/winnt-conf/2.4.6-dynlink
150 new file mode 100644
151 index 0000000..c786ec3
152 --- /dev/null
153 +++ b/patches/winnt-conf/2.4.6-dynlink
154 @@ -0,0 +1,46 @@
155 +--- configure
156 ++++ configure
157 +@@ -11728,10 +11769,43 @@
158 + $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
159 + esac
160 + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
161 + else
162 + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
163 ++ case $host_os in
164 ++ winnt*)
165 ++ sys_lib_search_path_spec=`$CC -print-search-dirs |
166 ++ $AWK '/^libraries:/{sub(/^libraries: *=?/,""); print}'`
167 ++ # The space separated shell string breaks on characters like blanks and
168 ++ # parentheses often found in Windows directory names. Fortunately, the
169 ++ # 8.3 DOS format does not use these characters, but that might be disabled.
170 ++ # First, convert to 8.3 DOS format to remove invalid characters eventually.
171 ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec"`
172 ++ # Second, converting back to unix format does preserve 8.3 path parts.
173 ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec"`
174 ++ # Finally, convert to the space separated list, but filter out path names
175 ++ # with invalid characters: They were created while 8.3 DOS file name
176 ++ # creation was disabled for that partition.
177 ++ lt_search_path_spec=$sys_lib_search_path_spec
178 ++ sys_lib_search_path_spec=
179 ++ lt_save_ifs=$IFS;
180 ++ IFS=$PATH_SEPARATOR
181 ++ for lt_path in $lt_search_path_spec
182 ++ do
183 ++ IFS=$lt_save_ifs
184 ++ case $lt_path in
185 ++ *[' ()']*)
186 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing 8.3 path name to find libs in $lt_path" >&5
187 ++$as_echo "$as_me: WARNING: missing 8.3 path name to find libs in $lt_path" >&2;}
188 ++ continue
189 ++ ;;
190 ++ esac
191 ++ sys_lib_search_path_spec="$sys_lib_search_path_spec${sys_lib_search_path_spec:+ }$lt_path"
192 ++ done
193 ++ IFS=$lt_save_ifs
194 ++ ;;
195 ++ esac
196 + fi
197 + library_names_spec=
198 + libname_spec='lib$name'
199 + soname_spec=
200 + shrext_cmds=.so
201 diff --git a/patches/winnt-conf/2.4.6-dynlink-c b/patches/winnt-conf/2.4.6-dynlink-c
202 new file mode 100644
203 index 0000000..b80f2c7
204 --- /dev/null
205 +++ b/patches/winnt-conf/2.4.6-dynlink-c
206 @@ -0,0 +1,46 @@
207 +--- configure
208 ++++ configure
209 +@@ -11890,10 +11967,43 @@
210 + # the default ld.so.conf also contains /usr/contrib/lib and
211 + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
212 + # libtool to hard-code these into programs
213 + ;;
214 +
215 ++winnt*)
216 ++ # The real dll is NAME.dll,
217 ++ # the import lib is NAME.lib, but
218 ++ # the static lib is libNAME.lib, which requires libname_spec=lib$name.
219 ++ # Upon /path/to/*.lib, we use deplibs_check_method=file_magic to
220 ++ # accept NAME.lib as import lib, but reject static libNAME.lib.
221 ++ libext=lib
222 ++ version_type=windows
223 ++ need_version=no
224 ++ need_lib_prefix=no
225 ++ shrext_cmds=.dll
226 ++ library_names_spec='${libname#lib}.$libext'
227 ++ soname_spec='${libname#lib}$release$versuffix$shared_ext'
228 ++ sys_lib_dlsearch_path_spec=
229 ++ shlibpath_var=PATH
230 ++ shlibpath_overrides_runpath=yes
231 ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
232 ++ postinstall_cmds='base_file=`basename \$file`~
233 ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
234 ++ dldir=$destdir/`dirname \$dlpath`~
235 ++ test -d \$dldir || mkdir -p \$dldir~
236 ++ $install_prog $dir/$dlname \$dldir/$dlname~
237 ++ chmod a+x \$dldir/$dlname~
238 ++ if test -f $dir/${dlname%.dll}.pdb; then $install_prog $dir/${dlname%.dll}.pdb \$dldir/${dlname%.dll}.pdb; fi~
239 ++ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
240 ++ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
241 ++ fi'
242 ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
243 ++ dlpath=$dir/\$dldll~
244 ++ func_append rmfiles " \$dlpath \${dlpath%.dll}.pdb"'
245 ++ dynamic_linker='Win32 link.exe with Parity extensions'
246 ++ ;;
247 ++
248 + cygwin* | mingw* | pw32* | cegcc*)
249 + version_type=windows
250 + shrext_cmds=.dll
251 + need_version=no
252 + need_lib_prefix=no
253 diff --git a/patches/winnt-conf/2.4.6-global-syms b/patches/winnt-conf/2.4.6-global-syms
254 new file mode 100644
255 index 0000000..f84e6ab
256 --- /dev/null
257 +++ b/patches/winnt-conf/2.4.6-global-syms
258 @@ -0,0 +1,129 @@
259 +--- configure
260 ++++ configure
261 +@@ -7087,11 +7087,11 @@
262 + # Define system-specific variables.
263 + case $host_os in
264 + aix*)
265 + symcode='[BCDT]'
266 + ;;
267 +-cygwin* | mingw* | pw32* | cegcc*)
268 ++cygwin* | mingw* | pw32* | cegcc* | winnt*)
269 + symcode='[ABCDGISTW]'
270 + ;;
271 + hpux*)
272 + if test ia64 = "$host_cpu"; then
273 + symcode='[ABCDEGRST]'
274 +@@ -7126,46 +7126,56 @@
275 + symcode='[ABCDGIRSTW]' ;;
276 + esac
277 +
278 + if test "$lt_cv_nm_interface" = "MS dumpbin"; then
279 + # Gets list of data symbols to import.
280 +- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
281 ++ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/\1/p'"
282 + # Adjust the below global symbol transforms to fixup imported variables.
283 +- lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
284 +- lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
285 ++ lt_cdecl_hook=" -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern __declspec(dllimport) char \1;/p'"
286 ++ lt_c_name_hook=" -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) 0},/p'"
287 + lt_c_name_lib_hook="\
288 +- -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
289 +- -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
290 ++ -e 's/^I .* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) 0},/p'\
291 ++ -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"lib\1\", (void *) 0},/p'"
292 + else
293 + # Disable hooks by default.
294 + lt_cv_sys_global_symbol_to_import=
295 + lt_cdecl_hook=
296 + lt_c_name_hook=
297 + lt_c_name_lib_hook=
298 ++ case $host_os in
299 ++ winnt*)
300 ++ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/\1/p'"
301 ++ lt_cdecl_hook=" -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern __declspec(dllimport) char \1;/p'"
302 ++ lt_c_name_hook=" -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) 0},/p'"
303 ++ lt_c_name_lib_hook="\
304 ++ -e 's/^D [^ ]* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) 0},/p'\
305 ++ -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"lib\1\", (void *) 0},/p'"
306 ++ ;;
307 ++ esac
308 + fi
309 +
310 + # Transform an extracted symbol line into a proper C declaration.
311 + # Some systems (esp. on ia64) link data and code symbols differently,
312 + # so use this general approach.
313 + lt_cv_sys_global_symbol_to_cdecl="sed -n"\
314 + $lt_cdecl_hook\
315 +-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
316 +-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
317 ++" -e 's/^T .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern int \1();/p'"\
318 ++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern char \1;/p'"
319 +
320 + # Transform an extracted symbol line into symbol name and symbol address
321 + lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
322 + $lt_c_name_hook\
323 + " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
324 +-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
325 ++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) \&\1},/p'"
326 +
327 + # Transform an extracted symbol line into symbol name with lib prefix and
328 + # symbol address.
329 + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
330 + $lt_c_name_lib_hook\
331 + " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
332 +-" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
333 +-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
334 ++" -e 's/^$symcode$symcode* .* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"\1\", (void *) \&\1},/p'"\
335 ++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/ {\"lib\1\", (void *) \&\1},/p'"
336 +
337 + # Handle CRLF in mingw tool chain
338 + opt_cr=
339 + case $build_os in
340 + mingw*)
341 +@@ -7175,35 +7185,43 @@
342 +
343 + # Try without a prefix underscore, then with it.
344 + for ac_symprfx in "" "_"; do
345 +
346 + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
347 +- symxfrm="\\1 $ac_symprfx\\2 \\2"
348 ++ # In Windows import libraries, symbols may be prefixed with __imp_, as well
349 ++ # as __nm_ when using GNU ld. The leading underscore (in 32bit) comes after
350 ++ # the __imp_ and __nm_ prefix, so make sure to strip the underscore from the
351 ++ # symbol name instead of the __imp_ or __nm_ prefix, leaving these prefixes
352 ++ # intact in the symbol pipe output.
353 ++ symxfrm="\\1 \\2$ac_symprfx\\3 \\2\\3"
354 +
355 + # Write the raw and C identifiers.
356 + if test "$lt_cv_nm_interface" = "MS dumpbin"; then
357 + # Fake it for dumpbin and say T for any non-static function,
358 + # D for any global variable and I for any imported variable.
359 + # Also find C++ and __fastcall symbols from MSVC++,
360 +- # which start with @ or ?.
361 ++ # which start with @ or ?. And Cygwin gawk-4.1.4-3 and newer
362 ++ # treats input as binary, have to drop carriage return first.
363 + lt_cv_sys_global_symbol_pipe="$AWK '"\
364 ++" {sub(/\\r\$/,\"\")};"\
365 + " {last_section=section; section=\$ 3};"\
366 + " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
367 + " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
368 + " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
369 + " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
370 + " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
371 + " \$ 0!~/External *\|/{next};"\
372 + " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
373 + " {if(hide[section]) next};"\
374 + " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
375 ++" \$ 0~/ [0-9a-fA-F]*[1-9a-fA-F][0-9a-fA-F]* UNDEF /{f=\"C\"};"\
376 + " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
377 + " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
378 + " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
379 + " ' prfx=^$ac_symprfx"
380 + else
381 +- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
382 ++ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\(__imp_\|__nm_\)\{0,1\}$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
383 + fi
384 + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
385 +
386 + # Check to see that the pipe works correctly.
387 + pipe_works=no
388 diff --git a/patches/winnt-conf/2.4.6-pathconv b/patches/winnt-conf/2.4.6-pathconv
389 new file mode 100644
390 index 0000000..444d4ad
391 --- /dev/null
392 +++ b/patches/winnt-conf/2.4.6-pathconv
393 @@ -0,0 +1,21 @@
394 +--- configure
395 ++++ configure
396 +@@ -6040,16 +6040,16 @@
397 + $as_echo_n "checking how to convert $build file names to $host format... " >&6; }
398 + if ${lt_cv_to_host_file_cmd+:} false; then :
399 + $as_echo_n "(cached) " >&6
400 + else
401 + case $host in
402 +- *-*-mingw* )
403 ++ *-*-mingw* | *-*-winnt* )
404 + case $build in
405 + *-*-mingw* ) # actually msys
406 + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
407 + ;;
408 +- *-*-cygwin* )
409 ++ *-*-cygwin* | *-*-winnt* )
410 + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
411 + ;;
412 + * ) # otherwise, assume *nix
413 + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
414 + ;;
415 diff --git a/patches/winnt-conf/2.4.6-pic-c b/patches/winnt-conf/2.4.6-pic-c
416 new file mode 100644
417 index 0000000..2f15c5b
418 --- /dev/null
419 +++ b/patches/winnt-conf/2.4.6-pic-c
420 @@ -0,0 +1,19 @@
421 +--- configure
422 ++++ configure
423 +@@ -9709,10 +9737,16 @@
424 + lt_prog_compiler_static='$wl-static'
425 + ;;
426 + esac
427 + ;;
428 +
429 ++ winnt*)
430 ++ lt_prog_compiler_pic='-DDLL_EXPORT'
431 ++ lt_prog_compiler_wl='-Wl,'
432 ++ lt_prog_compiler_static='-static'
433 ++ ;;
434 ++
435 + hpux9* | hpux10* | hpux11*)
436 + lt_prog_compiler_wl='-Wl,'
437 + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
438 + # not for PA HP-UX.
439 + case $host_cpu in
440 diff --git a/patches/winnt-conf/2.4.6-pic-cxx b/patches/winnt-conf/2.4.6-pic-cxx
441 new file mode 100644
442 index 0000000..b99f526
443 --- /dev/null
444 +++ b/patches/winnt-conf/2.4.6-pic-cxx
445 @@ -0,0 +1,18 @@
446 +--- configure
447 ++++ configure
448 +@@ -16371,10 +16500,15 @@
449 + # Green Hills C++ Compiler
450 + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
451 + ;;
452 + esac
453 + ;;
454 ++ winnt*)
455 ++ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
456 ++ lt_prog_compiler_wl_CXX='-Wl,'
457 ++ lt_prog_compiler_static_CXX='-static'
458 ++ ;;
459 + mingw* | cygwin* | os2* | pw32* | cegcc*)
460 + # This hack is so that the source file can tell whether it is being
461 + # built for inclusion in a dll (and should export symbols for example).
462 + lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
463 + ;;
464 diff --git a/patches/winnt-conf/2.4.6-setup b/patches/winnt-conf/2.4.6-setup
465 new file mode 100644
466 index 0000000..50c1939
467 --- /dev/null
468 +++ b/patches/winnt-conf/2.4.6-setup
469 @@ -0,0 +1,23 @@
470 +--- configure
471 ++++ configure
472 +@@ -9208,10 +9226,20 @@
473 +
474 +
475 +
476 +
477 +
478 ++# On winnt, the Microsoft compiler (or compatible) is used behind the scenes.
479 ++# While wrappers around it may be capable of resolving symbolic links, the
480 ++# compiler (cl.exe) chokes on header files which are symlinked, as the
481 ++# wrapper cannot know about them.
482 ++# Everybody would be happy with ln -s, except libtoolize without --copy.
483 ++# There ln -s breaks the testsuite, since it tries to compile symlinked
484 ++# source, which is not supported by the compiler.
485 ++case $LN_S,$host_os in
486 ++,winnt*|"ln -s",winnt*) LN_S="cp -p" ;;
487 ++esac
488 + test -z "$LN_S" && LN_S="ln -s"
489 +
490 +
491 +
492 +
493 diff --git a/patches/winnt-conf/2.4.6-shlibs b/patches/winnt-conf/2.4.6-shlibs
494 new file mode 100644
495 index 0000000..1acd9d8
496 --- /dev/null
497 +++ b/patches/winnt-conf/2.4.6-shlibs
498 @@ -0,0 +1,15 @@
499 +--- configure
500 ++++ configure
501 +@@ -10200,11 +10234,11 @@
502 + # preloaded symbol tables.
503 + # Exclude shared library initialization/finalization symbols.
504 + extract_expsyms_cmds=
505 +
506 + case $host_os in
507 +- cygwin* | mingw* | pw32* | cegcc*)
508 ++ cygwin* | mingw* | pw32* | cegcc* | winnt*)
509 + # FIXME: the MSVC++ port hasn't been tested in a loooong time
510 + # When not using gcc, we currently assume that we are using
511 + # Microsoft Visual C++.
512 + if test yes != "$GCC"; then
513 + with_gnu_ld=no
514 diff --git a/patches/winnt-conf/2.4.6-shlibs-c b/patches/winnt-conf/2.4.6-shlibs-c
515 new file mode 100644
516 index 0000000..cba9709
517 --- /dev/null
518 +++ b/patches/winnt-conf/2.4.6-shlibs-c
519 @@ -0,0 +1,20 @@
520 +--- configure
521 ++++ configure
522 +@@ -10855,10 +10889,17 @@
523 +
524 + bsdi[45]*)
525 + export_dynamic_flag_spec=-rdynamic
526 + ;;
527 +
528 ++ winnt*)
529 ++ exclude_expsyms='__NULL_IMPORT_DESCRIPTOR|__IMPORT_DESCRIPTOR_.*'
530 ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags -o $output_objdir/$soname -Wl,--out-implib,$lib'
531 ++ archive_cmds_need_lc=no
532 ++ allow_undefined_flag=unsupported
533 ++ ;;
534 ++
535 + cygwin* | mingw* | pw32* | cegcc*)
536 + # When not using gcc, we currently assume that we are using
537 + # Microsoft Visual C++.
538 + # hardcode_libdir_flag_spec is actually meaningless, as there is
539 + # no search path for DLLs.
540 diff --git a/patches/winnt-conf/2.4.6-shlibs-cxx b/patches/winnt-conf/2.4.6-shlibs-cxx
541 new file mode 100644
542 index 0000000..fde2b39
543 --- /dev/null
544 +++ b/patches/winnt-conf/2.4.6-shlibs-cxx
545 @@ -0,0 +1,33 @@
546 +--- configure
547 ++++ configure
548 +@@ -15286,10 +15409,16 @@
549 + ld_shlibs_CXX=no
550 + ;;
551 + esac
552 + ;;
553 +
554 ++ winnt*)
555 ++ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags -o $output_objdir/$soname -Wl,--out-implib,$lib'
556 ++ archive_cmds_need_lc_CXX=no
557 ++ allow_undefined_flag_CXX=unsupported
558 ++ ;;
559 ++
560 + cygwin* | mingw* | pw32* | cegcc*)
561 + case $GXX,$cc_basename in
562 + ,cl* | no,cl*)
563 + # Native MSVC
564 + # hardcode_libdir_flag_spec is actually meaningless, as there is
565 +@@ -16860,10 +16994,13 @@
566 + fi
567 + ;;
568 + pw32*)
569 + export_symbols_cmds_CXX=$ltdll_cmds
570 + ;;
571 ++ winnt*)
572 ++ exclude_expsyms_CXX='__NULL_IMPORT_DESCRIPTOR|__IMPORT_DESCRIPTOR_.*'
573 ++ ;;
574 + cygwin* | mingw* | cegcc*)
575 + case $cc_basename in
576 + cl*)
577 + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
578 + ;;
579 diff --git a/patches/winnt-conf/2.4.6-strip b/patches/winnt-conf/2.4.6-strip
580 new file mode 100644
581 index 0000000..7cb0eec
582 --- /dev/null
583 +++ b/patches/winnt-conf/2.4.6-strip
584 @@ -0,0 +1,30 @@
585 +--- configure
586 ++++ configure
587 +@@ -13171,14 +13281,24 @@
588 + striplib=
589 + old_striplib=
590 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
591 + $as_echo_n "checking whether stripping libraries is possible... " >&6; }
592 + if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
593 +- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
594 +- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
595 +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
596 ++ case $host_os in
597 ++ winnt*)
598 ++ # Stripping is not save here, since POSIXish host utils may
599 ++ # be detected, but we operate on native windows libraries.
600 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
601 ++$as_echo "no" >&6; }
602 ++ ;;
603 ++ *)
604 ++ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
605 ++ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
606 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
607 + $as_echo "yes" >&6; }
608 ++ ;;
609 ++ esac
610 + else
611 + # FIXME - insert some real tests, host_os isn't really good enough
612 + case $host_os in
613 + darwin*)
614 + if test -n "$STRIP"; then
615 diff --git a/patches/winnt-ltmain/2.4.6 b/patches/winnt-ltmain/2.4.6
616 new file mode 100644
617 index 0000000..ddb077c
618 --- /dev/null
619 +++ b/patches/winnt-ltmain/2.4.6
620 @@ -0,0 +1,683 @@
621 +--- ltmain.sh
622 ++++ ltmain.sh
623 +@@ -2416,11 +2416,11 @@
624 + test : = "$debug_cmd" || func_append preserve_args " --debug"
625 +
626 + case $host in
627 + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
628 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
629 +- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
630 ++ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2* | *winnt*)
631 + # don't eliminate duplications in $postdeps and $predeps
632 + opt_duplicate_compiler_generated_deps=:
633 + ;;
634 + *)
635 + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
636 +@@ -3437,11 +3437,11 @@
637 + removelist="$lobj $libobj ${libobj}T"
638 + fi
639 +
640 + # On Cygwin there's no "real" PIC flag so we must build both object types
641 + case $host_os in
642 +- cygwin* | mingw* | pw32* | os2* | cegcc*)
643 ++ cygwin* | mingw* | pw32* | os2* | cegcc* | winnt*)
644 + pic_mode=default
645 + ;;
646 + esac
647 + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
648 + # non-PIC code in shared libraries is not supported
649 +@@ -4311,11 +4311,11 @@
650 + # Install the shared library and build the symlinks.
651 + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
652 + 'exit $?'
653 + tstripme=$stripme
654 + case $host_os in
655 +- cygwin* | mingw* | pw32* | cegcc*)
656 ++ cygwin* | mingw* | pw32* | cegcc* | winnt*)
657 + case $realname in
658 + *.dll.a)
659 + tstripme=
660 + ;;
661 + esac
662 +@@ -4424,11 +4424,11 @@
663 + ;;
664 + esac
665 +
666 + # Do a test to see if this is really a libtool program.
667 + case $host in
668 +- *cygwin* | *mingw*)
669 ++ *cygwin* | *mingw* | *winnt*)
670 + if func_ltwrapper_executable_p "$file"; then
671 + func_ltwrapper_scriptname "$file"
672 + wrapper=$func_ltwrapper_scriptname_result
673 + else
674 + func_stripname '' '.exe' "$file"
675 +@@ -4652,11 +4652,11 @@
676 + export_symbols=$output_objdir/$outputname.exp
677 + $opt_dry_run || {
678 + $RM $export_symbols
679 + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
680 + case $host in
681 +- *cygwin* | *mingw* | *cegcc* )
682 ++ *cygwin* | *mingw* | *cegcc* | winnt*)
683 + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
684 + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
685 + ;;
686 + esac
687 + }
688 +@@ -4664,11 +4664,11 @@
689 + $opt_dry_run || {
690 + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
691 + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
692 + eval '$MV "$nlist"T "$nlist"'
693 + case $host in
694 +- *cygwin* | *mingw* | *cegcc* )
695 ++ *cygwin* | *mingw* | *cegcc* | winnt*)
696 + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
697 + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
698 + ;;
699 + esac
700 + }
701 +@@ -4678,11 +4678,11 @@
702 + for dlprefile in $dlprefiles; do
703 + func_verbose "extracting global C symbols from '$dlprefile'"
704 + func_basename "$dlprefile"
705 + name=$func_basename_result
706 + case $host in
707 +- *cygwin* | *mingw* | *cegcc* )
708 ++ *cygwin* | *mingw* | *cegcc* | *winnt* )
709 + # if an import library, we need to obtain dlname
710 + if func_win32_import_lib_p "$dlprefile"; then
711 + func_tr_sh "$dlprefile"
712 + eval "curr_lafile=\$libfile_$func_tr_sh_result"
713 + dlprefile_dlbasename=
714 +@@ -4705,11 +4705,11 @@
715 + func_warning "Could not compute DLL name from $name"
716 + eval '$ECHO ": $name " >> "$nlist"'
717 + fi
718 + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
719 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
720 +- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
721 ++ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/ __nm_/ /' >> '$nlist'"
722 + }
723 + else # not an import lib
724 + $opt_dry_run || {
725 + eval '$ECHO ": $name " >> "$nlist"'
726 + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
727 +@@ -4853,11 +4853,11 @@
728 + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
729 +
730 + # Transform the symbol file into the correct name.
731 + symfileobj=$output_objdir/${my_outputname}S.$objext
732 + case $host in
733 +- *cygwin* | *mingw* | *cegcc* )
734 ++ *cygwin* | *mingw* | *cegcc* | winnt*)
735 + if test -f "$output_objdir/$my_outputname.def"; then
736 + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
737 + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
738 + else
739 + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
740 +@@ -4921,18 +4921,18 @@
741 + func_win32_libid ()
742 + {
743 + $debug_cmd
744 +
745 + win32_libid_type=unknown
746 +- win32_fileres=`file -L $1 2>/dev/null`
747 ++ win32_fileres=`file -L "$1" 2>/dev/null`
748 + case $win32_fileres in
749 + *ar\ archive\ import\ library*) # definitely import
750 + win32_libid_type="x86 archive import"
751 + ;;
752 + *ar\ archive*) # could be an import, or static
753 + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
754 +- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
755 ++ if eval $OBJDUMP -f \"\$1\" | $SED -e '10q' 2>/dev/null |
756 + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
757 + case $nm_interface in
758 + "MS dumpbin")
759 + if func_cygming_ms_implib_p "$1" ||
760 + func_cygming_gnu_implib_p "$1"
761 +@@ -4944,16 +4944,14 @@
762 + ;;
763 + *)
764 + func_to_tool_file "$1" func_convert_file_msys_to_w32
765 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
766 + $SED -n -e '
767 +- 1,100{
768 +- / I /{
769 +- s|.*|import|
770 +- p
771 +- q
772 +- }
773 ++ / I /{
774 ++ s|.*|import|
775 ++ p
776 ++ q
777 + }'`
778 + ;;
779 + esac
780 + case $win32_nmres in
781 + import*) win32_libid_type="x86 archive import";;
782 +@@ -5328,11 +5326,11 @@
783 + func_exec_program_core ()
784 + {
785 + "
786 + case $host in
787 + # Backslashes separate directories on plain windows
788 +- *-*-mingw | *-*-os2* | *-cegcc*)
789 ++ *-*-mingw | *-*-os2* | *-cegcc* | *-*-winnt*)
790 + $ECHO "\
791 + if test -n \"\$lt_option_debug\"; then
792 + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
793 + func_lt_dump_args \${1+\"\$@\"} 1>&2
794 + fi
795 +@@ -5751,11 +5749,11 @@
796 + {
797 + if (STREQ (argv[i], dumpscript_opt))
798 + {
799 + EOF
800 + case $host in
801 +- *mingw* | *cygwin* )
802 ++ *mingw* | *cygwin* | *winnt*)
803 + # make stdout use "unix" line endings
804 + echo " setmode(1,_O_BINARY);"
805 + ;;
806 + esac
807 +
808 +@@ -5854,11 +5852,11 @@
809 + XFREE (tmp_pathspec);
810 + tmp_pathspec = NULL;
811 + EOF
812 +
813 + case $host_os in
814 +- mingw*)
815 ++ mingw* | winnt*)
816 + cat <<"EOF"
817 + {
818 + char* p;
819 + while ((p = strchr (newargz[0], '\\')) != NULL)
820 + {
821 +@@ -5896,11 +5894,11 @@
822 + }
823 +
824 + EOF
825 +
826 + case $host_os in
827 +- mingw*)
828 ++ mingw* | winnt*)
829 + cat <<"EOF"
830 + /* execv doesn't actually work on mingw as expected on unix */
831 + newargz = prepare_spawn (newargz);
832 + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
833 + if (rval == -1)
834 +@@ -6315,11 +6313,11 @@
835 + }
836 + }
837 +
838 + EOF
839 + case $host_os in
840 +- mingw*)
841 ++ mingw* | winnt*)
842 + cat <<"EOF"
843 +
844 + /* Prepares an argument vector before calling spawn().
845 + Note that spawn() does not by itself call the command interpreter
846 + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
847 +@@ -6490,11 +6488,11 @@
848 + func_mode_link ()
849 + {
850 + $debug_cmd
851 +
852 + case $host in
853 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
854 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
855 + # It is impossible to link a dll without this setting, and
856 + # we shouldn't force the makefile maintainer to figure out
857 + # what system we are compiling for in order to pass an extra
858 + # flag for every libtool invocation.
859 + # allow_undefined=no
860 +@@ -6605,10 +6603,13 @@
861 + done
862 +
863 + # See if our shared archives depend on static archives.
864 + test -n "$old_archive_from_new_cmds" && build_old_libs=yes
865 +
866 ++ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
867 ++ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
868 ++
869 + # Go through the arguments, transforming them on the way.
870 + while test "$#" -gt 0; do
871 + arg=$1
872 + shift
873 + func_quote_for_eval "$arg"
874 +@@ -6989,11 +6990,11 @@
875 + esac
876 + func_append lib_search_path " $dir"
877 + ;;
878 + esac
879 + case $host in
880 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
881 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
882 + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
883 + case :$dllsearchpath: in
884 + *":$dir:"*) ;;
885 + ::) dllsearchpath=$dir;;
886 + *) func_append dllsearchpath ":$dir";;
887 +@@ -7009,11 +7010,11 @@
888 + ;;
889 +
890 + -l*)
891 + if test X-lc = "X$arg" || test X-lm = "X$arg"; then
892 + case $host in
893 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
894 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku* | *-*-winnt*)
895 + # These systems don't actually have a C or math library (as such)
896 + continue
897 + ;;
898 + *-*-os2*)
899 + # These systems don't actually have a C library (as such)
900 +@@ -7092,11 +7093,11 @@
901 + continue
902 + ;;
903 +
904 + -no-install)
905 + case $host in
906 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
907 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc* | *-*-winnt*)
908 + # The PATH hackery in wrapper scripts is required on Windows
909 + # and Darwin in order for the loader to find any dlls it needs.
910 + func_warning "'-no-install' is ignored for $host"
911 + func_warning "assuming '-no-fast-install' instead"
912 + fast_install=no
913 +@@ -7396,13 +7397,64 @@
914 + fi
915 + fi
916 + ;;
917 +
918 + *.$libext)
919 +- # An archive.
920 +- func_append deplibs " $arg"
921 +- func_append old_deplibs " $arg"
922 ++ # With MSVC cl.exe, even dynamic deplibs are added as NAME.lib,
923 ++ # so we need to distinguish based on their file type whether we
924 ++ # have to treat them as static archive or dynamic import lib.
925 ++ found=
926 ++ case $linkmode,$arg in
927 ++ *,*[\\/]*)
928 ++ searchdirs=
929 ++ if test -f "$arg"; then
930 ++ found=$arg
931 ++ fi
932 ++ ;;
933 ++ lib,*)
934 ++ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
935 ++ ;;
936 ++ *)
937 ++ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
938 ++ ;;
939 ++ esac
940 ++ for searchdir in $searchdirs; do
941 ++ if test -f "$searchdir/$arg"; then
942 ++ found=$searchdir/$arg
943 ++ break
944 ++ fi
945 ++ done
946 ++ case $found,$deplibs_check_method in
947 ++ ,*) ;; # nothing found
948 ++ *,file_magic*)
949 ++ file_magic_regex=`set dummy $deplibs_check_method; shift
950 ++ expr "$deplibs_check_method" : "\$1 \(.*\)"`
951 ++ while test -h "$found" 2>/dev/null; do
952 ++ # Follow soft links.
953 ++ if ls -lLd "$found" 2>/dev/null |
954 ++ $GREP " -> " >/dev/null; then
955 ++ break # found a soft link cycle
956 ++ fi
957 ++ foundlink=`ls -ld "$found" | $SED 's/.* -> //'`
958 ++ case $foundlink in
959 ++ [\\/]* | [A-Za-z]:[\\/]*) found=$foundlink;;
960 ++ *) found=`$ECHO "$found" | $SED 's|[^/]*$||'`"$foundlink";;
961 ++ esac
962 ++ done
963 ++ if eval $file_magic_cmd \"\$found\" |
964 ++ $SED -e 10q |
965 ++ $EGREP "$file_magic_regex" > /dev/null; then
966 ++ found=implib
967 ++ fi
968 ++ ;;
969 ++ esac
970 ++ if test implib = "$found"; then
971 ++ func_append deplibs " $arg"
972 ++ else
973 ++ func_append deplibs " $arg"
974 ++ func_append old_deplibs " $arg"
975 ++ fi
976 + continue
977 + ;;
978 +
979 + *.la)
980 + # A libtool-controlled library.
981 +@@ -7457,12 +7509,10 @@
982 + # get the directories listed in $shlibpath_var
983 + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
984 + else
985 + shlib_search_path=
986 + fi
987 +- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
988 +- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
989 +
990 + # Definition is injected by LT_CONFIG during libtool generation.
991 + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
992 +
993 + func_dirname "$output" "/" ""
994 +@@ -7625,21 +7675,36 @@
995 + func_warning "'-l' is ignored for archives/objects"
996 + continue
997 + fi
998 + func_stripname '-l' '' "$deplib"
999 + name=$func_stripname_result
1000 ++ release_save=$release
1001 ++ major_save=$major
1002 ++ versuffix_save=$versuffix
1003 ++ module_save=$module
1004 ++ release=
1005 ++ major=
1006 ++ versuffix=
1007 ++ module=no
1008 ++ eval shared_ext=\"$shrext_cmds\"
1009 ++ eval libname=\"$libname_spec\"
1010 ++ eval search_names=\"lib$name.la $library_names_spec lib$name$shared_ext lib$name.so $libname.$libext lib$name.$libext lib$name.a\"
1011 ++ release=$release_save
1012 ++ major=$major_save
1013 ++ versuffix=$versuffix_save
1014 ++ module=$module_save
1015 + if test lib = "$linkmode"; then
1016 + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
1017 + else
1018 + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
1019 + fi
1020 + for searchdir in $searchdirs; do
1021 +- for search_ext in .la $std_shrext .so .a; do
1022 ++ for search_name in $search_names; do
1023 + # Search the libtool library
1024 +- lib=$searchdir/lib$name$search_ext
1025 ++ lib=$searchdir/$search_name
1026 + if test -f "$lib"; then
1027 +- if test .la = "$search_ext"; then
1028 ++ if test "lib$name.la" = "$search_name"; then
1029 + found=:
1030 + else
1031 + found=false
1032 + fi
1033 + break 2
1034 +@@ -7765,38 +7830,82 @@
1035 + # Linking convenience modules into shared libraries is allowed,
1036 + # but linking other static libraries is non-portable.
1037 + case " $dlpreconveniencelibs " in
1038 + *" $deplib "*) ;;
1039 + *)
1040 +- valid_a_lib=false
1041 ++ valid_a_lib=no
1042 + case $deplibs_check_method in
1043 + match_pattern*)
1044 + set dummy $deplibs_check_method; shift
1045 + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
1046 + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
1047 + | $EGREP "$match_pattern_regex" > /dev/null; then
1048 +- valid_a_lib=:
1049 ++ valid_a_lib=warn
1050 + fi
1051 + ;;
1052 + pass_all)
1053 +- valid_a_lib=:
1054 ++ valid_a_lib=warn
1055 ++ ;;
1056 ++ file_magic*)
1057 ++ # Check for import lib having .$libext.
1058 ++ potlib=
1059 ++ case $deplib in
1060 ++ */* | *\\*)
1061 ++ potlib=$deplib
1062 ++ ;;
1063 ++ *)
1064 ++ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
1065 ++ for searchdir in $searchdirs; do
1066 ++ test -e "$searchdir/$deplib" || continue
1067 ++ potlib="$searchdir/$deplib"
1068 ++ break
1069 ++ done
1070 ++ ;;
1071 ++ esac
1072 ++ while test -h "$potlib" 2>/dev/null; do
1073 ++ # Follow soft links.
1074 ++ if ls -lLd "$potlib" 2>/dev/null |
1075 ++ $GREP " -> " >/dev/null; then
1076 ++ break # found a soft link cycle
1077 ++ fi
1078 ++ potliblink=`ls -ld "$potlib" | $SED 's/.* -> //'`
1079 ++ case $potliblink in
1080 ++ [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
1081 ++ *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
1082 ++ esac
1083 ++ done
1084 ++ set dummy $deplibs_check_method; shift
1085 ++ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
1086 ++ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
1087 ++ $SED -e 10q |
1088 ++ $EGREP "$file_magic_regex" > /dev/null; then
1089 ++ valid_a_lib=yes
1090 ++ fi
1091 + ;;
1092 + esac
1093 +- if $valid_a_lib; then
1094 ++ case $valid_a_lib in
1095 ++ yes)
1096 ++ # handle like a shared lib with -lNAME
1097 ++ deplibs="$deplib $deplibs"
1098 ++ newdependency_libs="$deplib $newdependency_libs"
1099 ++ ;;
1100 ++ warn)
1101 + echo
1102 + $ECHO "*** Warning: Linking the shared library $output against the"
1103 + $ECHO "*** static library $deplib is not portable!"
1104 + deplibs="$deplib $deplibs"
1105 +- else
1106 ++ ;;
1107 ++ *)
1108 + echo
1109 + $ECHO "*** Warning: Trying to link with static lib archive $deplib."
1110 + echo "*** I have the capability to make that library automatically link in when"
1111 + echo "*** you link to this library. But I can only do this if you have a"
1112 + echo "*** shared version of the library, which you do not appear to have"
1113 + echo "*** because the file extensions .$libext of this argument makes me believe"
1114 + echo "*** that it is just a static archive that I should not use here."
1115 +- fi
1116 ++ ;;
1117 ++ esac
1118 + ;;
1119 + esac
1120 + continue
1121 + ;;
1122 + prog)
1123 +@@ -7986,11 +8095,11 @@
1124 + if test -z "$libdir" && test prog = "$linkmode"; then
1125 + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
1126 + fi
1127 + case $host in
1128 + # special handling for platforms with PE-DLLs.
1129 +- *cygwin* | *mingw* | *cegcc* )
1130 ++ *cygwin* | *mingw* | *cegcc* | *winnt* )
1131 + # Linker will automatically link against shared library if both
1132 + # static and shared are present. Therefore, ensure we extract
1133 + # symbols from the import library if a shared library is present
1134 + # (otherwise, the dlopen module name will be incorrect). We do
1135 + # this by putting the import library name into $newdlprefiles.
1136 +@@ -8130,11 +8239,11 @@
1137 + use_static_libs=no
1138 + fi
1139 + if test -n "$library_names" &&
1140 + { test no = "$use_static_libs" || test -z "$old_library"; }; then
1141 + case $host in
1142 +- *cygwin* | *mingw* | *cegcc* | *os2*)
1143 ++ *cygwin* | *mingw* | *cegcc* | *os2* | *winnt*)
1144 + # No point in relinking DLLs because paths are not encoded
1145 + func_append notinst_deplibs " $lib"
1146 + need_relink=no
1147 + ;;
1148 + *)
1149 +@@ -8200,11 +8309,11 @@
1150 + if test -n "$dlname"; then
1151 + soname=$dlname
1152 + elif test -n "$soname_spec"; then
1153 + # bleh windows
1154 + case $host in
1155 +- *cygwin* | mingw* | *cegcc* | *os2*)
1156 ++ *cygwin* | mingw* | *cegcc* | *os2* | winnt*)
1157 + func_arith $current - $age
1158 + major=$func_arith_result
1159 + versuffix=-$major
1160 + ;;
1161 + esac
1162 +@@ -9110,11 +9219,11 @@
1163 + done
1164 +
1165 + if test yes = "$build_libtool_libs"; then
1166 + if test -n "$rpath"; then
1167 + case $host in
1168 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
1169 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku* | *-*-winnt*)
1170 + # these systems don't actually have a c library (as such)!
1171 + ;;
1172 + *-*-rhapsody* | *-*-darwin1.[012])
1173 + # Rhapsody C library is in the System framework
1174 + func_append deplibs " System.ltframework"
1175 +@@ -9280,24 +9389,33 @@
1176 + a_deplib=
1177 + ;;
1178 + esac
1179 + fi
1180 + if test -n "$a_deplib"; then
1181 +- libname=`eval "\\$ECHO \"$libname_spec\""`
1182 ++ module_save=$module
1183 ++ module=no
1184 ++ eval shared_ext=\"$shrext_cmds\"
1185 ++ eval libname=\"$libname_spec\"
1186 ++ eval search_names=\"$library_names_spec\"
1187 ++ module=$module_save
1188 + if test -n "$file_magic_glob"; then
1189 + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
1190 + else
1191 + libnameglob=$libname
1192 + fi
1193 + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
1194 + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
1195 ++ potential_libs=
1196 ++ for search_name in $search_names; do
1197 ++ potential_libs="$potential_libs `ls $i/$search_name 2>/dev/null`"
1198 ++ done
1199 + if test yes = "$want_nocaseglob"; then
1200 + shopt -s nocaseglob
1201 +- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
1202 ++ potential_libs="$potential_libs `ls $i/$libnameglob[.-]* 2>/dev/null`"
1203 + $nocaseglob
1204 + else
1205 +- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
1206 ++ potential_libs="$potential_libs `ls $i/$libnameglob[.-]* 2>/dev/null`"
1207 + fi
1208 + for potent_lib in $potential_libs; do
1209 + # Follow soft links.
1210 + if ls -lLd "$potent_lib" 2>/dev/null |
1211 + $GREP " -> " >/dev/null; then
1212 +@@ -9308,11 +9426,11 @@
1213 + # We might still enter an endless loop, since a link
1214 + # loop can be closed while we follow links,
1215 + # but so what?
1216 + potlib=$potent_lib
1217 + while test -h "$potlib" 2>/dev/null; do
1218 +- potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
1219 ++ potliblink=`ls -ld "$potlib" | $SED 's/.* -> //'`
1220 + case $potliblink in
1221 + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
1222 + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
1223 + esac
1224 + done
1225 +@@ -9624,11 +9742,11 @@
1226 + func_append delfiles " $export_symbols"
1227 + fi
1228 +
1229 + orig_export_symbols=
1230 + case $host_os in
1231 +- cygwin* | mingw* | cegcc*)
1232 ++ cygwin* | mingw* | cegcc* | winnt*)
1233 + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
1234 + # exporting using user supplied symfile
1235 + func_dll_def_p "$export_symbols" || {
1236 + # and it's NOT already a .def file. Must figure out
1237 + # which of the given symbols are data symbols and tag
1238 +@@ -10294,11 +10412,11 @@
1239 + *" $libdir "*) ;;
1240 + *) func_append perm_rpath " $libdir" ;;
1241 + esac
1242 + fi
1243 + case $host in
1244 +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
1245 ++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
1246 + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
1247 + case :$dllsearchpath: in
1248 + *":$libdir:"*) ;;
1249 + ::) dllsearchpath=$libdir;;
1250 + *) func_append dllsearchpath ":$libdir";;
1251 +@@ -10372,11 +10490,11 @@
1252 + case $host in
1253 + *cegcc* | *mingw32ce*)
1254 + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
1255 + wrappers_required=false
1256 + ;;
1257 +- *cygwin* | *mingw* )
1258 ++ *cygwin* | *mingw* | *winnt* )
1259 + test yes = "$build_libtool_libs" || wrappers_required=false
1260 + ;;
1261 + *)
1262 + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
1263 + wrappers_required=false
1264 +@@ -10525,11 +10643,11 @@
1265 + func_stripname '' '.exe' "$outputname"
1266 + outputname=$func_stripname_result ;;
1267 + *) exeext= ;;
1268 + esac
1269 + case $host in
1270 +- *cygwin* | *mingw* )
1271 ++ *cygwin* | *mingw* | *winnt* )
1272 + func_dirname_and_basename "$output" "" "."
1273 + output_name=$func_basename_result
1274 + output_path=$func_dirname_result
1275 + cwrappersource=$output_path/$objdir/lt-$output_name.c
1276 + cwrapper=$output_path/$output_name.exe
1277 +@@ -10552,11 +10670,12 @@
1278 + $RM $func_ltwrapper_scriptname_result
1279 + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
1280 + $opt_dry_run || {
1281 + # note: this script will not be executed, so do not chmod.
1282 + if test "x$build" = "x$host"; then
1283 +- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
1284 ++ # the running shell may be a Cygwin shell using binmode
1285 ++ $cwrapper --lt-dump-script | $SED -e "s/\\r//g" > $func_ltwrapper_scriptname_result
1286 + else
1287 + func_emit_wrapper no > $func_ltwrapper_scriptname_result
1288 + fi
1289 + }
1290 + ;;
1291 +@@ -10857,11 +10976,11 @@
1292 + # applies here; at the moment, that means platforms that use the PE
1293 + # object format with DLL files. See the long comment at the top of
1294 + # tests/bindir.at for full details.
1295 + tdlname=$dlname
1296 + case $host,$output,$installed,$module,$dlname in
1297 +- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
1298 ++ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll | *winnt*,*lai,yes,no,*.dll)
1299 + # If a -bindir argument was supplied, place the dll there.
1300 + if test -n "$bindir"; then
1301 + func_relative_path "$install_libdir" "$bindir"
1302 + tdlname=$func_relative_path_result/$dlname
1303 + else
1304 --
1305 2.22.0