wiki:gcc

Version 4 (modified by thomas, 9 years ago) ( diff )

--

GCC

Zip and Unzip are needed for Java.

To get the ecj.jar file, for gcj, do this:

./contrib/download_ecj
mkdir -v /usr/share/java
mv -v ecj.jar /usr/share/java

and then add this:

--with-ecj-jar=/usr/share/java/ecj.jar --with-system-zlib

The libjava/configure script wants to use Which (/usr/bin/which), so install that too.


GDC

There is a language which aims to combine all the benefits of C, C++, C# and Java to one new language: D

Even there is a complete compiler at dlang.org there is also a project which builds a gcc frontend for D, the GDC project. The following section shows how to setup gcc to be able to compile D sources.
First, checkout the frontend sources. This step needs to be done only once as a tarball is created which contains all the sources. This is just to make playing with the frontend sources easier as they do not need to be checked out again and again:

git clone https://github.com/D-Programming-GDC/GDC.git &&
cd GDC &&
git checkout gdc-4.7 &&
rm -rf .git &&
rm .gitignore &&
cd .. &&
mv GDC gdc-4.7-<checkout-date> &&
tar -cJf gdc-4.7-<checkout-date>.tar.xz  gdc-4.7-<checkout-date>
rm -rf gdc-4.7-<checkout-date>

Replace <checkout-date> by the current date, for example gdc-4.7-20130119. Save the gdc-4.7-<checkout-date>.tar.xz for later use (if any). Build the gcc with D fronend enabled by following commands (assuming the tarballs ar one directory level above):

tar -xf ../gdc-4.7-<checkout-date>.tar.xz &&
tar -xf ../gcc-4.7.2.tar.bz2 &&
cd gdc-4.7-<checkout-date> &&
./setup-gcc.sh ../gcc-4.7.2 &&
cd ../gcc-4.7.2

Next, follow the BLFS instructions to rebuild gcc. Add d to the --enable-languages option. Than this reads for example --enable-languages=c,c++,fortran,java,objc,obj-c++,d. Also add --with-bugurl="http://gdcproject.org/bugzilla".

Please test this in a save environment as the instructions will overwrite the current (working) gcc with a new one. In case there is a bug, either in the instructions above or somewhere else, you may no longer be able to compile any other package.

So long, Thomas


Up
Top

Note: See TracWiki for help on using the wiki.