bootstrap revision 1.1.1.4 1 1.1 kardel #! /bin/sh
2 1.1 kardel
3 1.1 kardel # This "bootstrap" script performs various pre-autoreconf actions
4 1.1 kardel # that are required after pulling fresh sources from the repository.
5 1.1 kardel #
6 1.1.1.2 kardel # --force is supported and will be passed to autoreconf
7 1.1.1.2 kardel #
8 1.1 kardel # NOTE: THE NTP VERSION NUMBER COMES FROM packageinfo.sh
9 1.1 kardel #
10 1.1 kardel # all other instances of it anywhere in the source base have propagated
11 1.1 kardel # from this one source.
12 1.1 kardel #
13 1.1 kardel # To use the raw sources from the repository, you must have the following
14 1.1 kardel # tools available to you:
15 1.1 kardel #
16 1.1 kardel # 1. Autoconf and Automake.
17 1.1 kardel #
18 1.1 kardel # 2. lynx. This is used to extract the COPYRIGHT file extracted from
19 1.1 kardel # the html documentation.
20 1.1 kardel #
21 1.1 kardel # *** The following are no longer needed for simple builds from the repo
22 1.1 kardel # 3. AutoGen. The repository does *not* contain the files generated from
23 1.1 kardel # the option definition files and it does not contain the libopts
24 1.1 kardel # tear-off/redistributable library.
25 1.1 kardel #
26 1.1 kardel # Note: AutoGen needs GNU Guile.
27 1.1 kardel #
28 1.1 kardel # 4. gunzip. The tear-off library is a gzipped tarball.
29 1.1 kardel
30 1.1 kardel set -e
31 1.1 kardel
32 1.1.1.3 christos (cd sntp && ../scripts/build/genver) || {
33 1.1.1.3 christos echo scripts/build/genver failed ; exit 1; }
34 1.1 kardel
35 1.1 kardel # autoreconf says:
36 1.1 kardel # The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
37 1.1 kardel # AUTOPOINT, LIBTOOLIZE, M4 are honored.
38 1.1 kardel
39 1.1 kardel AUTORECONF=${AUTORECONF:-autoreconf}
40 1.1 kardel
41 1.1.1.3 christos # case `hostname` in
42 1.1.1.3 christos # pogo.udel.edu)
43 1.1.1.3 christos # if fgrep -q 4.2.4 sntp/m4/version.m4; then
44 1.1.1.3 christos # AUTOCONF=autoconf-2.59
45 1.1.1.3 christos # AUTOHEADER=autoheader-2.59
46 1.1.1.3 christos # AUTOMAKE=automake-1.9
47 1.1.1.3 christos # ACLOCAL=aclocal-1.9
48 1.1.1.3 christos # export AUTOCONF AUTOHEADER AUTOMAKE ACLOCAL
49 1.1.1.3 christos # fi
50 1.1.1.3 christos # ;;
51 1.1.1.3 christos # esac
52 1.1 kardel
53 1.1 kardel # 20060629: HMS: Let's try checking in libopts and the autogen-generated files
54 1.1 kardel ## The copy for ntp...
55 1.1 kardel #rm -rf libopts*
56 1.1 kardel #gunzip -c $(autoopts-config --libsrc) | (
57 1.1 kardel # tar -xvf -
58 1.1 kardel # mv libopts-*.*.* libopts )
59 1.1 kardel
60 1.1 kardel ## The copy for sntp...
61 1.1 kardel #rm -rf sntp/libopts*
62 1.1 kardel #gunzip -c $(autoopts-config --libsrc) | (
63 1.1 kardel # cd sntp
64 1.1 kardel # tar -xvf -
65 1.1 kardel # mv libopts-*.*.* libopts )
66 1.1 kardel
67 1.1 kardel def_files=`find [B-Za-z]* -type f -name '*.def' -print | fgrep -v /SCCS/`
68 1.1 kardel prog_opt_files=`grep -l '^prog.name' $def_files`
69 1.1 kardel
70 1.1 kardel ## AutoGen stuff
71 1.1 kardel
72 1.1 kardel #incdir=${PWD}/include
73 1.1 kardel
74 1.1 kardel #for f in ${prog_opt_files}
75 1.1 kardel #do
76 1.1 kardel # ( cd $(dirname ${f})
77 1.1 kardel # echo "Running autogen on $f..."
78 1.1 kardel # autogen -L${incdir} $(basename ${f})
79 1.1 kardel # ) || exit 1
80 1.1 kardel #done
81 1.1 kardel
82 1.1 kardel ## Non-AutoGen stuff
83 1.1 kardel
84 1.1 kardel # touch the stuff generated by the opt files
85 1.1 kardel
86 1.1.1.4 christos l=
87 1.1.1.4 christos lh=
88 1.1.1.4 christos li=
89 1.1 kardel for f in ${prog_opt_files}
90 1.1 kardel do
91 1.1.1.3 christos f=`echo $f | sed -e 's/-opts.def//' -e 's/.def//'`
92 1.1.1.3 christos dfi=`dirname $f`
93 1.1.1.3 christos dfi=`echo $dfi | sed -e 's:$:/invoke-*:'`
94 1.1.1.3 christos for i in `ls -1 $f* $dfi`
95 1.1 kardel do
96 1.1 kardel case "$i" in
97 1.1.1.4 christos *invoke-*)
98 1.1.1.4 christos li="$li $i"
99 1.1.1.4 christos ;;
100 1.1.1.4 christos *.c|*.h|*.[1-9]*man|*.[1-9]*mdoc|*.man.in|*.mdoc.in|*-opts|*.texi|*.menu)
101 1.1 kardel l="$l $i"
102 1.1 kardel ;;
103 1.1.1.2 kardel *.html)
104 1.1.1.2 kardel lh="$lh $i"
105 1.1.1.2 kardel ;;
106 1.1 kardel esac
107 1.1 kardel done
108 1.1 kardel done
109 1.1.1.4 christos case "$l" in
110 1.1.1.4 christos '') ;;
111 1.1.1.4 christos *) touch $l
112 1.1.1.4 christos echo "Touching <$l>"
113 1.1.1.4 christos sleep 1
114 1.1.1.4 christos ;;
115 1.1.1.4 christos esac
116 1.1.1.4 christos case "$li" in
117 1.1.1.4 christos '') ;;
118 1.1.1.4 christos *) touch $li
119 1.1.1.4 christos echo "Touching <$li>"
120 1.1.1.4 christos sleep 1
121 1.1.1.4 christos ;;
122 1.1.1.4 christos esac
123 1.1.1.4 christos case "$lh" in
124 1.1.1.4 christos '') ;;
125 1.1.1.4 christos *) touch $lh
126 1.1.1.4 christos echo "Touching <$lh>"
127 1.1.1.4 christos ;;
128 1.1.1.4 christos esac
129 1.1 kardel
130 1.1 kardel ## EOAutoGen stuff
131 1.1 kardel
132 1.1.1.2 kardel # Yacc/bison files ntp_parser.[ch] so we don't require the tool if
133 1.1.1.2 kardel # ntp_parser.y hasn't been updated. At the same time, keyword-gen-utd
134 1.1.1.2 kardel # and ntp_keyword.h which are derived from ntp_parser.h and
135 1.1.1.2 kardel # keyword-gen.c.
136 1.1 kardel
137 1.1.1.2 kardel touch ntpd/ntp_parser.[ch] ntpd/keyword-gen-utd ntpd/ntp_keyword.h
138 1.1 kardel
139 1.1 kardel cp bincheck.mf sntp/
140 1.1 kardel cp depsver.mf sntp/
141 1.1 kardel
142 1.1.1.3 christos ${AUTORECONF} -i -v "$@"
143 1.1 kardel
144 1.1.1.4 christos # Because some systems do not support 'test a -nt b'
145 1.1.1.4 christos case `ls -1tr config.h.in aclocal.m4 | tail -1` in
146 1.1.1.4 christos aclocal.m4) touch config.h.in ;;
147 1.1.1.4 christos esac
148 1.1.1.4 christos case `ls -1tr sntp/config.h.in sntp/aclocal.m4 | tail -1` in
149 1.1.1.4 christos sntp/aclocal.m4) touch sntp/config.h.in ;;
150 1.1.1.4 christos esac
151 1.1.1.4 christos case `ls -1tr sntp/libevent/config.h.in sntp/libevent/aclocal.m4 | tail -1` in
152 1.1.1.4 christos sntp/libevent/aclocal.m4) touch sntp/libevent/config.h.in ;;
153 1.1.1.4 christos esac
154 1.1.1.4 christos
155 1.1.1.3 christos # DH: 20110118: Due to our workaround for the AM_COND_IF bug that was
156 1.1.1.3 christos # triggering the buggy recursive autoreconf, we can once again use a
157 1.1.1.3 christos # single autoreconf invocation. See
158 1.1.1.3 christos # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7860
159 1.1.1.2 kardel # DH: 20101120: We are back to a single copy of libopts, and
160 1.1.1.2 kardel # once again it seems we need to run autoreconf in sntp after
161 1.1.1.2 kardel # the top-level run to get a correct sntp/libopts/Makefile.in.
162 1.1.1.2 kardel # To reduce redundancy, the top-level autoreconf uses --no-recursive.
163 1.1.1.2 kardel #
164 1.1 kardel # HMS: 20060618: Now that we use separate copies of libopts
165 1.1 kardel # we should only need the previous line.
166 1.1 kardel #
167 1.1 kardel ## HMS: 20060615: the next line seems to be needed to make sure
168 1.1 kardel ## we get the correct srcdir path in sntp/libopts/Makefile.in
169 1.1 kardel #rm -rf sntp/autom4te.cache
170 1.1 kardel #
171 1.1.1.3 christos # (cd sntp && ${AUTORECONF} -i -v "$@")
172