diff -Naurp imlib-1.9.14/Imlib/Makefile.in imlib-1.9.14-cygwin/Imlib/Makefile.in
--- imlib-1.9.14/Imlib/Makefile.in	Mon Mar 25 16:50:26 2002
+++ imlib-1.9.14-cygwin/Imlib/Makefile.in	Wed Mar 27 12:41:53 2002
@@ -138,7 +138,7 @@ LIBS = @LIBS@
 libImlib_la_DEPENDENCIES = 
 libImlib_la_OBJECTS =  cache.lo colors.lo load.lo misc.lo rend.lo \
 utils.lo save.lo snprintf.lo
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ $(DLL_CFLAGS)
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -183,6 +183,9 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIE
 	  if test -f $$p; then \
 	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
 	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	    dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \
+	    echo "install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll"; \
+	    install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll; \
 	  else :; fi; \
 	done
 
@@ -190,6 +193,8 @@ uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	  dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \
+	  rm -f $(DESTDIR)$(bindir)/$$dll; \
 	done
 
 .c.o:
@@ -238,6 +243,7 @@ maintainer-clean-libtool:
 
 libImlib.la: $(libImlib_la_OBJECTS) $(libImlib_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libImlib_la_LDFLAGS) $(libImlib_la_OBJECTS) $(libImlib_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ $(libImlib_la_LIBADD) $(LIBS) $$(gtk-config --libs)
 
 install-includeHEADERS: $(include_HEADERS)
 	@$(NORMAL_INSTALL)
diff -Naurp imlib-1.9.14/config.h.in imlib-1.9.14-cygwin/config.h.in
--- imlib-1.9.14/config.h.in	Mon Mar 25 16:45:32 2002
+++ imlib-1.9.14-cygwin/config.h.in	Wed Mar 27 13:47:56 2002
@@ -24,6 +24,7 @@
 
 #undef HAVE_STDARGS
 #undef USE_GMODULE
+#define USE_GMODULE 1
 
 /* Define if you have the basename function.  */
 #undef HAVE_BASENAME
diff -Naurp imlib-1.9.14/configure imlib-1.9.14-cygwin/configure
--- imlib-1.9.14/configure	Mon Mar 25 16:45:33 2002
+++ imlib-1.9.14-cygwin/configure	Wed Mar 27 13:39:29 2002
@@ -3097,7 +3097,8 @@ EOF
       else $CC -o impgen impgen.c ; fi)~
       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
 
-    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+#    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+old_archive_from_expsyms_cmds=
 
     # cygwin and mingw dlls have different entry points and sets of symbols
     # to exclude.
@@ -4947,7 +4948,8 @@ old_postuninstall_cmds=$lt_old_postunins
 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
 
 # Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+#old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+old_archive_from_expsyms_cmds=
 
 # Commands used to build and install a shared archive.
 archive_cmds=$lt_archive_cmds
@@ -7359,7 +7361,7 @@ fi
 if test -z "$GDK_IMLIB"; then
   # see macros/gnome-x-checks.m4, and gtk.m4
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-  GX_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lm"
+  GX_LIBS="$X_PRE_LIBS $X_LIBS -lX11"
 else
   CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
   GX_LIBS="$GTK_LIBS"
@@ -7973,7 +7975,7 @@ if eval "test \"`echo '$''{'ac_cv_lib_$a
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lpng -lz -lm $GX_LIBS $LIBS"
+LIBS="-lpng -lz $GX_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 7979 "configure"
 #include "confdefs.h"
@@ -8079,7 +8081,7 @@ EOF
 
 fi
 
-SUPPORT_LIBS="$SUPPORT_LIBS -lm"
+SUPPORT_LIBS="$SUPPORT_LIBS"
 GDK_SUPPORT_LIBS="$SUPPORT_LIBS"
 
 if test $dynworks = false; then
diff -Naurp imlib-1.9.14/gdk_imlib/Makefile.in imlib-1.9.14-cygwin/gdk_imlib/Makefile.in
--- imlib-1.9.14/gdk_imlib/Makefile.in	Mon Mar 25 16:50:24 2002
+++ imlib-1.9.14-cygwin/gdk_imlib/Makefile.in	Wed Mar 27 13:54:01 2002
@@ -128,18 +128,18 @@ libimlib_ppm_la_SOURCES = io-ppm.c
 libimlib_ppm_la_LDFLAGS = $(common_ldflags)
 libimlib_ppm_la_LIBADD = libgdk_imlib.la
 
-@DYNAMIC_MODULES_WORK_TRUE@@HAVE_GIF_TRUE@GIF = libimlib-gif.la
+GIF = libimlib-gif.la
 
-@DYNAMIC_MODULES_WORK_TRUE@@HAVE_JPEG_TRUE@JPEG = libimlib-jpeg.la
+JPEG = libimlib-jpeg.la
 
-@DYNAMIC_MODULES_WORK_TRUE@@HAVE_PNG_TRUE@PNG = libimlib-png.la
+PNG = libimlib-png.la
 
-@DYNAMIC_MODULES_WORK_TRUE@@HAVE_TIFF_TRUE@TIFF = libimlib-tiff.la
+TIFF = libimlib-tiff.la
 
-@DYNAMIC_MODULES_WORK_TRUE@OTHER = 	libimlib-bmp.la			libimlib-xpm.la			libimlib-ppm.la			libimlib-ps.la
+OTHER = 	libimlib-bmp.la			libimlib-xpm.la			libimlib-ppm.la			libimlib-ps.la
 
-@DYNAMIC_MODULES_WORK_TRUE@DYNAMIC_LIBS = 	$(OTHER) $(GIF) $(JPEG) $(TIFF) $(PNG)
-@DYNAMIC_MODULES_WORK_FALSE@DYNAMIC_LIBS = 
+DYNAMIC_LIBS = 	$(OTHER) $(GIF) $(JPEG) $(TIFF) $(PNG)
+#DYNAMIC_LIBS = 
 
 lib_LTLIBRARIES =  	libgdk_imlib.la			$(DYNAMIC_LIBS)
 
@@ -153,7 +153,8 @@ libgdk_imlib_la_LIBADD = $(GMODULE_LIBS)
 
 include_HEADERS = gdk_imlib.h gdk_imlib_private.h gdk_imlib_types.h
 
-DEFS = -DSYSTEM_IMRC=\"$(sysconfdir)/imrc\" 	-DIMLIB_LIB=\""$(libdir)"\" -DSYSCONFDIR=\"$(sysconfdir)\"
+#DEFS = -DSYSTEM_IMRC=\"$(sysconfdir)/imrc\" 	-DIMLIB_LIB=\""$(libdir)"\" -DSYSCONFDIR=\"$(sysconfdir)\"
+DEFS = -DSYSTEM_IMRC=\"$(sysconfdir)/imrc\" 	-DIMLIB_LIB=\""$(bindir)"\" -DSYSCONFDIR=\"$(sysconfdir)\"
 
 
 INCLUDES = -I. -I$(srcdir) -I.. -I$(srcdir)/.. 	$(GTK_CFLAGS) $(X_CFLAGS) $(GMODULE_FLAGS) 
@@ -183,7 +184,7 @@ libimlib_tiff_la_DEPENDENCIES =  libgdk_
 libimlib_tiff_la_OBJECTS =  io-tiff.lo
 libimlib_png_la_DEPENDENCIES =  libgdk_imlib.la
 libimlib_png_la_OBJECTS =  io-png.lo
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ $(DLL_CFLAGS)
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -228,6 +229,9 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIE
 	  if test -f $$p; then \
 	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
 	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	    dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \
+	    echo "install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll"; \
+	    install -D --mode=755 .libs/$$dll $(DESTDIR)$(bindir)/$$dll; \
 	  else :; fi; \
 	done
 
@@ -235,6 +239,8 @@ uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	  dll=$$(echo $$p | sed 's,^lib\(.*\).la$$,cyg\1.dll,'); \
+	  rm -f $(DESTDIR)$(bindir)/$$dll; \
 	done
 
 .c.o:
@@ -281,32 +287,42 @@ distclean-libtool:
 
 maintainer-clean-libtool:
 
+libgdk_imlib.la: DLL_CFLAGS = -DGDK_IMLIB_BUILD_DLL
 libgdk_imlib.la: $(libgdk_imlib_la_OBJECTS) $(libgdk_imlib_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libgdk_imlib_la_LDFLAGS) $(libgdk_imlib_la_OBJECTS) $(libgdk_imlib_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ $(libgdk_imlib_la_LIBADD) $(LIBS) $$(gtk-config --libs)
 
 libimlib-bmp.la: $(libimlib_bmp_la_OBJECTS) $(libimlib_bmp_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_bmp_la_LDFLAGS) $(libimlib_bmp_la_OBJECTS) $(libimlib_bmp_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@  -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-xpm.la: $(libimlib_xpm_la_OBJECTS) $(libimlib_xpm_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_xpm_la_LDFLAGS) $(libimlib_xpm_la_OBJECTS) $(libimlib_xpm_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-ppm.la: $(libimlib_ppm_la_OBJECTS) $(libimlib_ppm_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_ppm_la_LDFLAGS) $(libimlib_ppm_la_OBJECTS) $(libimlib_ppm_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-ps.la: $(libimlib_ps_la_OBJECTS) $(libimlib_ps_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_ps_la_LDFLAGS) $(libimlib_ps_la_OBJECTS) $(libimlib_ps_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-gif.la: $(libimlib_gif_la_OBJECTS) $(libimlib_gif_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_gif_la_LDFLAGS) $(libimlib_gif_la_OBJECTS) $(libimlib_gif_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -L/usr/local/lib -lungif -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-jpeg.la: $(libimlib_jpeg_la_OBJECTS) $(libimlib_jpeg_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_jpeg_la_LDFLAGS) $(libimlib_jpeg_la_OBJECTS) $(libimlib_jpeg_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -ljpeg -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-tiff.la: $(libimlib_tiff_la_OBJECTS) $(libimlib_tiff_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_tiff_la_LDFLAGS) $(libimlib_tiff_la_OBJECTS) $(libimlib_tiff_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -ltiff -L. -lgdk_imlib $$(gtk-config --libs)
 
 libimlib-png.la: $(libimlib_png_la_OBJECTS) $(libimlib_png_la_DEPENDENCIES)
 	$(LINK) -rpath $(libdir) $(libimlib_png_la_LDFLAGS) $(libimlib_png_la_OBJECTS) $(libimlib_png_la_LIBADD) $(LIBS)
+	cd .libs && PREFIX=$(prefix) sh ../../mkdll.sh $@ -lpng -lz -L. -lgdk_imlib $$(gtk-config --libs)
 
 install-includeHEADERS: $(include_HEADERS)
 	@$(NORMAL_INSTALL)
diff -Naurp imlib-1.9.14/gdk_imlib/gdk_imlib_private.h imlib-1.9.14-cygwin/gdk_imlib/gdk_imlib_private.h
--- imlib-1.9.14/gdk_imlib/gdk_imlib_private.h	Mon Mar  4 17:06:29 2002
+++ imlib-1.9.14-cygwin/gdk_imlib/gdk_imlib_private.h	Wed Mar 27 12:41:53 2002
@@ -1,6 +1,14 @@
 #ifndef _GDK_IMLIB_PRIVATE_H
 #define _GDK_IMLIB_PRIVATE_H
 
+#ifndef GDK_IMLIB_IMPORT
+#if (defined(_WIN32) || defined(__CYGWIN__)) && !(defined(GDK_IMLIB_BUILD_DLL) || defined(GDK_IMLIB_STATIC))
+#define GDK_IMLIB_IMPORT __declspec(dllimport)
+#else
+#define GDK_IMLIB_IMPORT
+#endif
+#endif
+
 #ifndef CONVERT_PATH
 #define CONVERT_PATH "/usr/local/bin"
 #endif
@@ -143,7 +151,7 @@ typedef struct _imlibdata
   }
 ImlibData;
 
-extern ImlibData   *_gdk_imlib_data;
+extern GDK_IMLIB_IMPORT ImlibData   *_gdk_imlib_data;
 
 gint                _gdk_imlib_index_best_color_match(gint * r, gint * g, gint * b);
 void                gdk_imlib_load_default_colors__private (void);
@@ -207,29 +215,29 @@ ter=&(Der2[Dex-6]);\
 typedef unsigned char *(*gdk_imlib_loader_fn) (FILE *, int *w, int *h, int *transp);
 typedef unsigned char *(*gdk_imlib_loader_fn2)(FILE *, char *fname, int *w, int *h, int *trans);
 
-extern gdk_imlib_loader_fn _gdk_imlib_LoadBMP;
-extern gdk_imlib_loader_fn _gdk_imlib_LoadXPM;
-extern gdk_imlib_loader_fn _gdk_imlib_LoadGIF;
-extern gdk_imlib_loader_fn2 _gdk_imlib_LoadTIFF;
-extern gdk_imlib_loader_fn _gdk_imlib_LoadJPEG;
-extern gdk_imlib_loader_fn _gdk_imlib_LoadPNG;
-extern gdk_imlib_loader_fn _gdk_imlib_LoadPPM;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadBMP;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadXPM;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadGIF;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn2 _gdk_imlib_LoadTIFF;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadJPEG;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadPNG;
+extern GDK_IMLIB_IMPORT gdk_imlib_loader_fn _gdk_imlib_LoadPPM;
 
 typedef gint (*gdk_imlib_saver_fn)(GdkImlibImage *im, char *file, GdkImlibSaveInfo *info);
 
-extern gdk_imlib_saver_fn _gdk_imlib_SavePNG;
-extern gdk_imlib_saver_fn _gdk_imlib_SaveTIFF;
-extern gdk_imlib_saver_fn _gdk_imlib_SavePNG;
-extern gdk_imlib_saver_fn _gdk_imlib_SaveJPEG;
-extern gdk_imlib_saver_fn _gdk_imlib_SavePS;
-extern gdk_imlib_saver_fn _gdk_imlib_SavePPM;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SavePNG;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SaveTIFF;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SavePNG;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SaveJPEG;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SavePS;
+extern GDK_IMLIB_IMPORT gdk_imlib_saver_fn _gdk_imlib_SavePPM;
 
 typedef GdkImlibImage * (*gdk_imlib_inline_fn)(unsigned char *data, int data_size);
 
-extern gdk_imlib_inline_fn _gdk_imlib_inlined_png_to_image;
+extern GDK_IMLIB_IMPORT gdk_imlib_inline_fn _gdk_imlib_inlined_png_to_image;
 
 typedef GdkImlibImage *(*gdk_imlib_load_alpha_fn)(char *file);
 
-extern gdk_imlib_load_alpha_fn _gdk_imlib_load_alpha_png;
+extern GDK_IMLIB_IMPORT gdk_imlib_load_alpha_fn _gdk_imlib_load_alpha_png;
 
 #endif
diff -Naurp imlib-1.9.14/gdk_imlib/modules.c imlib-1.9.14-cygwin/gdk_imlib/modules.c
--- imlib-1.9.14/gdk_imlib/modules.c	Fri Jul 30 17:34:02 1999
+++ imlib-1.9.14-cygwin/gdk_imlib/modules.c	Wed Mar 27 12:41:53 2002
@@ -83,7 +83,11 @@ get_module_loader_saver (char *mod,
 	gboolean v;
 	void *ptr;
 
+#ifdef __CYGWIN__
+	modname = g_strconcat ("cygimlib-", mod, ".dll", NULL);
+#else
 	modname = g_strconcat ("imlib-", mod, NULL);
+#endif
 	path = g_module_build_path (IMLIB_LIB, modname);
 	g_free (modname);
 
diff -Naurp imlib-1.9.14/imlib-config.in imlib-1.9.14-cygwin/imlib-config.in
--- imlib-1.9.14/imlib-config.in	Wed Mar 28 04:18:40 2001
+++ imlib-1.9.14-cygwin/imlib-config.in	Wed Mar 27 12:41:53 2002
@@ -59,7 +59,7 @@ while test $# -gt 0; do
       ;;
     --libs)
       libdirs=-L@libdir@
-      echo $libdirs -lImlib @LDFLAGS@ $gx_libs @X_LIBS@ @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
+      echo $libdirs -lImlib @LDFLAGS@ $gx_libs @X_LIBS@ @X_PRE_LIBS@  @X_EXTRA_LIBS@ -lXext -lX11
       ;;
     --libs-gdk)
       libdirs=-L@libdir@
diff -Naurp imlib-1.9.14/mkdll.sh imlib-1.9.14-cygwin/mkdll.sh
--- imlib-1.9.14/mkdll.sh	Thu Jan  1 00:00:00 1970
+++ imlib-1.9.14-cygwin/mkdll.sh	Wed Mar 27 12:41:53 2002
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# script to generate dll from libtool-generated static archive (.la file)
+# invoke in .libs directory with:
+# mkdll.sh <archive.la> <dependency libs>
+# eg:
+# mkdll.sh libtest.la -L/usr/local/lib -llocal
+
+# defaults to using gcc for libraries written in C.
+# set the CC env var to use a different compiler driver: eg
+# export CC=g++ 
+# for C++ libraries
+
+# defaults to using /usr/local as the installation PREFIX
+# override this by setting the PREFIX env var: eg
+# export PREFIX=/opt/gnome
+
+archive=$1
+module=$(echo $(basename $archive) | sed -e 's,^lib\(.*\).la$,\1,')
+
+shift
+dependency_libs="$@"
+
+test -n "$CC" || CC=gcc
+test -n "$PREFIX" || prefix=/usr/local
+
+# get the static library name
+old_lib=$(sed -ne '/^old_library=/ s,^old_library='\''\(.*\)'\''.*$,\1,p' $archive)
+
+# update the archive with the dll and import lib name.
+if sed -e 's,^dlname='\'\'',dlname='\'cyg${module}.dll\'',;s,^library_names='\'\'',library_names='\'lib${module}.dll.a\'',' $archive > ${archive}.tmp
+then cat ${archive}.tmp > ${archive}
+fi
+rm -f ${archive}.tmp
+
+# update the install archive if it exists
+if [ -f ${archive}i ] ; then
+	if sed -e 's,^dlname='\'\'',dlname='\'../bin/cyg${module}.dll\'',;s,^library_names='\'\'',library_names='\'lib${module}.dll.a\'',' ${archive}i > ${archive}i.tmp
+	then cat ${archive}i.tmp > ${archive}i
+	fi
+	rm -f ${archive}i.tmp
+fi
+
+# update the archive with the install dir if not already set
+libdir=${prefix}/lib
+if sed -e '/^libdir=/ s,='\'\'',='\'$libdir\'',' $archive > ${archive}.tmp
+then cat ${archive}.tmp > $archive
+fi
+rm -f ${archive}.tmp
+
+
+# report the link command to stdout
+eval echo $CC -shared -o cyg${module}.dll -Wl,--out-implib=lib${module}.dll.a \
+-Wl,--export-all-symbols -Wl,--whole-archive $old_lib -Wl,--no-whole-archive ${dependency_libs}
+
+# do the link command
+eval $CC -shared -o cyg${module}.dll -Wl,--out-implib=lib${module}.dll.a -Wl,--export-all-symbols \
+-Wl,--whole-archive $old_lib -Wl,--no-whole-archive ${dependency_libs}
+
diff -Naurp imlib-1.9.14/utils/Makefile.in imlib-1.9.14-cygwin/utils/Makefile.in
--- imlib-1.9.14/utils/Makefile.in	Mon Mar 25 16:50:25 2002
+++ imlib-1.9.14-cygwin/utils/Makefile.in	Wed Mar 27 12:41:53 2002
@@ -50,6 +50,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 transform = @program_transform_name@
+EXEEXT = .exe
 
 NORMAL_INSTALL = :
 PRE_INSTALL = :
@@ -165,8 +166,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
 	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
