/* Copyright (c) 2010 Axel Wachtler
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
   * Neither the name of the authors nor the names of its contributors
     may be used to endorse or promote products derived from this software
     without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE. */

/* $Id: arduino.dox,v 1.1 2010/01/03 21:03:04 awachtler Exp $ */

/**
 @page pgContribArduino  Arduino Support

 This section describes how to use Zigbit modules in the Arduino Build Environment.
 Currently the build process is described for Linux.


 @section secArduinoFromScratch Build the Arduino Environment from the Sources.

 @par Get Arduino Sources

 @code
 svn checkout http://arduino.googlecode.com/svn/trunk/ arduino  && echo OK
 @endcode

 The checkout may need several retries, since connection maybe reset during
 checkout. If you see "OK" on the command line, then svn has succeeded.
 (Normally you will need 2 to 5 retries, depending how often the svn server
 cancels the the connection).

 @note
 In order to save the time of a complete check out for later updates,
 zip the build directory now.

 @par Prebuild the distribution

 The next step patches some source files and builds the distribution.

 @code
 cd arduino/
 patch -p0 -i [uracoli-src-dir]/Contrib/Arduino/zigbit.patch
 cd build/linux
 bash make.sh
 @endcode

 The make.sh script produces this output:

 @code
 Setting up directories to build for Linux...
 cp: cannot stat `../shared/libraries': No such file or directory
 Copying examples...
 Extracting reference...
 Extracting JRE...
 Building processing.core
 Note: Some input files use unchecked or unsafe operations.
 Note: Recompile with -Xlint:unchecked for details.

 Done.
 @endcode

 While running make.sh, it seems that the following error message
 can be ignored.
 <pre>
 cp: cannot stat `../shared/libraries': No such file or directory
 </pre>

 @par Build your personal Zigbit Arduino Distribution

 @code
 cd arduino/build/linux
 cp -rfv [uracoli-src-dir]/Contrib/Arduino/examples/* ../shared/examples/
 cp -rfv [uracoli-src-dir]/Contrib/Arduino/hardware/* ../../hardware/
 bash dist.sh
 @endcode

 The dist.sh script produces this output:


 @code
  Creating Arduino distribution for revision 0018...
  Building processing.core
  Note: Some input files use unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.

  Done.
  cp: cannot stat `../shared/libraries': No such file or directory
  Copying examples...
  Extracting reference...
  Creating tarball and finishing...
  Done.
 @endcode


 @par Install and Test the new distribution

 The result file is arduino-<version>.tgz, unpack it and start arduino in
 the usual way.

 Copy arduino-<version>.tgz to a save place and remove the arduino directory.

 @code
 tar xvzf arduino-<version>.tgz
 cd arduino-<version>
 ./arduino
 @endcode


@section secArduinoPatch Patch arduino binary distribution

 @todo Check if it would be possible to replace the patched Compiler.java
 in the jar archiv, so only this file needs to be checked out.
 (see arduino/build/linux/work/lib/pde.jar that contains arduino/app/src/processing/app/debug/Compiler.class)


*/
