You're getting confused by a few things:
which does not reflect aliases. So when you're trying to check if an alias was made, using
which won't help you. Run
alias without arguments instead; it'll show all the aliases in effect. Example:
bash: foo: command not found
anthony@Zia:~ [$?=127]$ alias foo='echo hi'
anthony@Zia:~$ which foo
Aliases affect the shell, not other things. When
eclipse, etc. attempt to run
gcc, shell aliases will not matter. You also can only export variables, not aliases. Here is an example (again with that foo alias) of perl trying to run it:
anthony@Zia:~$ perl -Mautodie=system -E 'system("foo")'
"foo" failed to start: "No such file or directory" at (eval 6) line 12.
at -e line 1
Most things that compile things run
c++, etc., not
gcc. So even if you had overridden
gcc, it probably wouldn't have worked.
So, how to accomplish this?
The best approach is to tell
make, etc. which compiler to use:
make CC=/path/to/myrtgcc target
You can also pass that in the environment when running
/.configure for programs that use autoconf.
The second approach is to create simple shell scripts called
cc, etc. in (for example)
~/bin and put that first in your path. The scripts would look something like this:
exec /path/to/myrtgcc "$@"
and you'd put them first in PATH using something like this in your