altbuild.sh revision a078776647dc80691fe97e2dd94a2525564df3ec
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont#!/bin/sh
52c1cac19a87d591152634a1de44a0311383b359Automatic Updater#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Copyright (C) 2000-2002 Internet Software Consortium.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Permission to use, copy, modify, and distribute this software for any
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# purpose with or without fee is hereby granted, provided that the above
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# copyright notice and this permission notice appear in all copies.
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updater# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# $Id: altbuild.sh,v 1.14 2002/02/20 03:48:37 marka Exp $
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# "Alternative build" test.
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Build BIND9 with build options that are seldom tested otherwise.
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Specify the CVS tag or the name of a kit .tar.gz file as a
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# command line argument.
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont#
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponttmpdir=/tmp
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcase $# in
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont 2) arg=$1 tmpdir="$2" ;;
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updater 1) arg=$1 ;;
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont *) echo "usage: $0 cvs-tag | absolute-path-to-gzipped-tar-file [tmpdir]" >&2; exit 1 ;;
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontesac
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updater
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponthere=`pwd`
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponttest -f util/check-instincludes.sh || {
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont echo "$0: must be run from top of CVS tree";
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont exit 1;
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater}
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updaterkitdir=${tmpdir}/kit
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updatersrcdir=${tmpdir}/src
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updaterbuilddir=${tmpdir}/build
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontinstdir=${tmpdir}/inst
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updatertest -d $tmpdir || mkdir $tmpdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponttest ! -d $kitdir || rm -rf $kitdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontmkdir $kitdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponttest ! -d $srcdir || rm -rf $srcdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontmkdir $srcdir
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updatertest ! -d $builddir || rm -rf $builddir
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updatermkdir $builddir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Duponttest ! -d $instdir || rm -rf $instdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontmkdir $instdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcase $arg in
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont *.tar.gz)
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont kit="$arg"
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont ;;
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont *)
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont tag="$arg"
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont sh util/kit.sh $tag $kitdir || exit 1
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont kit=$kitdir/*.tar.gz
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont ;;
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontesac
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcd $srcdir || exit 1
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontgzcat $kit | tar xf -
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcd $builddir || exit 1
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Test a libtool / separate object dir / threadless build.
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic UpdaterCFLAGS="-g -DISC_CHECK_NONE -DISC_MEM_FILL=0 -DISC_LIST_CHECKINIT" \
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater sh $srcdir/bind-*/configure --with-libtool \
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater --disable-threads --with-openssl --enable-libbind --prefix=$instdir
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updatergmake clean
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updatergmake
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updatergmake install
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater# Rebuild in the source tree so that the test suite
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater# works, then run it.
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcd $srcdir/bind-* || exit 1
90f35c2f2a1c660f3b96eec413036d238df395f6Francis DupontCFLAGS="-g -DISC_CHECK_NONE -DISC_MEM_FILL=0 -DISC_LIST_CHECKINIT" \
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont sh configure --with-libtool --disable-threads --prefix=$instdir
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontmake
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontmake install
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont( cd bin/tests && make test )
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupont# Check the installed header files
c7d32c0b0ff4c01f0d4479af3410d3c06044d48aAutomatic Updater
90f35c2f2a1c660f3b96eec413036d238df395f6Francis Dupontcd $here
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updatersh util/check-instincludes.sh $instdir
f8e3e03cacd16ffb923a9603fca23a9e1a1fee07Automatic Updater