diff -urN --exclude=.build --exclude=Makefile.in --exclude=autom4te.cache imlib2-1.2.1-orig/src/lib/Makefile.am imlib2-1.2.1/src/lib/Makefile.am
--- imlib2-1.2.1-orig/src/lib/Makefile.am	2005-06-10 11:24:41.000000000 +0900
+++ imlib2-1.2.1/src/lib/Makefile.am	2005-06-29 02:01:18.412059200 +0900
@@ -97,5 +97,5 @@
 libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h
 endif
 endif
-libImlib2_la_LDFLAGS      = -version-info 3:1:2
+libImlib2_la_LDFLAGS      = -version-info 3:1:2 -no-undefined
 
diff -urN --exclude=.build --exclude=Makefile.in --exclude=autom4te.cache imlib2-1.2.1-orig/src/lib/dynamic_filters.c imlib2-1.2.1/src/lib/dynamic_filters.c
--- imlib2-1.2.1-orig/src/lib/dynamic_filters.c	2004-11-01 18:45:30.000000000 +0900
+++ imlib2-1.2.1/src/lib/dynamic_filters.c	2005-06-29 01:48:44.270473600 +0900
@@ -35,7 +35,11 @@
    MALLOCSHOW;
    ptr = malloc(sizeof(ImlibExternalFilter));
    ptr->filename = strdup(file);
+#if defined(__CYGWIN__)
+   ptr->handle = dlopen(file, RTLD_NOW);
+#else
    ptr->handle = dlopen(file, RTLD_NOW | RTLD_LOCAL);
+#endif
    if (!ptr->handle)
      {
         FREESHOW;
diff -urN --exclude=.build --exclude=Makefile.in --exclude=autom4te.cache imlib2-1.2.1-orig/src/lib/image.c imlib2-1.2.1/src/lib/image.c
--- imlib2-1.2.1-orig/src/lib/image.c	2005-01-17 03:23:46.000000000 +0900
+++ imlib2-1.2.1/src/lib/image.c	2005-06-29 02:36:55.384198400 +0900
@@ -572,7 +572,11 @@
    l = malloc(sizeof(ImlibLoader));
    l->num_formats = 0;
    l->formats = NULL;
+#if defined(__CYGWIN__)
+   l->handle = dlopen(file, RTLD_NOW);
+#else
    l->handle = dlopen(file, RTLD_NOW | RTLD_LOCAL);
+#endif
    if (!l->handle)
      {
         free(l);
@@ -663,7 +667,11 @@
         if (!list[i])
            continue;
         ext = strrchr(list[i], '.');
+#if defined(__CYGWIN__)
+        if ((ext) && (!strcasecmp(ext, ".dll")))
+#else
         if ((ext) && (!strcasecmp(ext, ".so")))
+#endif
           {
              /* Don't add the same loader multiple times... */
              if (!__imlib_ItemInList(ret, size, list[i]))
diff -urN --exclude=.build --exclude=Makefile.in --exclude=autom4te.cache imlib2-1.2.1-orig/src/modules/filters/Makefile.am imlib2-1.2.1/src/modules/filters/Makefile.am
--- imlib2-1.2.1-orig/src/modules/filters/Makefile.am	2005-02-13 13:05:03.000000000 +0900
+++ imlib2-1.2.1/src/modules/filters/Makefile.am	2005-06-29 02:07:53.960830400 +0900
@@ -11,14 +11,14 @@
 pkg_LTLIBRARIES       = testfilter.la bumpmap.la colormod.la
 
 testfilter_la_SOURCES = filter_test.c
-testfilter_la_LDFLAGS = -module -avoid-version
+testfilter_la_LDFLAGS = -module -avoid-version -no-undefined
 testfilter_la_LIBADD  = $(top_builddir)/src/lib/libImlib2.la
 
 bumpmap_la_SOURCES    = filter_bumpmap.c
-bumpmap_la_LDFLAGS    = -module -avoid-version
+bumpmap_la_LDFLAGS    = -module -avoid-version -no-undefined
 bumpmap_la_LIBADD     = $(top_builddir)/src/lib/libImlib2.la
 
 colormod_la_SOURCES   = filter_colormod.c
-colormod_la_LDFLAGS   = -module -avoid-version
+colormod_la_LDFLAGS   = -module -avoid-version -no-undefined
 colormod_la_LIBADD    = $(top_builddir)/src/lib/libImlib2.la
 
diff -urN --exclude=.build --exclude=Makefile.in --exclude=autom4te.cache imlib2-1.2.1-orig/src/modules/loaders/Makefile.am imlib2-1.2.1/src/modules/loaders/Makefile.am
--- imlib2-1.2.1-orig/src/modules/loaders/Makefile.am	2005-02-13 13:05:03.000000000 +0900
+++ imlib2-1.2.1/src/modules/loaders/Makefile.am	2005-06-29 02:06:25.844124800 +0900
@@ -43,49 +43,49 @@
 lbm.la
 
 jpeg_la_SOURCES      = loader_jpeg.c
-jpeg_la_LDFLAGS      = -module -avoid-version
+jpeg_la_LDFLAGS      = -module -avoid-version -no-undefined
 jpeg_la_LIBADD       = @JPEGLIBS@ $(top_builddir)/src/lib/libImlib2.la
 
 png_la_SOURCES       = loader_png.c
-png_la_LDFLAGS       = -module -avoid-version
+png_la_LDFLAGS       = -module -avoid-version -no-undefined
 png_la_LIBADD        = @PNGLIBS@ $(top_builddir)/src/lib/libImlib2.la
                        
 tiff_la_SOURCES      = loader_tiff.c
-tiff_la_LDFLAGS      = -module -avoid-version
+tiff_la_LDFLAGS      = -module -avoid-version -no-undefined
 tiff_la_LIBADD       = @TIFFLIBS@ $(top_builddir)/src/lib/libImlib2.la
 
 gif_la_SOURCES       = loader_gif.c
-gif_la_LDFLAGS       = -module -avoid-version
+gif_la_LDFLAGS       = -module -avoid-version -no-undefined
 gif_la_LIBADD        = @GIFLIBS@ $(top_builddir)/src/lib/libImlib2.la
 
 zlib_la_SOURCES      = loader_zlib.c
-zlib_la_LDFLAGS      = -module -avoid-version
+zlib_la_LDFLAGS      = -module -avoid-version -no-undefined
 zlib_la_LIBADD       = @ZLIBLIBS@ $(top_builddir)/src/lib/libImlib2.la
 
 bz2_la_SOURCES       = loader_bz2.c
-bz2_la_LDFLAGS       = -module -avoid-version
+bz2_la_LDFLAGS       = -module -avoid-version -no-undefined
 bz2_la_LIBADD        = @BZ2LIBS@ $(top_builddir)/src/lib/libImlib2.la
 
 pnm_la_SOURCES       = loader_pnm.c
-pnm_la_LDFLAGS       = -module -avoid-version
+pnm_la_LDFLAGS       = -module -avoid-version -no-undefined
 pnm_la_LIBADD        = $(top_builddir)/src/lib/libImlib2.la
 
 argb_la_SOURCES      = loader_argb.c
-argb_la_LDFLAGS      = -module -avoid-version
+argb_la_LDFLAGS      = -module -avoid-version -no-undefined
 argb_la_LIBADD       = $(top_builddir)/src/lib/libImlib2.la
 
 bmp_la_SOURCES       = loader_bmp.c
-bmp_la_LDFLAGS       = -module -avoid-version
+bmp_la_LDFLAGS       = -module -avoid-version -no-undefined
 bmp_la_LIBADD        = $(top_builddir)/src/lib/libImlib2.la
 
 xpm_la_SOURCES       = loader_xpm.c
-xpm_la_LDFLAGS       = -module -avoid-version
+xpm_la_LDFLAGS       = -module -avoid-version -no-undefined
 xpm_la_LIBADD        = $(top_builddir)/src/lib/libImlib2.la
 
 tga_la_SOURCES       = loader_tga.c
-tga_la_LDFLAGS       = -module -avoid-version
+tga_la_LDFLAGS       = -module -avoid-version -no-undefined
 tga_la_LIBADD        = $(top_builddir)/src/lib/libImlib2.la
 
 lbm_la_SOURCES       = loader_lbm.c
-lbm_la_LDFLAGS       = -module -avoid-version
+lbm_la_LDFLAGS       = -module -avoid-version -no-undefined
 lbm_la_LIBADD        = $(top_builddir)/src/lib/libImlib2.la
