xref: /isa-l_crypto/tools/nasm-filter.sh (revision d2c8615007940417abef3e531c3468da8bd301f3)
1#!/bin/sh
2
3# Filter out unnecessary options added by automake
4
5while [ -n "$*" ]; do
6    case "$1" in
7	-f | -o | -D )
8	    # Supported options with arg
9	    options="$options $1 $2"
10	    shift
11	    shift
12	    ;;
13	-I | -i )
14	    options="$options $1 $2/"
15	    shift
16	    shift
17	    ;;
18	--prefix* )
19	    # Supported options without arg
20	    options="$options $1"
21	    shift
22	    ;;
23	-I* | -i* )
24	    options="$options $1/"
25	    shift
26	    ;;
27	-D* ) # For defines we need to remove spaces
28	    case "$1" in
29		*' '* ) ;;
30		*) options="$options $1" ;;
31	    esac
32	    shift
33	    ;;
34	#-blah )
35	# Unsupported options with args - none known
36	-* )
37	    # Unsupported options with no args
38	    shift
39	    ;;
40	* )
41	    args="$args $1"
42	    shift
43	    ;;
44    esac
45done
46
47nasm $options $args
48