\index{installation@{installation}}

This chapter shows how to build and install, from source code, a complete development environment for the A\+VR processors using the G\+NU toolset. There are two main sections, one for Linux, Free\+B\+SD, and other Unix-\/like operating systems, and another section for Windows.\hypertarget{install_tools_install_unix}{}\doxysubsection{Building and Installing under Linux, Free\+B\+S\+D, and Others}\label{install_tools_install_unix}
The default behaviour for most of these tools is to install every thing under the {\ttfamily /usr/local} directory. In order to keep the A\+VR tools separate from the base system, it is usually better to install everything into {\ttfamily /usr/local/avr}. If the {\ttfamily /usr/local/avr} directory does not exist, you should create it before trying to install anything. You will need {\ttfamily root} access to install there. If you don\textquotesingle{}t have root access to the system, you can alternatively install in your home directory, for example, in {\ttfamily \$\+H\+O\+ME/local/avr}. Where you install is a completely arbitrary decision, but should be consistent for all the tools.

You specify the installation directory by using the {\ttfamily --prefix=dir} option with the {\ttfamily configure} script. It is important to install all the A\+VR tools in the same directory or some of the tools will not work correctly. To ensure consistency and simplify the discussion, we will use {\ttfamily \$\+P\+R\+E\+F\+IX} 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)\+:

\index{\$PREFIX@{\$PREFIX}} \index{-\/-\/prefix@{-\/-\/prefix}} \begin{DoxyVerb}$ PREFIX=$HOME/local/avr
$ export PREFIX
\end{DoxyVerb}


\index{\$PATH@{\$PATH}} \label{install_tools_path}%
\Hypertarget{install_tools_path}%
\begin{DoxyNote}{Note}
Be sure that you have your {\ttfamily P\+A\+TH} environment variable set to search the directory you install everything in {\itshape before} you start installing anything. For example, if you use {\ttfamily --prefix=\$\+P\+R\+E\+F\+IX}, you must have {\ttfamily \$\+P\+R\+E\+F\+IX/bin} in your exported {\ttfamily P\+A\+TH}. As such\+:
\end{DoxyNote}
\begin{DoxyVerb}$ PATH=$PATH:$PREFIX/bin
$ export PATH
\end{DoxyVerb}


\begin{DoxyWarning}{Warning}
If you have {\ttfamily CC} set to anything other than {\ttfamily avr-\/gcc} in your environment, this will cause the configure script to fail. It is best to not have {\ttfamily CC} set at all.
\end{DoxyWarning}
\begin{DoxyNote}{Note}
It is usually the best to use the latest released version of each of the tools.
\end{DoxyNote}
\hypertarget{install_tools_required_tools}{}\doxysubsection{Required Tools}\label{install_tools_required_tools}
\index{tools, required@{tools, required}}


\begin{DoxyItemize}
\item {\bfseries{G\+NU Binutils}}~\newline
 \href{http://sources.redhat.com/binutils/}{\texttt{ http\+://sources.\+redhat.\+com/binutils/}} ~\newline
 \mbox{\hyperlink{install_tools_install_avr_binutils}{Installation}}
\item {\bfseries{G\+CC}}~\newline
 \href{http://gcc.gnu.org/}{\texttt{ http\+://gcc.\+gnu.\+org/}} ~\newline
 \mbox{\hyperlink{install_tools_install_avr_gcc}{Installation}}
\item {\bfseries{A\+VR LibC}}~\newline
 \href{http://savannah.gnu.org/projects/avr-libc/}{\texttt{ http\+://savannah.\+gnu.\+org/projects/avr-\/libc/}} ~\newline
 \mbox{\hyperlink{install_tools_install_avr_libc}{Installation}}~\newline

\end{DoxyItemize}\hypertarget{install_tools_optional_tools}{}\doxysubsection{Optional Tools}\label{install_tools_optional_tools}
\index{tools, optional@{tools, optional}}

You can develop programs for A\+VR devices without the following tools. They may or may not be of use for you.


\begin{DoxyItemize}
\item {\bfseries{A\+V\+R\+D\+U\+DE}}~\newline
 \href{http://savannah.nongnu.org/projects/avrdude/}{\texttt{ http\+://savannah.\+nongnu.\+org/projects/avrdude/}} ~\newline
 \mbox{\hyperlink{install_tools_install_avrprog}{Installation}} ~\newline
 \mbox{\hyperlink{using_avrprog}{Usage Notes}}
\item {\bfseries{G\+DB}}~\newline
 \href{http://sources.redhat.com/gdb/}{\texttt{ http\+://sources.\+redhat.\+com/gdb/}} ~\newline
 \mbox{\hyperlink{install_tools_install_gdb}{Installation}}~\newline

\item {\bfseries{Simul\+A\+VR}}~\newline
 \href{http://savannah.gnu.org/projects/simulavr/}{\texttt{ http\+://savannah.\+gnu.\+org/projects/simulavr/}} ~\newline
 \mbox{\hyperlink{install_tools_install_simulavr}{Installation}}
\item {\bfseries{A\+Va\+R\+I\+CE}}~\newline
 \href{http://avarice.sourceforge.net/}{\texttt{ http\+://avarice.\+sourceforge.\+net/}} ~\newline
 \mbox{\hyperlink{install_tools_install_avarice}{Installation}}~\newline

\end{DoxyItemize}\hypertarget{install_tools_install_avr_binutils}{}\doxysubsection{G\+N\+U Binutils for the A\+V\+R target}\label{install_tools_install_avr_binutils}
\index{installation, binutils@{installation, binutils}}

The {\ttfamily {\bfseries{binutils}}} package provides all the low-\/level utilities needed in building and manipulating object files. Once installed, your environment will have an A\+VR assembler ({\ttfamily avr-\/as}), linker ({\ttfamily avr-\/ld}), and librarian ({\ttfamily avr-\/ar} and {\ttfamily avr-\/ranlib}). In addition, you get tools which extract data from object files ({\ttfamily avr-\/objcopy}), dissassemble object file information ({\ttfamily avr-\/objdump}), and strip information from object files ({\ttfamily avr-\/strip}). Before we can build the C compiler, these tools need to be in place.

Download and unpack the source files\+:

\begin{DoxyVerb}$ bunzip2 -c binutils-<version>.tar.bz2 | tar xf -
$ cd binutils-<version>
\end{DoxyVerb}


\begin{DoxyNote}{Note}
Replace {\ttfamily $<$version$>$} with the version of the package you downloaded.

If you obtained a gzip compressed file (.gz), use {\ttfamily gunzip} instead of {\ttfamily bunzip2}.
\end{DoxyNote}
It is usually a good idea to configure and build {\ttfamily {\bfseries{binutils}}} in a subdirectory so as not to pollute the source with the compiled files. This is recommended by the {\ttfamily {\bfseries{binutils}}} developers.

\begin{DoxyVerb}$ mkdir obj-avr
$ cd obj-avr
\end{DoxyVerb}


The next step is to configure and build the tools. This is done by supplying arguments to the {\ttfamily configure} script that enable the A\+V\+R-\/specific options.

\begin{DoxyVerb}$ ../configure --prefix=$PREFIX --target=avr --disable-nls
\end{DoxyVerb}


If you don\textquotesingle{}t specify the {\ttfamily --prefix} option, the tools will get installed in the {\ttfamily /usr/local} hierarchy (i.\+e. the binaries will get installed in {\ttfamily /usr/local/bin}, the info pages get installed in {\ttfamily /usr/local/info}, etc.) Since these tools are changing frequently, It is preferrable to put them in a location that is easily removed.

When {\ttfamily configure} 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 {\ttfamily Makefile}s that are custom tailored to your platform. At this point, you can build the project.

\begin{DoxyVerb}$ make
\end{DoxyVerb}


\begin{DoxyNote}{Note}
B\+SD users should note that the project\textquotesingle{}s {\ttfamily Makefile} uses G\+NU {\ttfamily make} syntax. This means Free\+B\+SD users may need to build the tools by using {\ttfamily gmake}.
\end{DoxyNote}
If the tools compiled cleanly, you\textquotesingle{}re ready to install them. If you specified a destination that isn\textquotesingle{}t owned by your account, you\textquotesingle{}ll need {\ttfamily root} access to install them. To install\+:

\begin{DoxyVerb}$ make install
\end{DoxyVerb}


You should now have the programs from binutils installed into {\ttfamily \$\+P\+R\+E\+F\+IX/bin}. Don\textquotesingle{}t forget to \mbox{\hyperlink{install_tools_path}{set your P\+A\+TH}} environment variable before going to build avr-\/gcc.\hypertarget{install_tools_install_avr_gcc}{}\doxysubsection{G\+C\+C for the A\+V\+R target}\label{install_tools_install_avr_gcc}
\index{installation, gcc@{installation, gcc}}

\begin{DoxyWarning}{Warning}
You {\itshape {\bfseries{must}}} install \mbox{\hyperlink{install_tools_install_avr_binutils}{avr-\/binutils}} and make sure your \mbox{\hyperlink{install_tools_path}{path is set}} properly before installing avr-\/gcc.
\end{DoxyWarning}
The steps to build {\ttfamily avr-\/gcc} are essentially same as for \mbox{\hyperlink{install_tools_install_avr_binutils}{binutils}}\+:

\begin{DoxyVerb}$ 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
\end{DoxyVerb}


To save your self some download time, you can alternatively download only the {\ttfamily gcc-\/core-\/$<$version$>$.tar.\+bz2} and {\ttfamily gcc-\/c++-\/$<$version$>$.tar.\+bz2} parts of the gcc. Also, if you don\textquotesingle{}t need C++ support, you only need the core part and should only enable the C language support. (Starting with G\+CC 4.\+7 releases, these split files are no longer available though.)

\begin{DoxyNote}{Note}
Early versions of these tools did not support C++.

The stdc++ libs are not included with C++ for A\+VR due to the size limitations of the devices.
\end{DoxyNote}
\hypertarget{install_tools_install_avr_libc}{}\doxysubsection{A\+V\+R LibC}\label{install_tools_install_avr_libc}
\index{installation, avr-\/libc@{installation, avr-\/libc}}

\begin{DoxyWarning}{Warning}
You {\itshape {\bfseries{must}}} install \mbox{\hyperlink{install_tools_install_avr_binutils}{avr-\/binutils}}, \mbox{\hyperlink{install_tools_install_avr_gcc}{avr-\/gcc}} and make sure your \mbox{\hyperlink{install_tools_path}{path is set}} properly before installing avr-\/libc.
\end{DoxyWarning}
\begin{DoxyNote}{Note}
If you have obtained the latest avr-\/libc from cvs, you will have to run the {\ttfamily bootstrap} script before using either of the build methods described below.
\end{DoxyNote}
To build and install avr-\/libc\+:

\begin{DoxyVerb}$ gunzip -c avr-libc-<version>.tar.gz | tar xf -
$ cd avr-libc-<version>
$ ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
$ make
$ make install
\end{DoxyVerb}


Optionally, generation of debug information can be requested with\+:

\begin{DoxyVerb}$ 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
\end{DoxyVerb}


where {\ttfamily D\+E\+B\+U\+G\+\_\+\+I\+N\+FO} can be one of {\ttfamily stabs}, {\ttfamily dwarf-\/2}, or {\ttfamily dwarf-\/4}.

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.\hypertarget{install_tools_install_avrprog}{}\doxysubsection{A\+V\+R\+D\+U\+DE}\label{install_tools_install_avrprog}
\index{installation, avrprog@{installation, avrprog}} \index{installation, avrdude@{installation, avrdude}}

\begin{DoxyNote}{Note}
It has been ported to windows (via Min\+GW or cygwin), Linux and Solaris. Other Unix systems should be trivial to port to.
\end{DoxyNote}
{\ttfamily {\bfseries{avrdude}}} is part of the Free\+B\+SD ports system. To install it, simply do the following\+:

\begin{DoxyVerb}# cd /usr/ports/devel/avrdude
# make install
\end{DoxyVerb}


\begin{DoxyNote}{Note}
Installation into the default location usually requires root permissions. However, running the program only requires access permissions to the appropriate {\ttfamily ppi(4)} device.
\end{DoxyNote}
Building and installing on other systems should use the {\ttfamily configure} system, as such\+:

\begin{DoxyVerb}$ gunzip -c avrdude-<version>.tar.gz | tar xf -
$ cd avrdude-<version>
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX
$ make
$ make install
\end{DoxyVerb}
\hypertarget{install_tools_install_gdb}{}\doxysubsection{G\+D\+B for the A\+V\+R target}\label{install_tools_install_gdb}
\index{Installation, gdb@{Installation, gdb}}

G\+DB also uses the {\ttfamily configure} system, so to build and install\+:

\begin{DoxyVerb}$ 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
\end{DoxyVerb}


\begin{DoxyNote}{Note}
If you are planning on using {\ttfamily avr-\/gdb}, you will probably want to install either \mbox{\hyperlink{install_tools_install_simulavr}{simulavr}} or \mbox{\hyperlink{install_tools_install_avarice}{avarice}} since avr-\/gdb needs one of these to run as a a remote target backend.
\end{DoxyNote}
\hypertarget{install_tools_install_simulavr}{}\doxysubsection{Simul\+A\+VR}\label{install_tools_install_simulavr}
\index{installation, simulavr@{installation, simulavr}}

Simul\+A\+VR also uses the {\ttfamily configure} system, so to build and install\+:

\begin{DoxyVerb}$ gunzip -c simulavr-<version>.tar.gz | tar xf -
$ cd simulavr-<version>
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX
$ make
$ make install
\end{DoxyVerb}


\begin{DoxyNote}{Note}
You might want to have already installed \mbox{\hyperlink{install_tools_install_avr_binutils}{avr-\/binutils}}, \mbox{\hyperlink{install_tools_install_avr_gcc}{avr-\/gcc}} and \mbox{\hyperlink{install_tools_install_avr_libc}{avr-\/libc}} if you want to have the test programs built in the simulavr source.
\end{DoxyNote}
\hypertarget{install_tools_install_avarice}{}\doxysubsection{A\+Va\+R\+I\+CE}\label{install_tools_install_avarice}
\index{installation, avarice@{installation, avarice}}

\begin{DoxyNote}{Note}
These install notes are not applicable to avarice-\/1.\+5 or older. You probably don\textquotesingle{}t want to use anything that old anyways since there have been many improvements and bug fixes since the 1.\+5 release.
\end{DoxyNote}
A\+Va\+R\+I\+CE also uses the {\ttfamily configure} system, so to build and install\+:

\begin{DoxyVerb}$ gunzip -c avarice-<version>.tar.gz | tar xf -
$ cd avarice-<version>
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX
$ make
$ make install
\end{DoxyVerb}


\begin{DoxyNote}{Note}
A\+Va\+R\+I\+CE uses the B\+FD 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 {\ttfamily $<$hdr\+\_\+path$>$} with the path to the {\ttfamily bfd.\+h} file on your system. Replace {\ttfamily $<$lib\+\_\+path$>$} with the path to {\ttfamily libbfd.\+a} on your system.)\+:
\end{DoxyNote}
\begin{DoxyVerb}$ CPPFLAGS=-I<hdr_path> LDFLAGS=-L<lib_path> ../configure --prefix=$PREFIX
\end{DoxyVerb}
\hypertarget{install_tools_install_windows}{}\doxysubsection{Building and Installing under Windows}\label{install_tools_install_windows}
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 P\+O\+S\+IX environment such as Unix and Linux. Windows does not natively provide such an environment.

There are two projects available that provide such an environment, Cygwin and Min\+GW. There are advantages and disadvantages to both. Cygwin provides a very complete P\+O\+S\+IX environment that allows one to build many Linux based tools from source with very little or no source modifications. However, P\+O\+S\+IX functionality is provided in the form of a D\+LL that is linked to the application. This D\+LL has to be redistributed with your application and there are issues if the Cygwin D\+LL already exists on the installation system and different versions of the D\+LL. On the other hand, Min\+GW can compile code as native Win32 applications. However, this means that programs designed for Unix and Linux (i.\+e. that use P\+O\+S\+IX functionality) will not compile as Min\+GW does not provide that P\+O\+S\+IX 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.

Min\+GW does provide somewhat of a P\+O\+S\+IX environment, called M\+S\+YS, that allows you to build Unix and Linux applications as they woud normally do, with a {\ttfamily configure} step and a {\ttfamily make} step. Cygwin also provides such an environment. This means that building the A\+VR toolchain is very similar to how it is built in Linux, described above. The main differences are in what the P\+A\+TH environment variable gets set to, pathname differences, and the tools that are required to build the projects under Windows. We\textquotesingle{}ll take a look at the tools next.\hypertarget{install_tools_install_windows_tools}{}\doxysubsection{Tools Required for Building the Toolchain for Windows}\label{install_tools_install_windows_tools}
These are the tools that are currently used to build an A\+VR tool chain. This list may change, either the version of the tools, or the tools themselves, as improvements are made.


\begin{DoxyItemize}
\item {\bfseries{Min\+GW}}~\newline
 Download the Min\+GW Automated Installer, 20100909 (or later) \href{http://sourceforge.net/projects/mingw/files/Automated\%20MinGW\%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download}{\texttt{ http\+://sourceforge.\+net/projects/mingw/files/\+Automated\%20\+Min\+G\+W\%20\+Installer/mingw-\/get-\/inst/mingw-\/get-\/inst-\/20100909/mingw-\/get-\/inst-\/20100909.\+exe/download}}
\begin{DoxyItemize}
\item Run mingw-\/get-\/inst-\/20100909.\+exe
\item In the installation wizard, keep the default values and press the \char`\"{}\+Next\char`\"{} button for all installer pages except for the pages explicitly listed below.
\item In the installer page \char`\"{}\+Repository Catalogues\char`\"{}, select the \char`\"{}\+Download latest
	repository catalogues\char`\"{} radio button, and press the \char`\"{}\+Next\char`\"{} button
\item In the installer page \char`\"{}\+License Agreement\char`\"{}, select the \char`\"{}\+I accept the agreement\char`\"{} radio button, and press the \char`\"{}\+Next\char`\"{} button
\item In the installer page \char`\"{}\+Select Components\char`\"{}, be sure to select these items\+:
\begin{DoxyItemize}
\item C compiler (default checked)
\item C++ compiler
\item Ada compiler
\item Min\+GW Developer Toolkit (which includes \char`\"{}\+M\+S\+Y\+S Basic System\char`\"{}).
\end{DoxyItemize}
\item Install.
\end{DoxyItemize}
\item {\bfseries{Install Cygwin}}~\newline

\begin{DoxyItemize}
\item Install everything, all users, U\+N\+IX line endings. This will take a $\ast$long$\ast$ 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.
\end{DoxyItemize}
\end{DoxyItemize}

\begin{DoxyNote}{Note}
G\+MP, M\+P\+FR, and M\+PC are required to build G\+CC. 

G\+MP is a prequisite for building M\+P\+FR. Build G\+MP first. 

M\+P\+FR is a prerequisite for building M\+PC. Build M\+P\+FR second.
\end{DoxyNote}

\begin{DoxyItemize}
\item {\bfseries{Build G\+MP for Min\+GW}}~\newline

\begin{DoxyItemize}
\item Latest Version
\item \href{http://gmplib.org/}{\texttt{ http\+://gmplib.\+org/}}
\item Build script\+: \begin{DoxyVerb}        ./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\end{DoxyVerb}

\item G\+MP headers will be installed under /usr/local/include and library installed under /usr/local/lib.
\end{DoxyItemize}
\item {\bfseries{Build M\+P\+FR for Min\+GW}}~\newline

\begin{DoxyItemize}
\item Latest Version
\item \href{http://www.mpfr.org/}{\texttt{ http\+://www.\+mpfr.\+org/}}
\item Build script\+: \begin{DoxyVerb}        ./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\end{DoxyVerb}

\item M\+P\+FR headers will be installed under /usr/local/include and library installed under /usr/local/lib.
\end{DoxyItemize}
\item {\bfseries{Build M\+PC for Min\+GW}}~\newline

\begin{DoxyItemize}
\item Latest Version
\item \href{http://www.multiprecision.org/}{\texttt{ http\+://www.\+multiprecision.\+org/}}
\item Build script\+: \begin{DoxyVerb}        ./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\end{DoxyVerb}

\item M\+P\+FR headers will be installed under /usr/local/include and library installed under /usr/local/lib.
\end{DoxyItemize}
\end{DoxyItemize}

\begin{DoxyNote}{Note}
Doxygen is required to build A\+V\+R-\/\+LibC documentation.
\begin{DoxyItemize}
\item {\bfseries{Install Doxygen}}~\newline

\begin{DoxyItemize}
\item Version 1.\+7.\+2
\item \href{http://www.stack.nl/~dimitri/doxygen/}{\texttt{ http\+://www.\+stack.\+nl/$\sim$dimitri/doxygen/}}
\item Download and install.
\end{DoxyItemize}
\end{DoxyItemize}

Net\+P\+BM is required to build graphics in the A\+V\+R-\/\+LibC documentation.
\begin{DoxyItemize}
\item {\bfseries{Install Net\+P\+BM}}~\newline

\begin{DoxyItemize}
\item Version 10.\+27.\+0
\item From the G\+N\+U\+Win32 project\+: \href{http://gnuwin32.sourceforge.net/packages.html}{\texttt{ http\+://gnuwin32.\+sourceforge.\+net/packages.\+html}}
\item Download and install.
\end{DoxyItemize}
\end{DoxyItemize}

fig2dev is required to build graphics in the A\+V\+R-\/\+LibC documentation.
\begin{DoxyItemize}
\item {\bfseries{Install fig2dev}}~\newline

\begin{DoxyItemize}
\item Version 3.\+2 patchlevel 5c
\item From Win\+Fig 4.\+62\+: \href{http://www.schmidt-web-berlin.de/winfig/}{\texttt{ http\+://www.\+schmidt-\/web-\/berlin.\+de/winfig/}}
\item Download the zip file version of Win\+Fig
\item Unzip the download file and install fig2dev.\+exe in a location of your choice, somewhere in the P\+A\+TH.
\item You may have to unzip and install related D\+LL files for fig2dev. In the version above, you have to install Qt\+Core4.\+dll and Qt\+Gui4.\+dll.
\end{DoxyItemize}
\end{DoxyItemize}

Mik\+TeX is required to build various documentation.
\begin{DoxyItemize}
\item {\bfseries{Install Mi\+K\+TeX}}~\newline

\begin{DoxyItemize}
\item Version 2.\+9
\item \href{http://miktex.org/}{\texttt{ http\+://miktex.\+org/}}
\item Download and install.
\end{DoxyItemize}
\end{DoxyItemize}

Ghostscript is required to build various documentation.
\begin{DoxyItemize}
\item {\bfseries{Install Ghostscript}}~\newline

\begin{DoxyItemize}
\item Version 9.\+00
\item \href{http://www.ghostscript.com}{\texttt{ http\+://www.\+ghostscript.\+com}}
\item Download and install.
\item In the \textbackslash{}bin subdirectory of the installaion, copy gswin32c.\+exe to gs.\+exe.
\end{DoxyItemize}
\item Set the T\+E\+MP and T\+MP environment variables to {\bfseries{c\+:\textbackslash{}temp}} or to the short filename version. This helps to avoid N\+T\+V\+DM errors during building.
\end{DoxyItemize}
\end{DoxyNote}
\hypertarget{install_tools_install_windows_building}{}\doxysubsection{Building the Toolchain for Windows}\label{install_tools_install_windows_building}
All directories in the P\+A\+TH enviornment variable should be specified using their short filename (8.\+3) version. This will also help to avoid N\+T\+V\+DM errors during building. These short filenames can be specific to each machine.

Build the tools below in Min\+G\+W/\+M\+S\+YS.


\begin{DoxyItemize}
\item {\bfseries{Binutils}}~\newline

\begin{DoxyItemize}
\item Open source code pacakge and patch as necessary.
\item Configure and build in a directory outside of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item $<$ghostscript executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item /mingw/bin
\item c\+:/cygwin/bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}        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\end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all html install install-html 2>&1 | tee binutils-make.log\end{DoxyVerb}

\item Manually change documentation location.
\end{DoxyItemize}
\item {\bfseries{G\+CC}}~\newline

\begin{DoxyItemize}
\item Open source code pacakge and patch as necessary.
\item Configure and build in a directory outside of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item $<$ghostscript executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item /mingw/bin
\item c\+:/cygwin/bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}		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 \end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all html install 2>&1 | tee $package-make.log\end{DoxyVerb}

\end{DoxyItemize}
\item {\bfseries{avr-\/libc}}~\newline

\begin{DoxyItemize}
\item Open source code package.
\item Configure and build at the top of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item /usr/local/bin
\item /mingw/bin
\item /bin
\item $<$Mik\+Tex executables$>$
\item $<$install directory$>$/bin
\item $<$Doxygen executables$>$
\item $<$Net\+P\+BM executables$>$
\item $<$fig2dev executable$>$
\item $<$Ghostscript executables$>$
\item c\+:/cygwin/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}        ./configure \
            --host=avr \
            --prefix=$installdir \
            --enable-doc \
            --disable-versioned-doc \
            --enable-html-doc \
            --enable-pdf-doc \
            --enable-man-doc \
            --mandir=$installdir/man \
            --datadir=$installdir \
            2>&1 | tee $package-configure.log \end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all install 2>&1 | tee $package-make.log\end{DoxyVerb}

\item Manually change location of man page documentation.
\item Move the examples to the top level of the install tree.
\item Convert line endings in examples to Windows line endings.
\item Convert line endings in header files to Windows line endings.
\end{DoxyItemize}
\item {\bfseries{A\+V\+R\+D\+U\+DE}}~\newline

\begin{DoxyItemize}
\item Open source code package.
\item Configure and build at the top of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item /mingw/bin
\item c\+:/cygwin/bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Set location of Lib\+U\+SB headers and libraries \begin{DoxyVerb}        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"\end{DoxyVerb}

\item Configure \begin{DoxyVerb}        ./configure \
            --prefix=$installdir \
            --datadir=$installdir \
            --sysconfdir=$installdir/bin \
            --enable-doc \
            --disable-versioned-doc \
            2>&1 | tee $package-configure.log \end{DoxyVerb}

\item Make \begin{DoxyVerb}        make -k all install 2>&1 | tee $package-make.log\end{DoxyVerb}

\item Convert line endings in avrdude config file to Windows line endings.
\item Delete backup copy of avrdude config file in install directory if exists.
\end{DoxyItemize}
\item {\bfseries{Insight/\+G\+DB}}~\newline

\begin{DoxyItemize}
\item Open source code pacakge and patch as necessary.
\item Configure and build in a directory outside of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item /mingw/bin
\item c\+:/cygwin/bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}        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\end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all install 2>&1 | tee $package-make.log\end{DoxyVerb}

\end{DoxyItemize}
\item {\bfseries{S\+Record}}~\newline

\begin{DoxyItemize}
\item Open source code package.
\item Configure and build at the top of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item /mingw/bin
\item c\+:/cygwin/bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}        ./configure \
            --prefix=$installdir \
            --infodir=$installdir/info \
            --mandir=$installdir/man \
            2>&1 | tee $package-configure.log \end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all install 2>&1 | tee $package-make.log\end{DoxyVerb}

\end{DoxyItemize}
\end{DoxyItemize}

Build the tools below in Cygwin.


\begin{DoxyItemize}
\item {\bfseries{A\+Va\+R\+I\+CE}}~\newline

\begin{DoxyItemize}
\item Open source code package.
\item Configure and build in a directory outside of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Set location of Lib\+U\+SB headers and libraries \begin{DoxyVerb}        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 "\end{DoxyVerb}

\item Configure \begin{DoxyVerb}        ../$archivedir/configure \
        --prefix=$installdir \
        --datadir=$installdir/doc \
        --mandir=$installdir/man \
        --infodir=$installdir/info \
        2>&1 | tee avarice-configure.log\end{DoxyVerb}

\item Make \begin{DoxyVerb}        make all install 2>&1 | tee avarice-make.log\end{DoxyVerb}

\end{DoxyItemize}
\item {\bfseries{Simul\+A\+VR}}~\newline

\begin{DoxyItemize}
\item Open source code package.
\item Configure and build in a directory outside of the source code tree.
\item Set P\+A\+TH, in order\+:
\begin{DoxyItemize}
\item $<$Mik\+Tex executables$>$
\item /usr/local/bin
\item /usr/bin
\item /bin
\item $<$install directory$>$/bin
\end{DoxyItemize}
\item Configure \begin{DoxyVerb}        export LDFLAGS="-static"
        ../$archivedir/configure \
            --prefix=$installdir \
            --datadir=$installdir \
            --disable-tests \
            --disable-versioned-doc \
            2>&1 | tee simulavr-configure.log\end{DoxyVerb}

\item Make \begin{DoxyVerb}        make -k all install 2>&1 | tee simulavr-make.log
        make pdf install-pdf 2>&1 | tee simulavr-pdf-make.log\end{DoxyVerb}
 
\end{DoxyItemize}
\end{DoxyItemize}