This week I have been busy working out how to use LLVM to compile Ada. It was a little difficult on the beginning because I had to install an old version of the Ada compiler (GNAT), and I didn't realize it a first. But after that it went a little smother. I asked on the llvm-dev list for some help, and Duncan Sands helped me out. Below is a description of what I had to do to install llvm-gcc with support for Ada.
- The build requires having a compiler that supports Ada, C and C++. The Ada front-end is written in Ada so an Ada compiler is needed to build it. Compilers known to work with the LLVM 2.4 release are gcc-4.2 and the 2005, 2006 and 2007 versions of the GNAT GPL Edition.
- So first thing is to do is download GNAT 2007. Download it from here.
- Export the download in a folder. Lets call it ada_folder. Then install it into
/build.
Now we need to get llvm-gcc. Lest call llvm-gcc_folder the folder where llvm-gcc is downloaded.
Make a build directory for llvm-gcc and make it the current directory:
mkdir build
cd build
Now we need to configure it.
export CXX=PATH_TO_C++_COMPILER
../configure --enable-languages=c,c++,fortran,ada --disable-bootstrap --disable-nls --disable-multilib --enable-checking --program-prefix=llvm- --prefix=
Before we build the compiler we need to put gnat2007 in our classpath. Only while we build it, we can change it later.
Build and install the compiler:
make install
Now we need to change the PATH:
No comments:
Post a Comment