[CLUE-Cert] LFS build program
Dennis J Perkins
djperkins at americanisp.net
Sat Apr 19 14:00:43 MDT 2003
I've done some more thinking about how to do this. The idea of using
keyword/parameter pairs is good but insufficient in shell scripts. I
think it will work fine using XML. But I think it is premature to
consider XML at this time.
The reason the first approach won't work is that some packages need
commands like sed, cp, ln, etc. applied. In a few cases, a series of
commands are needed. The result starts looking like a shell script
again. Rock Linux uses shell scripts to build itself, so I looked at it
to see what it does. It also uses shell scripts, called conf files,
that set variables. Some variables contain functions.
Here is a quick idea on how binutils might be built.
# binutils.conf
confoptions="--disable-nls"
makeflags="LDFLAGS=--all-static"
builddir=y
patches=binutils-2.13.patch
A quick and dirty (and untested!) build function example in the build
engine.
build() { # $1=package.conf
source $1
for patch in $patches
do
patch $patchflags $patch
done
if [ $builddir = "y" ]; then
bdir=${srcdir}-build
test -d $bdir && rm -rf $bdir
mkdir $bdir
cd $bdir
else
cd $srcdir
fi
# Run preconfigure function in conf file if it exists.
eval $preconfigure
if [ -z $bdir ]; then
./configure $confoptions --prefix=$prefix
else
../${srcdir}/configure $confoptions --prefix=$prefix
fi
# Run anything that needs to be run prior to running make.
$premake
make $makeflags $makeoptions
make check
# Run anything that needs to be done after running make.
eval $postmake
make install $makeinstalloptions
}
Some metainformation about binutils might be useful
# binutils.info
PACKAGE binutils
VERSION 2.13
NEEDS gcc-core-3.2.1 glibc-2.3.1
URL ftp.gnu.org/pub/
PATCHES binutils-2.13.patch
More information about the clue-cert
mailing list