diff -pru perl-5.8.8-orig/config_h.SH perl-5.8.8-try1-bad-tests/config_h.SH
--- perl-5.8.8-orig/config_h.SH	Mon Oct 31 10:13:04 2005
+++ perl-5.8.8-try1-bad-tests/config_h.SH	Mon Nov 27 17:34:00 2006
@@ -3354,6 +3354,18 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
  */
 #define Pid_t $pidtype		/* PID type */
 
+/* INSTALL_PREFIX:
+ *	This symbol contains the "root" of installation tree for this package.
+ *	The program should be prepared to do ~ expansion.
+ */
+/* INSTALL_PREFIX_EXP:
+ *	This symbol contains the "root" of installation tree for this package
+ *	to be used
+ *	in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+#define INSTALL_PREFIX "$installprefix"		/**/
+#define INSTALL_PREFIX_EXP "$installprefixexp"	/**/
+
 /* PRIVLIB:
  *	This symbol contains the name of the private library for this package.
  *	The library is private in the sense that it needn't be in anyone's
diff -pru perl-5.8.8-orig/configpm perl-5.8.8-try1-bad-tests/configpm
--- perl-5.8.8-orig/configpm	Wed Sep 14 01:34:34 2005
+++ perl-5.8.8-try1-bad-tests/configpm	Mon Nov 27 17:40:42 2006
@@ -471,51 +471,60 @@ sub launcher {
 1;
 ENDOFEND
 
-if ($^O eq 'os2') {
-    print CONFIG <<'ENDOFSET';
-my %preconfig;
-if ($OS2::is_aout) {
-    my ($value, $v) = $Config_SH_expanded =~ m/^used_aout='(.*)'\s*$/m;
-    for (split ' ', $value) {
-        ($v) = $Config_SH_expanded =~ m/^aout_$_='(.*)'\s*$/m;
-        $preconfig{$_} = $v eq 'undef' ? undef : $v;
+sub quote_pair ($$) {
+    my ($key, $value) = (shift, shift);
+    # Is it safe on the LHS of => ?
+    my $qkey = $key =~ /^[A-Za-z_][A-Za-z0-9_]*$/ ? $key : "'$key'";
+    if (defined $value) {
+	# Quote things for a '' string
+	$value =~ s!\\!\\\\!g;
+	$value =~ s!'!\\'!g;
+	$value = "'$value'";
+    } else {
+	$value = "undef";
     }
+    "$qkey => $value";
 }
-$preconfig{d_fork} = undef unless $OS2::can_fork; # Some funny cases can't
-sub TIEHASH { bless {%preconfig} }
-ENDOFSET
+
+my ($Extra, %Extra) = '';
+if ($^O eq 'os2') {
+    my $used_aout = fetch_string ({}, 'used_aout');
+    for my $k (split ' ', $used_aout) {
+        my ($v) = fetch_string ({}, "aout_$k");
+	$Extra{$k} = quote_pair($k, $v);
+    }
     # Extract the name of the DLL from the makefile to avoid duplication
     my ($f) = grep -r, qw(GNUMakefile Makefile);
-    my $dll;
+    my $dll = '';
     if (open my $fh, '<', $f) {
 	while (<$fh>) {
 	    $dll = $1, last if /^PERL_DLL_BASE\s*=\s*(\S*)\s*$/;
 	}
+	$dll = "    " . quote_pair(dll_name => $dll) . ",\n" if $dll;
     }
-    print CONFIG <<ENDOFSET if $dll;
-\$preconfig{dll_name} = '$dll';
-ENDOFSET
-} else {
-    print CONFIG <<'ENDOFSET';
+    my $fill_Extra = join '', map { "\t$_,\n" } sort values %Extra;
+    printf CONFIG <<'ENDOFPAT', $dll, $fill_Extra;
+my @Extra_aout;
+my @Extra = (
+    d_fork => $OS2::can_fork || undef, # Some funny cases can't
+%s);
+if ($OS2::is_aout) {
+    @Extra_aout = (
+%s    );
+}
+ENDOFPAT
+    $Extra = "    \@Extra, \@Extra_aout\n";
+}
+
+print CONFIG <<'ENDOFSET';
 sub TIEHASH {
     bless $_[1], $_[0];
 }
 ENDOFSET
-}
 
 foreach my $key (keys %Common) {
     my $value = fetch_string ({}, $key);
-    # Is it safe on the LHS of => ?
-    my $qkey = $key =~ /^[A-Za-z_][A-Za-z0-9_]*$/ ? $key : "'$key'";
-    if (defined $value) {
-	# Quote things for a '' string
-	$value =~ s!\\!\\\\!g;
-	$value =~ s!'!\\'!g;
-	$value = "'$value'";
-    } else {
-	$value = "undef";
-    }
-    $Common{$key} = "$qkey => $value";
+    $Common{$key} = quote_pair($key, $value);
 }
 
 if ($Common{byteorder}) {
@@ -525,7 +534,7 @@ my $fast_config = join '', map { "    $_
 
 # Sanity check needed to stop an infite loop if Config_heavy.pl fails to define
 # &launcher for some reason (eg it got truncated)
-print CONFIG sprintf <<'ENDOFTIE', $fast_config;
+print CONFIG sprintf <<'ENDOFTIE', $fast_config, $Extra;
 
 sub DESTROY { }
 
@@ -537,7 +546,7 @@ sub AUTOLOAD {
 
 # tie returns the object, so the value returned to require will be true.
 tie %%Config, 'Config', {
-%s};
+%s%s};
 ENDOFTIE
 
 
diff -pru perl-5.8.8-orig/ext/Devel/DProf/DProf.xs perl-5.8.8-try1-bad-tests/ext/Devel/DProf/DProf.xs
--- perl-5.8.8-orig/ext/Devel/DProf/DProf.xs	Mon Jan  2 06:17:44 2006
+++ perl-5.8.8-try1-bad-tests/ext/Devel/DProf/DProf.xs	Mon Nov 27 17:53:08 2006
@@ -181,6 +181,7 @@ dprof_times(pTHX_ struct tms *t)
 #ifdef OS2
     ULONG rc;
     QWORD cnt;
+    STRLEN n_a;
     
     if (!g_frequ) {
 	if (CheckOSError(DosTmrQueryFreq(&g_frequ)))
diff -pru perl-5.8.8-orig/lib/perl5db.pl perl-5.8.8-try1-bad-tests/lib/perl5db.pl
--- perl-5.8.8-orig/lib/perl5db.pl	Fri Oct 28 17:03:20 2005
+++ perl-5.8.8-try1-bad-tests/lib/perl5db.pl	Mon Nov 27 18:27:08 2006
@@ -498,7 +498,7 @@ where it has to go.
 
 package DB;
 
-use IO::Handle;
+BEGIN {eval 'use IO::Handle'};	# Apparently not needed; breaks under miniperl
 
 # Debugger for Perl 5.00x; perl5db.pl patch level:
 $VERSION = 1.28;
@@ -3415,8 +3415,10 @@ any variables we might want to address i
                 $onetimedumpDepth = undef;
             }
             elsif ( $term_pid == $$ ) {
-                STDOUT->flush();
-                STDERR->flush();
+		eval {		# May run under miniperl, when not available...
+                    STDOUT->flush();
+                    STDERR->flush();
+		};
 
                 # XXX If this is the master pid, print a newline.
                 print $OUT "\n";
diff -pru perl-5.8.8-orig/Makefile.SH perl-5.8.8-try1-bad-tests/Makefile.SH
--- perl-5.8.8-orig/Makefile.SH	Tue Jan 24 04:49:44 2006
+++ perl-5.8.8-try1-bad-tests/Makefile.SH	Mon Nov 27 18:48:26 2006
@@ -531,7 +531,7 @@ os2)
 MINIPERLEXP		= miniperl
 
 perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
-	./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl.exp
+	./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
 
 !NO!SUBS!
 	;;
diff -pru perl-5.8.8-orig/os2/Makefile.SHs perl-5.8.8-try1-bad-tests/os2/Makefile.SHs
--- perl-5.8.8-orig/os2/Makefile.SHs	Tue Oct 25 04:40:42 2005
+++ perl-5.8.8-try1-bad-tests/os2/Makefile.SHs	Mon Nov 27 18:56:50 2006
@@ -71,7 +71,7 @@ libperl_override.lib: libperl_override.i
 	emximp -o $@ libperl_override.imp
 
 libperl_dllmain.imp: imp_version
-	echo	'main	$(PERL_DLL_BASE)	dll_perlmain	?' >> $@
+	echo	'main	$(PERL_DLL_BASE)	dll_perlmain	?' > $@
 
 libperl_dllmain.lib: libperl_dllmain.imp
 	emximp -o $@ libperl_dllmain.imp
diff -pru perl-5.8.8-orig/perlvars.h perl-5.8.8-try1-bad-tests/perlvars.h
--- perl-5.8.8-orig/perlvars.h	Wed Sep 21 11:31:28 2005
+++ perl-5.8.8-try1-bad-tests/perlvars.h	Mon Nov 27 17:26:24 2006
@@ -53,7 +53,11 @@ PERLVAR(Gdollarzero_mutex, perl_mutex)	/
 #endif
 
 /* This is constant on most architectures, a global on OS/2 */
+#ifdef OS2
+PERLVARI(Gsh_path,	      char *,	SH_PATH)/* full path of shell */
+#else
 PERLVARI(Gsh_path,	const char *,	SH_PATH)/* full path of shell */
+#endif
 
 #ifndef PERL_MICRO
 /* If Perl has to ignore SIGPFE, this is its saved state.
