This document explains how to set up your Elemental Linux Server (ELS) system to build software from source code.
Before starting this document, you should first follow the instructions in the ELS Howto: Kernel Rebuild. Even though you may not want to customize your kernel, many source packages depend upon the existence of certain kernel components in order to build successfully.
You may also want to have access to the ELS Source CD-ROM or the ability to download the .iso image from the ELS Distribution Site.
The following steps show how to build a typical GNU package from source code.
The following example shows how you might build version 2.4 of GNU's hello package.
cd /usr/src wget ftp://ftp.gnu.org/gnu/hello/hello-2.4.tar.gz tar -zxf hello-2.4.tar.gz cd hello-2.4 ./configure --help | less ./configure make mkdir /var/tmp/hello make DESTDIR=/var/tmp/hello install
Provided everything went well, there should be a hello binary installed in /var/tmp/hello/usr/local/bin. Run it by issuing the command /var/tmp/hello/usr/local/bin/hello.
The example below shows a successful test of the hello binary.
cd /var/tmp/hello/usr/local/bin ls hello* ./hello Hello, World!
If you were not able to build the hello package successfully, here are some things to try.
cat <<EOF >hello.c #include <stdio.h> int main() { printf("Hello World.\n"); } EOF gcc -o hello hello.c