1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#! /bin/sh
# Run this program to setup the build environment.
# $Id$
# $URL$
# $Progeny: setup,v 1.6 2002/07/12 07:05:45 epg Exp $
# This program is in the public domain.
# Too bad we don't have something like sysexits.h for POSIX sh...
EX_USAGE=64
usage ()
{
cat <<EOF
usage: $0
$0 (aclocal|autoheader|autoconf) ...
Setup the build environment. If arguments are given, only those
actions are performed.
EOF
}
do_aclocal ()
{
echo "cat /dev/null $@ > aclocal.m4"
cat /dev/null "$@" > aclocal.m4
return $?
}
do_autoheader ()
{
echo "autoheader && touch config.h.in"
autoheader && touch config.h.in
return $?
}
do_autoconf ()
{
echo "autoconf"
autoconf
return $?
}
###############################################################################
build=build
aclibs="${build}/check.m4"
aclibs="${aclibs} ${build}/config-script.m4"
aclibs="${aclibs} ${build}/libtool.m4"
aclibs="${aclibs} ${build}/show-config.m4"
if [ -f aclibs ]; then
aclibs=$(sed -e 's/#.*//' aclibs)
fi
if [ $# -eq 0 ]; then
set aclocal autoheader autoconf
fi
while [ $# -gt 0 ]; do
case $1 in
aclocal)
do_aclocal ${aclibs}
;;
autoheader)
do_autoheader
;;
autoconf)
do_autoconf
;;
*)
usage
exit ${EX_USAGE}
;;
esac
result=$?
if [ ${result} -ne 0 ]; then
echo "$0: $1 failed."
exit ${result}
fi
shift
done
exit 0
|