From: Theodore Tso Date: Wed, 21 Sep 1994 02:45:20 +0000 (+0000) Subject: Kbuild is a program which builds a Kerberos V5 distribution with a X-Git-Tag: krb5-1.0-beta4.3~105 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=661fe5cbe1f4560e9d5971f933c9e0c19ea35460;p=krb5.git Kbuild is a program which builds a Kerberos V5 distribution with a specific set of compilation programs and configuration options, in a repeatable manner. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4304 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/kbuild b/src/util/kbuild new file mode 100644 index 000000000..72b45a0a1 --- /dev/null +++ b/src/util/kbuild @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Kerberos V5 build tool. Builds Kerberos V5 using a specified +# configuration file to control which support programs are used to +# compile it, which options are given to configure, etc. +# + +CONFIG=$1 +BUILD_PATH=./build-path + +if test ${CONFIG}x = x ]; then + echo "You must specify an build configuration file!" + exit 1 +fi + + +SRCDIR=`sed -e '/^SRCDIR:/!d' -e 's/SRCDIR: *//' $CONFIG` +CONFIG_OPTS=`sed -e '/^CONFIG_OPTS:/!d' -e 's/CONFIG_OPTS: *//' $CONFIG` +CC=`sed -e '/^CC:/!d' -e 's/CC: *//' $CONFIG` +CC_OPTS=`sed -e '/^CC_OPTS:/!d' -e 's/CC_OPTS: *//' $CONFIG` +KRB4=`sed -e '/^KRB4:/!d' -e 's/KRB4: *//' $CONFIG` + +CMD_PROGS=`cat $CONFIG | sed -e '1,/BEGIN CMD_LIST/d' \ + -e '/END CMD_LIST/,$d' \ + -e '/^$/d' -e '/^\#/d'` + +if test ${CC}x != "x" +then + CONFIG_OPTS="$CONFIG_OPTS --with-cc=${CC}" +fi + +if test ${CC_OPTS}x != "x" +then + CONFIG_OPTS="$CONFIG_OPTS --with-ccopts=${CC_OPTS}" +fi + +if test ${KRB4}x != "x" +then + CONFIG_OPTS="$CONFIG_OPTS --with-krb4=${KRB4}" +fi + +/bin/rm -rf $BUILD_PATH +mkdir $BUILD_PATH +cd $BUILD_PATH + +for i in $CMD_PROGS +do + ln -s $i +done + +cd .. + +PATH=`pwd`/$BUILD_PATH +export PATH +echo "Build path is $PATH" + +$SRCDIR/configure $CONFIG_OPTS + +echo "Configuration done. Building using the command:" +echo " (setenv PATH $PATH; make)" +echo " " + +make