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
|
#!/bin/sh
# bootstrap vbisam/build_aux
# Bootstrap vbisam package from checked-out sources
# Note: call as ./bootstrap if you don't have readlink -f
#
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
# Written by Simon Sobisch
#
# This file is part of VBISAM, originating in GnuCOBOL 3.1.2.
#
# VBISAM 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.
#
# VBISAM 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 VBISAM. If not, see <https://www.gnu.org/licenses/>.
me=bootstrap
echo "start to bootstrap VBISAM"
# get path to VBISAM main directory, possibly set with VBMAINPATH
if test -z "$VBMAINPATH"; then
if test "$0" = "./$me"; then
MAINPATH=..
else
MAINPATH=$(dirname $(readlink -f "$0"))/..
fi
else
MAINPATH=$VBMAINPATH
fi
if test ! -f $MAINPATH/build_aux/$me; then
echo; echo "ERROR - cannot set main directory [checked $MAINPATH/build_aux/$me] - aborting $me" && exit 1
fi
echo; echo "ensure that we have executable scripts..."
scripts="compile config.guess config.sub depcomp install-sh ltmain.sh mdate-sh missing mkinstalldirs"
for file in $scripts ; do
if test -f $MAINPATH/build_aux/$file; then
chmod -f u+x $MAINPATH/build_aux/$file
else
echo "WARNING, file $MAINPATH/build-aux/$file is missing."
fi
done
scripts="autogen.sh"
for file in $scripts ; do
if test -f $MAINPATH/$file; then
chmod -f u+x $MAINPATH/$file
else
if test ! $file = "create_win_dist.sh"; then
echo "WARNING, file $MAINPATH/$file is missing."
fi
fi
done
echo; echo "running autoreconf..."
ret=0
# changing build_aux scripts at large:
#autoreconf --verbose --force --install --include=m4 $MAINPATH; ret=$?
# changing files possibly needed for new systems:
#config_file_url="https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux"
#for file in config.guess config.sub; do
# echo "$0: getting $file..."
# wget -q --timeout=5 -O $MAINPATH/build_aux/$file.tmp "${config_file_url}/${file};hb=HEAD" \
# && mv $MAINPATH/build_aux/$file.tmp $MAINPATH/build_aux/$file \
# && chmod a+x $MAINPATH/build_aux/$file
# retval=$?
# rm -f $MAINPATH/build_aux/$file.tmp
# test $retval -eq 0 # || exit $retval
#done
# ensure the configure and Makefile parts are up-to-date:
msgs=/tmp/autoreconf
autoreconf --verbose --force --include=m4 $MAINPATH > $msgs 2>&1; ret=$?
# Filter aminclude_static as those are only used _within_ another
# check so reporting as portability problem is only noise.
# This has the effect of redirecting some error messages to stdout.
# to be moved to the Makefile - currently only usable for bootstrap,
# but should be done on autogen, too
awk '/^aminclude_static[.]am:/ { msg = msg sep $0; sep = "\n"; next }
/Makefile[.]am.+aminclude_static.am.+from here/ {
msg = ""; sep = ""; next }
msg { print msg > "/dev/stderr"; msg = "" }
{ print }' $msgs
rm -rf $msgs
if test $ret -ne 0; then
echo; echo "ERROR, autoreconf returned $ret - aborting bootstrap" && exit $ret
fi
echo; echo "bootstrap is finished"
echo; echo "now run configure with your desired options, for instance:"
echo " ./configure CFLAGS='-g' # in $MAINPATH"
echo "or, especially preferred for development:"
echo " mkdir build && cd build \ "
echo " && $MAINPATH/configure --enable-debug --enable-hardening"
|