<commit_before># Copyright (C) 2005-2007, The Perl Foundation.
# $Id$

package init::hints::linux;

use strict;
use warnings;

use Config;

sub option_or_data {
    my $conf = shift;
    my $arg = shift;

    my $opt = $conf->options->get( $arg );
    return $opt ? $opt : $conf->data->get( $arg );
}

sub runstep {
    my ( $self, $conf ) = @_;

    my $libs        = option_or_data($conf, 'libs');
    my $cflags      = option_or_data($conf, 'cflags');
    my $cc          = option_or_data($conf, 'cc');
    my $linkflags   = option_or_data($conf, 'linkflags');

    # should find g++ in most cases
    my $link = $conf->data->get('link') || 'c++';

    if ( $libs !~ /-lpthread/ ) {
        $libs .= ' -lpthread';
    }
    my $ld_share_flags = $conf->data->get('ld_share_flags');
    my $cc_shared      = $conf->data->get('cc_shared');

    if ( $cc =~ /icc/ ) {
        # Intel C++ compiler has the same name as its C compiler
        $link = $cc;

        # don't allow icc to pretend it's gcc<commit_msg>[config] option passed to option_or_data() should actually have been ccflags rather than cflags<commit_after># Copyright (C) 2005-2007, The Perl Foundation.
# $Id$

package init::hints::linux;

use strict;
use warnings;

use Config;

sub option_or_data {
    my $conf = shift;
    my $arg = shift;

    my $opt = $conf->options->get( $arg );
    return $opt ? $opt : $conf->data->get( $arg );
}

sub runstep {
    my ( $self, $conf ) = @_;

    my $libs        = option_or_data($conf, 'libs');
    my $cflags      = option_or_data($conf, 'ccflags');
    my $cc          = option_or_data($conf, 'cc');
    my $linkflags   = option_or_data($conf, 'linkflags');

    # should find g++ in most cases
    my $link = $conf->data->get('link') || 'c++';

    if ( $libs !~ /-lpthread/ ) {
        $libs .= ' -lpthread';
    }
    my $ld_share_flags = $conf->data->get('ld_share_flags');
    my $cc_shared      = $conf->data->get('cc_shared');

    if ( $cc =~ /icc/ ) {
        # Intel C++ compiler has the same name as its C compiler
        $link = $cc;

        # don't allow icc to pretend it's gcc
{'fraction_non_alphanumeric': 0.1700712589073634, 'fraction_numerical': 0.007600950118764846, 'mean_word_length': 2.563451776649746, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '3595583', 'n_tokens_mistral': 778, 'n_tokens_neox': 736, 'n_words': 207}