<commit_before># Copyright: 2005 The Perl Foundation.  All Rights Reserved.
# $Id$
use Parrot::Configure::Step qw(cc_gen cc_run);

my $libs = Parrot::Configure::Data->get('libs');
if ( $libs !~ /-lpthread/ ) {
    $libs .= ' -lpthread';
}
if ( $libs !~ /-lrt\b/ ) {
    $libs .= ' -lrt';      # Needed for sched_yield.
}
Parrot::Configure::Data->set(
    libs => $libs,
);

################################################################
# If we're going to be using ICU (or any other C++-compiled library) we
# need to use the c++ compiler as a linker.  As soon as the user
# selects a compiler, we will run the gccversion test.  (If we were to
# wait till it's normally run, the linker question would have already
# been asked.)
my $solaris_link_cb = sub {
    use Carp;
    my ($key, $cc) = @_;
    my %gnuc;
    my $link = Parrot::Configure::Data->get('link');
    cc_gen("config/auto/gcc/test_c.in");
    # Can't call cc_build since we haven't set all the flags yet.
    # This should suffice for this test.
    Parrot::Configure::Step::_run_command("$cc -o test test.c", 'test.cco', 'test.cco')
        and confess "C compiler failed (see test.cco)";
    %gnuc=eval cc_run() or die "Can't run the test program: $!";
    if (defined $gnuc{__GNUC__}) {
	$link = 'g++';
    }
    else {
	$link =~ s/\bcc\b/CC/;
    }
    Parrot::Configure::Data->set(link => $link);
    Parrot::Configure::Data->deltrigger("cc", "solaris_link");
};
Parrot::Configure::Data->settrigger("cc", "solaris_link", $solaris_link_cb);

################################################################
# cc_shared:  Flags to instruct the compiler to use position-independent
# code for use in shared libraries.  -KPIC for Sun's compiler, -fPIC for
# gcc.  We don't know which compiler we're using till after the
# gccversion test.
# XXX Should this go into the shlibs.pl Configure.pl unit instead?
my $solaris_cc_shared_cb = sub {
    my ($key, $gccversion) = @_;
    if ($gccversion) {
	Parrot::Configure::Data->set(cc_shared => '-fPIC');
    }
    else {
	Parrot::Configure::Data->set(cc_shared => '-KPIC');
    }
    Parrot::Configure::Data->deltrigger("gccversion", "solaris_cc_shared");
};
Parrot::Configure::Data->settrigger("gccversion", "solaris_cc_shared", 
			$solaris_cc_shared_cb);

################################################################
# Parrot usually aims for IEEE-754 compliance.
# For Solaris 8/Sun Workshop Pro 4, both
#    atan2( 0.0, -0.0) and atan2(-0.0, -0.0)
# return 0, when they should return +PI and -PI respectively.
# For Sun's compilers, fix this with the -xlibmieee flag.
# I don't know of an equivalent flag for gcc.
# (Alternatively, and more generally, perhahs we should run an
# ieee-conformance test and then call back into a hints-file trigger
# to set platform-specific flags.
#	<NAME>  7 March 2005
# We don't know which compiler we're using till after the gccversion test.
my $solaris_ieee_cb = sub {
    my ($key, $gccversion) = @_;
    if ($gccversion) {
	# Don't know how to do this for gcc.
    }
    else {
	my $linkflags = Parrot::Configure::Data->get('linkflags');
	Parrot::Configure::Data->set(linkflags => '-xlibmieee')
		unless $linkflags =~ /-xlibmieee/;
    }
    Parrot::Configure::Data->deltrigger("gccversion", "solaris_ieee");
};
Parrot::Configure::Data->settrigger("gccversion", "solaris_ieee", $solaris_ieee_cb);
<commit_msg>revert Parrot::Configure::Data->set() -> Parrot::Configure::Data->add()<commit_after># Copyright: 2005 The Perl Foundation.  All Rights Reserved.
# $Id$
use Parrot::Configure::Step qw(cc_gen cc_run);

my $libs = Parrot::Configure::Data->get('libs');
if ( $libs !~ /-lpthread/ ) {
    $libs .= ' -lpthread';
}
if ( $libs !~ /-lrt\b/ ) {
    $libs .= ' -lrt';      # Needed for sched_yield.
}
Parrot::Configure::Data->set(
    libs => $libs,
);

################################################################
# If we're going to be using ICU (or any other C++-compiled library) we
# need to use the c++ compiler as a linker.  As soon as the user
# selects a compiler, we will run the gccversion test.  (If we were to
# wait till it's normally run, the linker question would have already
# been asked.)
my $solaris_link_cb = sub {
    use Carp;
    my ($key, $cc) = @_;
    my %gnuc;
    my $link = Parrot::Configure::Data->get('link');
    cc_gen("config/auto/gcc/test_c.in");
    # Can't call cc_build since we haven't set all the flags yet.
    # This should suffice for this test.
    Parrot::Configure::Step::_run_command("$cc -o test test.c", 'test.cco', 'test.cco')
        and confess "C compiler failed (see test.cco)";
    %gnuc=eval cc_run() or die "Can't run the test program: $!";
    if (defined $gnuc{__GNUC__}) {
	$link = 'g++';
    }
    else {
	$link =~ s/\bcc\b/CC/;
    }
    Parrot::Configure::Data->set(link => $link);
    Parrot::Configure::Data->deltrigger("cc", "solaris_link");
};
Parrot::Configure::Data->settrigger("cc", "solaris_link", $solaris_link_cb);

################################################################
# cc_shared:  Flags to instruct the compiler to use position-independent
# code for use in shared libraries.  -KPIC for Sun's compiler, -fPIC for
# gcc.  We don't know which compiler we're using till after the
# gccversion test.
# XXX Should this go into the shlibs.pl Configure.pl unit instead?
my $solaris_cc_shared_cb = sub {
    my ($key, $gccversion) = @_;
    if ($gccversion) {
	Parrot::Configure::Data->set(cc_shared => '-fPIC');
    }
    else {
	Parrot::Configure::Data->set(cc_shared => '-KPIC');
    }
    Parrot::Configure::Data->deltrigger("gccversion", "solaris_cc_shared");
};
Parrot::Configure::Data->settrigger("gccversion", "solaris_cc_shared", 
			$solaris_cc_shared_cb);

################################################################
# Parrot usually aims for IEEE-754 compliance.
# For Solaris 8/Sun Workshop Pro 4, both
#    atan2( 0.0, -0.0) and atan2(-0.0, -0.0)
# return 0, when they should return +PI and -PI respectively.
# For Sun's compilers, fix this with the -xlibmieee flag.
# I don't know of an equivalent flag for gcc.
# (Alternatively, and more generally, perhahs we should run an
# ieee-conformance test and then call back into a hints-file trigger
# to set platform-specific flags.
#	<NAME>  7 March 2005
# We don't know which compiler we're using till after the gccversion test.
my $solaris_ieee_cb = sub {
    my ($key, $gccversion) = @_;
    if ($gccversion) {
	# Don't know how to do this for gcc.
    }
    else {
	my $linkflags = Parrot::Configure::Data->get('linkflags');
	Parrot::Configure::Data->add(' ', linkflags => '-xlibmieee')
		unless $linkflags =~ /-xlibmieee/;
    }
    Parrot::Configure::Data->deltrigger("gccversion", "solaris_ieee");
};
Parrot::Configure::Data->settrigger("gccversion", "solaris_ieee", $solaris_ieee_cb);

{'fraction_non_alphanumeric': 0.20152873732176982, 'fraction_numerical': 0.007349698662354844, 'mean_word_length': 4.135094339622642, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5872419', 'n_tokens_mistral': 2430, 'n_tokens_neox': 2257, 'n_words': 667}