Index: src/global_setup.c
===================================================================
--- src/global_setup.c	(revision 10968)
+++ src/global_setup.c	(working copy)
@@ -28,21 +28,69 @@
 /* These functions are defined in the auto-generated file core_pmcs.c */
 extern void Parrot_initialize_core_pmcs(Interp *interp);
 
-static void
-create_config_hash(Interp *interpreter, PMC *iglobals)
+static const unsigned char* parrot_config_stored = NULL;
+static unsigned int parrot_config_size_stored = 0;
+
+
+/*
+
+=item C<void
+Parrot_set_config_hash_internal (const unsigned char* parrot_config,
+                                 unsigned int parrot_config_size)>
+
+Called by Parrot_set_config_hash with the serialised hash which
+will be used in subsequently created Interpreters
+
+=cut
+
+*/
+
+void
+Parrot_set_config_hash_internal (const unsigned char* parrot_config,
+                                 unsigned int parrot_config_size)
 {
-    STRING *config = parrot_get_config_string(interpreter);
-    PMC *hash;
+    parrot_config_stored      = parrot_config;
+    parrot_config_size_stored = parrot_config_size;
+}
 
-    if (config) {
-        hash = Parrot_thaw(interpreter, config);
+/*
+
+=item C<void parrot_set_config_hash_interpreter (Interp* interpreter)>
+
+
+Used internally to associate the config hash with an Interpreter
+using the last registered config data.
+
+=cut
+
+*/
+
+static void parrot_set_config_hash_interpreter (Interp* interpreter)
+{
+    PMC *iglobals = interpreter->iglobals;
+
+    PMC *config_hash = NULL;
+
+    if (parrot_config_size_stored > 1)
+    {
+        STRING *config_string =
+            string_make_direct(interpreter,
+                               parrot_config_stored, parrot_config_size_stored,
+                               PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
+                               PObj_external_FLAG|PObj_constant_FLAG);
+
+        config_hash = Parrot_thaw(interpreter, config_string);
     }
     else
-        hash = pmc_new(interpreter, enum_class_Hash);
+    {
+        config_hash = pmc_new(interpreter, enum_class_Hash);
+    }
+
     VTABLE_set_pmc_keyed_int(interpreter, iglobals,
-            (INTVAL) IGLOBALS_CONFIG_HASH, hash);
+                             (INTVAL) IGLOBALS_CONFIG_HASH, config_hash);
+}
 
-}
+
 /*
 
 =item C<void init_world(Interp *interpreter)>
@@ -91,11 +139,10 @@
     PMC_data(self) = interpreter;
     VTABLE_set_pmc_keyed_int(interpreter, iglobals,
             (INTVAL) IGLOBALS_INTERPRETER, self);
+
+    parrot_set_config_hash_interpreter(interpreter);
+
     /*
-     * create runtime config hash
-     */
-    create_config_hash(interpreter, iglobals);
-    /*
      * HLL support
      */
     if (interpreter->parent_interpreter)
@@ -121,6 +168,7 @@
             IGLOBALS_DYN_LIBS, pmc);
 }
 
+
 /*
 
 =back
Index: tools/build/parrotdef.pl
===================================================================
--- tools/build/parrotdef.pl	(revision 10968)
+++ tools/build/parrotdef.pl	(working copy)
@@ -1,275 +1,309 @@
-#! perl -w
-# Copyright: 2005 The Perl Foundation.  All Rights Reserved.
-
-=head1 NAME
-
-tools/build/parrotdef.pl - Create a DEF file from Parrot headers
-
-=head1 SYNOPSIS
-
-	% perl tools/build/parrotdef.pl
-
-=head1 DESCRIPTION
-
-This script creates a DEF file for use with the Microsoft Linker that
-names all functions to export from parrot.exe that may be called from
-dynamic PMCs. It looks at header files to build its list.
-
-=cut
-
-use strict;
-
-# This is a list of symbols we'll export 
-my @funcnames = qw(
-	Parrot_new
-	Parrot_init
-	Parrot_setwarnings
-	Parrot_readbc
-	Parrot_loadbc
-	Parrot_runcode
-	Parrot_destroy
-	Parrot_debug
-	Parrot_disassemble
-	Parrot_load_bytecode
-	Parrot_load_lib
-	pmc_new
-	pmc_reuse
-	pmc_new_noinit
-	pmc_new_init
-	constant_pmc_new_noinit
-	constant_pmc_new
-	constant_pmc_new_init
-	pmc_register
-	pmc_type
-	dod_register_pmc
-	dod_unregister_pmc
-	Parrot_create_mro
-	Parrot_new_vtable
-	Parrot_clone_vtable
-	Parrot_destroy_vtable
-	Parrot_vtable_set_type
-	Parrot_vtable_set_name
-	Parrot_vtable_set_data
-	internal_exception
-	real_exception
-	do_panic
-	push_exception
-	pop_exception
-	throw_exception
-	rethrow_exception
-	handle_exception
-	new_c_exception_handler
-	push_new_c_exception_handler
-	rethrow_c_exception
-	do_exception
-	new_internal_exception
-	free_internal_exception
-	Parrot_push_mark
-	Parrot_pop_mark
-	Parrot_push_action
-	string_make
-	string_concat
-	string_append
-	string_chopn
-	string_compare
-	string_equal
-	string_bool
-	string_increment
-	string_length
-	string_ord
-	string_chr
-	string_to_num
-	string_to_int
-	string_from_int
-	string_from_num
-	string_grow
-	string_make_direct
-	string_copy
-	string_set
-	string_init
-	string_deinit
-	string_capacity
-	string_index
-	string_from_cstring
-	string_from_const_cstring
-	const_string
-	string_to_cstring
-	string_cstring_free
-	string_hash
-	string_upcase
-	string_downcase
-	string_titlecase
-	string_upcase_inplace
-	string_downcase_inplace
-	string_titlecase_inplace
-	string_substr
-	string_str_index
-	Parrot_string_is_cclass
-	Parrot_string_find_cclass
-	Parrot_string_find_not_cclass
-	Parrot_binary_charset_ptr
-	list_pmc_new
-	list_pmc_new_init
-	list_mark
-	list_visit
-	list_length
-	list_set_length
-	list_push
-	list_unshift
-	list_insert
-	list_delete
-	list_get
-	list_assign
-	list_splice
-	new_hash
-	hash_destroy
-	new_pmc_hash
-	new_cstring_hash
-	Parrot_new_INTVAL_hash
-	hash_clone
-	hash_size
-	hash_destroy
-	hash_get_bucket
-	hash_get
-	hash_exists
-	hash_put
-	hash_delete
-	mark_hash
-	hash_visit
-	dump_hash
-	hash_get_idx
-	new_pmc_hash_x
-	mmd_dispatch_v_pp
-	mmd_dispatch_v_pi
-	mmd_dispatch_v_pn
-	mmd_dispatch_v_ps
-	mmd_dispatch_p_ppp
-	mmd_dispatch_p_pip
-	mmd_dispatch_p_pnp
-	mmd_dispatch_p_psp
-	mmd_dispatch_i_pp
-	mmd_add_by_class
-	mmd_register
-	mmd_register_sub
-	mmd_add_function
-	mmd_destroy
-	mmd_vtfind
-	Parrot_mmd_register_table
-	Parrot_mmd_rebuild_table
-	Parrot_MMD_search_default_func
-	Parrot_run_maybe_mmd_meth
-	Parrot_MMD_method_idx
-	get_mmd_dispatch_type
-	mem_sys_allocate
-	mem_sys_allocate_zeroed
-	mem__sys_realloc
-	mem_sys_free
-	Parrot_char_is_alnum
-	Parrot_char_is_alpha
-	Parrot_char_is_ascii
-	Parrot_char_is_blank
-	Parrot_char_is_cntrl
-	Parrot_char_is_digit
-	Parrot_char_is_graph
-	Parrot_char_is_lower
-	Parrot_char_is_print
-	Parrot_char_is_punct
-	Parrot_char_is_space
-	Parrot_char_is_UWhiteSpace
-	Parrot_char_is_Whitespace
-	Parrot_char_is_upper
-	Parrot_char_is_JavaSpaceChar
-	Parrot_char_is_xdigit
-	key_new
-	key_new_integer
-	key_new_number
-	key_new_string
-	key_new_cstring
-	key_new_pmc
-	key_set_integer
-	key_set_number
-	key_set_string
-	key_set_pmc
-	key_type
-	key_integer
-	key_number
-	key_string
-	key_pmc
-	key_next
-	key_append
-	key_mark
-	mark_context
-	invalidate_retc_context
-	Parrot_full_sub_name
-	Parrot_Context_info
-	Parrot_Context_infostr
-	interpinfo
-	interpinfo_p
-	runops
-	runops_int
-	Parrot_runops_fromc
-	Parrot_runops_fromc_args
-	Parrot_runops_fromc_args_reti
-	Parrot_runops_fromc_args_retf
-	Parrot_runops_fromc_arglist
-	Parrot_runops_fromc_arglist_reti
-	Parrot_runops_fromc_arglist_retf
-	Parrot_run_meth_fromc
-	Parrot_run_meth_fromc_arglist
-	Parrot_run_meth_fromc_arglist_reti
-	Parrot_run_meth_fromc_arglist_retf
-	Parrot_compreg
-	Parrot_register_HLL
-	Parrot_register_HLL_type
-	Parrot_get_HLL_id
-	Parrot_get_HLL_type
-	Parrot_get_ctx_HLL_type
-	PIO_fprintf
-	PIO_printf
-	PIO_eprintf
-	Parrot_sprintf_c
-	Parrot_psprintf
-	enter_nci_method
-	Parrot_find_global
-	pobject_lives
-	stack_push
-	Parrot_signbit
-	new_ret_continuation_pmc
-	Parrot_PMC_typenum
-	Parrot_call_sub
-	Parrot_get_global
-	string_make_empty
-	Parrot_PMC_get_intval
-	Parrot_call_method
-	string_replace
-	Parrot_make_COW_reference
-	Parrot_switch_to_cs
-	PackFile_Segment_new_seg
-);
-push @funcnames, "PMCNULL	DATA";
-push @funcnames, "Parrot_base_vtables	DATA";
-
-# Extract function names from PMC header files and the core ops file.
-my $hfile;
-foreach $hfile ((glob "src/classes/*.h"), "include/parrot/oplib/core_ops.h") {
-	open FILE, "< $hfile" or die "Can't open $hfile: $!";
-	while (<FILE>) {
-		if (/^(?:extern\s+)?\w+\*?\s+\*?(\w+)\s*\([^)]+\)\s*;/) {
-			my $func = $1;
-			next if $func =~ /_class_init$/;
-			push @funcnames, $func;
-		}
-	}
-	close FILE;
-}
-
-# Remove dupes, if we have any.
-my %seen;
-@funcnames = grep { ! $seen{$_}++ } @funcnames;
-
-# Emit a .def file.
-open FILE, "> parrot.def";
-print FILE "EXPORTS\n";
-print FILE "\t$_\n" foreach @funcnames;
-close FILE;
-
+#! perl -w
+# Copyright: 2005 The Perl Foundation.  All Rights Reserved.
+
+=head1 NAME
+
+tools/build/parrotdef.pl - Create a DEF file from Parrot headers
+
+=head1 SYNOPSIS
+
+	% perl tools/build/parrotdef.pl
+
+=head1 DESCRIPTION
+
+This script creates a DEF file for use with the Microsoft Linker that
+names all functions to export from parrot.exe that may be called from
+dynamic PMCs. It looks at header files to build its list.
+
+=cut
+
+use strict;
+
+# This is a list of symbols we'll export 
+my @funcnames = qw(
+	Parrot_new
+	Parrot_init
+	Parrot_setwarnings
+	Parrot_readbc
+	Parrot_loadbc
+	Parrot_runcode
+	Parrot_destroy
+	Parrot_debug
+	Parrot_disassemble
+	Parrot_load_bytecode
+	Parrot_load_lib
+	pmc_new
+	pmc_reuse
+	pmc_new_noinit
+	pmc_new_init
+	constant_pmc_new_noinit
+	constant_pmc_new
+	constant_pmc_new_init
+	pmc_register
+	pmc_type
+	dod_register_pmc
+	dod_unregister_pmc
+	Parrot_create_mro
+	Parrot_new_vtable
+	Parrot_clone_vtable
+	Parrot_destroy_vtable
+	Parrot_vtable_set_type
+	Parrot_vtable_set_name
+	Parrot_vtable_set_data
+	internal_exception
+	real_exception
+	do_panic
+	push_exception
+	pop_exception
+	throw_exception
+	rethrow_exception
+	handle_exception
+	new_c_exception_handler
+	push_new_c_exception_handler
+	rethrow_c_exception
+	do_exception
+	new_internal_exception
+	free_internal_exception
+	Parrot_push_mark
+	Parrot_pop_mark
+	Parrot_push_action
+	string_make
+	string_concat
+	string_append
+	string_chopn
+	string_compare
+	string_equal
+	string_bool
+	string_increment
+	string_length
+	string_ord
+	string_chr
+	string_to_num
+	string_to_int
+	string_from_int
+	string_from_num
+	string_grow
+	string_make_direct
+	string_copy
+	string_set
+	string_init
+	string_deinit
+	string_capacity
+	string_index
+	string_from_cstring
+	string_from_const_cstring
+	const_string
+	string_to_cstring
+	string_cstring_free
+	string_hash
+	string_upcase
+	string_downcase
+	string_titlecase
+	string_upcase_inplace
+	string_downcase_inplace
+	string_titlecase_inplace
+	string_substr
+	string_str_index
+	Parrot_string_is_cclass
+	Parrot_string_find_cclass
+	Parrot_string_find_not_cclass
+	Parrot_binary_charset_ptr
+	list_pmc_new
+	list_pmc_new_init
+	list_mark
+	list_visit
+	list_length
+	list_set_length
+	list_push
+	list_unshift
+	list_insert
+	list_delete
+	list_get
+	list_assign
+	list_splice
+	new_hash
+	hash_destroy
+	new_pmc_hash
+	new_cstring_hash
+	Parrot_new_INTVAL_hash
+	hash_clone
+	hash_size
+	hash_destroy
+	hash_get_bucket
+	hash_get
+	hash_exists
+	hash_put
+	hash_delete
+	mark_hash
+	hash_visit
+	dump_hash
+	hash_get_idx
+	new_pmc_hash_x
+	mmd_dispatch_v_pp
+	mmd_dispatch_v_pi
+	mmd_dispatch_v_pn
+	mmd_dispatch_v_ps
+	mmd_dispatch_p_ppp
+	mmd_dispatch_p_pip
+	mmd_dispatch_p_pnp
+	mmd_dispatch_p_psp
+	mmd_dispatch_i_pp
+	mmd_add_by_class
+	mmd_register
+	mmd_register_sub
+	mmd_add_function
+	mmd_destroy
+	mmd_vtfind
+	Parrot_mmd_register_table
+	Parrot_mmd_rebuild_table
+	Parrot_MMD_search_default_func
+	Parrot_run_maybe_mmd_meth
+	Parrot_MMD_method_idx
+	get_mmd_dispatch_type
+	mem_sys_allocate
+	mem_sys_allocate_zeroed
+	mem__sys_realloc
+	mem_sys_free
+	Parrot_char_is_alnum
+	Parrot_char_is_alpha
+	Parrot_char_is_ascii
+	Parrot_char_is_blank
+	Parrot_char_is_cntrl
+	Parrot_char_is_digit
+	Parrot_char_is_graph
+	Parrot_char_is_lower
+	Parrot_char_is_print
+	Parrot_char_is_punct
+	Parrot_char_is_space
+	Parrot_char_is_UWhiteSpace
+	Parrot_char_is_Whitespace
+	Parrot_char_is_upper
+	Parrot_char_is_JavaSpaceChar
+	Parrot_char_is_xdigit
+	key_new
+	key_new_integer
+	key_new_number
+	key_new_string
+	key_new_cstring
+	key_new_pmc
+	key_set_integer
+	key_set_number
+	key_set_string
+	key_set_pmc
+	key_type
+	key_integer
+	key_number
+	key_string
+	key_pmc
+	key_next
+	key_append
+	key_mark
+	mark_context
+	invalidate_retc_context
+	Parrot_full_sub_name
+	Parrot_Context_info
+	Parrot_Context_infostr
+	interpinfo
+	interpinfo_p
+	runops
+	runops_int
+	Parrot_runops_fromc
+	Parrot_runops_fromc_args
+	Parrot_runops_fromc_args_reti
+	Parrot_runops_fromc_args_retf
+	Parrot_runops_fromc_arglist
+	Parrot_runops_fromc_arglist_reti
+	Parrot_runops_fromc_arglist_retf
+	Parrot_run_meth_fromc
+	Parrot_run_meth_fromc_arglist
+	Parrot_run_meth_fromc_arglist_reti
+	Parrot_run_meth_fromc_arglist_retf
+	Parrot_compreg
+	Parrot_register_HLL
+	Parrot_register_HLL_type
+	Parrot_get_HLL_id
+	Parrot_get_HLL_type
+	Parrot_get_ctx_HLL_type
+	PIO_fprintf
+	PIO_printf
+	PIO_eprintf
+	Parrot_sprintf_c
+	Parrot_psprintf
+	enter_nci_method
+	Parrot_find_global
+	pobject_lives
+	stack_push
+	Parrot_signbit
+	new_ret_continuation_pmc
+	Parrot_PMC_typenum
+	Parrot_call_sub
+	Parrot_get_global
+	string_make_empty
+	Parrot_PMC_get_intval
+	Parrot_call_method
+	string_replace
+	Parrot_make_COW_reference
+	Parrot_switch_to_cs
+	PackFile_Segment_new_seg
+	PackFile_fixup_subs
+	PackFile_pack
+	PackFile_pack_size
+	line
+	imc_cleanup
+	imc_compile_all_units
+	imc_compile_all_units_for_ast
+	IMCC_ast_compile
+	emit_open
+	IMCC_push_parser_state
+	PackFile_new
+	IMCC_info
+	Parrot_set_run_core
+	Parrot_exit
+	IMCC_fatal
+	IMCC_ast_init
+	imcc_init
+	Parrot_get_runtime_prefix
+	Parrot_set_debug
+	Parrot_set_trace
+	Parrot_set_flag
+	longopt_get
+	Parrot_config_revision
+	Parrot_revision
+	Parrot_set_config_hash_internal
+	yyin
+	yydebug
+	yylex
+	yyparse
+	make_interpreter
+	PackFile_unpack
+	Parrot_stat_info_intval
+	PackFile_add_segment
+	Parrot_new_debug_seg
+);
+push @funcnames, "PMCNULL	DATA";
+push @funcnames, "Parrot_base_vtables	DATA";
+
+# Extract function names from PMC header files and the core ops file.
+my $hfile;
+foreach $hfile ((glob "src/classes/*.h"), "include/parrot/oplib/core_ops.h") {
+	open FILE, "< $hfile" or die "Can't open $hfile: $!";
+	while (<FILE>) {
+		if (/^(?:extern\s+)?\w+\*?\s+\*?(\w+)\s*\([^)]+\)\s*;/) {
+			my $func = $1;
+			next if $func =~ /_class_init$/;
+			push @funcnames, $func;
+		}
+	}
+	close FILE;
+}
+
+# Remove dupes, if we have any.
+my %seen;
+@funcnames = grep { ! $seen{$_}++ } @funcnames;
+
+# Emit a .def file.
+open FILE, "> parrot.def";
+print FILE "EXPORTS\n";
+print FILE "\t$_\n" foreach @funcnames;
+close FILE;
+
Index: tools/build/parrot_config_c.pl
===================================================================
--- tools/build/parrot_config_c.pl	(revision 10968)
+++ tools/build/parrot_config_c.pl	(working copy)
@@ -7,7 +7,7 @@
 
 =head1 NAME
 
-tools/build/parrot_config_c.pl - Create src/parrot_config.c
+tools/build/parrot_config_c.pl - Create src/parrot_config.c and variants
 
 =head1 SYNOPSIS
 
@@ -17,10 +17,13 @@
 
 =head1 DESCRIPTION
 
-Create F<src/parrot_config.c> with relevant runtime fro the config
-process. The created string contains a frozen image of the config hash.
+Create F<src/parrot_config.c> with relevant runtime for the config
+process.
 
-For miniparrot a fake config file is written that contains just the interface.
+The data in the generated configuration file is a serialised hash
+which can be passed to the parrot VM by calling Parrot_set_config_hash
+and will in turn be used to provide the config environment for
+subsequently created Interpreters.
 
 =cut
 
@@ -28,7 +31,8 @@
 use strict;
 
 my ($mini_parrot, $install_parrot);
-$mini_parrot = 1 if (@ARGV && $ARGV[0] =~ /mini/);
+
+$mini_parrot = 1    if (@ARGV && $ARGV[0] =~ /mini/);
 $install_parrot = 1 if (@ARGV && $ARGV[0] =~ /install/);
 
 print << "EOF";
@@ -41,31 +45,39 @@
  *
  */
 
-#include "parrot/parrot.h"
+#include "parrot/embed.h"
 
+void
+Parrot_set_config_hash_internal (const unsigned char* parrot_config,
+                                 unsigned int parrot_config_size);
+
+
 static const unsigned char parrot_config[] = {
 EOF
+;
 
 if ($mini_parrot) {
     print "    0\n";
 }
 else {
+
     my $image_file = $install_parrot ?
-	'install_config.fpmc' : 'runtime/parrot/include/config.fpmc';
+        'install_config.fpmc' : 'runtime/parrot/include/config.fpmc';
     open F, $image_file or die "Can't read '$image_file': $!";
     my $image;
     local $/;
-	binmode F;
+    binmode F;
     $_ = <F>;
     close F;
+#    $_ ||= "\0";
     my @c = split '';
     printf '    ';
     my $i;
     for (@c) {
-	printf "0x%02x", ord($_);
-	++$i;
-	print ', ', if ($i < scalar(@c));
-	print "\n    " unless $i % 8;
+        printf "0x%02x", ord($_);
+        ++$i;
+        print ', ', if ($i < scalar(@c));
+        print "\n    " unless $i % 8;
     }
     print "\n";
 }
@@ -73,17 +85,9 @@
 print << "EOF";
 }; /* parrot_config */
 
-STRING*
-parrot_get_config_string(Interp* interpreter)
+void
+Parrot_set_config_hash(void)
 {
-    if (sizeof(parrot_config) <= 1)
-	return NULL;
-    return string_make_direct(interpreter,
-	    parrot_config, sizeof(parrot_config),
-	    PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
-	    PObj_external_FLAG|PObj_constant_FLAG);
-
+    Parrot_set_config_hash_internal(parrot_config, sizeof(parrot_config));
 }
 EOF
-
-
Index: include/parrot/embed.h
===================================================================
--- include/parrot/embed.h	(revision 10968)
+++ include/parrot/embed.h	(working copy)
@@ -62,6 +62,11 @@
 
 void Parrot_run_native(Parrot_Interp interpreter, native_func_t func);
 
+/* Parrot_set_config_hash exists in *_config.o (e.g install_config.o),
+   so if you make this call then you will need to link with it in
+   addition to libparrot */
+void Parrot_set_config_hash(void);
+
 int Parrot_revision(void);
 
 #endif /* PARROT_EMBED_H_GUARD */
Index: include/parrot/interpreter.h
===================================================================
--- include/parrot/interpreter.h	(revision 10968)
+++ include/parrot/interpreter.h	(working copy)
@@ -431,6 +431,8 @@
 void Parrot_init(Interp *);
 void Parrot_destroy(Interp *);
 
+void Parrot_set_config_hash_internal(const unsigned char*, unsigned int);
+
 INTVAL interpinfo(Interp *interpreter, INTVAL what);
 PMC*   interpinfo_p(Interp *interpreter, INTVAL what);
 STRING*interpinfo_s(Interp *interpreter, INTVAL what);
Index: include/parrot/library.h
===================================================================
--- include/parrot/library.h	(revision 10968)
+++ include/parrot/library.h	(working copy)
@@ -39,7 +39,6 @@
         enum_runtime_ft);
 
 void Parrot_autoload_class(Interp *, STRING *class);
-STRING * parrot_get_config_string(Interp* );
 const char* Parrot_get_runtime_prefix(Interp *, STRING **prefix);
 void parrot_init_library_paths(Interp *);
 STRING * parrot_split_path_ext(Interp* , STRING *in, 
Index: compilers/imcc/main.c
===================================================================
--- compilers/imcc/main.c	(revision 10968)
+++ compilers/imcc/main.c	(working copy)
@@ -24,7 +24,12 @@
 
 static int load_pbc, run_pbc, write_pbc, pre_process, pasm_file;
 static char optimizer_opt[20];
+
+#ifdef MSVC
+__declspec(dllimport) FILE *yyin;
+#else
 extern FILE *yyin;
+#endif
 
 static void
 usage(FILE* fp)
@@ -455,8 +460,13 @@
     char *sourcefile;
     const char *output_file;
 
-    Interp *interp = Parrot_new(NULL);
+    Interp *interp;
 
+    Parrot_set_config_hash();
+
+    interp = Parrot_new(NULL);
+
+
     Parrot_init(interp);
 
     Parrot_block_DOD(interp);
Index: config/init/defaults.pm
===================================================================
--- config/init/defaults.pm	(revision 10968)
+++ config/init/defaults.pm	(working copy)
@@ -89,6 +89,8 @@
         ld_load_flags     => $Config{lddlflags},
         parrot_exe_def    => '',
         ld_parrot_exe_def => '',
+        parrot_dll_def    => '',
+        ld_parrot_dll_def => '',
 
         libs => $Config{libs},
 
Index: config/init/hints/mswin32.pm
===================================================================
--- config/init/hints/mswin32.pm	(revision 10968)
+++ config/init/hints/mswin32.pm	(working copy)
@@ -22,6 +22,7 @@
     my $is_bcc   = grep { $cc eq $_ } (qw(bcc32 bcc32.exe));
 
     $conf->data->set(
+        win32             => 1,
         PQ                => '"',
         make_c            => '$(PERL) -e "chdir shift @ARGV; system \'$(MAKE)\', @ARGV; exit $$? >> 8;"',
         ncilib_link_extra => '-def:src/libnci_test.def',
@@ -61,8 +62,13 @@
             slash                => '\\',
             blib_dir             => 'blib\\lib',
             ccflags              => $ccflags,
-            ccwarn               => ''
+            ccwarn               => '',
+            has_dynamic_linking  => 1
         );
+        
+        # We'll build shared by default.
+        $conf->data->set('parrot_is_shared') = 1
+            unless defined($conf->data->get('parrot_is_shared'));
 
         # 'link' needs to be link.exe, not cl.exe.
         # This makes 'link' and 'ld' the same.
@@ -75,11 +81,19 @@
             $conf->data->set(linkflags => $linkflags);
         }
 
-        # We need to build a .def file to export parrot.exe symbols.
-        $conf->data->set(
-            ld_parrot_exe_def => '-def:parrot.def',
-            parrot_exe_def    => 'parrot.def'
-        );
+        # We need to build a .def file to export parrot.exe symbols in a
+        # static build and similarly to the shared lib otherwise.
+        if ($conf->data->get('parrot_is_shared')) {
+            $conf->data->set(
+                ld_parrot_dll_def => '-def:parrot.def',
+                parrot_dll_def    => 'parrot.def'
+            );
+        } else {
+            $conf->data->set(
+                ld_parrot_exe_def => '-def:parrot.def',
+                parrot_exe_def    => 'parrot.def'
+            );
+        }
 
         # When building dynclasses we need to flag up the need to
         # mark shared variables with __declspec(dllimport).
@@ -109,7 +123,8 @@
             slash                => '\\',
             blib_dir             => 'blib\\lib',
             ccflags              => $ccflags,
-            ccwarn               => ''
+            ccwarn               => '',
+            has_dynamic_linking  => 1,
         );
 
         # 'link' needs to be xilink.exe, not icl.exe.
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in	(revision 10968)
+++ config/gen/makefiles/root.in	(working copy)
@@ -475,7 +475,8 @@
 
 # Libraries
 LIBPARROT_STATIC  = ${blib_dir}${slash}${libparrot_static}
-LIBPARROT_SHARED  = ${blib_dir}${slash}${libparrot_shared}
+#CONDITIONED_LINE(win32):LIBPARROT_SHARED  = ${libparrot_shared}
+#INVERSE_CONDITIONED_LINE(win32):LIBPARROT_SHARED  = ${blib_dir}${slash}${libparrot_shared}
 
 # This line controls whether a static or shared library is built
 LIBPARROT         = ${libparrot}
@@ -697,15 +698,15 @@
 	@echo Invoking Parrot to generate runtime/parrot/include/config.fpmc --cross your fingers
 	$(MINIPARROT) config_lib.pasm > $@
 
-parrot.def :
+parrot.def : tools/build/parrotdef.pl
 	$(PERL) tools/build/parrotdef.pl
 
 $(PARROT) : $(IMCC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
 	lib/Parrot/OpLib/core.pm $(SRC_DIR)/parrot_config$(O) \
 	$(MINIPARROT) ${parrot_exe_def}
-	$(LINK) ${ld_out}$@ $(LINKFLAGS) $(LINK_DYNAMIC) ${ld_parrot_exe_def} \
+	$(LINK) ${ld_out}$@ $(LINKFLAGS) $(LINK_DYNAMIC) \
 	$(IMCC_DIR)/main$(O) ${rpath_blib} $(ALL_PARROT_LIBS) \
-	$(SRC_DIR)/parrot_config$(O)
+	$(SRC_DIR)/parrot_config$(O) ${ld_parrot_exe_def}
 #
 # TODO build the real miniparrot
 #
@@ -773,11 +774,11 @@
 	$(AR_CR) ${ar_out}$@ ${ar_extra} $(O_FILES)
 	$(RANLIB) $@
 
-$(LIBPARROT_SHARED) : $(O_FILES)
+$(LIBPARROT_SHARED) : $(O_FILES) ${parrot_dll_def}
 	$(MKDIR) ${blib_dir}
 	$(RM_F) $(LIBPARROT_SHARED)
 	$(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) ${ld_out}$@ ${libparrot_soname} \
-	$(O_FILES) $(C_LIBS) $(ICU_SHARED)
+	$(O_FILES) $(C_LIBS) $(ICU_SHARED) ${ld_parrot_dll_def}
 #CONDITIONED_LINE(libparrot_shared_alias):	( cd ${blib_dir} ; ln -sf ${libparrot_shared} ${libparrot_shared_alias} )
 
 
@@ -790,13 +791,11 @@
 $(PDB) : $(SRC_DIR)/pdb$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pdb$(O) \
-	$(SRC_DIR)/null_config$(O) \
 	$(LINKFLAGS) ${rpath_blib} $(ALL_PARROT_LIBS)
 
 $(INSTALLABLEPDB) : $(SRC_DIR)/pdb$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pdb$(O) \
-	$(SRC_DIR)/install_config$(O) \
 	$(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 #
@@ -808,13 +807,11 @@
 $(DIS) : $(SRC_DIR)/disassemble$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/disassemble$(O) \
-	$(SRC_DIR)/null_config$(O) \
 	$(LINKFLAGS) ${rpath_blib} $(ALL_PARROT_LIBS)
 
 $(INSTALLABLEDIS) : $(SRC_DIR)/disassemble$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/disassemble$(O) \
-	$(SRC_DIR)/install_config$(O) \
 	$(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 #
@@ -824,13 +821,11 @@
 $(PDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pdump$(O) \
-	$(SRC_DIR)/null_config$(O) \
 	$(SRC_DIR)/packdump$(O) $(LINKFLAGS) ${rpath_blib} $(ALL_PARROT_LIBS)
 
 $(INSTALLABLEPDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pdump$(O) \
-	$(SRC_DIR)/install_config$(O) \
 	$(SRC_DIR)/packdump$(O) $(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 
@@ -838,13 +833,11 @@
 $(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pbc_info$(O) \
-	$(SRC_DIR)/null_config$(O) \
 	$(LINKFLAGS) ${rpath_blib} $(ALL_PARROT_LIBS)
 
 $(INSTALLABLEPINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
 	$(LINK) ${ld_out}$@ \
 	$(SRC_DIR)/pbc_info$(O) \
-	$(SRC_DIR)/install_config$(O) \
 	$(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 #
