Skip to content

Commit

Permalink
Fix build on mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
PatZim committed Mar 27, 2019
1 parent 787596d commit 5bc6269
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
# Try `use`ing it here so users know if they need to install this module
# (not included with *every* Perl installation)
use ExtUtils::Command;

# This allows us to run on ancient perls.
sub defined_or($$) {
defined $_[0] ? $_[0] : $_[1]
}

MAIN: {
if (-r 'config.default') {
unshift @ARGV, shellwords(slurp('config.default'));
Expand Down Expand Up @@ -339,7 +345,7 @@
}
$config{'c_runner_libs'} = join ' ',
(map { sprintf $nqp_config{'moar::ldusr'}, $_; } @c_runner_libs),
$nqp_config{'moar::sharedlib'};
sprintf(defined_or($nqp_config{'moar::ldimp'}, $nqp_config{'moar::ldusr'}), $nqp_config{'moar::name'});

unless (@errors) {
print "Using $config{'m_nqp'} (version $nqp_config{'nqp::version'} / MoarVM $nqp_config{'moar::version'}).\n";
Expand Down
8 changes: 4 additions & 4 deletions tools/build/Makefile-Moar.in
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ $(M_C_RUNNER): src/vm/moar/runner/main.c
# Using only the pkgconfig moar includes does not work, because moar.h assumes all the specific includes below.
$(M_CC) @moar::ccswitch@ @static_nqp_home_define@ @static_perl6_home_define@ $(M_CFLAGS) $(M_CCINC)$(M_INCPATH) $(M_CCINC)$(M_INCPATH)/moar \
$(M_CCINC)$(M_INCPATH)/libatomic_ops $(M_CCINC)$(M_INCPATH)/dyncall $(M_CCINC)$(M_INCPATH)/moar $(M_CCINC)$(M_INCPATH)/sha1 $(M_CCINC)$(M_INCPATH)/tinymt $(M_CCINC)$(M_INCPATH)/libtommath $(M_CCINC)$(M_INCPATH)/libuv \
$(M_MINGW_UNICODE) @moar::ccout@main@moar::obj@ src/vm/moar/runner/main.c
$(M_LD) @moar::ldout@$@ $(M_LDFLAGS) main@moar::obj@ @moar::lddir@@moar::libdir@ $(M_C_RUNNER_LIBS)
@moar::ccout@main@moar::obj@ src/vm/moar/runner/main.c
$(M_LD) @moar::ldout@$@ $(M_LDFLAGS) $(M_MINGW_UNICODE) main@moar::obj@ @moar::lddir@@moar::libdir@ $(M_C_RUNNER_LIBS)

$(M_C_DEBUG_RUNNER): src/vm/moar/runner/main.c
$(RM_F) $(M_C_DEBUG_RUNNER)
# Using only the pkgconfig moar includes does not work, because moar.h assumes all the specific includes below.
$(M_CC) @moar::ccswitch@ @static_nqp_home_define@ @static_perl6_home_define@ -DMOAR_PERL6_RUNNER_DEBUG $(M_CFLAGS) $(M_CCINC)$(M_INCPATH) $(M_CCINC)$(M_INCPATH)/moar \
$(M_CCINC)$(M_INCPATH)/libatomic_ops $(M_CCINC)$(M_INCPATH)/dyncall $(M_CCINC)$(M_INCPATH)/moar $(M_CCINC)$(M_INCPATH)/sha1 $(M_CCINC)$(M_INCPATH)/tinymt $(M_CCINC)$(M_INCPATH)/libtommath $(M_CCINC)$(M_INCPATH)/libuv \
$(M_MINGW_UNICODE) @moar::ccout@main@moar::obj@ src/vm/moar/runner/main.c
$(M_LD) @moar::ldout@$@ $(M_LDFLAGS) main@moar::obj@ @moar::lddir@@moar::libdir@ $(M_C_RUNNER_LIBS)
@moar::ccout@main@moar::obj@ src/vm/moar/runner/main.c
$(M_LD) @moar::ldout@$@ $(M_LDFLAGS) $(M_MINGW_UNICODE) main@moar::obj@ @moar::lddir@@moar::libdir@ $(M_C_RUNNER_LIBS)


## testing targets
Expand Down

0 comments on commit 5bc6269

Please sign in to comment.