3 # This "bootstrap" script performs various pre-autoreconf actions
4 # that are required after pulling fresh sources from the repository.
6 # --force is supported and will be passed to autoreconf
8 # NOTE: THE NTP VERSION NUMBER COMES FROM packageinfo.sh
10 # all other instances of it anywhere in the source base have propagated
11 # from this one source.
13 # To use the raw sources from the repository, you must have the following
14 # tools available to you:
16 # 1. Autoconf and Automake.
18 # 2. lynx. This is used to extract the COPYRIGHT file extracted from
19 # the html documentation.
21 # *** The following are no longer needed for simple builds from the repo
22 # 3. AutoGen. The repository does *not* contain the files generated from
23 # the option definition files and it does not contain the libopts
24 # tear-off/redistributable library.
26 # Note: AutoGen needs GNU Guile.
28 # 4. gunzip. The tear-off library is a gzipped tarball.
32 (cd sntp && ../scripts/build/genver) || {
33 echo scripts/build/genver failed ; exit 1; }
36 # The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
37 # AUTOPOINT, LIBTOOLIZE, M4 are honored.
39 AUTORECONF=${AUTORECONF:-autoreconf}
43 # if fgrep -q 4.2.4 sntp/m4/version.m4; then
44 # AUTOCONF=autoconf-2.59
45 # AUTOHEADER=autoheader-2.59
46 # AUTOMAKE=automake-1.9
48 # export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
54 # 20060629: HMS: Let's try checking in libopts and the autogen-generated files
55 ## The copy for ntp...
57 #gunzip -c $(autoopts-config --libsrc) | (
59 # mv libopts-*.*.* libopts )
61 ## The copy for sntp...
63 #gunzip -c $(autoopts-config --libsrc) | (
66 # mv libopts-*.*.* libopts )
71 # the ruby generator must be older than the test files.
72 # the test files must be older than the runner files.
74 runner_files=`find [B-Za-z]* -type f -name 'run-*' -print | fgrep -v /SCCS/`
78 for f in ${runner_files}
80 fb=`echo $f | sed -e 's/run-//'`
82 lr="$lr $f" # Yes, lr and runner_files are eventually the same
90 ## EOUnity test runners
94 def_files=`find [B-Za-z]* -type f -name '*.def' -print | fgrep -v /SCCS/`
95 prog_opt_files=`grep -l '^prog.name' $def_files`
97 # touch the stuff generated by the opt files
102 for f in ${prog_opt_files}
104 f=`echo $f | sed -e 's/-opts.def//' -e 's/.def//'`
106 dfi=`echo $dfi | sed -e 's:$:/invoke-*:'`
107 for i in `ls -1 $f* $dfi`
113 *.c|*.h|*.[1-9]*man|*.[1-9]*mdoc|*.man.in|*.mdoc.in|*-opts|*.texi|*.menu)
132 echo "Touching <$li>"
139 echo "Touching <$lh>"
147 # Yacc/bison files ntp_parser.[ch] so we don't require the tool if
148 # ntp_parser.y hasn't been updated. At the same time, keyword-gen-utd
149 # and ntp_keyword.h which are derived from ntp_parser.h and
152 touch ntpd/ntp_parser.[ch] ntpd/keyword-gen-utd ntpd/ntp_keyword.h
154 ## EOYacc/bison files
159 ${AUTORECONF} -i -v "$@"
161 # Because some systems do not support 'test a -nt b'
162 case `ls -1tr config.h.in aclocal.m4 | tail -1` in
163 aclocal.m4) touch config.h.in ;;
165 case `ls -1tr sntp/config.h.in sntp/aclocal.m4 | tail -1` in
166 sntp/aclocal.m4) touch sntp/config.h.in ;;
168 case `ls -1tr sntp/libevent/config.h.in sntp/libevent/aclocal.m4 | tail -1` in
169 sntp/libevent/aclocal.m4) touch sntp/libevent/config.h.in ;;
172 # DH: 20110118: Due to our workaround for the AM_COND_IF bug that was
173 # triggering the buggy recursive autoreconf, we can once again use a
174 # single autoreconf invocation. See
175 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7860
176 # DH: 20101120: We are back to a single copy of libopts, and
177 # once again it seems we need to run autoreconf in sntp after
178 # the top-level run to get a correct sntp/libopts/Makefile.in.
179 # To reduce redundancy, the top-level autoreconf uses --no-recursive.
181 # HMS: 20060618: Now that we use separate copies of libopts
182 # we should only need the previous line.
184 ## HMS: 20060615: the next line seems to be needed to make sure
185 ## we get the correct srcdir path in sntp/libopts/Makefile.in
186 #rm -rf sntp/autom4te.cache
188 # (cd sntp && ${AUTORECONF} -i -v "$@")