Skip to content

Instantly share code, notes, and snippets.

@TJC
Created May 23, 2013 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TJC/5633484 to your computer and use it in GitHub Desktop.
Save TJC/5633484 to your computer and use it in GitHub Desktop.
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