vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

vxrungcc (549B)


      1 #!/bin/sh
      2 
      3 # Find the -o or -c argument.
      4 iscc=0
      5 next=0
      6 out=a.out
      7 flags=""
      8 for i
      9 do
     10 	case "$next" in
     11 	1)
     12 		out="$i"
     13 		next=0
     14 		;;
     15 	esac
     16 	case "$i" in
     17 	-o)
     18 		next=1
     19 		;;
     20 	-c)
     21 		iscc=1
     22 		flags="-ggdb -mfp-ret-in-387"
     23 		;;
     24 	esac
     25 done
     26 
     27 case "$out" in
     28 /*)
     29 	;;
     30 *)
     31 	out="`pwd`/$out"
     32 	;;
     33 esac
     34 
     35 # Run regular gcc
     36 vx32-gcc $flags "$@" || exit $?
     37 
     38 case "$iscc" in
     39 1)
     40 	exit 0
     41 esac
     42 
     43 # Rename output to _output
     44 uout="`echo $out | sed 's!.*/!&_!'`"
     45 mv $out $uout
     46 
     47 # Write new output file 
     48 cat >$out <<EOF
     49 #!/bin/sh
     50 exec vxrun "$uout" "\$@"
     51 EOF
     52 chmod +x $out
     53 exit 0