diff -rubB libtool-1.5.22.orig/bootstrap libtool-1.5.22/bootstrap
--- libtool-1.5.22.orig/bootstrap	2004-04-14 12:50:09.000000000 +0200
+++ libtool-1.5.22/bootstrap	2006-07-19 17:27:24.000000000 +0200
@@ -37,6 +37,8 @@
     ;;
   esac
 
+  set -xv
+
   cd $sub
   rm -f acinclude.m4 aclocal.m4 Makefile configure
   for file in $acfiles; do
@@ -49,6 +51,8 @@
   eval $AUTOMAKE $AUTOMAKE_FLAGS
   $AUTOCONF
   cd $top_srcdir
+
+  set +xv
 done
 
 rm -f ltmain.sh libtoolize libltdl/ltmain.sh
diff -rubB libtool-1.5.22.orig/demo/foo.c libtool-1.5.22/demo/foo.c
--- libtool-1.5.22.orig/demo/foo.c	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/demo/foo.c	2006-07-19 14:08:56.000000000 +0200
@@ -18,7 +18,9 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 USA. */
 
+#define __EXPORT_FOO__
 #include "foo.h"
+#undef __EXPORT_FOO__
 
 #include <stdio.h>
 
@@ -27,7 +29,7 @@
 #endif
 
 /* Give a global variable definition. */
-int nothing = FOO_RET;
+int _foo_EXPORT nothing = FOO_RET;
 
 int
 foo ()
diff -rubB libtool-1.5.22.orig/demo/foo.h libtool-1.5.22/demo/foo.h
--- libtool-1.5.22.orig/demo/foo.h	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/demo/foo.h	2006-07-19 14:08:23.000000000 +0200
@@ -33,6 +33,21 @@
 #  endif
 #endif
 
+/* __PXWC__ is defined whenever compiling under Interix* with wgcc.
+ * If it is defined we need to define some macros to export vars
+ * on native win32.
+ */
+
+#ifdef __PXWC__
+#  ifdef __EXPORT_FOO__
+#    define _foo_EXPORT __declspec(dllexport)
+#  else
+#    define _foo_EXPORT __declspec(dllimport)
+#  endif
+#else
+#  define _foo_EXPORT
+#endif
+
 /* __BEGIN_DECLS should be used at the beginning of your declarations,
    so that C++ compilers don't mangle their names.  Use __END_DECLS at
    the end of C declarations. */
@@ -67,7 +82,7 @@
 __BEGIN_DECLS
 int foo LT_PARAMS((void));
 int hello LT_PARAMS((void));
-extern int nothing;
+extern _foo_EXPORT int nothing;
 __END_DECLS
 
 #endif /* !_FOO_H_ */
diff -rubB libtool-1.5.22.orig/depdemo/l1/l1.c libtool-1.5.22/depdemo/l1/l1.c
--- libtool-1.5.22.orig/depdemo/l1/l1.c	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l1/l1.c	2006-07-19 16:56:29.000000000 +0200
@@ -17,10 +17,12 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 USA. */
 
+#define __EXPORT_L1__
 #include "l1/l1.h"
+#undef __EXPORT_L1__
 #include <stdio.h>
 
-int	var_l1 = 0;
+int	_l1_EXPORT var_l1 = 0;
 
 int
 func_l1(indent)
diff -rubB libtool-1.5.22.orig/depdemo/l1/l1.h libtool-1.5.22/depdemo/l1/l1.h
--- libtool-1.5.22.orig/depdemo/l1/l1.h	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l1/l1.h	2006-07-19 16:54:24.000000000 +0200
@@ -23,8 +23,18 @@
 
 #include "sysdep.h"
 
+#if defined(__PXWC__)
+#	if defined(__EXPORT_L1__)
+#		define _l1_EXPORT __declspec(dllexport)
+#	else
+#		define _l1_EXPORT __declspec(dllimport)
+#	endif
+#else
+#	define _l1_EXPORT
+#endif
+
 __BEGIN_DECLS
-extern int var_l1;
+extern _l1_EXPORT int var_l1;
 int	func_l1 __P((int));
 __END_DECLS
 
diff -rubB libtool-1.5.22.orig/depdemo/l2/l2.c libtool-1.5.22/depdemo/l2/l2.c
--- libtool-1.5.22.orig/depdemo/l2/l2.c	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l2/l2.c	2006-07-19 16:57:06.000000000 +0200
@@ -17,12 +17,14 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 USA. */
 
+#define __EXPORT_L2__
 #include "l2/l2.h"
+#undef __EXPORT_L2__
 
 #include "l1/l1.h"
 #include <stdio.h>
 
-int	var_l2 = 0;
+int	_l2_EXPORT var_l2 = 0;
 
 int
 func_l2(indent)
diff -rubB libtool-1.5.22.orig/depdemo/l2/l2.h libtool-1.5.22/depdemo/l2/l2.h
--- libtool-1.5.22.orig/depdemo/l2/l2.h	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l2/l2.h	2006-07-19 16:55:01.000000000 +0200
@@ -23,8 +23,18 @@
 
 #include "sysdep.h"
 
+#if defined(__PXWC__)
+#	if defined(__EXPORT_L2__)
+#		define _l2_EXPORT __declspec(dllexport)
+#	else
+#		define _l2_EXPORT __declspec(dllimport)
+#	endif
+#else
+#	define _l2_EXPORT
+#endif
+
 __BEGIN_DECLS
-extern int var_l2;
+extern _l2_EXPORT int var_l2;
 int	func_l2 __P((int));
 __END_DECLS
 
diff -rubB libtool-1.5.22.orig/depdemo/l3/l3.c libtool-1.5.22/depdemo/l3/l3.c
--- libtool-1.5.22.orig/depdemo/l3/l3.c	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l3/l3.c	2006-07-19 16:57:38.000000000 +0200
@@ -17,13 +17,15 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 USA. */
 
+#define __EXPORT_L3__
 #include "l3/l3.h"
+#undef __EXPORT_L3__
 
 #include "l1/l1.h"
 #include "l2/l2.h"
 #include <stdio.h>
 
-int	var_l3 = 0;
+int	_l3_EXPORT var_l3 = 0;
 
 int
 func_l3(indent)
diff -rubB libtool-1.5.22.orig/depdemo/l3/l3.h libtool-1.5.22/depdemo/l3/l3.h
--- libtool-1.5.22.orig/depdemo/l3/l3.h	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l3/l3.h	2006-07-19 16:55:51.000000000 +0200
@@ -23,8 +23,18 @@
 
 #include "sysdep.h"
 
+#if defined(__PXWC__)
+#   if defined(__EXPORT_L3__)
+#       define _l3_EXPORT __declspec(dllexport)
+#   else
+#       define _l3_EXPORT __declspec(dllimport)
+#   endif
+#else
+#   define _l3_EXPORT
+#endif
+
 __BEGIN_DECLS
-extern int var_l3;
+extern _l3_EXPORT int var_l3;
 int	func_l3 __P((int));
 __END_DECLS
 
diff -rubB libtool-1.5.22.orig/depdemo/l4/l4.c libtool-1.5.22/depdemo/l4/l4.c
--- libtool-1.5.22.orig/depdemo/l4/l4.c	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l4/l4.c	2006-07-19 17:01:21.000000000 +0200
@@ -17,7 +17,9 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 USA. */
 
+#define __EXPORT_L4__
 #include "l4/l4.h"
+#undef __EXPORT_L4__
 
 #include "l3/l3.h"
 #include <stdio.h>
@@ -26,7 +28,7 @@
 #include <math.h>
 #endif
 
-int	var_l4 = 0;
+int	_l4_EXPORT var_l4 = 0;
 
 int
 func_l4(indent)
diff -rubB libtool-1.5.22.orig/depdemo/l4/l4.h libtool-1.5.22/depdemo/l4/l4.h
--- libtool-1.5.22.orig/depdemo/l4/l4.h	2005-04-23 07:39:20.000000000 +0200
+++ libtool-1.5.22/depdemo/l4/l4.h	2006-07-19 17:00:42.000000000 +0200
@@ -23,8 +23,18 @@
 
 #include "sysdep.h"
 
+#if defined(__PXWC__)
+#   if defined(__EXPORT_L4__)
+#       define _l4_EXPORT __declspec(dllexport)
+#   else
+#       define _l4_EXPORT __declspec(dllimport)
+#   endif
+#else
+#   define _l4_EXPORT
+#endif
+
 __BEGIN_DECLS
-extern int var_l4;
+extern _l4_EXPORT int var_l4;
 int	func_l4 __P((int));
 __END_DECLS
 
diff -rubB libtool-1.5.22.orig/libltdl/ltdl.c libtool-1.5.22/libltdl/ltdl.c
--- libtool-1.5.22.orig/libltdl/ltdl.c	2005-10-31 20:44:43.000000000 +0100
+++ libtool-1.5.22/libltdl/ltdl.c	2006-07-20 16:53:39.000000000 +0200
@@ -1361,6 +1361,14 @@
       cygwin_conv_to_full_win32_path (searchname, wpath);
       module = LoadLibrary (wpath);
     }
+#elif defined(__PXWC__)
+	{
+	  char wpath[MAX_PATH];
+	  strcpy(wpath, searchname);
+	  __pxwc_convert(wpath, MAX_PATH);
+	  fprintf(stderr, "\n\n__pxwc_convert: %s\n\n", wpath);
+	  module = LoadLibrary(wpath);
+	}
 #else
     module = LoadLibrary (searchname);
 #endif
@@ -2744,12 +2752,21 @@
   char	     **pdir	= (char **) data1;
   FILE	     **pfile	= (FILE **) data2;
   int	     is_done	= 0;
+#if defined(__PXWC__)  
+  char		 wpath[MAX_PATH];
+#endif  
 
   assert (filename && *filename);
   assert (pdir);
   assert (pfile);
 
+#if defined(__PXWC__)
+  strcpy(wpath, filename);
+  __pxwc_convert(wpath, MAX_PATH);
+  if ((*pfile = fopen (wpath, LT_READTEXT_MODE)))
+#else
   if ((*pfile = fopen (filename, LT_READTEXT_MODE)))
+#endif
     {
       char *dirend = strrchr (filename, '/');
 
@@ -3205,7 +3222,14 @@
 	}
       if (!file)
 	{
+#if defined(__PXWC__)
+		char wpath[MAX_PATH];
+		strcpy(wpath, filename);
+		__pxwc_convert(wpath, MAX_PATH);
+		file = fopen (wpath, LT_READTEXT_MODE);
+#else
 	  file = fopen (filename, LT_READTEXT_MODE);
+#endif
 	}
 
       /* If we didn't find the file by now, it really isn't there.  Set
@@ -3675,13 +3699,22 @@
 {
   DIR	*dirp	  = 0;
   int    errors	  = 0;
+#if defined(__PXWC__)  
+  char wpath[MAX_PATH];
+#endif  
 
   assert (dirnam && *dirnam);
   assert (pargz);
   assert (pargz_len);
   assert (dirnam[LT_STRLEN(dirnam) -1] != '/');
 
+#if defined(__PXWC__)
+	strcpy(wpath, dirnam);
+	__pxwc_convert(wpath, MAX_PATH);
+	dirp = opendir (wpath);
+#else
   dirp = opendir (dirnam);
+#endif
   if (dirp)
     {
       struct dirent *dp	= 0;
diff -rubB libtool-1.5.22.orig/libtool.m4 libtool-1.5.22/libtool.m4
--- libtool-1.5.22.orig/libtool.m4	2005-12-18 22:53:17.000000000 +0100
+++ libtool-1.5.22/libtool.m4	2006-07-26 13:15:45.000000000 +0200
@@ -928,9 +928,15 @@
    ;;
 
   cygwin*)
+  	case "$CC" in
+	*wgcc*)
+		;;
+	*)	
     lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
    ;;
+	esac	
+   ;;
 
   darwin*)
   # if libdl is installed we need to link against it
@@ -1063,6 +1069,11 @@
    cd ..
    rmdir conftest
    $rm conftest*
+   case "$CC" in
+   *wgcc*)
+   	$rm -rf conftest
+	;;
+   esac	
 ])
 ])# AC_LIBTOOL_PROG_CC_C_O
 
@@ -1357,6 +1368,36 @@
   dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
+
+	case $cc_basename in
+	*wgcc*)
+		shrext_cmds=".so"
+		version_type=linux
+		need_lib_prefix=no
+		need_version=no
+		library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+		soname_spec='${libname}${release}${shared_ext}$major'
+		hardcode_into_libs=yes
+
+		shlibpath_var=PATH
+		shlibpath_overrides_runpath=yes
+		dynamic_linker='Interix to Win32 cross linker (wgcc)'
+		# the wgcc linker gives .dll files with the .so's...
+		postinstall_cmds='base_file=`basename \${file}`~
+			dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+			dldir=$destdir/`dirname \$dlpath` ~
+			set dummy `ls -l $dir/\$dlname*.dll` ~
+			while test -n "\${3}" ; do shift; done ~
+			dllname=`basename ${2}` ~
+			test -d \${dldir}/../bin || mkdir -p \${dldir}/../bin ~
+			$install_prog $dir/$dllname \$dldir/../bin/$dllname ~
+			chmod a+x \$dldir/../bin/$dllname'
+		postuninstall_cmds='dlpath=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+			set dummy `ls -l $dir/../bin/\$dlname*.dll` ~
+			while test -n "\${3}" ; do shift; done ~
+			$rm ${2}'
+	;;
+	esac
   ;;
 
 darwin* | rhapsody*)
@@ -1503,7 +1544,7 @@
   postinstall_cmds='chmod 555 $lib'
   ;;
 
-interix3*)
+interix*)
   version_type=linux
   need_lib_prefix=no
   need_version=no
@@ -1513,6 +1554,29 @@
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
+
+	case $cc_basename in
+	*wgcc*)
+		shlibpath_var=PATH
+		shlibpath_overrides_runpath=yes
+		dynamic_linker='Interix to Win32 cross linker (wgcc)'
+		# the wgcc linker gives .dll files with the .so's...
+		postinstall_cmds='base_file=`basename \${file}`~
+			dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+			dldir=$destdir/`dirname \$dlpath` ~
+			set dummy `ls -l $dir/\$dlname*.dll` ~
+			while test -n "\${3}" ; do shift; done ~
+			dllname=`basename ${2}` ~
+			test -d \${dldir}/../bin || mkdir -p \${dldir}/../bin ~
+			$install_prog $dir/$dllname \$dldir/../bin/$dllname ~
+			chmod a+x \$dldir/../bin/$dllname'
+		postuninstall_cmds='dlpath=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+			set dummy `ls -l $dir/../bin/\$dlname*.dll` ~
+			while test -n "\${3}" ; do shift; done ~
+			$rm ${2}'
+	;;
+	esac
+  
   ;;
 
 irix5* | irix6* | nonstopux*)
@@ -2289,9 +2353,16 @@
 
 cygwin*)
   # func_win32_libid is a shell function defined in ltmain.sh
+  case $CC in
+  *wgcc*)
+  lt_cv_deplibs_check_method='pass_all'
+	  ;;
+  *) 
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
   lt_cv_file_magic_cmd='func_win32_libid'
   ;;
+  esac
+  ;;
 
 mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
@@ -2342,10 +2413,17 @@
   esac
   ;;
 
-interix3*)
+interix*)
   # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  case $CC in
+  *wgcc*)
+  lt_cv_deplibs_check_method='pass_all'
+	  ;;
+  *) 
   lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
   ;;
+  esac 
+  ;;
 
 irix5* | irix6* | nonstopux*)
   case $LD in
@@ -3005,6 +3083,22 @@
     ;;
 
   cygwin* | mingw* | pw32*)
+  	case "$CC" in
+	*wgcc*)
+		_LT_AC_TAGVAR(hardcode_direct, $1)=no
+		_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+		_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+		_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=''
+		# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+		# Instead, shared libraries are loaded at an image base (0x10000000 by
+		# default) and relocated if they conflict, which is a slow very memory
+		# consuming and fragmenting process.  To avoid this, we pick a random,
+		# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+		# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+		_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+		_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+		;;
+	*)
     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
     # as there is no search path for DLLs.
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -3027,6 +3121,8 @@
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
   ;;
+	esac
+  ;;
       darwin* | rhapsody*)
         case $host_os in
         rhapsody* | darwin1.[[012]])
@@ -3233,11 +3329,18 @@
 	;;
     esac
     ;;
-  interix3*)
+  interix*)
     _LT_AC_TAGVAR(hardcode_direct, $1)=no
     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	case $cc_basename in
+	*wgcc*)
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=''
+		;;
+	*)
     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+		;;
+	esac	
     # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
     # Instead, shared libraries are loaded at an image base (0x10000000 by
     # default) and relocated if they conflict, which is a slow very memory
@@ -3864,7 +3967,7 @@
 # PORTME: override above test on systems where it is broken
 ifelse([$1],[CXX],
 [case $host_os in
-interix3*)
+interix*)
   # Interix 3.5 installs completely hosed .la files for C++, so rather than
   # hack all around it, let's just trust "g++" to DTRT.
   _LT_AC_TAGVAR(predep_objects,$1)=
@@ -3872,6 +3975,18 @@
   _LT_AC_TAGVAR(postdeps,$1)=
   ;;
 
+  
+cygwin* | mingw* | pw32*)
+	case "$CC" in
+	*wgcc*)
+	  # wgcc comes from Interix, so make it feel home ;o)
+	  _LT_AC_TAGVAR(predep_objects,$1)=
+	  _LT_AC_TAGVAR(postdep_objects,$1)=
+	  _LT_AC_TAGVAR(postdeps,$1)=
+	;;
+	esac
+	;;
+
 solaris*)
   case $cc_basename in
   CC*)
@@ -4855,7 +4970,7 @@
       # DJGPP does not support shared libraries at all
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
-    interix3*)
+    interix*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -4949,9 +5064,27 @@
 	    ;;
 	esac
 	;;
+	cygwin*|mingw*|pw32*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+
+	case $cc_basename in
+	*wgcc*)
+		_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+		_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+		;;
+	esac
+	;;
       interix*)
 	# This is c89, which is MS Visual C++ (no shared libs)
 	# Anyone wants to do a port?
+
+	case $cc_basename in
+	*wgcc*)
+		_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+		_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+		;;
+	esac
 	;;
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
@@ -5127,7 +5260,7 @@
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
-    interix3*)
+    interix*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
       ;;
@@ -5207,6 +5340,24 @@
       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
       ;;
 
+	cygwin*|mingw*|pw32*)
+	case $cc_basename in
+	*wgcc*)
+		_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+		_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+		;;
+	esac
+	;;
+
+	interix*)
+	case $cc_basename in
+	*wgcc*)
+		_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+		_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+		;;
+	esac
+	;;
+
     irix5* | irix6* | nonstopux*)
       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC (with -KPIC) is the default.
@@ -5357,8 +5508,14 @@
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   cygwin* | mingw*)
+  	case "$CC" in
+	*wgcc*)
+		;;
+	*)	
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
+	esac	
+  ;;
   *)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
@@ -5410,6 +5567,12 @@
     if test "$GCC" != yes; then
       with_gnu_ld=no
     fi
+
+	case "$CC" in
+	*wgcc*)
+		with_gnu_ld=yes
+		;;
+	esac	
     ;;
   interix*)
     # we just hope/assume this is gcc and not c89 (= MSVC++)
@@ -5490,6 +5653,22 @@
       ;;
 
     cygwin* | mingw* | pw32*)
+	  case "$CC" in
+	  *wgcc*)
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=''
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	  	;;
+	  *)
       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -5513,12 +5692,21 @@
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
+	  esac
+      ;;
 
-    interix3*)
+    interix*)
       _LT_AC_TAGVAR(hardcode_direct, $1)=no
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  case $cc_basename in
+	  *wgcc*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=''
+		  ;;
+	  *)
       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+		  ;;
+	  esac 
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
@@ -5790,6 +5978,22 @@
       ;;
 
     cygwin* | mingw* | pw32*)
+	  case "$CC" in
+	  *wgcc*)
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=''
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	  	;;
+	  *)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -5809,6 +6013,8 @@
       _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
+	  esac
+	  ;;
 
     darwin* | rhapsody*)
       case $host_os in
diff -rubB libtool-1.5.22.orig/ltmain.in libtool-1.5.22/ltmain.in
--- libtool-1.5.22.orig/ltmain.in	2005-12-18 22:43:52.000000000 +0100
+++ libtool-1.5.22/ltmain.in	2006-07-19 11:43:28.000000000 +0200
@@ -5310,6 +5310,14 @@
 "
 
 	if test "$fast_install" = yes; then
+	case "`uname`:$CC" in
+	Interix:wgcc)
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+		;;
+	*)	
 	  $echo >> $output "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
@@ -5343,6 +5351,8 @@
       $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
     $rm \"\$progdir/\$file\"
   fi"
+		;;
+	esac	
 	else
 	  $echo >> $output "\
   program='$outputname'

