altbuild.sh revision dafcb997e390efa4423883dafd100c975c4095d6
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson#!/bin/sh
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2000-2002 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and distribute this software for any
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# purpose with or without fee is hereby granted, provided that the above
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# copyright notice and this permission notice appear in all copies.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater#
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
821644d49b73b49f2abc5463bc53a3132f612478Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# PERFORMANCE OF THIS SOFTWARE.
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# $Id: altbuild.sh,v 1.15 2004/03/05 05:14:15 marka Exp $
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson#
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# "Alternative build" test.
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson#
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# Build BIND9 with build options that are seldom tested otherwise.
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# Specify the CVS tag or the name of a kit .tar.gz file as a
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson# command line argument.
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson#
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafssontmpdir=/tmp
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafssoncase $# in
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson 2) arg=$1 tmpdir="$2" ;;
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson 1) arg=$1 ;;
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson *) echo "usage: $0 cvs-tag | absolute-path-to-gzipped-tar-file [tmpdir]" >&2; exit 1 ;;
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafssonesac
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafssonhere=`pwd`
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafssontest -f util/check-instincludes.sh || {
e0315f216065c35e7352e15ad454c2687f01debbAndreas Gustafsson echo "$0: must be run from top of CVS tree";
exit 1;
}
kitdir=${tmpdir}/kit
srcdir=${tmpdir}/src
builddir=${tmpdir}/build
instdir=${tmpdir}/inst
test -d $tmpdir || mkdir $tmpdir
test ! -d $kitdir || rm -rf $kitdir
mkdir $kitdir
test ! -d $srcdir || rm -rf $srcdir
mkdir $srcdir
test ! -d $builddir || rm -rf $builddir
mkdir $builddir
test ! -d $instdir || rm -rf $instdir
mkdir $instdir
case $arg in
*.tar.gz)
kit="$arg"
;;
*)
tag="$arg"
sh util/kit.sh $tag $kitdir || exit 1
kit=$kitdir/*.tar.gz
;;
esac
cd $srcdir || exit 1
gzcat $kit | tar xf -
cd $builddir || exit 1
# Test a libtool / separate object dir / threadless build.
CFLAGS="-g -DISC_CHECK_NONE -DISC_MEM_FILL=0 -DISC_LIST_CHECKINIT" \
sh $srcdir/bind-*/configure --with-libtool \
--disable-threads --with-openssl --enable-libbind --prefix=$instdir
gmake clean
gmake
gmake install
# Rebuild in the source tree so that the test suite
# works, then run it.
cd $srcdir/bind-* || exit 1
CFLAGS="-g -DISC_CHECK_NONE -DISC_MEM_FILL=0 -DISC_LIST_CHECKINIT" \
sh configure --with-libtool --disable-threads --prefix=$instdir
make
make install
( cd bin/tests && make test )
# Check the installed header files
cd $here
sh util/check-instincludes.sh $instdir