Skip to content

Instantly share code, notes, and snippets.

@nevsan
Created August 27, 2012 19:29
Show Gist options
  • Save nevsan/3491555 to your computer and use it in GitHub Desktop.
Save nevsan/3491555 to your computer and use it in GitHub Desktop.
Octave patch (pass compiler arguments to mkoctfile)
diff --git a/src/mkoctfile.in b/src/mkoctfile.in
index 7a9e66f..5b28974 100644
--- a/src/mkoctfile.in
+++ b/src/mkoctfile.in
@@ -213,6 +213,10 @@ Options:
-W... Pass flags to the compiler such as -Wa,OPTION.
+ -f..., -m... Pass flags to the compiler, e.g. -ffast-math -march=native
+
+ -P:<OPTION> Pass arbitrary <OPTION> to the compiler
+
-Wl,... Pass flags to the linker such as -Wl,-rpath=...
-M, --depend Generate dependency files (.d) for C and C++
@@ -340,9 +344,12 @@ EOF
incflags="$incflags -I."
output_ext=".mex"
;;
- -W*)
+ -[Wfm]*)
pass_on_options="$pass_on_options $1"
;;
+ -P:*)
+ pass_on_options="$pass_on_options `echo $1 | $SED 's,-P:,,'`"
+ ;;
*)
echo "mkoctfile: unrecognized argument $1" 1>&2
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment