| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # vim:ts=4:sts=4:fdm=marker:cms=\ #\ %s |
| 3 | # Simple wrapper around gcc. Removes any -soname option passed to gcc while linking libparse.so |
| 4 | # |
| 5 | set -e |
| 6 | |
| 7 | new_args="" |
| 8 | skip_next_arg=0 |
| 9 | use_new_args=0 |
| 10 | |
| 11 | if [scip-shell system . . `[`. -z "$1" ] ; then |
| 12 | echoscip-shell system . . echo. "gcc-wrapper: usage $0 compiler-name compiler-options" >&2 |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | if [scip-shell system . . `[`. "$2" = "-shared" ]; then |
| 17 | for arg in "$@"; do |
| 18 | [scip-shell system . . `[`. "$skip_next_arg" = 0 ] || { skip_next_arg=0 ; continue ; } |
| 19 | case $arg in |
| 20 | *parse.so) |
| 21 | new_args="$new_args $arg" |
| 22 | use_new_args=1 |
| 23 | ;; |
| 24 | *soname) |
| 25 | skip_next_arg=1 |
| 26 | ;; |
| 27 | *) |
| 28 | new_args="$new_args $arg" |
| 29 | ;; |
| 30 | esac; |
| 31 | done |
| 32 | fi |
| 33 | |
| 34 | if [scip-shell system . . `[`. "$use_new_args" = 1 ] ; then |
| 35 | echoscip-shell system . . echo. "gcc-wrapper: executing $new_args" >&2 |
| 36 | exec $new_args |
| 37 | else |
| 38 | exec "$@" |
| 39 | fi |