NSLU2-Linux
view · edit · print · history

Note that you can now use the instructions at NativelyCompileUnslungPackages to natively compile GNU gawk directly from the Unslung CVS repository.

Goal:

Build a native version of GNU gawk directly on your NSLU2 Box.

Prerequisites:

Installation of Unslung.
Successful completion of NativeNSLU2Toolchain (including setting and exporting C_INCLUDE_PATH), which provides a development environment on your NSLU2.
Successful completion of BuildGNUMakeOnYourNSLU2Box. Make is needed to make gawk.
Busybox version 1.00 (potentially optional). Use ipkg to install.

Steps:

The instructions for making GNU gawk are included in README and INSTALL files included in the release. However, this set of instructions are specific for the NSLU2. In addition, the sed command in step 2 takes care of a problem with the configuration script's creation of the config.h file. (It would be best if this were corrected in the GNU source file...) All these instructions take place directly on your NSLU2. Don't skip the prerequisites!

1) Retrieve source code for GNU gawk, and then unzip and untar it. I did this from my NSLU2 box using the following command:

    cd /share/hdd/data
wget ftp://ftp.gnu.org/gnu/gawk/gawk-3.1.4.tar.gz
gunzip gawk-3.1.4.tar.gz (gunzip comes with Busybox 1.00)
tar -xvf gawk-3.1.4.tar

2) Create the gawk executable, and put it somewhere in your path.

    cd gawk-3.1.4
./configure (This takes about 7 minutes)
mv config.h config.tmp (configure incorrectly identifies presence of getgroups()(?))
sed -e '/HAVE_GETGROUPS/d' config.tmp >config.h
make -f Makefile gawk (make should also work)
strip gawk (Optional)
mv gawk /opt/usr/bin (ensure /opt/usr/bin is in your path)

That's it! GNU gawk for the NSLU2!

view · edit · print · history · Last edited by michaelebrownmindspringcom.
Based on work by michaelebrownmindspringcom and jeremyeglen.
Originally by rwhitby.
Page last modified on April 14, 2005, at 10:26 PM