From: Michael Haubenwallner <ha...@gentoo.org>

If a package does not have libtool-2.4.6 there is no guarantee things
will work, and the package should use eautoreconf instead.

Signed-off-by: Michael Haubenwallner <ha...@gentoo.org>
---
 eltpatch.in                             |   3 +-
 patches/winnt-conf/2.4.6-cmd-max-len    |  15 +
 patches/winnt-conf/2.4.6-deplibs-method |  15 +
 patches/winnt-conf/2.4.6-dlload         |  15 +
 patches/winnt-conf/2.4.6-dlopen-deplibs |  16 +
 patches/winnt-conf/2.4.6-dynlink        |  46 ++
 patches/winnt-conf/2.4.6-dynlink-c      |  46 ++
 patches/winnt-conf/2.4.6-global-syms    | 129 +++++
 patches/winnt-conf/2.4.6-pathconv       |  21 +
 patches/winnt-conf/2.4.6-pic-c          |  19 +
 patches/winnt-conf/2.4.6-pic-cxx        |  18 +
 patches/winnt-conf/2.4.6-setup          |  23 +
 patches/winnt-conf/2.4.6-shlibs         |  15 +
 patches/winnt-conf/2.4.6-shlibs-c       |  20 +
 patches/winnt-conf/2.4.6-shlibs-cxx     |  33 ++
 patches/winnt-conf/2.4.6-strip          |  30 ++
 patches/winnt-ltmain/2.4.6              | 683 ++++++++++++++++++++++++
 17 files changed, 1146 insertions(+), 1 deletion(-)
 create mode 100644 patches/winnt-conf/2.4.6-cmd-max-len
 create mode 100644 patches/winnt-conf/2.4.6-deplibs-method
 create mode 100644 patches/winnt-conf/2.4.6-dlload
 create mode 100644 patches/winnt-conf/2.4.6-dlopen-deplibs
 create mode 100644 patches/winnt-conf/2.4.6-dynlink
 create mode 100644 patches/winnt-conf/2.4.6-dynlink-c
 create mode 100644 patches/winnt-conf/2.4.6-global-syms
 create mode 100644 patches/winnt-conf/2.4.6-pathconv
 create mode 100644 patches/winnt-conf/2.4.6-pic-c
 create mode 100644 patches/winnt-conf/2.4.6-pic-cxx
 create mode 100644 patches/winnt-conf/2.4.6-setup
 create mode 100644 patches/winnt-conf/2.4.6-shlibs
 create mode 100644 patches/winnt-conf/2.4.6-shlibs-c
 create mode 100644 patches/winnt-conf/2.4.6-shlibs-cxx
 create mode 100644 patches/winnt-conf/2.4.6-strip
 create mode 100644 patches/winnt-ltmain/2.4.6

diff --git a/eltpatch.in b/eltpatch.in
index d8c847b..6b69216 100644
--- a/eltpatch.in
+++ b/eltpatch.in
@@ -179,6 +179,7 @@ elibtoolize() {
                *-hpux*)    elt_patches+=" hpux-conf deplibs hc-flag-ld 
hardcode hardcode-relink relink-prog no-lc" ;;
                *-irix*)    elt_patches+=" irix-ltmain" ;;
                *-mint*)    elt_patches+=" mint-conf" ;;
+               *-winnt*)   elt_patches+=" winnt-conf winnt-ltmain" ;;
        esac
 
        if ${LD} --version 2>&1 | grep -qs 'GNU gold'; then
@@ -371,7 +372,7 @@ elibtoolize() {
                                                ret=$?
                                        fi
                                        ;;
-                               aixrtl|hpux-conf)
+                               aixrtl|hpux-conf|winnt-conf)
                                        ret=1
                                        local subret=0
                                        # apply multiple patches as often as 
they match
diff --git a/patches/winnt-conf/2.4.6-cmd-max-len 
b/patches/winnt-conf/2.4.6-cmd-max-len
new file mode 100644
index 0000000..0b7b290
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-cmd-max-len
@@ -0,0 +1,15 @@
+--- configure
++++ configure
+@@ -5915,11 +5915,11 @@
+     # And add a safety zone
+     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+     ;;
+ 
+-  interix*)
++  interix* | winnt*)
+     # We know the value 262144 and hardcode it with a safety zone (like BSD)
+     lt_cv_sys_max_cmd_len=196608
+     ;;
+ 
+   os2*)
diff --git a/patches/winnt-conf/2.4.6-deplibs-method 
b/patches/winnt-conf/2.4.6-deplibs-method
new file mode 100644
index 0000000..92b2ac9
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-deplibs-method
@@ -0,0 +1,15 @@
+--- configure
++++ configure
+@@ -6285,11 +6285,11 @@
+   # func_win32_libid is a shell function defined in ltmain.sh
+   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+   lt_cv_file_magic_cmd='func_win32_libid'
+   ;;
+ 
+-mingw* | pw32*)
++mingw* | pw32* | winnt*)
+   # Base MSYS/MinGW do not provide the 'file' command needed by
+   # func_win32_libid shell function, so use a weaker test based on 'objdump',
+   # unless we find 'file', for example because we are cross-compiling.
+   if ( file / ) >/dev/null 2>&1; then
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
diff --git a/patches/winnt-conf/2.4.6-dlload b/patches/winnt-conf/2.4.6-dlload
new file mode 100644
index 0000000..ea9b804
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-dlload
@@ -0,0 +1,15 @@
+--- configure
++++ configure
+@@ -13596,11 +13716,11 @@
+ 
+   ;;
+ beos*)
+   LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
+   ;;
+-cygwin* | mingw* | pw32*)
++cygwin* | mingw* | pw32* | winnt*)
+   ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" 
"ac_cv_have_decl_cygwin_conv_path" "#include <sys/cygwin.h>
+ "
+ if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then :
+   ac_have_decl=1
+ else
diff --git a/patches/winnt-conf/2.4.6-dlopen-deplibs 
b/patches/winnt-conf/2.4.6-dlopen-deplibs
new file mode 100644
index 0000000..c0b6404
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-dlopen-deplibs
@@ -0,0 +1,16 @@
+--- configure
++++ configure
+@@ -13935,10 +14055,13 @@
+     lt_cv_sys_dlopen_deplibs=yes
+     ;;
+   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+     libltdl_cv_sys_dlopen_deplibs=yes
+     ;;
++  winnt*)
++    lt_cv_sys_dlopen_deplibs=yes
++    ;;
+   esac
+ 
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" 
>&5
+ $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; }
diff --git a/patches/winnt-conf/2.4.6-dynlink b/patches/winnt-conf/2.4.6-dynlink
new file mode 100644
index 0000000..c786ec3
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-dynlink
@@ -0,0 +1,46 @@
+--- configure
++++ configure
+@@ -11728,10 +11769,43 @@
+       $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+   esac
+   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+ else
+   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++  case $host_os in
++  winnt*)
++    sys_lib_search_path_spec=`$CC -print-search-dirs |
++      $AWK '/^libraries:/{sub(/^libraries: *=?/,""); print}'`
++    # The space separated shell string breaks on characters like blanks and
++    # parentheses often found in Windows directory names.  Fortunately, the
++    # 8.3 DOS format does not use these characters, but that might be 
disabled.
++    # First, convert to 8.3 DOS format to remove invalid characters 
eventually.
++    sys_lib_search_path_spec=`cygpath --path --dos 
"$sys_lib_search_path_spec"`
++    # Second, converting back to unix format does preserve 8.3 path parts.
++    sys_lib_search_path_spec=`cygpath --path --unix 
"$sys_lib_search_path_spec"`
++    # Finally, convert to the space separated list, but filter out path names
++    # with invalid characters: They were created while 8.3 DOS file name
++    # creation was disabled for that partition.
++    lt_search_path_spec=$sys_lib_search_path_spec
++    sys_lib_search_path_spec=
++    lt_save_ifs=$IFS;
++    IFS=$PATH_SEPARATOR
++    for lt_path in $lt_search_path_spec
++    do
++      IFS=$lt_save_ifs
++      case $lt_path in
++      *[' ()']*)
++      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing 8.3 path name 
to find libs in $lt_path" >&5
++$as_echo "$as_me: WARNING: missing 8.3 path name to find libs in $lt_path" 
>&2;}
++      continue
++      ;;
++      esac
++      
sys_lib_search_path_spec="$sys_lib_search_path_spec${sys_lib_search_path_spec:+ 
}$lt_path"
++    done
++    IFS=$lt_save_ifs
++    ;;
++  esac
+ fi
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+ shrext_cmds=.so
diff --git a/patches/winnt-conf/2.4.6-dynlink-c 
b/patches/winnt-conf/2.4.6-dynlink-c
new file mode 100644
index 0000000..b80f2c7
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-dynlink-c
@@ -0,0 +1,46 @@
+--- configure
++++ configure
+@@ -11890,10 +11967,43 @@
+   # the default ld.so.conf also contains /usr/contrib/lib and
+   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+   # libtool to hard-code these into programs
+   ;;
+ 
++winnt*)
++  # The real dll is NAME.dll,
++  # the import lib is NAME.lib, but
++  # the static lib is libNAME.lib, which requires libname_spec=lib$name.
++  # Upon /path/to/*.lib, we use deplibs_check_method=file_magic to
++  # accept NAME.lib as import lib, but reject static libNAME.lib.
++  libext=lib
++  version_type=windows
++  need_version=no
++  need_lib_prefix=no
++  shrext_cmds=.dll
++  library_names_spec='${libname#lib}.$libext'
++  soname_spec='${libname#lib}$release$versuffix$shared_ext'
++  sys_lib_dlsearch_path_spec=
++  shlibpath_var=PATH
++  shlibpath_overrides_runpath=yes
++  # DLL is installed to $(libdir)/../bin by postinstall_cmds
++  postinstall_cmds='base_file=`basename \$file`~
++    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo 
\$dlname'\''`~
++    dldir=$destdir/`dirname \$dlpath`~
++    test -d \$dldir || mkdir -p \$dldir~
++    $install_prog $dir/$dlname \$dldir/$dlname~
++    chmod a+x \$dldir/$dlname~
++    if test -f $dir/${dlname%.dll}.pdb; then $install_prog 
$dir/${dlname%.dll}.pdb \$dldir/${dlname%.dll}.pdb; fi~
++    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
++      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
++    fi'
++  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++    dlpath=$dir/\$dldll~
++    func_append rmfiles " \$dlpath \${dlpath%.dll}.pdb"'
++  dynamic_linker='Win32 link.exe with Parity extensions'
++  ;;
++
+ cygwin* | mingw* | pw32* | cegcc*)
+   version_type=windows
+   shrext_cmds=.dll
+   need_version=no
+   need_lib_prefix=no
diff --git a/patches/winnt-conf/2.4.6-global-syms 
b/patches/winnt-conf/2.4.6-global-syms
new file mode 100644
index 0000000..f84e6ab
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-global-syms
@@ -0,0 +1,129 @@
+--- configure
++++ configure
+@@ -7087,11 +7087,11 @@
+ # Define system-specific variables.
+ case $host_os in
+ aix*)
+   symcode='[BCDT]'
+   ;;
+-cygwin* | mingw* | pw32* | cegcc*)
++cygwin* | mingw* | pw32* | cegcc* | winnt*)
+   symcode='[ABCDGISTW]'
+   ;;
+ hpux*)
+   if test ia64 = "$host_cpu"; then
+     symcode='[ABCDEGRST]'
+@@ -7126,46 +7126,56 @@
+   symcode='[ABCDGIRSTW]' ;;
+ esac
+ 
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+   # Gets list of data symbols to import.
+-  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
++  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* 
\([a-zA-Z_][0-9a-zA-Z_]*\)$/\1/p'"
+   # Adjust the below global symbol transforms to fixup imported variables.
+-  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char 
\1;/p'"
+-  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
++  lt_cdecl_hook=" -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern 
__declspec(dllimport) char \1;/p'"
++  lt_c_name_hook=" -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", (void 
*) 0},/p'"
+   lt_c_name_lib_hook="\
+-  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+-  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
++  -e 's/^I .* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", (void *) 0},/p'\
++  -e 's/^I .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"lib\1\", (void *) 0},/p'"
+ else
+   # Disable hooks by default.
+   lt_cv_sys_global_symbol_to_import=
+   lt_cdecl_hook=
+   lt_c_name_hook=
+   lt_c_name_lib_hook=
++  case $host_os in
++  winnt*)
++    lt_cv_sys_global_symbol_to_import="sed -n -e 's/^D [^ ]* 
\([a-zA-Z_][0-9a-zA-Z_]*\)$/\1/p'"
++    lt_cdecl_hook=" -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern 
__declspec(dllimport) char \1;/p'"
++    lt_c_name_hook=" -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", 
(void *) 0},/p'"
++    lt_c_name_lib_hook="\
++    -e 's/^D [^ ]* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", (void *) 0},/p'\
++    -e 's/^D [^ ]* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"lib\1\", (void *) 0},/p'"
++    ;;
++  esac
+ fi
+ 
+ # Transform an extracted symbol line into a proper C declaration.
+ # Some systems (esp. on ia64) link data and code symbols differently,
+ # so use this general approach.
+ lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+ $lt_cdecl_hook\
+-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
++" -e 's/^T .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern int \1();/p'"\
++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+ $lt_c_name_hook\
+ " -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", (void *) 
\&\1},/p'"
+ 
+ # Transform an extracted symbol line into symbol name with lib prefix and
+ # symbol address.
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+ $lt_c_name_lib_hook\
+ " -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+-" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+-" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
++" -e 's/^$symcode$symcode* .* \(lib[a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"\1\", (void 
*) \&\1},/p'"\
++" -e 's/^$symcode$symcode* .* \([a-zA-Z_][0-9a-zA-Z_]*\)$/  {\"lib\1\", (void 
*) \&\1},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+ case $build_os in
+ mingw*)
+@@ -7175,35 +7185,43 @@
+ 
+ # Try without a prefix underscore, then with it.
+ for ac_symprfx in "" "_"; do
+ 
+   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+-  symxfrm="\\1 $ac_symprfx\\2 \\2"
++  # In Windows import libraries, symbols may be prefixed with __imp_, as well
++  # as __nm_ when using GNU ld.  The leading underscore (in 32bit) comes after
++  # the __imp_ and __nm_ prefix, so make sure to strip the underscore from the
++  # symbol name instead of the __imp_ or __nm_ prefix, leaving these prefixes
++  # intact in the symbol pipe output.
++  symxfrm="\\1 \\2$ac_symprfx\\3 \\2\\3"
+ 
+   # Write the raw and C identifiers.
+   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+     # Fake it for dumpbin and say T for any non-static function,
+     # D for any global variable and I for any imported variable.
+     # Also find C++ and __fastcall symbols from MSVC++,
+-    # which start with @ or ?.
++    # which start with @ or ?.  And Cygwin gawk-4.1.4-3 and newer
++    # treats input as binary, have to drop carriage return first.
+     lt_cv_sys_global_symbol_pipe="$AWK '"\
++"     {sub(/\\r\$/,\"\")};"\
+ "     {last_section=section; section=\$ 3};"\
+ "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+ "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+ "     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+ "     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+ "     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+ "     \$ 0!~/External *\|/{next};"\
+ "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+ "     {if(hide[section]) next};"\
+ "     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
++"     \$ 0~/ [0-9a-fA-F]*[1-9a-fA-F][0-9a-fA-F]* UNDEF /{f=\"C\"};"\
+ "     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+ "     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+ "     s[1]~prfx {split(s[1],t,\"@\"); print 
f,t[1],substr(t[1],length(prfx))}"\
+ "     ' prfx=^$ac_symprfx"
+   else
+-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[    
]\($symcode$symcode*\)[         ][      
]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
++    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[    
]\($symcode$symcode*\)[         ][      
]*\(__imp_\|__nm_\)\{0,1\}$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
+   lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ 
__gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
diff --git a/patches/winnt-conf/2.4.6-pathconv 
b/patches/winnt-conf/2.4.6-pathconv
new file mode 100644
index 0000000..444d4ad
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-pathconv
@@ -0,0 +1,21 @@
+--- configure
++++ configure
+@@ -6040,16 +6040,16 @@
+ $as_echo_n "checking how to convert $build file names to $host format... " 
>&6; }
+ if ${lt_cv_to_host_file_cmd+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   case $host in
+-  *-*-mingw* )
++  *-*-mingw* | *-*-winnt* )
+     case $build in
+       *-*-mingw* ) # actually msys
+         lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+         ;;
+-      *-*-cygwin* )
++      *-*-cygwin* | *-*-winnt* )
+         lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+         ;;
+       * ) # otherwise, assume *nix
+         lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+         ;;
diff --git a/patches/winnt-conf/2.4.6-pic-c b/patches/winnt-conf/2.4.6-pic-c
new file mode 100644
index 0000000..2f15c5b
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-pic-c
@@ -0,0 +1,19 @@
+--- configure
++++ configure
+@@ -9709,10 +9737,16 @@
+       lt_prog_compiler_static='$wl-static'
+       ;;
+       esac
+       ;;
+ 
++    winnt*)
++      lt_prog_compiler_pic='-DDLL_EXPORT'
++      lt_prog_compiler_wl='-Wl,'
++      lt_prog_compiler_static='-static'
++      ;;
++
+     hpux9* | hpux10* | hpux11*)
+       lt_prog_compiler_wl='-Wl,'
+       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+       # not for PA HP-UX.
+       case $host_cpu in
diff --git a/patches/winnt-conf/2.4.6-pic-cxx b/patches/winnt-conf/2.4.6-pic-cxx
new file mode 100644
index 0000000..b99f526
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-pic-cxx
@@ -0,0 +1,18 @@
+--- configure
++++ configure
+@@ -16371,10 +16500,15 @@
+         # Green Hills C++ Compiler
+         # _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"
+         ;;
+       esac
+       ;;
++      winnt*)
++      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
++      lt_prog_compiler_wl_CXX='-Wl,'
++      lt_prog_compiler_static_CXX='-static'
++      ;;
+       mingw* | cygwin* | os2* | pw32* | cegcc*)
+       # This hack is so that the source file can tell whether it is being
+       # built for inclusion in a dll (and should export symbols for example).
+       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+       ;;
diff --git a/patches/winnt-conf/2.4.6-setup b/patches/winnt-conf/2.4.6-setup
new file mode 100644
index 0000000..50c1939
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-setup
@@ -0,0 +1,23 @@
+--- configure
++++ configure
+@@ -9208,10 +9226,20 @@
+ 
+ 
+ 
+ 
+ 
++# On winnt, the Microsoft compiler (or compatible) is used behind the scenes.
++# While wrappers around it may be capable of resolving symbolic links, the
++# compiler (cl.exe) chokes on header files which are symlinked, as the
++# wrapper cannot know about them.
++# Everybody would be happy with ln -s, except libtoolize without --copy.
++# There ln -s breaks the testsuite, since it tries to compile symlinked
++# source, which is not supported by the compiler.
++case $LN_S,$host_os in
++,winnt*|"ln -s",winnt*) LN_S="cp -p" ;;
++esac
+ test -z "$LN_S" && LN_S="ln -s"
+ 
+ 
+ 
+ 
diff --git a/patches/winnt-conf/2.4.6-shlibs b/patches/winnt-conf/2.4.6-shlibs
new file mode 100644
index 0000000..1acd9d8
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-shlibs
@@ -0,0 +1,15 @@
+--- configure
++++ configure
+@@ -10200,11 +10234,11 @@
+   # preloaded symbol tables.
+   # Exclude shared library initialization/finalization symbols.
+   extract_expsyms_cmds=
+ 
+   case $host_os in
+-  cygwin* | mingw* | pw32* | cegcc*)
++  cygwin* | mingw* | pw32* | cegcc* | winnt*)
+     # FIXME: the MSVC++ port hasn't been tested in a loooong time
+     # When not using gcc, we currently assume that we are using
+     # Microsoft Visual C++.
+     if test yes != "$GCC"; then
+       with_gnu_ld=no
diff --git a/patches/winnt-conf/2.4.6-shlibs-c 
b/patches/winnt-conf/2.4.6-shlibs-c
new file mode 100644
index 0000000..cba9709
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-shlibs-c
@@ -0,0 +1,20 @@
+--- configure
++++ configure
+@@ -10855,10 +10889,17 @@
+ 
+     bsdi[45]*)
+       export_dynamic_flag_spec=-rdynamic
+       ;;
+ 
++    winnt*)
++      exclude_expsyms='__NULL_IMPORT_DESCRIPTOR|__IMPORT_DESCRIPTOR_.*'
++      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags 
-o $output_objdir/$soname -Wl,--out-implib,$lib'
++      archive_cmds_need_lc=no
++      allow_undefined_flag=unsupported
++      ;;
++
+     cygwin* | mingw* | pw32* | cegcc*)
+       # When not using gcc, we currently assume that we are using
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
diff --git a/patches/winnt-conf/2.4.6-shlibs-cxx 
b/patches/winnt-conf/2.4.6-shlibs-cxx
new file mode 100644
index 0000000..fde2b39
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-shlibs-cxx
@@ -0,0 +1,33 @@
+--- configure
++++ configure
+@@ -15286,10 +15409,16 @@
+         ld_shlibs_CXX=no
+         ;;
+         esac
+         ;;
+ 
++      winnt*)
++      archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags -o $output_objdir/$soname -Wl,--out-implib,$lib'
++      archive_cmds_need_lc_CXX=no
++      allow_undefined_flag_CXX=unsupported
++      ;;
++
+       cygwin* | mingw* | pw32* | cegcc*)
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+@@ -16860,10 +16994,13 @@
+     fi
+     ;;
+   pw32*)
+     export_symbols_cmds_CXX=$ltdll_cmds
+     ;;
++  winnt*)
++    exclude_expsyms_CXX='__NULL_IMPORT_DESCRIPTOR|__IMPORT_DESCRIPTOR_.*'
++    ;;
+   cygwin* | mingw* | cegcc*)
+     case $cc_basename in
+     cl*)
+       exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+       ;;
diff --git a/patches/winnt-conf/2.4.6-strip b/patches/winnt-conf/2.4.6-strip
new file mode 100644
index 0000000..7cb0eec
--- /dev/null
+++ b/patches/winnt-conf/2.4.6-strip
@@ -0,0 +1,30 @@
+--- configure
++++ configure
+@@ -13171,14 +13281,24 @@
+ striplib=
+ old_striplib=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries 
is possible" >&5
+ $as_echo_n "checking whether stripping libraries is possible... " >&6; }
+ if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++  case $host_os in
++  winnt*)
++    # Stripping is not save here, since POSIXish host utils may
++    # be detected, but we operate on native windows libraries.
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++    ;;
++  *)
++    test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
++    test -z "$striplib" && striplib="$STRIP --strip-unneeded"
++    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
++    ;;
++  esac
+ else
+ # FIXME - insert some real tests, host_os isn't really good enough
+   case $host_os in
+   darwin*)
+     if test -n "$STRIP"; then
diff --git a/patches/winnt-ltmain/2.4.6 b/patches/winnt-ltmain/2.4.6
new file mode 100644
index 0000000..ddb077c
--- /dev/null
+++ b/patches/winnt-ltmain/2.4.6
@@ -0,0 +1,683 @@
+--- ltmain.sh
++++ ltmain.sh
+@@ -2416,11 +2416,11 @@
+     test : = "$debug_cmd" || func_append preserve_args " --debug"
+ 
+     case $host in
+       # Solaris2 added to fix 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+       # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+-      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
++      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2* | *winnt*)
+         # don't eliminate duplications in $postdeps and $predeps
+         opt_duplicate_compiler_generated_deps=:
+         ;;
+       *)
+         opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+@@ -3437,11 +3437,11 @@
+       removelist="$lobj $libobj ${libobj}T"
+     fi
+ 
+     # On Cygwin there's no "real" PIC flag so we must build both object types
+     case $host_os in
+-    cygwin* | mingw* | pw32* | os2* | cegcc*)
++    cygwin* | mingw* | pw32* | os2* | cegcc* | winnt*)
+       pic_mode=default
+       ;;
+     esac
+     if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
+       # non-PIC code in shared libraries is not supported
+@@ -4311,11 +4311,11 @@
+         # Install the shared library and build the symlinks.
+         func_show_eval "$install_shared_prog $dir/$srcname 
$destdir/$realname" \
+             'exit $?'
+         tstripme=$stripme
+         case $host_os in
+-        cygwin* | mingw* | pw32* | cegcc*)
++        cygwin* | mingw* | pw32* | cegcc* | winnt*)
+           case $realname in
+           *.dll.a)
+             tstripme=
+             ;;
+           esac
+@@ -4424,11 +4424,11 @@
+           ;;
+       esac
+ 
+       # Do a test to see if this is really a libtool program.
+       case $host in
+-      *cygwin* | *mingw*)
++      *cygwin* | *mingw* | *winnt*)
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             wrapper=$func_ltwrapper_scriptname_result
+           else
+             func_stripname '' '.exe' "$file"
+@@ -4652,11 +4652,11 @@
+           export_symbols=$output_objdir/$outputname.exp
+           $opt_dry_run || {
+             $RM $export_symbols
+             eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< 
"$nlist" > "$export_symbols"'
+             case $host in
+-            *cygwin* | *mingw* | *cegcc* )
++            *cygwin* | *mingw* | *cegcc*  | winnt*)
+                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                 eval 'cat "$export_symbols" >> 
"$output_objdir/$outputname.def"'
+               ;;
+             esac
+           }
+@@ -4664,11 +4664,11 @@
+           $opt_dry_run || {
+             eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' 
< "$export_symbols" > "$output_objdir/$outputname.exp"'
+             eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > 
"$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+             case $host in
+-              *cygwin* | *mingw* | *cegcc* )
++              *cygwin* | *mingw* | *cegcc*  | winnt*)
+                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                 ;;
+             esac
+           }
+@@ -4678,11 +4678,11 @@
+       for dlprefile in $dlprefiles; do
+         func_verbose "extracting global C symbols from '$dlprefile'"
+         func_basename "$dlprefile"
+         name=$func_basename_result
+           case $host in
+-          *cygwin* | *mingw* | *cegcc* )
++          *cygwin* | *mingw* | *cegcc* | *winnt* )
+             # if an import library, we need to obtain dlname
+             if func_win32_import_lib_p "$dlprefile"; then
+               func_tr_sh "$dlprefile"
+               eval "curr_lafile=\$libfile_$func_tr_sh_result"
+               dlprefile_dlbasename=
+@@ -4705,11 +4705,11 @@
+                   func_warning "Could not compute DLL name from $name"
+                   eval '$ECHO ": $name " >> "$nlist"'
+                 fi
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | 
$global_symbol_pipe |
+-                  $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> 
'$nlist'"
++                  $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/ __nm_/ /' >> 
'$nlist'"
+               }
+             else # not an import lib
+               $opt_dry_run || {
+                 eval '$ECHO ": $name " >> "$nlist"'
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+@@ -4853,11 +4853,11 @@
+       func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" 
"${nlist}T" "${nlist}I"'
+ 
+       # Transform the symbol file into the correct name.
+       symfileobj=$output_objdir/${my_outputname}S.$objext
+       case $host in
+-      *cygwin* | *mingw* | *cegcc* )
++      *cygwin* | *mingw* | *cegcc*  | winnt*)
+         if test -f "$output_objdir/$my_outputname.def"; then
+           compile_command=`$ECHO "$compile_command" | $SED 
"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED 
"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+         else
+           compile_command=`$ECHO "$compile_command" | $SED 
"s%@SYMFILE@%$symfileobj%"`
+@@ -4921,18 +4921,18 @@
+ func_win32_libid ()
+ {
+   $debug_cmd
+ 
+   win32_libid_type=unknown
+-  win32_fileres=`file -L $1 2>/dev/null`
++  win32_fileres=`file -L "$1" 2>/dev/null`
+   case $win32_fileres in
+   *ar\ archive\ import\ library*) # definitely import
+     win32_libid_type="x86 archive import"
+     ;;
+   *ar\ archive*) # could be an import, or static
+     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
++    if eval $OBJDUMP -f \"\$1\" | $SED -e '10q' 2>/dev/null |
+        $EGREP 'file format (pei*-i386(.*architecture: 
i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+       case $nm_interface in
+       "MS dumpbin")
+       if func_cygming_ms_implib_p "$1" ||
+          func_cygming_gnu_implib_p "$1"
+@@ -4944,16 +4944,14 @@
+       ;;
+       *)
+       func_to_tool_file "$1" func_convert_file_msys_to_w32
+       win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+         $SED -n -e '
+-          1,100{
+-              / I /{
+-                  s|.*|import|
+-                  p
+-                  q
+-              }
++          / I /{
++              s|.*|import|
++              p
++              q
+           }'`
+       ;;
+       esac
+       case $win32_nmres in
+       import*)  win32_libid_type="x86 archive import";;
+@@ -5328,11 +5326,11 @@
+ func_exec_program_core ()
+ {
+ "
+   case $host in
+   # Backslashes separate directories on plain windows
+-  *-*-mingw | *-*-os2* | *-cegcc*)
++  *-*-mingw | *-*-os2* | *-cegcc* | *-*-winnt*)
+     $ECHO "\
+       if test -n \"\$lt_option_debug\"; then
+         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: 
\$progdir\\\\\$program\" 1>&2
+         func_lt_dump_args \${1+\"\$@\"} 1>&2
+       fi
+@@ -5751,11 +5749,11 @@
+     {
+       if (STREQ (argv[i], dumpscript_opt))
+       {
+ EOF
+           case $host in
+-            *mingw* | *cygwin* )
++            *mingw* | *cygwin* | *winnt*)
+               # make stdout use "unix" line endings
+               echo "          setmode(1,_O_BINARY);"
+               ;;
+             esac
+ 
+@@ -5854,11 +5852,11 @@
+   XFREE (tmp_pathspec);
+   tmp_pathspec = NULL;
+ EOF
+ 
+           case $host_os in
+-            mingw*)
++            mingw* | winnt*)
+           cat <<"EOF"
+   {
+     char* p;
+     while ((p = strchr (newargz[0], '\\')) != NULL)
+       {
+@@ -5896,11 +5894,11 @@
+     }
+ 
+ EOF
+ 
+           case $host_os in
+-            mingw*)
++            mingw* | winnt*)
+               cat <<"EOF"
+   /* execv doesn't actually work on mingw as expected on unix */
+   newargz = prepare_spawn (newargz);
+   rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) 
newargz);
+   if (rval == -1)
+@@ -6315,11 +6313,11 @@
+     }
+ }
+ 
+ EOF
+           case $host_os in
+-            mingw*)
++            mingw* | winnt*)
+               cat <<"EOF"
+ 
+ /* Prepares an argument vector before calling spawn().
+    Note that spawn() does not by itself call the command interpreter
+      (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+@@ -6490,11 +6488,11 @@
+ func_mode_link ()
+ {
+     $debug_cmd
+ 
+     case $host in
+-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
++    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
+       # It is impossible to link a dll without this setting, and
+       # we shouldn't force the makefile maintainer to figure out
+       # what system we are compiling for in order to pass an extra
+       # flag for every libtool invocation.
+       # allow_undefined=no
+@@ -6605,10 +6603,13 @@
+     done
+ 
+     # See if our shared archives depend on static archives.
+     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+ 
++    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
++
+     # Go through the arguments, transforming them on the way.
+     while test "$#" -gt 0; do
+       arg=$1
+       shift
+       func_quote_for_eval "$arg"
+@@ -6989,11 +6990,11 @@
+         esac
+         func_append lib_search_path " $dir"
+         ;;
+       esac
+       case $host in
+-      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
++      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
+         testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$dir:"*) ;;
+         ::) dllsearchpath=$dir;;
+         *) func_append dllsearchpath ":$dir";;
+@@ -7009,11 +7010,11 @@
+       ;;
+ 
+       -l*)
+       if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+         case $host in
+-        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | 
*-*-haiku*)
++        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | 
*-*-haiku* | *-*-winnt*)
+           # These systems don't actually have a C or math library (as such)
+           continue
+           ;;
+         *-*-os2*)
+           # These systems don't actually have a C library (as such)
+@@ -7092,11 +7093,11 @@
+       continue
+       ;;
+ 
+       -no-install)
+       case $host in
+-      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | 
*-cegcc*)
++      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | 
*-cegcc* | *-*-winnt*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # and Darwin in order for the loader to find any dlls it needs.
+         func_warning "'-no-install' is ignored for $host"
+         func_warning "assuming '-no-fast-install' instead"
+         fast_install=no
+@@ -7396,13 +7397,64 @@
+         fi
+       fi
+       ;;
+ 
+       *.$libext)
+-      # An archive.
+-      func_append deplibs " $arg"
+-      func_append old_deplibs " $arg"
++      # With MSVC cl.exe, even dynamic deplibs are added as NAME.lib,
++      # so we need to distinguish based on their file type whether we
++      # have to treat them as static archive or dynamic import lib.
++      found=
++      case $linkmode,$arg in
++      *,*[\\/]*)
++        searchdirs=
++        if test -f "$arg"; then
++          found=$arg
++        fi
++        ;;
++      lib,*)
++        searchdirs="$newlib_search_path $lib_search_path 
$compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
++        ;;
++      *)
++        searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path 
$shlib_search_path"
++        ;;
++      esac
++      for searchdir in $searchdirs; do
++        if test -f "$searchdir/$arg"; then
++          found=$searchdir/$arg
++          break
++        fi
++      done
++      case $found,$deplibs_check_method in
++      ,*) ;; # nothing found
++      *,file_magic*)
++        file_magic_regex=`set dummy $deplibs_check_method; shift
++          expr "$deplibs_check_method" : "\$1 \(.*\)"`
++        while test -h "$found" 2>/dev/null; do
++          # Follow soft links.
++          if ls -lLd "$found" 2>/dev/null |
++             $GREP " -> " >/dev/null; then
++            break # found a soft link cycle
++          fi
++          foundlink=`ls -ld "$found" | $SED 's/.* -> //'`
++          case $foundlink in
++          [\\/]* | [A-Za-z]:[\\/]*) found=$foundlink;;
++          *) found=`$ECHO "$found" | $SED 's|[^/]*$||'`"$foundlink";;
++          esac
++        done
++        if eval $file_magic_cmd \"\$found\" |
++           $SED -e 10q |
++           $EGREP "$file_magic_regex" > /dev/null; then
++          found=implib
++        fi
++        ;;
++      esac
++      if test implib = "$found"; then
++        func_append deplibs " $arg"
++      else
++        func_append deplibs " $arg"
++        func_append old_deplibs " $arg"
++      fi
+       continue
+       ;;
+ 
+       *.la)
+       # A libtool-controlled library.
+@@ -7457,12 +7509,10 @@
+       # get the directories listed in $shlibpath_var
+       eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ 
/g\'\`
+     else
+       shlib_search_path=
+     fi
+-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+ 
+     # Definition is injected by LT_CONFIG during libtool generation.
+     func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+ 
+     func_dirname "$output" "/" ""
+@@ -7625,21 +7675,36 @@
+           func_warning "'-l' is ignored for archives/objects"
+           continue
+         fi
+         func_stripname '-l' '' "$deplib"
+         name=$func_stripname_result
++        release_save=$release
++        major_save=$major
++        versuffix_save=$versuffix
++        module_save=$module
++        release=
++        major=
++        versuffix=
++        module=no
++        eval shared_ext=\"$shrext_cmds\"
++        eval libname=\"$libname_spec\"
++        eval search_names=\"lib$name.la $library_names_spec 
lib$name$shared_ext lib$name.so $libname.$libext lib$name.$libext lib$name.a\"
++        release=$release_save
++        major=$major_save
++        versuffix=$versuffix_save
++        module=$module_save
+         if test lib = "$linkmode"; then
+           searchdirs="$newlib_search_path $lib_search_path 
$compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+         else
+           searchdirs="$newlib_search_path $lib_search_path 
$sys_lib_search_path $shlib_search_path"
+         fi
+         for searchdir in $searchdirs; do
+-          for search_ext in .la $std_shrext .so .a; do
++          for search_name in $search_names; do
+             # Search the libtool library
+-            lib=$searchdir/lib$name$search_ext
++            lib=$searchdir/$search_name
+             if test -f "$lib"; then
+-              if test .la = "$search_ext"; then
++              if test "lib$name.la" = "$search_name"; then
+                 found=:
+               else
+                 found=false
+               fi
+               break 2
+@@ -7765,38 +7830,82 @@
+           # Linking convenience modules into shared libraries is allowed,
+           # but linking other static libraries is non-portable.
+           case " $dlpreconveniencelibs " in
+           *" $deplib "*) ;;
+           *)
+-            valid_a_lib=false
++            valid_a_lib=no
+             case $deplibs_check_method in
+               match_pattern*)
+                 set dummy $deplibs_check_method; shift
+                 match_pattern_regex=`expr "$deplibs_check_method" : "$1 
\(.*\)"`
+                 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+-                  valid_a_lib=:
++                  valid_a_lib=warn
+                 fi
+               ;;
+               pass_all)
+-                valid_a_lib=:
++                valid_a_lib=warn
++              ;;
++              file_magic*)
++                # Check for import lib having .$libext.
++                potlib=
++                case $deplib in
++                  */* | *\\*)
++                    potlib=$deplib
++                    ;;
++                  *)
++                    searchdirs="$newlib_search_path $lib_search_path 
$compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
++                    for searchdir in $searchdirs; do
++                      test -e "$searchdir/$deplib" || continue
++                      potlib="$searchdir/$deplib"
++                      break
++                    done
++                  ;;
++                esac
++                while test -h "$potlib" 2>/dev/null; do
++                  # Follow soft links.
++                  if ls -lLd "$potlib" 2>/dev/null |
++                     $GREP " -> " >/dev/null; then
++                    break # found a soft link cycle
++                  fi
++                  potliblink=`ls -ld "$potlib" | $SED 's/.* -> //'`
++                  case $potliblink in
++                  [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
++                  *) potlib=`$ECHO "$potlib" | $SED 
's|[^/]*$||'`"$potliblink";;
++                  esac
++                done
++                set dummy $deplibs_check_method; shift
++                file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
++                if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
++                   $SED -e 10q |
++                   $EGREP "$file_magic_regex" > /dev/null; then
++                  valid_a_lib=yes
++                fi
+               ;;
+             esac
+-            if $valid_a_lib; then
++            case $valid_a_lib in
++            yes)
++              # handle like a shared lib with -lNAME
++              deplibs="$deplib $deplibs"
++              newdependency_libs="$deplib $newdependency_libs"
++              ;;
++            warn)
+               echo
+               $ECHO "*** Warning: Linking the shared library $output against 
the"
+               $ECHO "*** static library $deplib is not portable!"
+               deplibs="$deplib $deplibs"
+-            else
++              ;;
++            *)
+               echo
+               $ECHO "*** Warning: Trying to link with static lib archive 
$deplib."
+               echo "*** I have the capability to make that library 
automatically link in when"
+               echo "*** you link to this library.  But I can only do this if 
you have a"
+               echo "*** shared version of the library, which you do not 
appear to have"
+               echo "*** because the file extensions .$libext of this argument 
makes me believe"
+               echo "*** that it is just a static archive that I should not 
use here."
+-            fi
++              ;;
++            esac
+             ;;
+           esac
+           continue
+           ;;
+         prog)
+@@ -7986,11 +8095,11 @@
+         if test -z "$libdir" && test prog = "$linkmode"; then
+           func_fatal_error "only libraries may -dlpreopen a convenience 
library: '$lib'"
+         fi
+         case $host in
+           # special handling for platforms with PE-DLLs.
+-          *cygwin* | *mingw* | *cegcc* )
++          *cygwin* | *mingw* | *cegcc* | *winnt* )
+             # Linker will automatically link against shared library if both
+             # static and shared are present.  Therefore, ensure we extract
+             # symbols from the import library if a shared library is present
+             # (otherwise, the dlopen module name will be incorrect).  We do
+             # this by putting the import library name into $newdlprefiles.
+@@ -8130,11 +8239,11 @@
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test no = "$use_static_libs" || test -z "$old_library"; }; then
+         case $host in
+-        *cygwin* | *mingw* | *cegcc* | *os2*)
++        *cygwin* | *mingw* | *cegcc* | *os2* | *winnt*)
+             # No point in relinking DLLs because paths are not encoded
+             func_append notinst_deplibs " $lib"
+             need_relink=no
+           ;;
+         *)
+@@ -8200,11 +8309,11 @@
+           if test -n "$dlname"; then
+             soname=$dlname
+           elif test -n "$soname_spec"; then
+             # bleh windows
+             case $host in
+-            *cygwin* | mingw* | *cegcc* | *os2*)
++            *cygwin* | mingw* | *cegcc* | *os2* | winnt*)
+               func_arith $current - $age
+               major=$func_arith_result
+               versuffix=-$major
+               ;;
+             esac
+@@ -9110,11 +9219,11 @@
+       done
+ 
+       if test yes = "$build_libtool_libs"; then
+       if test -n "$rpath"; then
+         case $host in
+-        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | 
*-cegcc* | *-*-haiku*)
++        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | 
*-cegcc* | *-*-haiku* | *-*-winnt*)
+           # these systems don't actually have a c library (as such)!
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C library is in the System framework
+           func_append deplibs " System.ltframework"
+@@ -9280,24 +9389,33 @@
+                 a_deplib=
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib"; then
+-              libname=`eval "\\$ECHO \"$libname_spec\""`
++              module_save=$module
++              module=no
++              eval shared_ext=\"$shrext_cmds\"
++              eval libname=\"$libname_spec\"
++              eval search_names=\"$library_names_spec\"
++              module=$module_save
+               if test -n "$file_magic_glob"; then
+                 libnameglob=`func_echo_all "$libname" | $SED -e 
$file_magic_glob`
+               else
+                 libnameglob=$libname
+               fi
+               test yes = "$want_nocaseglob" && nocaseglob=`shopt -p 
nocaseglob`
+               for i in $lib_search_path $sys_lib_search_path 
$shlib_search_path; do
++                potential_libs=
++                for search_name in $search_names; do
++                  potential_libs="$potential_libs `ls $i/$search_name 
2>/dev/null`"
++                done
+                 if test yes = "$want_nocaseglob"; then
+                   shopt -s nocaseglob
+-                  potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++                  potential_libs="$potential_libs `ls $i/$libnameglob[.-]* 
2>/dev/null`"
+                   $nocaseglob
+                 else
+-                  potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++                  potential_libs="$potential_libs `ls $i/$libnameglob[.-]* 
2>/dev/null`"
+                 fi
+                 for potent_lib in $potential_libs; do
+                     # Follow soft links.
+                     if ls -lLd "$potent_lib" 2>/dev/null |
+                        $GREP " -> " >/dev/null; then
+@@ -9308,11 +9426,11 @@
+                     # We might still enter an endless loop, since a link
+                     # loop can be closed while we follow links,
+                     # but so what?
+                     potlib=$potent_lib
+                     while test -h "$potlib" 2>/dev/null; do
+-                      potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
++                      potliblink=`ls -ld "$potlib" | $SED 's/.* -> //'`
+                       case $potliblink in
+                       [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+                       *) potlib=`$ECHO "$potlib" | $SED 
's|[^/]*$||'`"$potliblink";;
+                       esac
+                     done
+@@ -9624,11 +9742,11 @@
+         func_append delfiles " $export_symbols"
+       fi
+ 
+       orig_export_symbols=
+       case $host_os in
+-      cygwin* | mingw* | cegcc*)
++      cygwin* | mingw* | cegcc* | winnt*)
+         if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+           # exporting using user supplied symfile
+           func_dll_def_p "$export_symbols" || {
+             # and it's NOT already a .def file. Must figure out
+             # which of the given symbols are data symbols and tag
+@@ -10294,11 +10412,11 @@
+         *" $libdir "*) ;;
+         *) func_append perm_rpath " $libdir" ;;
+         esac
+       fi
+       case $host in
+-      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
++      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc* | *-*-winnt*)
+         testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$libdir:"*) ;;
+         ::) dllsearchpath=$libdir;;
+         *) func_append dllsearchpath ":$libdir";;
+@@ -10372,11 +10490,11 @@
+       case $host in
+       *cegcc* | *mingw32ce*)
+         # Disable wrappers for cegcc and mingw32ce hosts, we are cross 
compiling anyway.
+         wrappers_required=false
+         ;;
+-      *cygwin* | *mingw* )
++      *cygwin* | *mingw* | *winnt* )
+         test yes = "$build_libtool_libs" || wrappers_required=false
+         ;;
+       *)
+         if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+           wrappers_required=false
+@@ -10525,11 +10643,11 @@
+           func_stripname '' '.exe' "$outputname"
+           outputname=$func_stripname_result ;;
+         *) exeext= ;;
+       esac
+       case $host in
+-        *cygwin* | *mingw* )
++        *cygwin* | *mingw* | *winnt* )
+           func_dirname_and_basename "$output" "" "."
+           output_name=$func_basename_result
+           output_path=$func_dirname_result
+           cwrappersource=$output_path/$objdir/lt-$output_name.c
+           cwrapper=$output_path/$output_name.exe
+@@ -10552,11 +10670,12 @@
+           $RM $func_ltwrapper_scriptname_result
+           trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 
2 15
+           $opt_dry_run || {
+             # note: this script will not be executed, so do not chmod.
+             if test "x$build" = "x$host"; then
+-              $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
++              # the running shell may be a Cygwin shell using binmode
++              $cwrapper --lt-dump-script | $SED -e "s/\\r//g" > 
$func_ltwrapper_scriptname_result
+             else
+               func_emit_wrapper no > $func_ltwrapper_scriptname_result
+             fi
+           }
+         ;;
+@@ -10857,11 +10976,11 @@
+         # applies here; at the moment, that means platforms that use the PE
+         # object format with DLL files.  See the long comment at the top of
+         # tests/bindir.at for full details.
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+-          *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | 
*cegcc*,*lai,yes,no,*.dll)
++          *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | 
*cegcc*,*lai,yes,no,*.dll | *winnt*,*lai,yes,no,*.dll)
+             # If a -bindir argument was supplied, place the dll there.
+             if test -n "$bindir"; then
+               func_relative_path "$install_libdir" "$bindir"
+               tdlname=$func_relative_path_result/$dlname
+             else
-- 
2.22.0


Reply via email to