2008-08-18 14:26:05 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# This "bootstrap" script performs various pre-autoreconf actions
|
|
|
|
# that are required after pulling fresh sources from the repository.
|
|
|
|
#
|
2013-12-04 21:33:17 +00:00
|
|
|
# --force is supported and will be passed to autoreconf
|
|
|
|
#
|
2008-08-18 14:26:05 +00:00
|
|
|
# NOTE: THE NTP VERSION NUMBER COMES FROM packageinfo.sh
|
|
|
|
#
|
|
|
|
# all other instances of it anywhere in the source base have propagated
|
|
|
|
# from this one source.
|
|
|
|
#
|
|
|
|
# To use the raw sources from the repository, you must have the following
|
|
|
|
# tools available to you:
|
|
|
|
#
|
|
|
|
# 1. Autoconf and Automake.
|
|
|
|
#
|
|
|
|
# 2. lynx. This is used to extract the COPYRIGHT file extracted from
|
|
|
|
# the html documentation.
|
|
|
|
#
|
|
|
|
# *** The following are no longer needed for simple builds from the repo
|
|
|
|
# 3. AutoGen. The repository does *not* contain the files generated from
|
|
|
|
# the option definition files and it does not contain the libopts
|
|
|
|
# tear-off/redistributable library.
|
|
|
|
#
|
|
|
|
# Note: AutoGen needs GNU Guile.
|
|
|
|
#
|
|
|
|
# 4. gunzip. The tear-off library is a gzipped tarball.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
(cd sntp && ../scripts/build/genver) || {
|
|
|
|
echo scripts/build/genver failed ; exit 1; }
|
2008-08-18 14:26:05 +00:00
|
|
|
|
|
|
|
# autoreconf says:
|
|
|
|
# The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
|
|
|
|
# AUTOPOINT, LIBTOOLIZE, M4 are honored.
|
|
|
|
|
|
|
|
AUTORECONF=${AUTORECONF:-autoreconf}
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
# case `hostname` in
|
|
|
|
# pogo.udel.edu)
|
|
|
|
# if fgrep -q 4.2.4 sntp/m4/version.m4; then
|
|
|
|
# AUTOCONF=autoconf-2.59
|
|
|
|
# AUTOHEADER=autoheader-2.59
|
|
|
|
# AUTOMAKE=automake-1.9
|
|
|
|
# ACLOCAL=aclocal-1.9
|
|
|
|
# export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
|
|
|
|
# fi
|
|
|
|
# ;;
|
|
|
|
# esac
|
2008-08-18 14:26:05 +00:00
|
|
|
|
|
|
|
# 20060629: HMS: Let's try checking in libopts and the autogen-generated files
|
|
|
|
## The copy for ntp...
|
|
|
|
#rm -rf libopts*
|
|
|
|
#gunzip -c $(autoopts-config --libsrc) | (
|
|
|
|
# tar -xvf -
|
|
|
|
# mv libopts-*.*.* libopts )
|
|
|
|
|
|
|
|
## The copy for sntp...
|
|
|
|
#rm -rf sntp/libopts*
|
|
|
|
#gunzip -c $(autoopts-config --libsrc) | (
|
|
|
|
# cd sntp
|
|
|
|
# tar -xvf -
|
|
|
|
# mv libopts-*.*.* libopts )
|
|
|
|
|
|
|
|
def_files=`find [B-Za-z]* -type f -name '*.def' -print | fgrep -v /SCCS/`
|
|
|
|
prog_opt_files=`grep -l '^prog.name' $def_files`
|
|
|
|
|
|
|
|
## AutoGen stuff
|
|
|
|
|
|
|
|
#incdir=${PWD}/include
|
|
|
|
|
|
|
|
#for f in ${prog_opt_files}
|
|
|
|
#do
|
|
|
|
# ( cd $(dirname ${f})
|
|
|
|
# echo "Running autogen on $f..."
|
|
|
|
# autogen -L${incdir} $(basename ${f})
|
|
|
|
# ) || exit 1
|
|
|
|
#done
|
|
|
|
|
|
|
|
## Non-AutoGen stuff
|
|
|
|
|
|
|
|
# touch the stuff generated by the opt files
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
l=
|
|
|
|
lh=
|
|
|
|
li=
|
2008-08-18 14:26:05 +00:00
|
|
|
for f in ${prog_opt_files}
|
|
|
|
do
|
2014-12-20 22:52:39 +00:00
|
|
|
f=`echo $f | sed -e 's/-opts.def//' -e 's/.def//'`
|
|
|
|
dfi=`dirname $f`
|
|
|
|
dfi=`echo $dfi | sed -e 's:$:/invoke-*:'`
|
|
|
|
for i in `ls -1 $f* $dfi`
|
2008-08-18 14:26:05 +00:00
|
|
|
do
|
|
|
|
case "$i" in
|
2014-12-20 22:52:39 +00:00
|
|
|
*invoke-*)
|
|
|
|
li="$li $i"
|
|
|
|
;;
|
|
|
|
*.c|*.h|*.[1-9]*man|*.[1-9]*mdoc|*.man.in|*.mdoc.in|*-opts|*.texi|*.menu)
|
2008-08-18 14:26:05 +00:00
|
|
|
l="$l $i"
|
|
|
|
;;
|
2013-12-04 21:33:17 +00:00
|
|
|
*.html)
|
|
|
|
lh="$lh $i"
|
|
|
|
;;
|
2008-08-18 14:26:05 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
2014-12-20 22:52:39 +00:00
|
|
|
case "$l" in
|
|
|
|
'') ;;
|
|
|
|
*) touch $l
|
|
|
|
echo "Touching <$l>"
|
|
|
|
sleep 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case "$li" in
|
|
|
|
'') ;;
|
|
|
|
*) touch $li
|
|
|
|
echo "Touching <$li>"
|
|
|
|
sleep 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case "$lh" in
|
|
|
|
'') ;;
|
|
|
|
*) touch $lh
|
|
|
|
echo "Touching <$lh>"
|
|
|
|
;;
|
|
|
|
esac
|
2008-08-18 14:26:05 +00:00
|
|
|
|
|
|
|
## EOAutoGen stuff
|
|
|
|
|
2013-12-04 21:33:17 +00:00
|
|
|
# Yacc/bison files ntp_parser.[ch] so we don't require the tool if
|
|
|
|
# ntp_parser.y hasn't been updated. At the same time, keyword-gen-utd
|
|
|
|
# and ntp_keyword.h which are derived from ntp_parser.h and
|
|
|
|
# keyword-gen.c.
|
|
|
|
|
|
|
|
touch ntpd/ntp_parser.[ch] ntpd/keyword-gen-utd ntpd/ntp_keyword.h
|
|
|
|
|
2008-08-18 14:26:05 +00:00
|
|
|
cp bincheck.mf sntp/
|
2013-12-04 21:33:17 +00:00
|
|
|
cp depsver.mf sntp/
|
2008-08-18 14:26:05 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
${AUTORECONF} -i -v "$@"
|
|
|
|
|
|
|
|
# Because some systems do not support 'test a -nt b'
|
|
|
|
case `ls -1tr config.h.in aclocal.m4 | tail -1` in
|
|
|
|
aclocal.m4) touch config.h.in ;;
|
|
|
|
esac
|
|
|
|
case `ls -1tr sntp/config.h.in sntp/aclocal.m4 | tail -1` in
|
|
|
|
sntp/aclocal.m4) touch sntp/config.h.in ;;
|
|
|
|
esac
|
|
|
|
case `ls -1tr sntp/libevent/config.h.in sntp/libevent/aclocal.m4 | tail -1` in
|
|
|
|
sntp/libevent/aclocal.m4) touch sntp/libevent/config.h.in ;;
|
|
|
|
esac
|
2008-08-18 14:26:05 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
# DH: 20110118: Due to our workaround for the AM_COND_IF bug that was
|
|
|
|
# triggering the buggy recursive autoreconf, we can once again use a
|
|
|
|
# single autoreconf invocation. See
|
|
|
|
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7860
|
2013-12-04 21:33:17 +00:00
|
|
|
# DH: 20101120: We are back to a single copy of libopts, and
|
|
|
|
# once again it seems we need to run autoreconf in sntp after
|
|
|
|
# the top-level run to get a correct sntp/libopts/Makefile.in.
|
|
|
|
# To reduce redundancy, the top-level autoreconf uses --no-recursive.
|
|
|
|
#
|
2008-08-18 14:26:05 +00:00
|
|
|
# HMS: 20060618: Now that we use separate copies of libopts
|
|
|
|
# we should only need the previous line.
|
|
|
|
#
|
|
|
|
## HMS: 20060615: the next line seems to be needed to make sure
|
|
|
|
## we get the correct srcdir path in sntp/libopts/Makefile.in
|
|
|
|
#rm -rf sntp/autom4te.cache
|
|
|
|
#
|
2014-12-20 22:52:39 +00:00
|
|
|
# (cd sntp && ${AUTORECONF} -i -v "$@")
|