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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
#! /bin/echo this-file-should-be-sourced,-not-executed.
## -*- Mode: shell-script -*-
## bootstrap -- bootstrapping script
##
## This file is part of Complexity.
## Complexity Copyright (c) 2011-2016 by Bruce Korb - all rights reserved
##
## Complexity is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by the
## Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## Complexity is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this program. If not, see <http://www.gnu.org/licenses/>.
initialize()
{
set -e
PS4='>BS-$FUNCNAME> '
if test "${xtrace+true}" = true
then
TRAPPED=false
tcode='TRAPPED=true sfile=${BASH_SOURCE[0]} sline=${BASH_LINENO[0]}'
trap "$tcode"' ; die "failed: ${_:-${FUNCNAME[0]}}"' 0
fi
builddir=$PWD
rm -rf m4 build-aux 2>/dev/null
mkdir m4 build-aux
cd ${progdir}
chmod a+x tests/*.test
if test -d .git
then
git clean -f -x -d .
elif test -f .sdir
then
cd $(<.sdir)
else
cd $(dirname "$0")/../complexity || \
die "Cannot locate source directory"
fi
GNULIB_DIR=${GNULIB_DIR:-~gnu/proj/gnulib}
v=$(bash ${GNULIB_DIR}/build-aux/git-version-gen \
$progdir/.tarball-version)
printf %s $v > $progdir/.tarball-version
cd $progdir/src
test -f opts.c -a -f opts.h -a opts.c -nt opts.def || \
autogen opts.def
if test -f char-types.h && test char-types.h -nt char-types.map
then
:
else
cm=`command -v char-mapper`
if test -x "$cm"
then $cm char-types.map
else touch char-types.h
fi
fi
cd ${progdir}
cp $(autoopts-config pkgdatadir)/liboptschk.m4 m4/.
sed $'1i\\\n'"New in $v - $(date +'%B %Y')"$'\\\n\n' NEWS > XX
mv -f XX NEWS
# Trick automake into "allowing" us to use texinfo rules:
#
printf '\\input texinfo\n@setfilename complexity.info\n' \
> doc/complexity.texi
gnulib_modules=$(
echo \
close \
fdl \
gendocs \
gpl-3.0 \
malloc-posix \
snprintf \
stdbool
)
test -d ~gnu/proj/gnulib && \
export GNULIB_SRCDIR=$(echo ~gnu/proj/gnulib)
set +e
}
untrap_die() {
case "$(trap -p 0)" in
*TRAPPED=true*' die '* )
trap '' 0
;;
esac
ln build-aux/* .
}
. ./"$0.std"
oribs=$(echo ~gnu/proj/libtool/bootstrap)
test -f "$oribs" && {
cmp -s "$oribs" "$0" || {
rm -f "$0"
cp -fp "$oribs" "$0"
exec bash $dasxh "$0" "$@"
}
}
initialize
func_add_hook func_fini untrap_die
|