hack around the gas requirement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like to submit a "patch", that isnt exactly a patch, but a utility
for compilation.

Some folks on solaris like to have gcc compiled with the native assembler,
but DO have 'gas' installed.

SOME nice programs that require gas, allow for
  "configure --with-gas=/path/to/gas"

But rather than adjusting a few dozen makefiles or whatever it takes
to use that sort of behaviour, here's another way:

Just set CC to be a wrapper script, instead of gcc.
[and fix winebuild to use 'gas' if in PATH, rather than naked 'as',
 perhaps?]

Here's the script that seems to work for the gcc wrapper.
I havent finished compiling the dang thing.. I didnt realize it would take
QUITE this long, and quite this much space. I'm going to sleep now :-)
But I wanted to email out the script now to the good folks out there in
the wired:

#!/bin/ksh -p
#wrapper script to make "normal" gcc act like a gcc with gas build-in.
#assuming that compilation of .c to .o uses   "gcc -c ... -o outfile ... *.c"

if [ "$1" = "gcc" ] ; then shift ; fi

case "$1" in
	-c)
		shift
	;;
	*)
		exec gcc "$@"
		exit
	;;
esac

gcc -S $*


while [[ "X$1" != "X-o" ]] ; do
	shift
	if [[ $# -eq 0 ]] ; then
		print ERROR: no -o found
		exit
	fi
done

shift

echo temp outfile is $1. Using gas on it
mv $1 $1.s
gas -o $1 $1.s



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux