Using Alternate Compilers
Tuesday, November 15th, 2005 ~ 10:49 pm
Users of Fedora Core 4, SuSE 10.0 and other distributions with GCC v4 may have found some open source softwares may not compile properly. Using alternate compilers may resolve the problem. FC4 also ships with GCC v3.2. There are many ways to specify alternate compilers during the build process, below are some ways.
Environment Variables
Most softwares support the
Configure Support
If the software is using the standard GNU automake and configure, then there is a chance it supports other compilers by passing in a setting to the to see if it mentions anything. The following example is from MPlayer:
Sometimes the software may just come with a
I am also providing some notes from my FC4 Guide on GCC and GCC Compatability Libraries.
Environment Variables
Most softwares support the
CC
and CXX
environment variables. First assign them, then run configure
or make
. Example:# export CC=gcc32 # export CXX=g++32 # ./configureA good example can be found on the Redhat Mailing List.
Configure Support
If the software is using the standard GNU automake and configure, then there is a chance it supports other compilers by passing in a setting to the
configure
script. First run configure --help
# ./configure --help # ./configure --cc=gcc32Makefile Support
Sometimes the software may just come with a
Makefile
. Open the Makefile
and look inside to see if there are variables that specify the compiler. You can either edit those variables or set them at compile time. For example:(in Makefile) C_COMPILER = cc CPLUSPLUS_COMPILER = c++Then using the makefile, you can run:
# make CPLUSPLUS_COMPILER=g++32Although the above examples are not exhaustive they should provide some ideas for using alternate compilers in Fedora Core and other Linux distributions.
I am also providing some notes from my FC4 Guide on GCC and GCC Compatability Libraries.
January 26th, 2006 at 11:28 pm # export CC=gcc32
# export CPP=g++32
# ./configure
Please note, it only worked for me when I used CXX (C++ compiler) instead of CPP (pre-processor).
Reference: http://www.mjmwired.net/linux/2005/11/15/using-alternate-compilers/