User:NeoAmsterdam/Snippets/Source Code

From OLPC
Jump to navigation Jump to search
This procedure builds software from source code.
Developers’ tools must be installed. Your results may vary.

Source code is a collection of instructions. Computers do not understand these instructions until it is translated into the computer’s own language. Building source code is translating instructions that people can understand into instructions that computers can understand and act upon.

Most programs a user may want can be obtained by downloading an activity or by installing it with yum. However, there are times when a user wants a program that is not available as an activity and is not available through yum. When this happens, one has to build the program from its source code.

This document will briefly explain how prepare your XO so that it can build programs from source code. Please note that this covers only the most popular form of building from source code (./configure; make; make install).

Finally, children should get permission from a parent, guardian, teacher, and/or Linux guru before building source code. Adult supervision is not required, but guidance is highly recommended.

Prerequisites

This process or procedure involves yum.
If misused, yum can render your XO unusable. Please read the documentation before using yum.

Compiler

Before you can translate source code into a program, you need to have the translation program (or “compiler”) installed. The most prevalent compiler is the GNU Compiler Collection, better known as “GCC”. GCC can be installed with yum:

  1. Open the Terminal Activity
  2. Type su
    You can now use yum.
  3. Type yum install gcc
  4. yum will ask you to confirm installing GCC. To continue, type y; to stop, type n
  5. yum will install GCC. When it has finished, type exit

Toolchain

Although you can build programs with GCC, other tools are often needed. Three of the most common ones used are autoconf, automake, and patch. These can also be installed with yum:

  1. Open the Terminal Activity
  2. Type su
    You can now use yum.
  3. Type yum install autoconf automake patch
  4. yum will ask you to confirm installing autoconf, automake, and patch. To continue, type y; to stop, type n
  5. yum will install autoconf, automake, and patch. When it has finished, type exit