]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/amd/bootstrap
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / amd / bootstrap
1 #!/bin/sh
2 #set -x
3 # helps bootstrapping am-utils, when checked out from CVS
4 # requires GNU autoconf and GNU automake
5 # this is not meant to go into the distributions
6 # Erez Zadok <ezk@cs.columbia.edu>
7
8 validateversion() {
9     local v="$(autoreconf --version 2>&1 | head -1)"
10     case "$v" in
11     *2.69)      ;;
12     *)          echo "am-utils requires autoconf 2.69, you have:"
13                 echo "  $v"
14                 exit 1;;
15     esac
16 }
17
18 # test cwd
19 test -f ../amd/amd.c && cd ..
20 if [ ! -f amd/amd.c ]; then
21     echo "Must run $0 from the top level source directory."
22     exit 1
23 fi
24
25 # validate macros directory and some macro files
26 if [ ! -d m4/macros ]; then
27     echo No m4/macros directory found!
28     exit 1
29 fi
30 if [ ! -f m4/macros/HEADER ]; then
31     echo No m4/macros/HEADER file found!
32     exit 1
33 fi
34
35 # remove any remaining autom4te.cache directory
36 rm -fr autom4te.cache autom4te-*.cache
37
38 # generate acinclude.m4 file
39 echo "AMU: prepare acinclude.m4..."
40 test -f acinclude.m4 && mv -f acinclude.m4 acinclude.m4.old
41 (cd m4/macros
42  for i in HEADER *.m4; do
43      cat $i
44      echo
45      echo
46  done
47  cat TRAILER
48 ) > acinclude.m4
49
50 # generate the rest of the scripts
51 echo "AMU: autoreconf..."
52 validateversion
53 if autoreconf -f -i; then
54     :
55 else
56     echo "autoreconf command failed.  fix errors and rerun $0."
57     exit 2
58 fi
59
60 # save timestamp
61 echo "AMU: save timestamp..."
62 echo timestamp > stamp-h.in
63
64 exit 0