Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two more changes to make smoking on win32 work out-of-the-box #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions bin/configsmoke.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ =head1 CONFIGURATION
if ($config{$arg} && !-f $config{$arg}) {
if (open my $toskip, '>', $config{$arg}) {
print $toskip "# One test name on a line\n";
print $toskip "t/porting/pending-author.t\n" if is_win32;
close $toskip;
print "Created skeleton '$config{$arg}'...\n";
}
Expand Down Expand Up @@ -2377,6 +2378,34 @@ sub default_buildcfg {
"($basename is missing)!\n";
copy $dftbcfg, $file_name
and print "\nCreated buildconfig '$file_name'";

_inject_dcchome_for_strawberry($file_name)
if is_win32 and $Config{myuname} =~ /strawberry/;
}

sub _inject_dcchome_for_strawberry {
my ($file_name) = @_;

my $dcchome = $^X;
$dcchome =~ s/perl.bin.perl.*$//;
$dcchome="-DCCHOME=${dcchome}c";
print "\nStrawberry on Windows detected, injecting: '$dcchome'";

use autodie;

open my $cfg_fh_r, "<:raw", $file_name;
my $body = do { local $/; <$cfg_fh_r> };
close $cfg_fh_r;

$body =~ s/(DCCHOME.*\n)/$1$dcchome\n/;

chmod 0666, $file_name;
open my $cfg_fh_w, ">:raw", $file_name;
print $cfg_fh_w $body;
close $cfg_fh_w;
chmod 0550, $file_name;

return;
}

=item check_buildcfg
Expand Down
Loading