Discussion:
Changing default gcc?
(too old to reply)
Usenet User
2007-03-20 18:24:01 UTC
Permalink
Platform: Ubuntu 6.10 (intel)
gcc: 4.1

Need to compile a large package (cross-compiler for arm) using an
older version of gcc (2.95, preferably). How do I switch to that
version?

I installed gcc-2.95 via Synaptic Package Manager, but what now?

Tried to use /usr/sbin/update-alternatives, but it does not allow for
that.

Any suggestions?

TIA!
Martin Vuille
2007-03-20 18:54:00 UTC
Permalink
Post by Usenet User
Platform: Ubuntu 6.10 (intel)
gcc: 4.1
Need to compile a large package (cross-compiler for arm) using
an older version of gcc (2.95, preferably). How do I switch to
that version?
Might depend on the specifics of the package that you want to
compile, but you can usually set environment variables to point the
Makefile to the right compiler: CC for the path to the C compiler,
CXX for the path to the C++ compiler, LDFLAGS for ld options, etc.

You may have to be careful about ensuring that the right set
of libraries are used in linking. That might mean disabling the
linking to the default libraries and explicitly enumerating the
libraries that correspond to the compiler version.

MV
--
I do not want replies; please follow-up to the group.
Usenet User
2007-03-20 18:59:18 UTC
Permalink
Post by Martin Vuille
Post by Usenet User
Platform: Ubuntu 6.10 (intel)
gcc: 4.1
Need to compile a large package (cross-compiler for arm) using
an older version of gcc (2.95, preferably). How do I switch to
that version?
Might depend on the specifics of the package that you want to
compile, but you can usually set environment variables to point the
Makefile to the right compiler: CC for the path to the C compiler,
CXX for the path to the C++ compiler, LDFLAGS for ld options, etc.
You may have to be careful about ensuring that the right set
of libraries are used in linking. That might mean disabling the
linking to the default libraries and explicitly enumerating the
libraries that correspond to the compiler version.
MV
I've heard of that, but the package is huge. Changing every Makefile
is a long story. Any way to do just a global switch?

Thanks!
Martin Vuille
2007-03-20 19:25:37 UTC
Permalink
Post by Usenet User
I've heard of that, but the package is huge. Changing every
Makefile is a long story. Any way to do just a global switch?
If the package supports the variables I mentioned earlier (or similar
ones) then you wouldn't have to change the Makefiles. You would
simply set their value in the environment or pass them as options to
the make or configure command.

Does the package include a README, INSTALL or similar file? Does it
say anything about this?

Does the package require you to run a script called "configure" as
the first step to building it? If so, then you may be able to do the
following:

./configure CC=whatever LDFLAGS=whatever (and so forth)

MV
--
I do not want replies; please follow-up to the group.
Usenet User
2007-03-20 20:49:28 UTC
Permalink
Post by Martin Vuille
If the package supports the variables I mentioned earlier (or similar
ones) then you wouldn't have to change the Makefiles. You would
simply set their value in the environment or pass them as options to
the make or configure command.
Does the package include a README, INSTALL or similar file? Does it
say anything about this?
Does the package require you to run a script called "configure" as
the first step to building it? If so, then you may be able to do the
./configure CC=whatever LDFLAGS=whatever (and so forth)
MV
That could help. Yet may take a while. I am quite new to all this, and
there a lot of settings to consider.
Martin Vuille
2007-03-20 23:08:01 UTC
Permalink
Post by Usenet User
That could help. Yet may take a while. I am quite new to all
this, and there a lot of settings to consider.
Perhaps there is a mailing list or a help forum
where users of this package can get help?

MV
--
I do not want replies; please follow-up to the group.
Usenet User
2007-03-21 18:59:27 UTC
Permalink
Post by Martin Vuille
Post by Usenet User
That could help. Yet may take a while. I am quite new to all
this, and there a lot of settings to consider.
Perhaps there is a mailing list or a help forum
where users of this package can get help?
MV
Yep, I figured this out. CC=<compiler to use> does the trick.
Thanks again!

Continue reading on narkive:
Loading...