359
371
$ CPPFLAGS=-I<hdr_path> LDFLAGS=-L<lib_path> ../configure --prefix=$PREFIX
376
\section install_windows Building and Installing under Windows
378
Building and installing the toolchain under Windows requires more effort because
379
all of the tools required for building, and the programs themselves, are mainly
380
designed for running under a POSIX environment such as Unix and Linux. Windows
381
does not natively provide such an environment.
383
There are two projects available that provide such an environment, Cygwin and
384
MinGW/MSYS. There are advantages and disadvantages to both. Cygwin provides a
385
very complete POSIX environment that allows one to build many Linux based tools
386
from source with very little or no source modifications. However, POSIX
387
functionality is provided in the form of a DLL that is linked to the application.
388
This DLL has to be redistributed with your application and there are issues if
389
the Cygwin DLL already exists on the installation system and different versions
390
of the DLL. On the other hand, MinGW/MSYS can compile code as native Win32
391
applications. However, this means that programs designed for Unix and Linux (i.e.
392
that use POSIX functionality) will not compile as MinGW/MSYS does not provide
393
that POSIX layer for you. Therefore most programs that compile on both types of
394
host systems, usually must provide some sort of abstraction layer to allow an
395
application to be built cross-platform.
397
MinGW/MSYS does provide somewhat of a POSIX environment that allows you to
398
build Unix and Linux applications as they woud normally do, with a \c configure
399
step and a \c make step. Cygwin also provides such an environment. This means
400
that building the AVR toolchain is very similar to how it is built in Linux,
401
described above. The main differences are in what the PATH environment variable
402
gets set to, pathname differences, and the tools that are required to build the
403
projects under Windows. We'll take a look at the tools next.
406
\section install_windows_tools Tools Required for Building the Toolchain for Windows
408
These are the tools that are currently used to build WinAVR 20070525 (or later).
409
This list may change, either the version of the tools, or the tools themselves,
410
as improvements are made.
412
- <b>MinGW/MSYS</b><br>
413
<http://downloads.sourceforge.net/mingw/MinGW-5.1.3.exe?use_mirror=superb-east>
414
- Put MinGW-5.1.3.exe in it's own directory (for example: C:\MinGWSetup)
415
- Run MinGW-5.1.3.exe
416
- Select "Download and install"
417
- Select "Current" package.
418
- Select type of install: Full.
420
- <b>Install MSYS-1.0.10.exe package.</b><br>
421
<http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download>
423
- Batch file will ask:
424
- "Do you wish to continue with the post install?" Press "y" and press enter.
425
- "Do you have MinGW installed?" Press "y" and press enter.
426
- "Where is your MinGW installation?" Type in "c:/mingw" (without quotes) and press enter
427
- "Do you wish for me to add mount bindings for c:/mingw to /mingw?" Press "y" and press enter.
428
- It will display some messages on the screen, then it will display: "Press any key to continue . . .". Press any key.
430
- <b>Edit c:\\msys\\1.0\\msys.bat</b><br>
431
Change line (should be line 41):
433
if EXIST rxvt.exe goto startrxvt
437
rem if EXIST rxvt.exe goto startrxvt
439
to remark out this line. Doing this will cause MSYS to always use the bash shell and not the rxvt shell.
441
\note The order of the next three is important. Install MSYS Developer toolkit before the autotools.
443
- <b>MSYS Developer Toolkit version 1.0.1</b><br>
444
- This is needed to build avr-libc in MinGW.
445
- <http://downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe?use_mirror=internap>
446
- Single file installer executable. Install.
448
- <b>autoconf 2.59 from the "MSYS Developer Toolkit" release</b><br>
449
- autoconf 2.59/2.60 is needed to build avr-libc in MinGW.
450
- <http://downloads.sourceforge.net/mingw/msys-autoconf-2.59.tar.bz2?use_mirror=internap>
451
- Extract to c:\\msys\\1.0
453
- <b>automake 1.8.2</b><br>
454
- automake 1.8/1.9 is needed to build avr-libc in MinGW.
455
- <http://downloads.sourceforge.net/mingw/msys-automake-1.8.2.tar.bz2?use_mirror=internap>
456
- Extract to c:\\msys\\1.0
459
- <b>Install Cygwin</b><br>
460
- Install everything, all users, UNIX line endings. This will take a *long* time.
461
A fat internet pipe is highly recommended. It is also recommended that you
462
download all to a directory first, and then install from that directory to
465
\note MPFR requires GMP, so build it first.
467
- <b>Build GMP for MinGW</b><br>
469
- <http://gmplib.org/>
472
./configure 2>&1 | tee gmp-configure.log
473
make 2>&1 | tee gmp-make.log
474
make check 2>&1 | tee gmp-make-check.log
475
make install 2>&1 | tee gmp-make-install.log
477
- GMP headers will be installed under /usr/local/include and library installed
478
under /usr/local/lib.
480
- <b>Build MPFR for MinGW</b><br>
482
- <http://www.mpfr.org/>
485
./configure --with-gmp=/usr/local 2>&1 | tee mpfr-configure.log
486
make 2>&1 | tee mpfr-make.log
487
make check 2>&1 | tee mpfr-make-check.log
488
make install 2>&1 | tee mpfr-make-install.log
490
- MPFR headers will be installed under /usr/local/include and library installed
491
under /usr/local/lib.
493
- <b>Install Doxygen</b><br>
495
- <http://www.stack.nl/~dimitri/doxygen/>
496
- Download and install.
498
- <b>Install NetPBM</b><br>
500
- From the GNUWin32 project: <http://gnuwin32.sourceforge.net/packages.html>
501
- Download and install.
503
- <b>Install fig2dev</b><br>
504
- Version 3.2 Patchlevel 5-alpha7
505
- From WinFig 1.71: <http://www.schmidt-web-berlin.de/winfig/>
506
- Unzip the download file and install in a location of your choice.
508
- <b>Install MiKTex</b><br>
510
- <http://miktex.org/>
511
- Download and install.
513
- <b>Install Ghostscript</b><br>
515
- <http://www.cs.wisc.edu/~ghost/>
516
- Download and install.
518
- Set the TEMP and TMP environment variables to <b>c:\\temp</b> or to the short filename
519
version. This helps to avoid NTVDM errors during building.
522
\section install_windows_building Building the Toolchain for Windows
524
All directories in the PATH enviornment variable should be specified using their
525
short filename (8.3) version. This will also help to avoid NTVDM errors during
526
building. These short filenames can be specific to each machine.
528
Build the tools below in MSYS.
530
- <b>Binutils</b><br>
531
- Open source code pacakge and patch as necessary.
532
- Configure and build in a directory outside of the source code tree.
533
- Set PATH, in order:
534
- \<MikTex executables\>
540
- \<install directory\>/bin
543
CFLAGS=-D__USE_MINGW_ACCESS \
544
../$archivedir/configure \
545
--prefix=$installdir \
549
--datadir=$installdir/doc/binutils \
550
--with-gmp=/usr/local \
551
--with-mpfr=/usr/local \
552
2>&1 | tee binutils-configure.log
556
make all html install install-html 2>&1 | tee binutils-make.log
558
- Manually change documentation location.
562
- Open source code pacakge and patch as necessary.
563
- Configure and build in a directory outside of the source code tree.
564
- Set PATH, in order:
565
- \<MikTex executables\>
571
- \<install directory\>/bin
574
CFLAGS=-D__USE_MINGW_ACCESS \
575
../gcc-$version/configure \
576
--prefix=$installdir \
578
--enable-languages=c,c++ \
580
--enable-win32-registry=WinAVR-$release \
582
--with-gmp=/usr/local \
583
--with-mpfr=/usr/local \
586
2>&1 | tee $package-configure.log
590
make all html install 2>&1 | tee $package-make.log
592
- Manually copy the HTML documentation from the source code tree to the
596
- <b>avr-libc</b><br>
597
- Open source code package.
598
- Configure and build at the top of the source code tree.
599
- Set PATH, in order:
603
- \<MikTex executables\>
604
- \<install directory\>/bin
605
- \<Doxygen executables\>
606
- \<NetPBM executables\>
607
- \<fig2dev executables\>
608
- \<Ghostscript executables\>
614
--prefix=$installdir \
616
--disable-versioned-doc \
620
--mandir=$installdir/man \
621
--datadir=$installdir \
622
2>&1 | tee $package-configure.log
626
make all install 2>&1 | tee $package-make.log
628
- Manually change location of man page documentation.
629
- Move the examples to the top level of the install tree.
630
- Convert line endings in examples to Windows line endings.
631
- Convert line endings in header files to Windows line endings.
634
- Open source code package.
635
- Configure and build at the top of the source code tree.
636
- Set PATH, in order:
637
- \<MikTex executables\>
643
- \<install directory\>/bin
644
- Set location of LibUSB headers and libraries
646
export CPPFLAGS="-I../../libusb-win32-device-bin-$libusb_version/include"
647
export CFLAGS="-I../../libusb-win32-device-bin-$libusb_version/include"
648
export LDFLAGS="-L../../libusb-win32-device-bin-$libusb_version/lib/gcc"
653
--prefix=$installdir \
654
--datadir=$installdir \
655
--sysconfdir=$installdir/bin \
657
--disable-versioned-doc \
658
2>&1 | tee $package-configure.log
662
make -k all install 2>&1 | tee $package-make.log
664
- Convert line endings in avrdude config file to Windows line endings.
665
- Delete backup copy of avrdude config file in install directory if exists.
667
- <b>Insight/GDB</b><br>
668
- Open source code pacakge and patch as necessary.
669
- Configure and build in a directory outside of the source code tree.
670
- Set PATH, in order:
671
- \<MikTex executables\>
677
- \<install directory\>/bin
680
CFLAGS=-D__USE_MINGW_ACCESS \
682
../$archivedir/configure \
683
--prefix=$installdir \
685
--with-gmp=/usr/local \
686
--with-mpfr=/usr/local \
688
2>&1 | tee insight-configure.log
692
make all install 2>&1 | tee $package-make.log
696
- Open source code package.
697
- Configure and build at the top of the source code tree.
698
- Set PATH, in order:
699
- \<MikTex executables\>
705
- \<install directory\>/bin
709
--prefix=$installdir \
710
--infodir=$installdir/info \
711
--mandir=$installdir/man \
712
2>&1 | tee $package-configure.log
716
make all install 2>&1 | tee $package-make.log
720
Build the tools below in Cygwin.
723
- Open source code package.
724
- Configure and build in a directory outside of the source code tree.
725
- Set PATH, in order:
726
- \<MikTex executables\>
730
- \<install directory\>/bin
731
- Set location of LibUSB headers and libraries
733
export CPPFLAGS=-I$startdir/libusb-win32-device-bin-$libusb_version/include
734
export CFLAGS=-I$startdir/libusb-win32-device-bin-$libusb_version/include
735
export LDFLAGS="-static -L$startdir/libusb-win32-device-bin-$libusb_version/lib/gcc "
739
../$archivedir/configure \
740
--prefix=$installdir \
741
--datadir=$installdir/doc \
742
--mandir=$installdir/man \
743
--infodir=$installdir/info \
744
2>&1 | tee avarice-configure.log
748
make all install 2>&1 | tee avarice-make.log
751
- <b>SimulAVR</b><br>
752
- Open source code package.
753
- Configure and build in a directory outside of the source code tree.
754
- Set PATH, in order:
755
- \<MikTex executables\>
759
- \<install directory\>/bin
762
export LDFLAGS="-static"
763
../$archivedir/configure \
764
--prefix=$installdir \
765
--datadir=$installdir \
767
--disable-versioned-doc \
768
2>&1 | tee simulavr-configure.log
772
make -k all install 2>&1 | tee simulavr-make.log
773
make pdf install-pdf 2>&1 | tee simulavr-pdf-make.log