Mercurial > hg > Members > anatofuz > MoarVM
view build/auto.pm @ 19:073d6fd557dc
adapt C90 for gcc
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 25 Oct 2018 14:40:22 +0900 |
parents | 2cf249471370 |
children |
line wrap: on
line source
package build::auto; use strict; use warnings; sub detect_native { my ($config, $defaults) = @_; # detect x64 on Windows so we can build the correct dyncall version if ($config->{cc} eq 'cl') { print ::dots(' auto-detecting x64 toolchain'); my $msg = `cl 2>&1`; if (defined $msg) { if ($msg =~ /x64/) { print "YES\n"; $defaults->{-thirdparty}->{dc}->{rule} = 'cd 3rdparty/dyncall && configure.bat /target-x64 && $(MAKE) -f Nmakefile'; } else { print "NO\n" } } else { ::softfail("could not run 'cl'"); print ::dots(' assuming x86'), "OK\n"; } } elsif ($defaults->{os} eq 'mingw32' && $defaults->{-toolchain} eq 'gnu') { print ::dots(' auto-detecting x64 toolchain'); my $cc = $config->{cc}; my $msg = `$cc -dumpmachine 2>&1`; if (defined $msg) { if ($msg =~ /x86_64/) { print "YES\n"; $defaults->{-thirdparty}->{dc}->{rule} = 'cd 3rdparty/dyncall && ./configure.bat /target-x64 /tool-gcc && $(MAKE) COMPILE.C=$$(COMPILE.c) -f Makefile.embedded mingw32'; } else { print "NO\n" } } else { ::softfail("could not run 'cl'"); print ::dots(' assuming x86'), "OK\n"; } } } sub detect_cross {} 42;