Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Perl script to monkey-patch cortex-m4 math libraries into path for teensyduino (teensy 3.0)
#!/usr/bin/perl
use strict;
use warnings;
my @args = @ARGV;
my $real = $0 . ".real";
if (grep { /cortex.m/ } @args) {
my @new_args = grep { ! /^\-lm$/ } @args;
push @new_args, "-L/home/tobyc/git/arduino/lib", "-larm_cortexM4l_math", "-lm";
@args = @new_args;
}
system($real, @args);
exit($? >> 8);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment