Initial work for G-code sender and more intensive usage of Boost
This commit is contained in:
parent
43cbad8867
commit
11dd67ab34
1649 changed files with 1860 additions and 1642 deletions
1
Build.PL
1
Build.PL
|
@ -7,6 +7,7 @@ use Config;
|
|||
use File::Spec;
|
||||
|
||||
my %prereqs = qw(
|
||||
Devel::CheckLib 0
|
||||
Encode::Locale 0
|
||||
ExtUtils::MakeMaker 6.80
|
||||
ExtUtils::ParseXS 3.22
|
||||
|
|
26
utils/send-gcode.pl
Normal file
26
utils/send-gcode.pl
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
}
|
||||
|
||||
use Slic3r;
|
||||
|
||||
my $serial = Slic3r::GCode::Sender->new($ARGV[0], $ARGV[1]);
|
||||
|
||||
$serial->send($ARGV[2]);
|
||||
|
||||
exit;
|
||||
|
||||
while (1) {
|
||||
$serial->send("1");
|
||||
sleep 1;
|
||||
$serial->send("0");
|
||||
sleep 1;
|
||||
}
|
||||
|
||||
__END__
|
37
xs/Build.PL
37
xs/Build.PL
|
@ -3,6 +3,7 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Devel::CheckLib;
|
||||
use ExtUtils::CppGuess;
|
||||
use Module::Build::WithXSpp;
|
||||
|
||||
|
@ -10,6 +11,39 @@ use Module::Build::WithXSpp;
|
|||
# HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC
|
||||
# NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace
|
||||
my @cflags = qw(-D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS);
|
||||
|
||||
my @INC = qw();
|
||||
my @LIBS = qw();
|
||||
|
||||
if (defined $ENV{BOOST_DIR}) {
|
||||
if (-d "$ENV{BOOST_DIR}/include") {
|
||||
push @INC, '-I' . $ENV{BOOST_DIR} . '/include';
|
||||
} else {
|
||||
push @INC, '-I' . $ENV{BOOST_DIR};
|
||||
}
|
||||
push @LIBS, '-L' . $ENV{BOOST_DIR};
|
||||
} else {
|
||||
push @INC, map "-I$_", grep { -d $_ }
|
||||
qw(/opt/local/include /usr/local/include /opt/include),
|
||||
qw(/usr/include C:/Boost/include);
|
||||
push @LIBS, map "-L$_", grep { -d $_ }
|
||||
qw(/opt/local/lib /usr/local/lib /opt/lib /usr/lib),
|
||||
qw(C:/Boost/lib /lib);
|
||||
}
|
||||
|
||||
push @INC, '-Iinclude';
|
||||
|
||||
my @boost_libs = qw(thread system);
|
||||
for my $pattern ('boost_%s', 'boost_%s-mt') {
|
||||
check_lib(
|
||||
lib => sprintf($pattern, 'system'),
|
||||
INC => join(' ', @INC),
|
||||
LIBS => join(' ', @LIBS),
|
||||
) or next;
|
||||
push @LIBS, map sprintf("-l$pattern", $_), @boost_libs;
|
||||
push @cflags, '-DBOOST_LIBS';
|
||||
last;
|
||||
}
|
||||
if ($ENV{SLIC3R_DEBUG}) {
|
||||
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
||||
push @cflags, qw(-DSLIC3R_DEBUG -g);
|
||||
|
@ -40,7 +74,8 @@ my $build = Module::Build::WithXSpp->new(
|
|||
Module::Build 0.38
|
||||
Module::Build::WithXSpp 0.13
|
||||
)},
|
||||
extra_compiler_flags => \@cflags,
|
||||
extra_compiler_flags => [ @INC, @cflags ],
|
||||
extra_linker_flags => \@LIBS,
|
||||
|
||||
# Provides extra C typemaps that are auto-merged
|
||||
extra_typemap_modules => {
|
||||
|
|
3303
xs/MANIFEST
3303
xs/MANIFEST
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue