diff --git a/tools/winebuild/Makefile.in b/tools/winebuild/Makefile.in
index d73e5e5..936cc7e 100644
--- a/tools/winebuild/Makefile.in
+++ b/tools/winebuild/Makefile.in
@@ -3,6 +3,7 @@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
+LIBEXT    = @LIBEXT@
 
 PROGRAMS = winebuild
 MODULE   = none
@@ -12,6 +13,7 @@
 	main.c \
 	parser.c \
 	relay.c \
+	res32.c \
 	spec16.c \
 	spec32.c \
 	utils.c
@@ -20,8 +22,11 @@
 
 @MAKE_RULES@
 
-winebuild: $(OBJS)
-	$(CC) $(CFLAGS) -o winebuild $(OBJS)
+winebuild: $(OBJS) $(TOPOBJDIR)/libwine_unicode.$(LIBEXT)
+	$(CC) $(CFLAGS) -o winebuild $(OBJS) -L$(TOPOBJDIR) -lwine_unicode
+
+$(TOPOBJDIR)/libwine_unicode.$(LIBEXT):
+	cd $(TOPOBJDIR) && $(MAKE) libwine_unicode.$(LIBEXT)
 
 install:: $(PROGRAMS)
 	[ -d $(bindir) ] || $(MKDIR) $(bindir)
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 7f03b23..99bf71e 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -137,11 +137,14 @@
 extern char *xstrdup( const char *str );
 extern char *strupper(char *s);
 extern void fatal_error( const char *msg, ... );
+extern void fatal_perror( const char *msg, ... );
 extern void warning( const char *msg, ... );
 extern void dump_bytes( FILE *outfile, const unsigned char *data, int len, const char *label );
 extern void add_import_dll( const char *name );
 extern void resolve_imports( FILE *outfile );
 extern int output_imports( FILE *outfile );
+extern void load_res32_file( const char *name );
+extern int output_resources( FILE *outfile );
 
 extern void BuildGlue( FILE *outfile, FILE *infile );
 extern void BuildRelays( FILE *outfile );
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 44c3314..c123a87 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -481,8 +481,12 @@
         }
         else if (strcmp(token, "rsrc") == 0)
         {
-            strcpy( rsrc_name, GetToken() );
-            strcat( rsrc_name, "_ResourceDescriptor" );
+            if (SpecType != SPEC_WIN16) load_res32_file( GetToken() );
+            else
+            {
+                strcpy( rsrc_name, GetToken() );
+                strcat( rsrc_name, "_ResourceDescriptor" );
+            }
         }
         else if (strcmp(token, "owner") == 0)
         {
diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
new file mode 100644
index 0000000..7b60177
--- /dev/null
+++ b/tools/winebuild/res32.c
@@ -0,0 +1,418 @@
+/*
+ * Builtin dlls resource support
+ *
+ * Copyright 2000 Alexandre Julliard
+ */
+
+#include "config.h"
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#include "winbase.h"
+#include "wine/unicode.h"
+#include "build.h"
+
+/* Unicode string or integer id */
+struct string_id
+{
+    WCHAR *str;  /* ptr to Unicode string */
+    WORD   id;   /* integer id if str is NULL */
+};
+
+/* descriptor for a resource */
+struct resource
+{
+    struct string_id type;
+    struct string_id name;
+    const void      *data;
+    unsigned int     data_size;
+    WORD             lang;
+};
+
+/* name level of the resource tree */
+struct res_name
+{
+    const struct string_id  *name;         /* name */
+    const struct resource   *res;          /* resource */
+    int                      nb_languages; /* number of languages */
+};
+
+/* type level of the resource tree */
+struct res_type
+{
+    const struct string_id  *type;         /* type name */
+    struct res_name         *names;        /* names array */
+    unsigned int             nb_names;     /* total number of names */
+    unsigned int             nb_id_names;  /* number of names that have a numeric id */
+};
+
+static struct resource *resources;
+static int nb_resources;
+
+static struct res_type *res_types;
+static int nb_types;     /* total number of types */
+static int nb_id_types;  /* number of types that have a numeric id */
+
+static const char *file_base;  /* base of resource file */
+static const char *file_pos;   /* current position in resource file */
+static const char *file_end;   /* end of resource file */
+static const char *file_name;  /* current resource file name */
+
+
+inline static struct resource *add_resource(void)
+{
+    resources = xrealloc( resources, (nb_resources + 1) * sizeof(*resources) );
+    return &resources[nb_resources++];
+}
+
+static struct res_name *add_name( struct res_type *type, const struct resource *res )
+{
+    struct res_name *name;
+    type->names = xrealloc( type->names, (type->nb_names + 1) * sizeof(*type->names) );
+    name = &type->names[type->nb_names++];
+    name->name         = &res->name;
+    name->res          = res;
+    name->nb_languages = 1;
+    if (!name->name->str) type->nb_id_names++;
+    return name;
+}
+
+static struct res_type *add_type( const struct resource *res )
+{
+    struct res_type *type;
+    res_types = xrealloc( res_types, (nb_types + 1) * sizeof(*res_types) );
+    type = &res_types[nb_types++];
+    type->type        = &res->type;
+    type->names       = NULL;
+    type->nb_names    = 0;
+    type->nb_id_names = 0;
+    if (!type->type->str) nb_id_types++;
+    return type;
+}
+
+/* get the next word from the current resource file */
+static WORD get_word(void)
+{
+    WORD ret = *(WORD *)file_pos;
+    file_pos += sizeof(WORD);
+    if (file_pos > file_end) fatal_error( "%s is a truncated file\n", file_name );
+    return ret;
+}
+
+/* get the next dword from the current resource file */
+static DWORD get_dword(void)
+{
+    DWORD ret = *(DWORD *)file_pos;
+    file_pos += sizeof(DWORD);
+    if (file_pos > file_end) fatal_error( "%s is a truncated file\n", file_name );
+    return ret;
+}
+
+/* get a string from the current resource file */
+static void get_string( struct string_id *str )
+{
+    WCHAR *p = (WCHAR *)file_pos;
+    if (*p == 0xffff)
+    {
+        get_word();  /* skip the 0xffff */
+        str->str = NULL;
+        str->id = get_word();
+    }
+    else
+    {
+        str->str = xmalloc( (strlenW(p) + 1) * sizeof(WCHAR) );
+        str->id = 0;
+        p = str->str;
+        while ((*p++ = get_word()));
+    }
+}
+
+/* check the file header */
+/* all values must be zero except header size */
+static void check_header(void)
+{
+    if (get_dword()) goto error;        /* data size */
+    if (get_dword() != 32) goto error;  /* header size */
+    if (get_word() != 0xffff || get_word()) goto error;  /* type, must be id 0 */
+    if (get_word() != 0xffff || get_word()) goto error;  /* name, must be id 0 */
+    if (get_dword()) goto error;        /* data version */
+    if (get_word()) goto error;         /* mem options */
+    if (get_word()) goto error;         /* language */
+    if (get_dword()) goto error;        /* version */
+    if (get_dword()) goto error;        /* characteristics */
+    return;
+ error:
+    fatal_error( "%s is not a valid Win32 resource file\n", file_name );
+}
+
+/* load the next resource from the current file */
+static void load_next_resource(void)
+{
+    DWORD hdr_size;
+    struct resource *res = add_resource();
+
+    res->data_size = (get_dword() + 3) & ~3;
+    hdr_size = get_dword();
+    if (hdr_size & 3) fatal_error( "%s header size not aligned\n", file_name );
+
+    res->data = file_pos - 2*sizeof(DWORD) + hdr_size;
+    get_string( &res->type );
+    get_string( &res->name );
+    if ((int)file_pos & 2) get_word();  /* align to dword boundary */
+    get_dword();                        /* skip data version */
+    get_word();                         /* skip mem options */
+    res->lang = get_word();
+    get_dword();                        /* skip version */
+    get_dword();                        /* skip characteristics */
+
+    file_pos = (char *)res->data + res->data_size;
+    if (file_pos > file_end) fatal_error( "%s is a truncated file\n", file_name );
+}
+
+/* load a Win32 .res file */
+void load_res32_file( const char *name )
+{
+    int fd;
+    void *base;
+    struct stat st;
+
+    if ((fd = open( name, O_RDONLY )) == -1) fatal_perror( "Cannot open %s", name );
+    if ((fstat( fd, &st ) == -1)) fatal_perror( "Cannot stat %s", name );
+    if (!st.st_size) fatal_error( "%s is an empty file\n" );
+    if ((base = mmap( NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0 )) == (void*)-1)
+    {
+        base = xmalloc( st.st_size );
+        if (read( fd, base, st.st_size ) != st.st_size)
+            fatal_error( "Cannot read %s\n", name );
+    }
+
+    file_name = name;
+    file_base = base;
+    file_pos  = file_base;
+    file_end  = file_base + st.st_size;
+    check_header();
+    while (file_pos < file_end) load_next_resource();
+}
+
+/* compare two unicode strings/ids */
+static int cmp_string( const struct string_id *str1, const struct string_id *str2 )
+{
+    if (!str1->str)
+    {
+        if (!str2->str) return str1->id - str2->id;
+        return 1;  /* an id compares larger than a string */
+    }
+    if (!str2->str) return -1;
+    return strcmpiW( str1->str, str2->str );
+}
+
+/* compare two resources for sorting the resource directory */
+/* resources are stored first by type, then by name, then by language */
+static int cmp_res( const void *ptr1, const void *ptr2 )
+{
+    const struct resource *res1 = ptr1;
+    const struct resource *res2 = ptr2;
+    int ret;
+
+    if ((ret = cmp_string( &res1->type, &res2->type ))) return ret;
+    if ((ret = cmp_string( &res1->name, &res2->name ))) return ret;
+    return res1->lang - res2->lang;
+}
+
+/* build the 3-level (type,name,language) resource tree */
+static void build_resource_tree(void)
+{
+    int i;
+    struct res_type *type = NULL;
+    struct res_name *name = NULL;
+
+    qsort( resources, nb_resources, sizeof(*resources), cmp_res );
+
+    for (i = 0; i < nb_resources; i++)
+    {
+        if (!i || cmp_string( &resources[i].type, &resources[i-1].type ))  /* new type */
+        {
+            type = add_type( &resources[i] );
+            name = add_name( type, &resources[i] );
+        }
+        else if (cmp_string( &resources[i].name, &resources[i-1].name )) /* new name */
+        {
+            name = add_name( type, &resources[i] );
+        }
+        else name->nb_languages++;
+    }
+}
+
+/* output a Unicode string */
+static void output_string( FILE *outfile, const WCHAR *name )
+{
+    int i, len = strlenW(name);
+    fprintf( outfile, "0x%04x", len );
+    for (i = 0; i < len; i++) fprintf( outfile, ", 0x%04x", name[i] );
+    fprintf( outfile, " /* " );
+    for (i = 0; i < len; i++) fprintf( outfile, "%c", isprint((char)name[i]) ? (char)name[i] : '?' );
+    fprintf( outfile, " */" );
+}
+
+/* output the resource definitions */
+int output_resources( FILE *outfile )
+{
+    int i, j, k;
+    const struct res_type *type;
+    const struct res_name *name;
+    const struct resource *res;
+
+    if (!nb_resources) return 0;
+
+    build_resource_tree();
+
+    /* resource data */
+
+    for (i = 0, res = resources; i < nb_resources; i++, res++)
+    {
+        const unsigned int *p = res->data;
+        int size = res->data_size / 4;
+        /* dump data as ints to ensure correct alignment */
+        fprintf( outfile, "static const unsigned int res_%d[%d] = {\n  ", i, size );
+        for (j = 0; j < size - 1; j++, p++)
+        {
+            fprintf( outfile, "0x%08x,", *p );
+            if ((j % 8) == 7) fprintf( outfile, "\n  " );
+        }
+        fprintf( outfile, "0x%08x\n};\n\n", *p );
+    }
+
+    /* directory structures */
+
+    fprintf( outfile, "struct res_dir {\n" );
+    fprintf( outfile, "  unsigned int Characteristics;\n" );
+    fprintf( outfile, "  unsigned int TimeDateStamp;\n" );
+    fprintf( outfile, "  unsigned short MajorVersion, MinorVersion;\n" );
+    fprintf( outfile, "  unsigned short NumerOfNamedEntries, NumberOfIdEntries;\n};\n\n" );
+    fprintf( outfile, "struct res_dir_entry {\n" );
+    fprintf( outfile, "  unsigned int Name;\n" );
+    fprintf( outfile, "  unsigned int OffsetToData;\n};\n\n" );
+    fprintf( outfile, "struct res_data_entry {\n" );
+    fprintf( outfile, "  const unsigned int *OffsetToData;\n" );
+    fprintf( outfile, "  unsigned int Size;\n" );
+    fprintf( outfile, "  unsigned int CodePage;\n" );
+    fprintf( outfile, "  unsigned int ResourceHandle;\n};\n\n" );
+
+    /* resource directory definition */
+
+    fprintf( outfile, "#define OFFSETOF(field) ((char*)&resources.field - (char*)&resources)\n" );
+    fprintf( outfile, "static struct {\n" );
+    fprintf( outfile, "  struct res_dir        type_dir;\n" );
+    fprintf( outfile, "  struct res_dir_entry  type_entries[%d];\n", nb_types );
+
+    for (i = 0, type = res_types; i < nb_types; i++, type++)
+    {
+        fprintf( outfile, "  struct res_dir        name_%d_dir;\n", i );
+        fprintf( outfile, "  struct res_dir_entry  name_%d_entries[%d];\n", i, type->nb_names );
+        for (j = 0, name = type->names; j < type->nb_names; j++, name++)
+        {
+            fprintf( outfile, "  struct res_dir        lang_%d_%d_dir;\n", i, j );
+            fprintf( outfile, "  struct res_dir_entry  lang_%d_%d_entries[%d];\n",
+                     i, j, name->nb_languages );
+        }
+    }
+
+    fprintf( outfile, "  struct res_data_entry data_entries[%d];\n", nb_resources );
+
+    for (i = 0, type = res_types; i < nb_types; i++, type++)
+    {
+        if (type->type->str)
+            fprintf( outfile, "  unsigned short        type_%d_name[%d];\n",
+                     i, strlenW(type->type->str)+1 );
+        for (j = 0, name = type->names; j < type->nb_names; j++, name++)
+        {
+            if (name->name->str)
+                fprintf( outfile, "  unsigned short        name_%d_%d_name[%d];\n",
+                         i, j, strlenW(name->name->str)+1 );
+        }
+    }
+
+    /* resource directory contents */
+
+    fprintf( outfile, "} resources = {\n" );
+    fprintf( outfile, "  { 0, 0, 0, 0, %d, %d },\n", nb_types - nb_id_types, nb_id_types );
+
+    /* dump the type directory */
+    fprintf( outfile, "  {\n" );
+    for (i = 0, type = res_types; i < nb_types; i++, type++)
+    {
+        if (!type->type->str)
+            fprintf( outfile, "    { 0x%04x, OFFSETOF(name_%d_dir) | 0x80000000 },\n",
+                     type->type->id, i );
+        else
+            fprintf( outfile, "    { OFFSETOF(type_%d_name) | 0x80000000, OFFSETOF(name_%d_dir) | 0x80000000 },\n",
+                     i, i );
+    }
+    fprintf( outfile, "  },\n" );
+
+    /* dump the names and languages directories */
+    for (i = 0, type = res_types; i < nb_types; i++, type++)
+    {
+        fprintf( outfile, "  { 0, 0, 0, 0, %d, %d }, /* name_%d_dir */\n  {\n",
+                 type->nb_names - type->nb_id_names, type->nb_id_names, i );
+        for (j = 0, name = type->names; j < type->nb_names; j++, name++)
+        {
+            if (!name->name->str)
+                fprintf( outfile, "    { 0x%04x, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n",
+                         name->name->id, i, j );
+            else
+                fprintf( outfile, "    { OFFSETOF(name_%d_%d_name) | 0x80000000, OFFSETOF(lang_%d_%d_dir) | 0x80000000 },\n",
+                         i, j, i, j );
+        }
+        fprintf( outfile, "  },\n" );
+
+        for (j = 0, name = type->names; j < type->nb_names; j++, name++)
+        {
+            fprintf( outfile, "  { 0, 0, 0, 0, 0, %d }, /* lang_%d_%d_dir */\n  {\n",
+                     name->nb_languages, i, j );
+            for (k = 0, res = name->res; k < name->nb_languages; k++, res++)
+            {
+                fprintf( outfile, "    { 0x%04x, OFFSETOF(data_entries[%d]) },\n",
+                         res->lang, res - resources );
+            }
+            fprintf( outfile, "  },\n" );
+        }
+    }
+
+    /* dump the resource data entries */
+    fprintf( outfile, "  {\n" );
+    for (i = 0, res = resources; i < nb_resources; i++, res++)
+    {
+        fprintf( outfile, "    { res_%d, sizeof(res_%d), 0, 0 },\n", i, i );
+    }
+
+    /* dump the name strings */
+    for (i = 0, type = res_types; i < nb_types; i++, type++)
+    {
+        if (type->type->str)
+        {
+            fprintf( outfile, "  },\n  { " );
+            output_string( outfile, type->type->str );
+        }
+        for (j = 0, name = type->names; j < type->nb_names; j++, name++)
+        {
+            if (name->name->str)
+            {
+                fprintf( outfile, "  },\n  { " );
+                output_string( outfile, name->name->str );
+            }
+        }
+    }
+    fprintf( outfile, "  }\n};\n#undef OFFSETOF\n\n" );
+    return nb_resources;
+}
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index b50fe3b..a8b02d2 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -274,7 +274,7 @@
 {
     ORDDEF *odp;
     int i, fwd_size = 0, have_regs = FALSE;
-    int nr_exports, nr_imports;
+    int nr_exports, nr_imports, nr_resources;
     int characteristics, subsystem;
     const char *init_func;
     DWORD page_size;
@@ -379,6 +379,10 @@
 
     nr_imports = output_imports( outfile );
 
+    /* Output the resources */
+
+    nr_resources = output_resources( outfile );
+
     /* Output LibMain function */
 
     init_func = DLLInitFunc[0] ? DLLInitFunc : NULL;
@@ -445,10 +449,6 @@
         break;
     }
 
-    /* Output the DLL descriptor */
-
-    if (rsrc_name[0]) fprintf( outfile, "extern char %s[];\n\n", rsrc_name );
-
     /* Output the NT header */
 
     /* this is the IMAGE_NT_HEADERS structure, but we cannot include winnt.h here */
@@ -493,7 +493,7 @@
     fprintf( outfile, "    int   SizeOfHeapCommit;\n" );
     fprintf( outfile, "    int   LoaderFlags;\n" );
     fprintf( outfile, "    int   NumberOfRvaAndSizes;\n" );
-    fprintf( outfile, "    struct { void *VirtualAddress; int Size; } DataDirectory[%d];\n",
+    fprintf( outfile, "    struct { const void *VirtualAddress; int Size; } DataDirectory[%d];\n",
              IMAGE_NUMBEROF_DIRECTORY_ENTRIES );
     fprintf( outfile, "  } OptionalHeader;\n" );
     fprintf( outfile, "} nt_header = {\n" );
@@ -527,8 +527,8 @@
              nr_exports ? "&exports" : "0", nr_exports ? "sizeof(exports.exp)" : "0" );
     fprintf( outfile, "      { %s, %s },\n",  /* IMAGE_DIRECTORY_ENTRY_IMPORT */
              nr_imports ? "&imports" : "0", nr_imports ? "sizeof(imports)" : "0" );
-    fprintf( outfile, "      { %s, 0 },\n",   /* IMAGE_DIRECTORY_ENTRY_RESOURCE */
-             rsrc_name[0] ? rsrc_name : "0" );
+    fprintf( outfile, "      { %s, %s },\n",   /* IMAGE_DIRECTORY_ENTRY_RESOURCE */
+             nr_resources ? "&resources" : "0", nr_resources ? "sizeof(resources)" : "0" );
     fprintf( outfile, "    }\n  }\n};\n\n" );
 
     /* Output the DLL constructor */
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index f859408..25aa51f 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -67,6 +67,23 @@
     exit(1);
 }
 
+void fatal_perror( const char *msg, ... )
+{
+    va_list valist;
+    va_start( valist, msg );
+    if (input_file_name)
+    {
+        fprintf( stderr, "%s:", input_file_name );
+        if (current_line)
+            fprintf( stderr, "%d:", current_line );
+        fputc( ' ', stderr );
+    }
+    vfprintf( stderr, msg, valist );
+    perror( " " );
+    va_end( valist );
+    exit(1);
+}
+
 void warning( const char *msg, ... )
 {
     va_list valist;
