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