summaryrefslogtreecommitdiffstats
path: root/src/isa-l/tools/nasm-filter.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/isa-l/tools/nasm-filter.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/isa-l/tools/nasm-filter.sh b/src/isa-l/tools/nasm-filter.sh
new file mode 100755
index 000000000..5ec9ba3f3
--- /dev/null
+++ b/src/isa-l/tools/nasm-filter.sh
@@ -0,0 +1,47 @@
+#/bin/sh
+
+# Filter out unnecessary options added by automake
+
+while [ -n "$*" ]; do
+ case "$1" in
+ -f | -o | -D )
+ # Supported options with arg
+ options="$options $1 $2"
+ shift
+ shift
+ ;;
+ -I | -i )
+ options="$options $1 $2/"
+ shift
+ shift
+ ;;
+ --prefix* )
+ # Supported options without arg
+ options="$options $1"
+ shift
+ ;;
+ -I* | -i* )
+ options="$options $1/"
+ shift
+ ;;
+ -D* ) # For defines we need to remove spaces
+ case "$1" in
+ *' '* ) ;;
+ *) options="$options $1" ;;
+ esac
+ shift
+ ;;
+ #-blah )
+ # Unsupported options with args - none known
+ -* )
+ # Unsupported options with no args
+ shift
+ ;;
+ * )
+ args="$args $1"
+ shift
+ ;;
+ esac
+done
+
+nasm $options $args