Skip to content
Permalink
Browse files

Fix build on mingw

  • Loading branch information...
patzim committed Mar 22, 2019
1 parent 787596d commit 5bc6269997cd18261b08368fc7a0819a2062b265
Showing with 11 additions and 5 deletions.
  1. +7 −1 Configure.pl
  2. +4 −4 tools/build/Makefile-Moar.in
@@ -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'));
@@ -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";
@@ -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

0 comments on commit 5bc6269

Please sign in to comment.
You can’t perform that action at this time.