You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
727 lines
36 KiB
HTML
727 lines
36 KiB
HTML
4 years ago
|
<!-- HTML header for doxygen 1.8.7-->
|
||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||
|
<meta name="generator" content="Doxygen 1.6.3"/>
|
||
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: Building and Installing the GNU Tool Chain</title><!--END PROJECT_NAME-->
|
||
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: Building and Installing the GNU Tool Chain</title><!--END !PROJECT_NAME-->
|
||
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||
|
$treeview
|
||
|
$search
|
||
|
$mathjax
|
||
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||
|
$extrastylesheet
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
|
|
||
|
<!--BEGIN TITLEAREA-->
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<!--BEGIN PROJECT_LOGO-->
|
||
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
||
|
<!--END PROJECT_LOGO-->
|
||
|
<!--BEGIN PROJECT_NAME-->
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectname">avr-libc
|
||
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
||
|
</div>
|
||
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
||
|
</td>
|
||
|
<!--END PROJECT_NAME-->
|
||
|
<!--BEGIN !PROJECT_NAME-->
|
||
|
<!--BEGIN PROJECT_BRIEF-->
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectbrief">$projectbrief</div>
|
||
|
</td>
|
||
|
<!--END PROJECT_BRIEF-->
|
||
|
<!--END !PROJECT_NAME-->
|
||
|
<!--BEGIN DISABLE_INDEX-->
|
||
|
<!--BEGIN SEARCHENGINE-->
|
||
|
<td>$searchbox</td>
|
||
|
<!--END SEARCHENGINE-->
|
||
|
<!--END DISABLE_INDEX-->
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<table>
|
||
|
<tr>
|
||
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
||
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
||
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<!--END TITLEAREA-->
|
||
|
<!-- end header part -->
|
||
|
<!-- Generated by Doxygen 1.6.3 -->
|
||
|
<script type="text/javascript"><!--
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
--></script>
|
||
|
<div class="contents">
|
||
|
|
||
|
|
||
|
<h1><a class="anchor" id="install_tools">Building and Installing the GNU Tool Chain </a></h1><p><a name="installation"></a></p>
|
||
|
<p>This chapter shows how to build and install, from source code, a complete development environment for the AVR processors using the GNU toolset. There are two main sections, one for Linux, FreeBSD, and other Unix-like operating systems, and another section for Windows.</p>
|
||
|
<h2><a class="anchor" id="install_unix">
|
||
|
Building and Installing under Linux, FreeBSD, and Others</a></h2>
|
||
|
<p>The default behaviour for most of these tools is to install every thing under the <code>/usr/local</code> directory. In order to keep the AVR tools separate from the base system, it is usually better to install everything into <code>/usr/local/avr</code>. If the <code>/usr/local/avr</code> directory does not exist, you should create it before trying to install anything. You will need <code>root</code> access to install there. If you don't have root access to the system, you can alternatively install in your home directory, for example, in <code>$HOME/local/avr</code>. Where you install is a completely arbitrary decision, but should be consistent for all the tools.</p>
|
||
|
<p>You specify the installation directory by using the <code>--prefix=dir</code> option with the <code>configure</code> script. It is important to install all the AVR tools in the same directory or some of the tools will not work correctly. To ensure consistency and simplify the discussion, we will use <code>$PREFIX</code> to refer to whatever directory you wish to install in. You can set this as an environment variable if you wish as such (using a Bourne-like shell):</p>
|
||
|
<p><a name="24PREFIX"></a> <a name="2d2dprefix"></a> </p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ PREFIX=$HOME/local/avr
|
||
|
$ export PREFIX
|
||
|
</pre></div><p><a name="24PATH"></a> <a class="anchor" id="path"></a> </p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>Be sure that you have your <code>PATH</code> environment variable set to search the directory you install everything in <em>before</em> you start installing anything. For example, if you use <code>--prefix=$PREFIX</code>, you must have <code>$PREFIX/bin</code> in your exported <code>PATH</code>. As such:</dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ PATH=$PATH:$PREFIX/bin
|
||
|
$ export PATH
|
||
|
</pre></div><dl class="warning"><dt><b>Warning:</b></dt><dd>If you have <code>CC</code> set to anything other than <code>avr-gcc</code> in your environment, this will cause the configure script to fail. It is best to not have <code>CC</code> set at all.</dd></dl>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>It is usually the best to use the latest released version of each of the tools.</dd></dl>
|
||
|
<h2><a class="anchor" id="required_tools">
|
||
|
Required Tools</a></h2>
|
||
|
<p><a name="tools2c_required"></a></p>
|
||
|
<ul>
|
||
|
<li><b>GNU Binutils</b><br/>
|
||
|
<a href="http://sources.redhat.com/binutils/">http://sources.redhat.com/binutils/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_avr_binutils">Installation</a></li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>GCC</b><br/>
|
||
|
<a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_avr_gcc">Installation</a></li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>AVR LibC</b><br/>
|
||
|
<a href="http://savannah.gnu.org/projects/avr-libc/">http://savannah.gnu.org/projects/avr-libc/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_avr_libc">Installation</a><br/>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<h2><a class="anchor" id="optional_tools">
|
||
|
Optional Tools</a></h2>
|
||
|
<p><a name="tools2c_optional"></a></p>
|
||
|
<p>You can develop programs for AVR devices without the following tools. They may or may not be of use for you.</p>
|
||
|
<ul>
|
||
|
<li><b>AVRDUDE</b><br/>
|
||
|
<a href="http://savannah.nongnu.org/projects/avrdude/">http://savannah.nongnu.org/projects/avrdude/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_avrprog">Installation</a> <br/>
|
||
|
<a class="el" href="using__avrprog.html">Usage Notes</a></li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>GDB</b><br/>
|
||
|
<a href="http://sources.redhat.com/gdb/">http://sources.redhat.com/gdb/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_gdb">Installation</a><br/>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>SimulAVR</b><br/>
|
||
|
<a href="http://savannah.gnu.org/projects/simulavr/">http://savannah.gnu.org/projects/simulavr/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_simulavr">Installation</a></li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>AVaRICE</b><br/>
|
||
|
<a href="http://avarice.sourceforge.net/">http://avarice.sourceforge.net/</a> <br/>
|
||
|
<a class="el" href="install__tools.html#install_avarice">Installation</a><br/>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<h2><a class="anchor" id="install_avr_binutils">
|
||
|
GNU Binutils for the AVR target</a></h2>
|
||
|
<p><a name="installation2c_binutils"></a></p>
|
||
|
<p>The <code><b>binutils</b></code> package provides all the low-level utilities needed in building and manipulating object files. Once installed, your environment will have an AVR assembler (<code>avr-as</code>), linker (<code>avr-ld</code>), and librarian (<code>avr-ar</code> and <code>avr-ranlib</code>). In addition, you get tools which extract data from object files (<code>avr-objcopy</code>), dissassemble object file information (<code>avr-objdump</code>), and strip information from object files (<code>avr-strip</code>). Before we can build the C compiler, these tools need to be in place.</p>
|
||
|
<p>Download and unpack the source files:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ bunzip2 -c binutils-<version>.tar.bz2 | tar xf -
|
||
|
$ cd binutils-<version>
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>Replace <code><version></code> with the version of the package you downloaded.</dd>
|
||
|
<dd>
|
||
|
If you obtained a gzip compressed file (.gz), use <code>gunzip</code> instead of <code>bunzip2</code>.</dd></dl>
|
||
|
<p>It is usually a good idea to configure and build <code><b>binutils</b></code> in a subdirectory so as not to pollute the source with the compiled files. This is recommended by the <code><b>binutils</b></code> developers.</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
</pre></div><p>The next step is to configure and build the tools. This is done by supplying arguments to the <code>configure</code> script that enable the AVR-specific options.</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ ../configure --prefix=$PREFIX --target=avr --disable-nls
|
||
|
</pre></div><p>If you don't specify the <code>--prefix</code> option, the tools will get installed in the <code>/usr/local</code> hierarchy (i.e. the binaries will get installed in <code>/usr/local/bin</code>, the info pages get installed in <code>/usr/local/info</code>, etc.) Since these tools are changing frequently, It is preferrable to put them in a location that is easily removed.</p>
|
||
|
<p>When <code>configure</code> is run, it generates a lot of messages while it determines what is available on your operating system. When it finishes, it will have created several <code>Makefile</code>s that are custom tailored to your platform. At this point, you can build the project.</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ make
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>BSD users should note that the project's <code>Makefile</code> uses GNU <code>make</code> syntax. This means FreeBSD users may need to build the tools by using <code>gmake</code>.</dd></dl>
|
||
|
<p>If the tools compiled cleanly, you're ready to install them. If you specified a destination that isn't owned by your account, you'll need <code>root</code> access to install them. To install:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ make install
|
||
|
</pre></div><p>You should now have the programs from binutils installed into <code>$PREFIX/bin</code>. Don't forget to <a class="el" href="install__tools.html#path">set your PATH</a> environment variable before going to build avr-gcc.</p>
|
||
|
<h2><a class="anchor" id="install_avr_gcc">
|
||
|
GCC for the AVR target</a></h2>
|
||
|
<p><a name="installation2c_gcc"></a></p>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>You <em><b>must</b></em> install <a class="el" href="install__tools.html#install_avr_binutils">avr-binutils</a> and make sure your <a class="el" href="install__tools.html#path">path is set</a> properly before installing avr-gcc.</dd></dl>
|
||
|
<p>The steps to build <code>avr-gcc</code> are essentially same as for <a class="el" href="install__tools.html#install_avr_binutils">binutils</a>:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ bunzip2 -c gcc-<version>.tar.bz2 | tar xf -
|
||
|
$ cd gcc-<version>
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ \
|
||
|
--disable-nls --disable-libssp --with-dwarf2
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><p>To save your self some download time, you can alternatively download only the <code>gcc-core-<version>.tar.bz2</code> and <code>gcc-c++-<version>.tar.bz2</code> parts of the gcc. Also, if you don't need C++ support, you only need the core part and should only enable the C language support. (Starting with GCC 4.7 releases, these split files are no longer available though.)</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>Early versions of these tools did not support C++.</dd>
|
||
|
<dd>
|
||
|
The stdc++ libs are not included with C++ for AVR due to the size limitations of the devices.</dd></dl>
|
||
|
<h2><a class="anchor" id="install_avr_libc">
|
||
|
AVR LibC</a></h2>
|
||
|
<p><a name="installation2c_avr2dlibc"></a></p>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>You <em><b>must</b></em> install <a class="el" href="install__tools.html#install_avr_binutils">avr-binutils</a>, <a class="el" href="install__tools.html#install_avr_gcc">avr-gcc</a> and make sure your <a class="el" href="install__tools.html#path">path is set</a> properly before installing avr-libc.</dd></dl>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>If you have obtained the latest avr-libc from cvs, you will have to run the <code>bootstrap</code> script before using either of the build methods described below.</dd></dl>
|
||
|
<p>To build and install avr-libc:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ gunzip -c avr-libc-<version>.tar.gz | tar xf -
|
||
|
$ cd avr-libc-<version>
|
||
|
$ ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><p>Optionally, generation of debug information can be requested with:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ gunzip -c avr-libc-<version>.tar.gz | tar xf -
|
||
|
$ cd avr-libc-<version>
|
||
|
$ ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr \
|
||
|
--with-debug-info=DEBUG_INFO
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><p>where <code>DEBUG_INFO</code> can be one of <code>stabs</code>, <code>dwarf-2</code>, or <code>dwarf-4</code>.</p>
|
||
|
<p>The default is to not generate any debug information, which is suitable for binary distributions of avr-libc, where the user does not have the source code installed the debug information would refer to.</p>
|
||
|
<h2><a class="anchor" id="install_avrprog">
|
||
|
AVRDUDE</a></h2>
|
||
|
<p><a name="installation2c_avrprog"></a> <a name="installation2c_avrdude"></a></p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>It has been ported to windows (via MinGW or cygwin), Linux and Solaris. Other Unix systems should be trivial to port to.</dd></dl>
|
||
|
<p><code><b>avrdude</b></code> is part of the FreeBSD ports system. To install it, simply do the following:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
# cd /usr/ports/devel/avrdude
|
||
|
# make install
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>Installation into the default location usually requires root permissions. However, running the program only requires access permissions to the appropriate <code>ppi(4)</code> device.</dd></dl>
|
||
|
<p>Building and installing on other systems should use the <code>configure</code> system, as such:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ gunzip -c avrdude-<version>.tar.gz | tar xf -
|
||
|
$ cd avrdude-<version>
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
$ ../configure --prefix=$PREFIX
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><h2><a class="anchor" id="install_gdb">
|
||
|
GDB for the AVR target</a></h2>
|
||
|
<p><a name="Installation2c_gdb"></a></p>
|
||
|
<p>GDB also uses the <code>configure</code> system, so to build and install:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ bunzip2 -c gdb-<version>.tar.bz2 | tar xf -
|
||
|
$ cd gdb-<version>
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
$ ../configure --prefix=$PREFIX --target=avr
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>If you are planning on using <code>avr-gdb</code>, you will probably want to install either <a class="el" href="install__tools.html#install_simulavr">simulavr</a> or <a class="el" href="install__tools.html#install_avarice">avarice</a> since avr-gdb needs one of these to run as a a remote target backend.</dd></dl>
|
||
|
<h2><a class="anchor" id="install_simulavr">
|
||
|
SimulAVR</a></h2>
|
||
|
<p><a name="installation2c_simulavr"></a></p>
|
||
|
<p>SimulAVR also uses the <code>configure</code> system, so to build and install:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ gunzip -c simulavr-<version>.tar.gz | tar xf -
|
||
|
$ cd simulavr-<version>
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
$ ../configure --prefix=$PREFIX
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>You might want to have already installed <a class="el" href="install__tools.html#install_avr_binutils">avr-binutils</a>, <a class="el" href="install__tools.html#install_avr_gcc">avr-gcc</a> and <a class="el" href="install__tools.html#install_avr_libc">avr-libc</a> if you want to have the test programs built in the simulavr source.</dd></dl>
|
||
|
<h2><a class="anchor" id="install_avarice">
|
||
|
AVaRICE</a></h2>
|
||
|
<p><a name="installation2c_avarice"></a></p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>These install notes are not applicable to avarice-1.5 or older. You probably don't want to use anything that old anyways since there have been many improvements and bug fixes since the 1.5 release.</dd></dl>
|
||
|
<p>AVaRICE also uses the <code>configure</code> system, so to build and install:</p>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ gunzip -c avarice-<version>.tar.gz | tar xf -
|
||
|
$ cd avarice-<version>
|
||
|
$ mkdir obj-avr
|
||
|
$ cd obj-avr
|
||
|
$ ../configure --prefix=$PREFIX
|
||
|
$ make
|
||
|
$ make install
|
||
|
</pre></div><dl class="note"><dt><b>Note:</b></dt><dd>AVaRICE uses the BFD library for accessing various binary file formats. You may need to tell the configure script where to find the lib and headers for the link to work. This is usually done by invoking the configure script like this (Replace <code><hdr_path></code> with the path to the <code>bfd.h</code> file on your system. Replace <code><lib_path></code> with the path to <code>libbfd.a</code> on your system.):</dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">
|
||
|
$ CPPFLAGS=-I<hdr_path> LDFLAGS=-L<lib_path> ../configure --prefix=$PREFIX
|
||
|
</pre></div><h2><a class="anchor" id="install_windows">
|
||
|
Building and Installing under Windows</a></h2>
|
||
|
<p>Building and installing the toolchain under Windows requires more effort because all of the tools required for building, and the programs themselves, are mainly designed for running under a POSIX environment such as Unix and Linux. Windows does not natively provide such an environment.</p>
|
||
|
<p>There are two projects available that provide such an environment, Cygwin and MinGW. There are advantages and disadvantages to both. Cygwin provides a very complete POSIX environment that allows one to build many Linux based tools from source with very little or no source modifications. However, POSIX functionality is provided in the form of a DLL that is linked to the application. This DLL has to be redistributed with your application and there are issues if the Cygwin DLL already exists on the installation system and different versions of the DLL. On the other hand, MinGW can compile code as native Win32 applications. However, this means that programs designed for Unix and Linux (i.e. that use POSIX functionality) will not compile as MinGW does not provide that POSIX layer for you. Therefore most programs that compile on both types of host systems, usually must provide some sort of abstraction layer to allow an application to be built cross-platform.</p>
|
||
|
<p>MinGW does provide somewhat of a POSIX environment, called MSYS, that allows you to build Unix and Linux applications as they woud normally do, with a <code>configure</code> step and a <code>make</code> step. Cygwin also provides such an environment. This means that building the AVR toolchain is very similar to how it is built in Linux, described above. The main differences are in what the PATH environment variable gets set to, pathname differences, and the tools that are required to build the projects under Windows. We'll take a look at the tools next.</p>
|
||
|
<h2><a class="anchor" id="install_windows_tools">
|
||
|
Tools Required for Building the Toolchain for Windows</a></h2>
|
||
|
<p>These are the tools that are currently used to build an AVR tool chain. This list may change, either the version of the tools, or the tools themselves, as improvements are made.</p>
|
||
|
<ul>
|
||
|
<li><b>MinGW</b><br/>
|
||
|
Download the MinGW Automated Installer, 20100909 (or later) <<a href="http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download">http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download</a>><ul>
|
||
|
<li>Run mingw-get-inst-20100909.exe</li>
|
||
|
<li>In the installation wizard, keep the default values and press the "Next" button for all installer pages except for the pages explicitly listed below.</li>
|
||
|
<li>In the installer page "Repository Catalogues", select the "Download latest
|
||
|
repository catalogues" radio button, and press the "Next" button</li>
|
||
|
<li>In the installer page "License Agreement", select the "I accept the agreement" radio button, and press the "Next" button</li>
|
||
|
<li>In the installer page "Select Components", be sure to select these items:<ul>
|
||
|
<li>C compiler (default checked)</li>
|
||
|
<li>C++ compiler</li>
|
||
|
<li>Ada compiler</li>
|
||
|
<li>MinGW Developer Toolkit (which includes "MSYS Basic System").</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Install.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>Install Cygwin</b><br/>
|
||
|
<ul>
|
||
|
<li>Install everything, all users, UNIX line endings. This will take a *long* time. A fat internet pipe is highly recommended. It is also recommended that you download all to a directory first, and then install from that directory to your machine.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>GMP, MPFR, and MPC are required to build GCC. </dd>
|
||
|
<dd>
|
||
|
GMP is a prequisite for building MPFR. Build GMP first. </dd>
|
||
|
<dd>
|
||
|
MPFR is a prerequisite for building MPC. Build MPFR second.</dd></dl>
|
||
|
<ul>
|
||
|
<li><b>Build GMP for MinGW</b><br/>
|
||
|
<ul>
|
||
|
<li>Latest Version</li>
|
||
|
<li><<a href="http://gmplib.org/">http://gmplib.org/</a>></li>
|
||
|
<li>Build script: <div class="fragment"><pre class="fragment">
|
||
|
./configure 2>&1 | tee gmp-configure.log
|
||
|
make 2>&1 | tee gmp-make.log
|
||
|
make check 2>&1 | tee gmp-make-check.log
|
||
|
make install 2>&1 | tee gmp-make-install.log
|
||
|
</pre></div></li>
|
||
|
<li>GMP headers will be installed under /usr/local/include and library installed under /usr/local/lib.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>Build MPFR for MinGW</b><br/>
|
||
|
<ul>
|
||
|
<li>Latest Version</li>
|
||
|
<li><<a href="http://www.mpfr.org/">http://www.mpfr.org/</a>></li>
|
||
|
<li>Build script: <div class="fragment"><pre class="fragment">
|
||
|
./configure --with-gmp=/usr/local --disable-shared 2>&1 | tee mpfr-configure.log
|
||
|
make 2>&1 | tee mpfr-make.log
|
||
|
make check 2>&1 | tee mpfr-make-check.log
|
||
|
make install 2>&1 | tee mpfr-make-install.log
|
||
|
</pre></div></li>
|
||
|
<li>MPFR headers will be installed under /usr/local/include and library installed under /usr/local/lib.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>Build MPC for MinGW</b><br/>
|
||
|
<ul>
|
||
|
<li>Latest Version</li>
|
||
|
<li><<a href="http://www.multiprecision.org/">http://www.multiprecision.org/</a>></li>
|
||
|
<li>Build script: <div class="fragment"><pre class="fragment">
|
||
|
./configure --with-gmp=/usr/local --with-mpfr=/usr/local --disable-shared 2>&1 | tee mpfr-configure.log
|
||
|
make 2>&1 | tee mpfr-make.log
|
||
|
make check 2>&1 | tee mpfr-make-check.log
|
||
|
make install 2>&1 | tee mpfr-make-install.log
|
||
|
</pre></div></li>
|
||
|
<li>MPFR headers will be installed under /usr/local/include and library installed under /usr/local/lib.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>Doxygen is required to build AVR-LibC documentation.<ul>
|
||
|
<li><b>Install Doxygen</b><br/>
|
||
|
<ul>
|
||
|
<li>Version 1.7.2</li>
|
||
|
<li><<a href="http://www.stack.nl/~dimitri/doxygen/">http://www.stack.nl/~dimitri/doxygen/</a>></li>
|
||
|
<li>Download and install.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dd>
|
||
|
NetPBM is required to build graphics in the AVR-LibC documentation.<ul>
|
||
|
<li><b>Install NetPBM</b><br/>
|
||
|
<ul>
|
||
|
<li>Version 10.27.0</li>
|
||
|
<li>From the GNUWin32 project: <<a href="http://gnuwin32.sourceforge.net/packages.html">http://gnuwin32.sourceforge.net/packages.html</a>></li>
|
||
|
<li>Download and install.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dd>
|
||
|
fig2dev is required to build graphics in the AVR-LibC documentation.<ul>
|
||
|
<li><b>Install fig2dev</b><br/>
|
||
|
<ul>
|
||
|
<li>Version 3.2 patchlevel 5c</li>
|
||
|
<li>From WinFig 4.62: <<a href="http://www.schmidt-web-berlin.de/winfig/">http://www.schmidt-web-berlin.de/winfig/</a>></li>
|
||
|
<li>Download the zip file version of WinFig</li>
|
||
|
<li>Unzip the download file and install fig2dev.exe in a location of your choice, somewhere in the PATH.</li>
|
||
|
<li>You may have to unzip and install related DLL files for fig2dev. In the version above, you have to install QtCore4.dll and QtGui4.dll.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dd>
|
||
|
MikTeX is required to build various documentation.<ul>
|
||
|
<li><b>Install MiKTeX</b><br/>
|
||
|
<ul>
|
||
|
<li>Version 2.9</li>
|
||
|
<li><<a href="http://miktex.org/">http://miktex.org/</a>></li>
|
||
|
<li>Download and install.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</dd>
|
||
|
<dd>
|
||
|
Ghostscript is required to build various documentation.<ul>
|
||
|
<li><b>Install Ghostscript</b><br/>
|
||
|
<ul>
|
||
|
<li>Version 9.00</li>
|
||
|
<li><<a href="http://www.ghostscript.com">http://www.ghostscript.com</a>></li>
|
||
|
<li>Download and install.</li>
|
||
|
<li>In the \bin subdirectory of the installaion, copy gswin32c.exe to gs.exe.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</dd></dl>
|
||
|
<ul>
|
||
|
<li>Set the TEMP and TMP environment variables to <b>c:\temp</b> or to the short filename version. This helps to avoid NTVDM errors during building.</li>
|
||
|
</ul>
|
||
|
<h2><a class="anchor" id="install_windows_building">
|
||
|
Building the Toolchain for Windows</a></h2>
|
||
|
<p>All directories in the PATH enviornment variable should be specified using their short filename (8.3) version. This will also help to avoid NTVDM errors during building. These short filenames can be specific to each machine.</p>
|
||
|
<p>Build the tools below in MinGW/MSYS.</p>
|
||
|
<ul>
|
||
|
<li><b>Binutils</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code pacakge and patch as necessary.</li>
|
||
|
<li>Configure and build in a directory outside of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li><ghostscript executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
CFLAGS=-D__USE_MINGW_ACCESS \
|
||
|
../$archivedir/configure \
|
||
|
--prefix=$installdir \
|
||
|
--target=avr \
|
||
|
--disable-nls \
|
||
|
--enable-doc \
|
||
|
--datadir=$installdir/doc/binutils \
|
||
|
--with-gmp=/usr/local \
|
||
|
--with-mpfr=/usr/local \
|
||
|
2>&1 | tee binutils-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all html install install-html 2>&1 | tee binutils-make.log
|
||
|
</pre></div></li>
|
||
|
<li>Manually change documentation location.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>GCC</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code pacakge and patch as necessary.</li>
|
||
|
<li>Configure and build in a directory outside of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li><ghostscript executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
LDFLAGS='-L /usr/local/lib -R /usr/local/lib' \
|
||
|
CFLAGS='-D__USE_MINGW_ACCESS' \
|
||
|
../gcc-$version/configure \
|
||
|
--with-gmp=/usr/local \
|
||
|
--with-mpfr=/usr/local \
|
||
|
--with-mpc=/usr/local \
|
||
|
--prefix=$installdir \
|
||
|
--target=$target \
|
||
|
--enable-languages=c,c++ \
|
||
|
--with-dwarf2 \
|
||
|
--enable-doc \
|
||
|
--with-docdir=$installdir/doc/$project \
|
||
|
--disable-shared \
|
||
|
--disable-libada \
|
||
|
--disable-libssp \
|
||
|
2>&1 | tee $project-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all html install 2>&1 | tee $package-make.log
|
||
|
</pre></div></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>avr-libc</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code package.</li>
|
||
|
<li>Configure and build at the top of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li><MikTex executables></li>
|
||
|
<li><install directory>/bin</li>
|
||
|
<li><Doxygen executables></li>
|
||
|
<li><NetPBM executables></li>
|
||
|
<li><fig2dev executable></li>
|
||
|
<li><Ghostscript executables></li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
./configure \
|
||
|
--host=avr \
|
||
|
--prefix=$installdir \
|
||
|
--enable-doc \
|
||
|
--disable-versioned-doc \
|
||
|
--enable-html-doc \
|
||
|
--enable-xml-doc \
|
||
|
--enable-pdf-doc \
|
||
|
--enable-man-doc \
|
||
|
--mandir=$installdir/man \
|
||
|
--datadir=$installdir \
|
||
|
2>&1 | tee $package-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all install 2>&1 | tee $package-make.log
|
||
|
</pre></div></li>
|
||
|
<li>Manually change location of man page documentation.</li>
|
||
|
<li>Move the examples to the top level of the install tree.</li>
|
||
|
<li>Convert line endings in examples to Windows line endings.</li>
|
||
|
<li>Convert line endings in header files to Windows line endings.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>AVRDUDE</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code package.</li>
|
||
|
<li>Configure and build at the top of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Set location of LibUSB headers and libraries <div class="fragment"><pre class="fragment">
|
||
|
export CPPFLAGS="-I../../libusb-win32-device-bin-$libusb_version/include"
|
||
|
export CFLAGS="-I../../libusb-win32-device-bin-$libusb_version/include"
|
||
|
export LDFLAGS="-L../../libusb-win32-device-bin-$libusb_version/lib/gcc"
|
||
|
</pre></div></li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
./configure \
|
||
|
--prefix=$installdir \
|
||
|
--datadir=$installdir \
|
||
|
--sysconfdir=$installdir/bin \
|
||
|
--enable-doc \
|
||
|
--disable-versioned-doc \
|
||
|
2>&1 | tee $package-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make -k all install 2>&1 | tee $package-make.log
|
||
|
</pre></div></li>
|
||
|
<li>Convert line endings in avrdude config file to Windows line endings.</li>
|
||
|
<li>Delete backup copy of avrdude config file in install directory if exists.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>Insight/GDB</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code pacakge and patch as necessary.</li>
|
||
|
<li>Configure and build in a directory outside of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
CFLAGS=-D__USE_MINGW_ACCESS \
|
||
|
LDFLAGS='-static' \
|
||
|
../$archivedir/configure \
|
||
|
--prefix=$installdir \
|
||
|
--target=avr \
|
||
|
--with-gmp=/usr/local \
|
||
|
--with-mpfr=/usr/local \
|
||
|
--enable-doc \
|
||
|
2>&1 | tee insight-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all install 2>&1 | tee $package-make.log
|
||
|
</pre></div></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>SRecord</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code package.</li>
|
||
|
<li>Configure and build at the top of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li>/mingw/bin</li>
|
||
|
<li>c:/cygwin/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
./configure \
|
||
|
--prefix=$installdir \
|
||
|
--infodir=$installdir/info \
|
||
|
--mandir=$installdir/man \
|
||
|
2>&1 | tee $package-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all install 2>&1 | tee $package-make.log
|
||
|
</pre></div></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p>Build the tools below in Cygwin.</p>
|
||
|
<ul>
|
||
|
<li><b>AVaRICE</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code package.</li>
|
||
|
<li>Configure and build in a directory outside of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Set location of LibUSB headers and libraries <div class="fragment"><pre class="fragment">
|
||
|
export CPPFLAGS=-I$startdir/libusb-win32-device-bin-$libusb_version/include
|
||
|
export CFLAGS=-I$startdir/libusb-win32-device-bin-$libusb_version/include
|
||
|
export LDFLAGS="-static -L$startdir/libusb-win32-device-bin-$libusb_version/lib/gcc "
|
||
|
</pre></div></li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
../$archivedir/configure \
|
||
|
--prefix=$installdir \
|
||
|
--datadir=$installdir/doc \
|
||
|
--mandir=$installdir/man \
|
||
|
--infodir=$installdir/info \
|
||
|
2>&1 | tee avarice-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make all install 2>&1 | tee avarice-make.log
|
||
|
</pre></div></li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<ul>
|
||
|
<li><b>SimulAVR</b><br/>
|
||
|
<ul>
|
||
|
<li>Open source code package.</li>
|
||
|
<li>Configure and build in a directory outside of the source code tree.</li>
|
||
|
<li>Set PATH, in order:<ul>
|
||
|
<li><MikTex executables></li>
|
||
|
<li>/usr/local/bin</li>
|
||
|
<li>/usr/bin</li>
|
||
|
<li>/bin</li>
|
||
|
<li><install directory>/bin</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>Configure <div class="fragment"><pre class="fragment">
|
||
|
export LDFLAGS="-static"
|
||
|
../$archivedir/configure \
|
||
|
--prefix=$installdir \
|
||
|
--datadir=$installdir \
|
||
|
--disable-tests \
|
||
|
--disable-versioned-doc \
|
||
|
2>&1 | tee simulavr-configure.log
|
||
|
</pre></div></li>
|
||
|
<li>Make <div class="fragment"><pre class="fragment">
|
||
|
make -k all install 2>&1 | tee simulavr-make.log
|
||
|
make pdf install-pdf 2>&1 | tee simulavr-pdf-make.log
|
||
|
</pre></div> </li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!--- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
||
|
|
||
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
<div id="MSearchResultsWindow">
|
||
|
<iframe src="" frameborder="0"
|
||
|
name="MSearchResults" id="MSearchResults">
|
||
|
</iframe>
|
||
|
</div>
|
||
|
|
||
|
<!-- HTML footer for doxygen 1.8.7-->
|
||
|
<!-- start footer part -->
|
||
|
<!--BEGIN GENERATE_TREEVIEW-->
|
||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||
|
<ul>
|
||
|
$navpath
|
||
|
<li class="footer">$generatedby
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!--END GENERATE_TREEVIEW-->
|
||
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
||
|
<hr class="footer"/><address class="footer"><small>
|
||
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
||
|
</a> 1.6.3
|
||
|
</small></address>
|
||
|
<!--END !GENERATE_TREEVIEW-->
|
||
|
</body>
|
||
|
</html>
|