[svn:parrot] r43281 - in branches/boehm_gc: config/auto lib/Parrot/Configure/Options lib/Parrot/Configure/Step
bacek at svn.parrot.org
bacek at svn.parrot.org
Mon Dec 28 20:37:25 UTC 2009
Author: bacek
Date: Mon Dec 28 20:37:25 2009
New Revision: 43281
URL: https://trac.parrot.org/parrot/changeset/43281
Log:
Stub for detecting Boehm GC in Configure.pl
Added:
branches/boehm_gc/config/auto/boehm.pm
Modified:
branches/boehm_gc/lib/Parrot/Configure/Options/Conf.pm
branches/boehm_gc/lib/Parrot/Configure/Step/List.pm
Added: branches/boehm_gc/config/auto/boehm.pm
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/boehm_gc/config/auto/boehm.pm Mon Dec 28 20:37:25 2009 (r43281)
@@ -0,0 +1,96 @@
+# Copyright (C) 2001-2004, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+config/auto/boehm.pm - Test for Boehm GC availability.
+
+=head1 DESCRIPTION
+
+Determines whether the platform supports Boehm GC.
+
+From L<http://www.hpl.hp.com/personal/Hans_Boehm/gc/>: "The Boehm-Demers-Weiser
+conservative garbage collector can be used as a garbage collecting replacement
+for C malloc or C++ new. It allows you to allocate memory basically as you
+normally would, without explicitly deallocating memory that is no longer
+useful. The collector automatically recycles memory when it determines that it
+can no longer be otherwise accessed."
+
+=cut
+
+package auto::boehm;
+
+use strict;
+use warnings;
+
+use base qw(Parrot::Configure::Step);
+
+use Parrot::Configure::Utils ':auto';
+
+sub _init {
+ my $self = shift;
+ my %data;
+ $data{description} = q{Does your platform support Boehm GC};
+ $data{result} = q{};
+
+ return \%data;
+}
+
+# This is actually stub for detecting Boehm GC. Requires testing on Win32 and
+# other platforms.
+sub runstep {
+ my ( $self, $conf ) = @_;
+
+ my ( $verbose, $without ) = $conf->options->get(
+ qw|
+ verbose
+ without-boehm-gc
+ |
+ );
+
+ if ($without) {
+ $conf->data->set( has_boehm_gc => 0 );
+ $self->set_result('no');
+ return 1;
+ }
+
+ my $osname = $conf->data->get('osname');
+
+ my $extra_libs = $self->_select_lib( {
+ conf => $conf,
+ osname => $osname,
+ cc => $conf->data->get('cc'),
+ win32_nongcc => 'gc.lib',
+ default => '-lgc',
+ } );
+
+ my $header = "gc.h";
+ $conf->data->set( TEMP_testheaders => "#include <$header>\n" );
+ $conf->data->set( TEMP_testheader => "$header" );
+ $conf->cc_gen('config/auto/headers/test_c.in');
+
+ # Clean up.
+ $conf->data->set( TEMP_testheaders => undef );
+ $conf->data->set( TEMP_testheader => undef );
+
+ eval { $conf->cc_build( '-I/usr/include/gc', '-lgc' ); };
+
+ my $has_boehm = ( ! $@ && $conf->cc_run() =~ /^$header OK/ );
+ if ($has_boehm) {
+ $conf->data->add( ' ', libs => $extra_libs );
+ $conf->data->add( ' ', ccflags => '-I/usr/include/gc' );
+ }
+ $self->set_result($has_boehm ? 'yes' : 'no');
+
+ return 1;
+}
+
+
+1;
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
Modified: branches/boehm_gc/lib/Parrot/Configure/Options/Conf.pm
==============================================================================
--- branches/boehm_gc/lib/Parrot/Configure/Options/Conf.pm Mon Dec 28 20:07:11 2009 (r43280)
+++ branches/boehm_gc/lib/Parrot/Configure/Options/Conf.pm Mon Dec 28 20:37:25 2009 (r43281)
@@ -105,6 +105,7 @@
--without-gmp Build parrot without GMP support
--without-opengl Build parrot without OpenGL support (GL/GLU/GLUT)
--without-pcre Build parrot without pcre support
+ --without-boehm-gc Build parrot without Boehm GC support
ICU Options:
Modified: branches/boehm_gc/lib/Parrot/Configure/Step/List.pm
==============================================================================
--- branches/boehm_gc/lib/Parrot/Configure/Step/List.pm Mon Dec 28 20:07:11 2009 (r43280)
+++ branches/boehm_gc/lib/Parrot/Configure/Step/List.pm Mon Dec 28 20:37:25 2009 (r43281)
@@ -45,6 +45,7 @@
auto::cgoto
auto::inline
auto::gc
+ auto::boehm
auto::memalign
auto::signal
auto::socklen_t
More information about the parrot-commits
mailing list