Skip to content

Commit 78adc57

Browse files
committed
Config.gc updates: shift all the default changes to a sub
This avoids needless repetition in the build configs. The build config also overrides any of the defaults.
1 parent 4699841 commit 78adc57

File tree

2 files changed

+81
-66
lines changed

2 files changed

+81
-66
lines changed

lib/Perl/Dist/Strawberry/Step.pm

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ sub _update_config_gc {
588588
}
589589
}
590590

591+
my $default_config_hash = $self->_get_default_config_hash;
592+
@data{keys %$default_config_hash} = values %$default_config_hash;
593+
591594
# fix up quoting of values
592595
foreach my $val (values %$update_hash) {
593596
next if $val =~ /^'/; # assumes symmetry, i.e. opening and closing
@@ -617,6 +620,76 @@ sub _update_config_gc {
617620

618621
}
619622

623+
sub _get_default_config_hash {
624+
my $h = {
625+
archlib => '~INST_TOP~\lib',
626+
archlibexp => '~INST_TOP~\lib',
627+
bin => '~INST_TOP~\bin',
628+
binexp => '~INST_TOP~\bin',
629+
d_vendorarch => 'define',
630+
d_vendorbin => 'define',
631+
d_vendorlib => 'define',
632+
d_vendorscript => 'define',
633+
dlext => 'xs.dll',
634+
installarchlib => '~INST_TOP~\lib',
635+
installbin => '~INST_TOP~\bin',
636+
installhtmldir => '',
637+
installhtmlhelpdir => '',
638+
installman1dir => '',
639+
installman3dir => '',
640+
installprefix => '~INST_TOP~',
641+
installprefixexp => '~INST_TOP~',
642+
installprivlib => '~INST_TOP~\lib',
643+
installscript => '~INST_TOP~\bin',
644+
installsitearch => '~INST_TOP~\site\lib',
645+
installsitebin => '~INST_TOP~\site\bin',
646+
installsitelib => '~INST_TOP~\site\lib',
647+
installsitescript => '~INST_TOP~\site\bin',
648+
installvendorarch => '~INST_TOP~\vendor\lib',
649+
installvendorbin => '~INST_TOP~\bin',
650+
installvendorlib => '~INST_TOP~\vendor\lib',
651+
installvendorscript => '~INST_TOP~\bin',
652+
man1dir => '',
653+
man1direxp => '',
654+
man3dir => '',
655+
man3direxp => '',
656+
perlpath => '~INST_TOP~\bin\perl.exe',
657+
privlib => '~INST_TOP~\lib',
658+
privlibexp => '~INST_TOP~\lib',
659+
scriptdir => '~INST_TOP~\bin',
660+
scriptdirexp => '~INST_TOP~\bin',
661+
sitearch => '~INST_TOP~\site\lib',
662+
sitearchexp => '~INST_TOP~\site\lib',
663+
sitebin => '~INST_TOP~\site\bin',
664+
sitebinexp => '~INST_TOP~\site\bin',
665+
sitelib => '~INST_TOP~\site\lib',
666+
sitelibexp => '~INST_TOP~\site\lib',
667+
siteprefix => '~INST_TOP~\site',
668+
siteprefixexp => '~INST_TOP~\site',
669+
sitescript => '~INST_TOP~\site\bin',
670+
sitescriptexp => '~INST_TOP~\site\bin',
671+
usevendorprefix => 'define',
672+
usrinc => 'C:\strawberry\c\include',
673+
vendorarch => '~INST_TOP~\vendor\lib',
674+
vendorarchexp => '~INST_TOP~\vendor\lib',
675+
vendorbin => '~INST_TOP~\bin',
676+
vendorbinexp => '~INST_TOP~\bin',
677+
vendorlib => '~INST_TOP~\vendor\lib',
678+
vendorlibexp => '~INST_TOP~\vendor\lib',
679+
vendorprefix => '~INST_TOP~\vendor',
680+
vendorprefixexp => '~INST_TOP~\vendor',
681+
vendorscript => '~INST_TOP~\bin',
682+
vendorscriptexp => '~INST_TOP~\bin',
683+
};
684+
685+
# fix up quoting of values - saves a heap of editing
686+
foreach my $val (values %$h) {
687+
next if $val =~ /^'/; # assumes symmetry, i.e. opening and closing
688+
$val = "'$val'";
689+
}
690+
691+
return $h;
692+
}
620693

621694
1;
622695

share/64bit-5.36.0.1.pp

Lines changed: 8 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -115,75 +115,17 @@
115115
HAS_BUILTIN_EXPECT => 'define',
116116
HAS_BUILTIN_CHOOSE_EXPR => 'define',
117117
},
118-
'config.gc' => { # many of these can be defaults
119-
archlib => '~INST_TOP~\lib',
120-
archlibexp => '~INST_TOP~\lib',
121-
bin => '~INST_TOP~\bin',
122-
binexp => '~INST_TOP~\bin',
118+
'config.gc' => { # see Step.pm for list of default updates
123119
d_builtin_choose_expr => 'define',
124120
d_builtin_expect => 'define',
125121
d_mkstemp => 'define',
126-
d_ndbm => 'define',
127-
d_vendorarch => 'define',
128-
d_vendorbin => 'define',
129-
d_vendorlib => 'define',
130-
d_vendorscript => 'define',
131-
dlext => 'xs.dll',
132-
i_db => 'define',
133-
i_dbm => 'define',
134-
i_gdbm => 'define',
135-
i_ndbm => 'define',
136-
installarchlib => '~INST_TOP~\lib',
137-
installbin => '~INST_TOP~\bin',
138-
installhtmldir => '',
139-
installhtmlhelpdir => '',
140-
installman1dir => '',
141-
installman3dir => '',
142-
installprefix => '~INST_TOP~',
143-
installprefixexp => '~INST_TOP~',
144-
installprivlib => '~INST_TOP~\lib',
145-
installscript => '~INST_TOP~\bin',
146-
installsitearch => '~INST_TOP~\site\lib',
147-
installsitebin => '~INST_TOP~\site\bin',
148-
installsitelib => '~INST_TOP~\site\lib',
149-
installsitescript => '~INST_TOP~\site\bin',
150-
installvendorarch => '~INST_TOP~\vendor\lib',
151-
installvendorbin => '~INST_TOP~\bin',
152-
installvendorlib => '~INST_TOP~\vendor\lib',
153-
installvendorscript => '~INST_TOP~\bin',
154-
man1dir => '',
155-
man1direxp => '',
156-
man3dir => '',
157-
man3direxp => '',
158-
myuname => 'Win32 strawberry-perl 5.36.0.1 #1 Sat 04 Mar 2023 x64 tempvaluesonly',
159-
osvers => '10',
160-
perlpath => '~INST_TOP~\bin\perl.exe',
161-
privlib => '~INST_TOP~\lib',
162-
privlibexp => '~INST_TOP~\lib',
163-
scriptdir => '~INST_TOP~\bin',
164-
scriptdirexp => '~INST_TOP~\bin',
165-
sitearch => '~INST_TOP~\site\lib',
166-
sitearchexp => '~INST_TOP~\site\lib',
167-
sitebin => '~INST_TOP~\site\bin',
168-
sitebinexp => '~INST_TOP~\site\bin',
169-
sitelib => '~INST_TOP~\site\lib',
170-
sitelibexp => '~INST_TOP~\site\lib',
171-
siteprefix => '~INST_TOP~\site',
172-
siteprefixexp => '~INST_TOP~\site',
173-
sitescript => '~INST_TOP~\site\bin',
174-
sitescriptexp => '~INST_TOP~\site\bin',
175-
usevendorprefix => 'define',
176-
usrinc => 'C:\strawberry\c\include',
177-
vendorarch => '~INST_TOP~\vendor\lib',
178-
vendorarchexp => '~INST_TOP~\vendor\lib',
179-
vendorbin => '~INST_TOP~\bin',
180-
vendorbinexp => '~INST_TOP~\bin',
181-
vendorlib => '~INST_TOP~\vendor\lib',
182-
vendorlibexp => '~INST_TOP~\vendor\lib',
183-
vendorprefix => '~INST_TOP~\vendor',
184-
vendorprefixexp => '~INST_TOP~\vendor',
185-
vendorscript => '~INST_TOP~\bin',
186-
vendorscriptexp => '~INST_TOP~\bin',
122+
d_ndbm => 'define',
123+
i_db => 'define',
124+
i_dbm => 'define',
125+
i_gdbm => 'define',
126+
i_ndbm => 'define',
127+
myuname => 'Win32 strawberry-perl 5.36.0.1 #1 Sat 04 Mar 2023 x64 tempvaluesonly',
128+
osvers => '10',
187129
},
188130
},
189131
license => { #SRC paths are relative to the perl src root

0 commit comments

Comments
 (0)