cvsuser 05/02/20 04:39:30
Modified: config/auto alignptrs.pl
Log:
Report the minimum pointer alignment
when doing a 'perl Configure.pl'.
Revision Changes Path
1.13 +42 -34 parrot/config/auto/alignptrs.pl
Index: alignptrs.pl
===================================================================
RCS file: /cvs/public/parrot/config/auto/alignptrs.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- alignptrs.pl 12 Aug 2004 09:10:10 -0000 1.12
+++ alignptrs.pl 20 Feb 2005 12:39:30 -0000 1.13
@@ -1,57 +1,65 @@
-# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: alignptrs.pl,v 1.12 2004/08/12 09:10:10 leo Exp $
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id: alignptrs.pl,v 1.13 2005/02/20 12:39:30 bernhard Exp $
=head1 NAME
-config/auto/alignptrs.pl - Pointer Alignment
+config/auto/alignptrs.pl - pointer alignment
=head1 DESCRIPTION
-Determines the minimum pointer alignment.
+Determine the minimum pointer alignment.
=cut
package Configure::Step;
use strict;
-use vars qw($description @args);
+use vars qw($description $result @args);
use Parrot::Configure::Step ':auto';
use Config;
-$description="Determining your minimum pointer alignment...";
+$description = "Determining your minimum pointer alignment...";
[EMAIL PROTECTED](miniparrot verbose);
[EMAIL PROTECTED] = qw(miniparrot verbose);
sub runstep {
- my ($miniparrot) = @_;
+ my ($miniparrot) = @_;
- return if $miniparrot;
- # HP-UX 10.20/32 hangs in this test.
- if ($^O eq 'hpux' && $Config{ccflags} !~ /DD64/) {
- Configure::Data->set(ptr_alignment => 4);
- return;
- }
-
- return if (defined(Configure::Data->get('ptr_alignment')));
- cc_gen('config/auto/alignptrs/test_c.in');
- cc_build();
-
- my $align = 999999;
-
- for my $try_align (64, 32, 16, 8, 4, 2, 1) {
- my $results=cc_run_capture($try_align);
- if ($results =~ /OK/ && $results !~ /align/i) {
- $align = $try_align;
- }
- }
-
- cc_clean();
-
- if ($align == 999999) {
- die "Can't determine alignment!\n";
- }
+ return if $miniparrot;
- Configure::Data->set(ptr_alignment => $align);
+ $result = '';
+ my $align;
+ if (defined(Configure::Data->get('ptr_alignment')))
+ {
+ $align = Configure::Data->get('ptr_alignment');
+ $result = "configured: ";
+ }
+ elsif ($^O eq 'hpux' && $Config{ccflags} !~ /DD64/) {
+ # HP-UX 10.20/32 hangs in this test.
+ my $align = 4;
+ Configure::Data->set(ptr_alignment => $align);
+ $result = "for hpux: ";
+ }
+ else {
+ # Now really test by compiling some code
+ cc_gen('config/auto/alignptrs/test_c.in');
+ cc_build();
+ for my $try_align (64, 32, 16, 8, 4, 2, 1) {
+ my $results=cc_run_capture($try_align);
+ if ($results =~ /OK/ && $results !~ /align/i) {
+ $align = $try_align;
+ }
+ }
+ cc_clean();
+
+ die "Can't determine alignment!\n" unless defined $align;
+ Configure::Data->set(ptr_alignment => $align);
+ }
+
+ $result .= " $align byte";
+ $result .= 's' unless $align == 1;
+
+ return;
}
1;