Difference between revisions of "Compile Software for the Humax"

From hummy.tv Wiki
Jump to: navigation, search
Line 34: Line 34:
  
 
humax# cd gzip-1.4
 
humax# cd gzip-1.4
humax# CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ./configure --prefix=/mod
+
humax# CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \
 +
    ./configure --prefix=/mod --build=mipsel-linux
 
checking for a BSD-compatible install... /mod/bin/busybox/install -c
 
checking for a BSD-compatible install... /mod/bin/busybox/install -c
 
checking whether build environment is sane... yes
 
checking whether build environment is sane... yes

Revision as of 16:51, 18 August 2011

Compiling on-box

It is possible to compile some software directly on the Humax itself, however due to the limited amount of CPU horsepower available, this is only recommended for fairly small packages.

First you need to install the gcc and gawk packages. gcc is the compiler itself and automatically pulls in dependant packages, gawk is needed to properly support packages which use GNU autoconf, which most do.

humax# opkg install gcc gawk

After this, close your telnet session and create a new one to properly set up the environment, and you are ready to compile your first piece of software on the Humax.

Example - compiling the GNU zip (gzip) program

humax# cd /mod/tmp
humax# wget http://ftp.gnu.org/gnu/gzip/gzip-1.4.tar.gz
--2011-08-18 16:39:58--  http://ftp.gnu.org/gnu/gzip/gzip-1.4.tar.gz
Resolving ftp.gnu.org... 140.186.70.20
Connecting to ftp.gnu.org|140.186.70.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 907411 (886K) [application/x-gzip]
Saving to: `gzip-1.4.tar.gz'

100%[======================================>] 907,411      225K/s   in 4.2s    

2011-08-18 16:40:03 (210 KB/s) - `gzip-1.4.tar.gz' saved [907411/907411]

humax# tar -xvf gzip-1.4.tar.gz 
gzip-1.4/
gzip-1.4/zgrep.1
gzip-1.4/configure.ac
...

humax# cd gzip-1.4
humax# CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" \
    ./configure --prefix=/mod --build=mipsel-linux
checking for a BSD-compatible install... /mod/bin/busybox/install -c
checking whether build environment is sane... yes
...

humax# make
Making all in lib
make[1]: Entering directory `/mnt/hd2/mod/tmp/gzip-1.4/lib'
  GEN      alloca.h
  GEN      arg-nonnull.h
...

humax# ./gzip -V
gzip 1.4
Copyright (C) 2007 Free Software Foundation, Inc.


Cross compiling on an external host