Guide to setting up a 'C' language build environment for the 'side4linux' IDE Let us set up an UBUNTU 'C' build environment from scratch for the 'C' programming language using the Synaptic Package Manager (users of rpm based systems such as SUSE will probably install from distribution CD or use rpm-find on the Internet). We will need to get the 'avra' Atmel AVR assembler TAR file from the 'avra' site on 'sourceforge.net' so connect to the Internet and download it, do not use another package as we are verifying the build environment and you need to check your terminal output against the rest of this help file!! Owners of the side4linuxDVD will find the latest AVRA Tar from the front page of the Help under, "Download Packages locally from DVD (Local, DVD)" Look in the "AVR" Section. PURPOSE OF THIS HELP FILE: To download a specific package to help test the 'C' language build environment and to install needed programs and libraries to make up for any deficiencies. When you have finished this exercises successfully then read 'setup GNOME build environment.txt' for the 'GNOME' stuff needed to install side4linux properly. Please note for the benefit of Windows users that suffer any 'screen freeze' due to a poorly performing program or instruction it is wise to use the key sequence 'control/alternate/backspace' (and not 'control/alternate/delete') and only switch off the computer to cause a reboot as a very last result (could cause file corruption). SECURITY NOTE: Keep in mind that you should not be connected to the Internet while logged in as the super user 'root'!. PREREQUISITES-1: We presume that you have selected all repositries and have clicked on 'Reload' in the top left corner of the package manager. PREREQUISITES-2: Logging in as root requires the setup of a super user and if not already done then open a terminal and do so (if you have administrator privileges, if not get your System Administrator to lend a hand with the following), my results are as follows, rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ sudo passwd root Password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ Note: The password is your password if you have administrator privileges. Note: Write down and keep the new UNIX password in a safe and private place, do not let others see it as they can change your system! This UNIX password is the one to enter for 'root' when you use the 'su' (select user) command later. firstly we need 'make' to make our makefiles Search for 'make' using the Synaptic Package Manager. make_3.80-9_i386.deb // for make (click on box and mark for install) (click on 'Apply' at the top in the 'Main Menu') (if Synaptic says it wants to include something else then click on 'Mark' in the 'Summary' message box) (click on terminal in the 'Changes Applied' message box to see what happened.) (make sure the automatically close on completion box is unchecked) (after seeing something like the following, close the message box.) Reconfiguring packages ... Selecting previously deselected package make. (Reading database ... 566890 files and directories currently installed.) Unpacking make (from .../make_3.80-9_i386.deb) ... Setting up binutils (2.16.1-2ubuntu6) ... Setting up make (3.80-9ubuntu9) ... Search for 'GCC-4' (also installs binutils, the GNU binary utility package) Preconfiguring packages ... Selecting previously deselected package binutils. (Reading database ... 56690 files and directories currently installed.) Unpacking binutils (from .../binutils_2.16.1-2ubuntu6_i386.deb) ... Selecting previously deselected package gcc-4.0. Unpacking gcc-4.0 (from .../gcc-4.0_4.0.1-4ubuntu9_i386.deb) ... Setting up binutils (2.16.1-2ubuntu6) ... Search for 'GCC' (adds dependency package) Preconfiguring packages ... Selecting previously deselected package gcc. (Reading database ... 56836 files and directories currently installed.) Unpacking gcc (from .../gcc_4%3a4.0.1-3_i386.deb) ... Setting up gcc (4.0.1-3) ... You should now be able to do a GCC version check e.g. for me 'rdb' rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ gcc --version gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Now to add the basic libc library for stdio.h etc. (when compiling programs get the 'dev' packages as they contain all of the code and not just binaries and header definitions) Search for 'libc' (we are after 'libc6-dev') Preconfiguring packages ... Selecting previously deselected package linux-kernel-headers. (Reading database ... 56851 files and directories currently installed.) Unpacking linux-kernel-headers (from .../linux-kernel-headers_2.6.11.2-0ubuntu13_i386.deb) ... Selecting previously deselected package libc6-dev. Unpacking libc6-dev (from .../libc6-dev_2.3.5-1ubuntu12_i386.deb) ... Setting up linux-kernel-headers (2.6.11.2-0ubuntu13) ... Setting up libc6-dev (2.3.5-1ubuntu12) ... Now take a copy of the current 'avra' TAR put it into it's own directory and unpack it by right clicking on it in Nautilus and left clicking on 'Extract here'. Change to the 'SOURCE' directory and open 'device.c' file with a text edit like gedit or similar but not a 'word processor' we need to keep the source code as pure text only! Save back to disk and close the file and the text editor. Open a 'terminal program' in the avra 'SOURCE' directory and do a file listing as, dir * and now sports persons for the moment of truth,,,,, and I quote from the "REEDME" file section 3.1 " 3.1 Linux To compile avra you need gcc and the automake utilities. These will create a ./configure script that evaluates your system enviroment. To get the avra executable, you have to issue the following commands: aclocal autoconf automake -a ./configure make && make install " So do as it says up to the 'make' command as follows from the command line prompt, rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ make You should then see something like the following: gcc -Wall -O3 -g -c -o device.o device.c gcc -o avra avra.o device.o parser.o expr.o mnemonic.o directiv.o macro.o file.o map.o coff.o args.o stdextra.o -s rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ now make yourself the super user which for me is, su Password:codecutter root@server:/home/rdb/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE# notice the name 'root' at the start of the command line and also the dollar sign at the end is now a hash sign. and finally we need to 'install' the program 'avra' to /usr/local/bin so that it is in our 'search path' so that side4linux can call it directly so issue the install command which for me is as follows, root@server:/home/rdb/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE# make install cp avra /usr/local/bin cp avra.1 /usr/local/man/man1 cp: cannot stat `avra.1': No such file or directory make: *** [install] Error 1 root@server:/home/rdb/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE# now notice the error, something wrong in the makefile or the file is missing, no bother the executable binary 'avra' has been copied to the /usr/local/bin directory so all is well!! type 'exit' and then press the 'Enter' key to return to your user space and as a final test try to launch the 'avra' program (this is my result below) exit rdb@server:~/Downloads/AVR/Avra/AVRAv 1-0-1/SOURCE$ avra --version AVRA: advanced AVR macro assembler Version 1.0.1 Build 113 (12. February 2004) Copyright (C) 1998-2004 Jon Anders Haugum, Tobias Weber AVRA is an open source assembler for Atmel AVR microcontroller family It can be used as a replacement of 'AVRASM32.EXE' the original assembler shipped with AVR Studio. We do not guarantee full compatibility for avra. AVRA comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of avra under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING. If you got this far then congratulations that completes the basic 'C' setup and now read 'setup GNOME build environment.txt' for the 'GNOME' stuff. DB. Adelaide, South Australia, 2007 Note: What would really make this file great is your feedback on it's suitability and accuracy, so if something is done wrong or is misleading then we must know as soon as possible!! To this end then you are encouraged to leave a message in the 'Help' forum on the 'side4linux' project page. Never think that someone else will do it or that you are not experienced enough to say something. It could be said that 'uber code cutters' will get by even without any documentation at all but the less experienced will benefit from your generous gift.