Gibbs Tanton - tgibbs:
# 1.) create an include/parrot directory under the main source directory
# 2.) move all .h files into include/parrot
# 3.) add -I./include to Configure.pl
The patch below my sig will handle the Configure side of things.
Include it in your own set of patches. Do not apply this until
everything else is ready for the switchover. Do not pass Go. Do not
collect $200. :^)
--Brent Dax
[EMAIL PROTECTED]
They *will* pay for what they've done.
--- c:\old_parrot\Configure.pl Fri Sep 14 08:06:22 2001
+++ Configure.pl Fri Sep 14 12:35:56 2001
@@ -30,9 +30,10 @@
#XXX Figure out better defaults
my(%c)=(
iv => ($Config{ivtype}||'long'),
- nv => ($Config{nvtype}||'long double'),
+ nv => ($Config{nvtype}||'double'),
cc => $Config{cc},
- ccflags => $Config{ccflags},
+ #XXX Do we want to get flags like -DDEBUGGING from Perl 5?
+ ccflags => $Config{ccflags}."-I./include",
libs => $Config{libs}
);
@@ -64,12 +65,29 @@
END
#now let's assemble the config.h file
-buildfile("config_h");
+buildfile("config_h", "include/parrot");
#and the makefile
buildfile("Makefile");
#and Parrot::Config
-buildconfigpm();
+{
+ unless($DDOK) {
+ print <<"END";
+Your system doesn't have Data::Dumper installed, so I couldn't
+build Parrot::Config. If you want Parrot::Config installed,
+use CPAN.pm to install Data::Dumper and run this script again.
+END
+
+ last;
+ }
+
+ my $dd=new Data::Dumper([\%c]);
+ $dd->Names(['*PConfig']);
+ $c{dumped}=$dd->Dump;
+
+ buildfile("Config_pm", "Parrot");
+}
+
print <<"END";
Okay, we're done!
@@ -102,7 +120,7 @@
}
sub buildfile {
- my($filename)=shift;
+ my($filename, $path)=(@_); $path||='.';
local $/;
open(IN, "<$filename.in") or die "Can't open $filename.in: $!";
@@ -112,37 +130,8 @@
$text =~ s/\$\{(\w+)\}/$c{$1}/g;
$filename =~ s/_/./; #config_h => config.h
- open(OUT, ">$filename") or die "Can't open $filename: $!";
+ mkdir("$path", 0777) or ( $! =~ /File exists/i or die "Can't make
directory $path: $!");
+ open(OUT, ">$path/$filename") or die "Can't open $path/$filename: $!";
print OUT $text;
close(OUT) or die "Can't close $filename: $!";
}
-
-sub buildconfigpm {
- unless($DDOK) {
- print <<"END";
-
-Your system doesn't have Data::Dumper installed, so I couldn't
-build Parrot::Config. If you want Parrot::Config installed,
-use CPAN.pm to install Data::Dumper and run this script again.
-END
-
- return;
- }
-
- my %C=%c;
- delete $C{headers};
- my $dd=new Data::Dumper([\%C]);
- $dd->Names(['*PConfig']);
-
- local $/;
- open(IN, "<Config_pm.in") or die "Can't open Config_pm.in: $!";
- my $text=<IN>;
- close(IN) or die "Can't close Config.pm_in: $!";
-
- $text =~ s/#DUMPER OUTPUT HERE/$dd->Dump()/eg;
-
- mkdir("Parrot", 0777) or ( $! =~ /File exists/i or die "Can't make
directory ./Parrot: $!");
- open(OUT, ">Parrot/Config.pm") or die "Can't open file
Parrot/Config.pm: $!";
- print OUT $text;
- close(OUT) or die "Can't close file Parrot/Config.pm: $!";
-}
--- c:\old_parrot\Config_pm.in Fri Sep 14 02:57:00 2001
+++ Config_pm.in Fri Sep 14 12:26:20 2001
@@ -9,6 +9,6 @@
@EXPORT=qw(%PConfig);
-#DUMPER OUTPUT HERE
+${dumped}
1;