diff -ur libIDL-0.8.0.orig/IDL.h.new.in libIDL-0.8.0/IDL.h.new.in
--- libIDL-0.8.0.orig/IDL.h.new.in	2001-09-25 01:29:02.000000000 +0900
+++ libIDL-0.8.0/IDL.h.new.in	2002-09-05 13:00:02.000000000 +0900
@@ -85,8 +85,8 @@
 #define IDLF_OUTPUT_PROPERTIES		(1UL << 2)
 #define IDLF_OUTPUT_CODEFRAGS		(1UL << 3)
 
-#ifdef _WIN32
-#  define IDL_EXPORT			__declspec (dllexport)
+#ifdef G_PLATFORM_WIN32
+#  define IDL_EXPORT			/* assume auto-export */
 #  define IDL_IMPORT			__declspec (dllimport)
 #else
 #  define IDL_EXPORT			/* empty */
diff -ur libIDL-0.8.0.orig/Makefile.am libIDL-0.8.0/Makefile.am
--- libIDL-0.8.0.orig/Makefile.am	2002-03-28 19:16:46.000000000 +0900
+++ libIDL-0.8.0/Makefile.am	2002-09-05 10:38:26.000000000 +0900
@@ -12,6 +12,10 @@
 
 YFLAGS = -d -v 2>/dev/null
 
+if PLATFORM_WIN32
+no_undefined = -no-undefined
+endif
+
 lexer.c: $(srcdir)/lexer.l parser.h
 	@rm -f $@
 	$(LEX) $(LFLAGS) -t $(srcdir)/lexer.l | sed -e 's/yy/__IDL_/g' >$@
@@ -49,7 +53,7 @@
 
 libIDL_2_la_SOURCES	= parser.c parser.h lexer.c \
 			  ns.c util.c util.h rename.h
-libIDL_2_la_LDFLAGS	= -version-info $(LT_VERSION) $(LIBIDL_LIBS)
+libIDL_2_la_LDFLAGS	= -version-info $(LT_VERSION) $(LIBIDL_LIBS) $(no_undefined)
 
 tstidl_SOURCES		= tstidl.c
 tstidl_LDADD		= libIDL-2.la $(LIBIDL_LIBS)
diff -ur libIDL-0.8.0.orig/configure.in libIDL-0.8.0/configure.in
--- libIDL-0.8.0.orig/configure.in	2002-06-03 11:15:46.000000000 +0900
+++ libIDL-0.8.0/configure.in	2002-09-05 12:36:40.000000000 +0900
@@ -60,15 +60,29 @@
 LFLAGS="-8"
 AC_SUBST(LFLAGS)
 AC_PROG_YACC
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 AM_MAINTAINER_MODE
 
+AC_MSG_CHECKING([for some Win32 platform])
+case "$host" in
+  *-*-mingw*|*-*-cygwin*)
+    libidl_platform_win32=yes
+    ;;
+  *)
+    libidl_platform_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$libidl_platform_win32])
+AM_CONDITIONAL(PLATFORM_WIN32, test "$libidl_platform_win32" = "yes")
+
 dnl Checks for libraries.
 PKG_CHECK_MODULES(LIBIDL, glib-2.0 >= 1.3.7)
 AC_SUBST(LIBIDL_LIBS)
 AC_SUBST(LIBIDL_CFLAGS)
 
 AC_STDC_HEADERS
+AC_CHECK_HEADERS(unistd.h)
 AC_CHECK_HEADERS(stddef.h)
 AC_CHECK_HEADERS(wchar.h, HAVE_WCHAR_H=1)
 AC_CHECK_HEADERS(wcstr.h, HAVE_WCSTR_H=1)
@@ -80,6 +94,7 @@
 fi
 AC_SUBST(HAVE_WCHAR_H)
 AC_SUBST(HAVE_WCSTR_H)
+AC_CHECK_FUNCS(popen symlink)
 
 if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then
         WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
diff -ur libIDL-0.8.0.orig/tstidl.c libIDL-0.8.0/tstidl.c
--- libIDL-0.8.0.orig/tstidl.c	1999-03-25 03:26:22.000000000 +0900
+++ libIDL-0.8.0/tstidl.c	2002-09-05 11:17:42.000000000 +0900
@@ -134,7 +134,7 @@
 
 /* #define TEST_INPUT_CB */
 
-#ifdef _WIN32
+#ifdef G_OS_WIN32
 #  ifndef TEST_INPUT_CB
 #    define TEST_INPUT_CB
 #  endif
@@ -197,7 +197,7 @@
 	WalkData data;
 	unsigned long parse_flags = 0;
 
-#ifndef _WIN32
+#ifndef G_PLATFORM_WIN32
 	{ extern int __IDL_debug;
 	__IDL_debug = argc >= 4 ? TRUE : FALSE; }
 #endif
diff -ur libIDL-0.8.0.orig/util.c libIDL-0.8.0/util.c
--- libIDL-0.8.0.orig/util.c	2002-02-04 22:46:38.000000000 +0900
+++ libIDL-0.8.0/util.c	2002-09-05 12:23:36.000000000 +0900
@@ -28,7 +28,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
-#ifndef _WIN32
+#ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
 #include "rename.h"
@@ -247,7 +247,7 @@
 		return -1;
 	}
 
-#ifndef NO_ACCESS
+#ifdef HAVE_ACCESS
 	if (access (filename, R_OK))
 		return -1;
 #endif
@@ -304,7 +304,7 @@
 	}
 	strcpy (tmpfilename, s);
 	strcat (tmpfilename, ".c");
-#ifndef NO_SYMLINK
+#ifdef HAVE_SYMLINK
 	if (symlink (linkto, tmpfilename) < 0) {
 		g_free (linkto);
 		g_free (tmpfilename);
@@ -328,7 +328,7 @@
 		    cwd, cpp_args ? cpp_args : "", tmpfilename, cpperrs);
 #endif
 
-#ifndef NO_POPEN
+#ifdef HAVE_POPEN
 	input = popen (cmd, "r");
 #else
 	input = fopen (cmd, "r");
@@ -364,7 +364,7 @@
 #ifndef HAVE_CPP_PIPE_STDIN
 	__IDL_tmp_filename = NULL;
 #endif
-#ifndef NO_POPEN
+#ifdef HAVE_POPEN
 	pclose (input);
 #else
 	fclose (input);
diff -ur libIDL-0.8.0.orig/util.h libIDL-0.8.0/util.h
--- libIDL-0.8.0.orig/util.h	2000-08-03 08:08:56.000000000 +0900
+++ libIDL-0.8.0/util.h	2002-09-05 12:00:54.000000000 +0900
@@ -35,19 +35,6 @@
 #include <glib.h>
 #include "IDL.h"
 
-#ifdef _WIN32
-#  define alloca
-#  define NO_ACCESS
-#endif
-
-#ifdef XP_MAC
-#  include <alloca.h>
-#  define alloca
-#  define NO_ACCESS
-#  define NO_SYMLINK
-#  define NO_POPEN
-#endif
-
 /* Internal parse flags */
 #define IDLFP_PROPERTIES	(1UL << 0)
 #define IDLFP_NATIVE		(1UL << 1)
