Re: [PATCH] Fix ivsize and nvsize issues

2001-09-21 Thread Simon Cozens

On Thu, Sep 20, 2001 at 09:44:41PM -0700, Brent Dax wrote:
 Okay, this fixes the issues with changing your IV or NV size.  It also
 provides an early warning if your C compiler settings aren't okay.  I've
 also made the style of the code a little more consistent.  I'm applying
 this, but I figure people might as well check it over anyway.
 
Excellent, thanks; sorry I was so quick to apply Andy's patch while you
were working on this.

  sub check_manifest {

ExtUtils::Manifest?

Simon
-- 
People in a Position to Know, Inc.



[PATCH] Fix ivsize and nvsize issues

2001-09-20 Thread Brent Dax

Okay, this fixes the issues with changing your IV or NV size.  It also
provides an early warning if your C compiler settings aren't okay.  I've
also made the style of the code a little more consistent.  I'm applying
this, but I figure people might as well check it over anyway.

--Brent Dax
[EMAIL PROTECTED]

They *will* pay for what they've done.


--- ..\..\parrot-cvs\parrot\Configure.plThu Sep 20 21:14:30 2001
+++ Configure.plThu Sep 20 21:24:56 2001
@@ -6,9 +6,10 @@
 use strict;
 use Config;
 use Getopt::Long;
+use ExtUtils::Manifest qw(manicheck);

-my( $opt_debugging, $opt_defaults, $opt_version, $opt_help ) = ( 0, 0,
0, 0 );
-my( %opt_defines );
+my($opt_debugging, $opt_defaults, $opt_version, $opt_help) = (0, 0, 0,
0);
+my(%opt_defines);
 my $result = GetOptions(
'debugging!' = \$opt_debugging,
'defaults!'  = \$opt_defaults,
@@ -17,12 +18,12 @@
'define=s'   = \%opt_defines,
 );

-if( $opt_version ) {
+if($opt_version) {
print '$Id: Configure.pl,v 1.12 2001/09/21 01:43:50 brentdax Exp
$' . \n;
exit;
 }

-if( $opt_help ) {
+if($opt_help) {
print EOT;
 $0 - Parrot Configure
 Options:
@@ -54,39 +55,43 @@
 complete Parrot kit.
 END

-#check_manifest();
+check_manifest();

 #Some versions don't seem to have ivtype or nvtype--provide
 #defaults for them.
 #XXX Figure out better defaults
 my(%c)=(
iv =   ($Config{ivtype}   ||'long'),
-ivsize =   ($Config{ivsize}   || 4 ),
-longsize = ($Config{longsize} || 4 ),
+   ivsize =   undef,
+
nv =   ($Config{nvtype}   ||'double'),
-nvsize =   ($Config{nvsize}   || 8 ),
-opcode_t = ($Config{ivtype}   ||'long'),
+   nvsize =   undef,
+
+   opcode_t = ($Config{ivtype}   ||'long'),
+   longsize = undef,
+
cc =   $Config{cc},
#ADD C COMPILER FLAGS HERE
ccflags =  $Config{ccflags}. -I./include,
libs = $Config{libs},
-   perl = $^X,
cc_debug = '-g',
o ='.o',   # object files extension
exe =  $Config{_exe},
+
ld =   $Config{ld},
ld_out =   '-o ',  # ld output file
ld_debug = '', # include debug info in
executab
le
+
+   perl = $^X,
debugging =$opt_debugging,
 );

-foreach my $i ( keys %opt_defines ) {
-   $c{$i} = $opt_defines{$i};
-}
+#copy the things from --define foo=bar
+@c{keys %opt_defines}=@opt_defines{keys %opt_defines};

 # set up default values
-my $hints = hints/ . lc( $^O ) . .pl;
-if( -f $hints ) {
+my $hints = hints/ . lc($^O) . .pl;
+if(-f $hints) {
local($/);
open HINT,  $hints or die Unable to open hints file
'$hints';
my $hint = HINT;
@@ -123,6 +128,17 @@

 print END;

+Alright, now I'm gonna check some stuff by compiling and running
+a small C program.  This could take a bit...
+END
+
+buildfile(test_c);
+system($c{cc} $c{ccflags} -o test$c{exe} test.c) and die C compiler
died!;
+(@c{qw(ivsize opsize nvsize)})=split('/', `test$c{exe}`);
+unlink('test.c', test$c{exe});
+
+print END;
+
 Okay, that's finished.  I'm now going to write your very
 own Makefile, config.h, and Parrot::Config to disk.
 END
@@ -208,36 +224,29 @@

$text =~ s/#DUMPER OUTPUT HERE/$dd-Dump()/eg;

-   mkdir(Parrot, 0777) or ( $! =~ /File exists/i or die Can't
make direc
tory ./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: $!;
 }

 sub check_manifest {
-   my $not_ok;
-   open(MANIFEST, MANIFEST);
+   print \n;

-   while(MANIFEST) {
-   chomp;
-   unless(-e $_) {
-   print File $_ is missing!\n;
-   $not_ok=1;
-   }
-   }
+   my(@missing)=manicheck();

-   if($not_ok) {
+   if(@missing) {
print END;

 Ack, some files were missing!  I can't continue running
 without everything here.  Please try to find the above
 files and then try running Configure again.
+
 END
+
exit;
}
else {
print END;
-
 Okay, we found everything.  Next you'll need to answer
 a few questions about your system.  Rules are the same
 as Perl 5's Configure--defaults are in square brackets,
--- /dev/null   Wed Dec 31 16:00:00 1969
+++ test_c.in   Thu Sep 20 21:12:32 2001
@@ -0,0 +1,13 @@
+/*
+ * test.c - figure out some Configure settings
+ *
+ * This file is automatically generated by Configure
+ * from test_c.in.
+ */
+
+#include stdio.h
+
+int main(int argc, char **argv) {
+   printf(%d/%d/%d, sizeof(${iv}), sizeof(long), sizeof(${nv}));
+   

Re: [PATCH] Fix ivsize and nvsize issues

2001-09-20 Thread Ask Bjoern Hansen

[EMAIL PROTECTED] (Brent Dax) writes:

 +(@c{qw(ivsize opsize nvsize)})=split('/', `test$c{exe}`);

I changed this so it works without having . in $PATH.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();