1.2. AVR-GCC

1.2.1. Downloading the Source

Warning:This section is being rewritten. Ignore it for now.

The gcc source archive, used in preparing this document, is version 2.95.2. You also need to apply AVR-specific patches.[1] The three files can be downloaded using the URLs in Table 1-1. Create a directory in which to build the tools and put the downloaded files in it. You are now ready to build the utilities.

1.2.2. Building the Project

The first step is to pull the source from the archive and apply the patches to the code.

    % tar zxf gcc-core-2.95.2.tar.gz
    % cd gcc-2.95.2
    % gunzip -dc ../gcc-core-2.95.2-avr-patch-1.1.gz | patch -p1

The next step is to configure and build the compiler. This is done by supplying arguments to the configure script that enable the AVR-specific options and then making the project.

    % configure --target=avr \
        --prefix=/usr/local/avr \
        --disable-nls \
        --enable-languages=c
    % make

I specify the same installation directory as the binutils. Also, since there is little C++ support (in the case of standard libraries), I only build the C compiler.

1.2.3. Installing the Tools

If the compiler was built cleanly, you're ready to install it. To install:

    % make install

Notes

[1]

Again, the AVR patches have been committed to the GNU project, so future releases will have AVR support built-in.