changeset 12662:2c54fde0f397 stable

Fix passing compiler options to mkoctfile * mkoctfile.in: Only pass the part after -W to the compiler, plus add a comma for consistency with -Wl option. * mkoctfile.m: Document the change.
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Wed, 11 May 2011 00:23:46 -0500
parents 9f91ca870f91
children 48b9e8344a03 aa3ba343a76f
files mkoctfile.in scripts/miscellaneous/mkoctfile.m
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mkoctfile.in
+++ b/mkoctfile.in
@@ -336,8 +336,8 @@
       incflags="$incflags -I."
       output_ext=".mex"
     ;;
-    -W*)
-      pass_on_options="$pass_on_options $1"
+    -W,*)
+      pass_on_options="$pass_on_options ${1:3}"
     ;;
     *)
       echo "mkoctfile: unrecognized argument $1" 1>&2
--- a/scripts/miscellaneous/mkoctfile.m
+++ b/scripts/miscellaneous/mkoctfile.m
@@ -51,12 +51,13 @@
 ## Add the run-time path to the link command.
 ##
 ## @item -Wl,@dots{}
-## Pass flags though the linker like "-Wl,-rpath=@dots{}".
+## Pass flags through the linker e.g. "-Wl,-rpath=@dots{}".
 ## The quotes are needed since commas are interpreted as command
 ## separators.
 ##
-## @item -W@dots{}
-## Pass flags though the compiler like "-Wa,OPTION".
+## @item -W,@dots{}
+## Pass flags through the compiler, e.g. "-W,-O2". The quotes are needed
+## since commas are interpreted as command separators.
 ##
 ## @item -c
 ## Compile but do not link.