source: rtems/bootstrap @ 6273201

4.115
Last change on this file since 6273201 was 65c6425, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 17:24:46

Remove CVS Id Strings (manual edits after script)

These modifications were required by hand after running the script.
In some cases, the file names did not match patterns. In others,
the format of the file did not match any common patterns.

  • Property mode set to 100755
File size: 6.0 KB
Line 
1#! /bin/sh
2#
3# helps bootstrapping, when checked out from CVS
4# requires GNU autoconf and GNU automake
5#
6# this is not meant to be exported outside the source tree
7#
8# NOTE: Inspired by libtool's autogen script
9#
10# to be run from the toplevel directory of RTEMS'
11# source tree
12
13progname=`basename $0`
14top_srcdir=`dirname $0`
15
16verbose="";
17quiet="false"
18mode="autoreconf"
19
20usage()
21{
22  echo
23  echo "usage: ${progname} [-c|-p|-h] [-q][-v]"
24  echo
25  echo "options:"
26  echo "        -c .. clean, remove all aclocal/autoconf/automake generated files"
27  echo "        -h .. display this message and exit"
28  echo "        -p .. regenerate preinstall.am files"
29  echo "        -q .. quiet, don't display directories"
30  echo "        -v .. verbose, pass -v to autotools"
31  echo
32  exit 1;
33}
34
35generate_bspdir_acinclude()
36{
37cat << EOF > acinclude.m4~
38# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY)
39AC_DEFUN([RTEMS_CHECK_BSPDIR],
40[
41  case "\$1" in
42EOF
43
44for i in */bsp_specs; do
45  d=`dirname $i`
46cat << EOF >> acinclude.m4~
47  $d )
48    AC_CONFIG_SUBDIRS([$d]);;
49EOF
50done
51cat << EOF >> acinclude.m4~
52  *)
53    AC_MSG_ERROR([Invalid BSP]);;
54  esac
55])
56EOF
57if cmp -s acinclude.m4 acinclude.m4~ 2>/dev/null; then
58  echo "acinclude.m4 is unchanged";
59else
60  cp acinclude.m4~ acinclude.m4
61fi
62rm -f acinclude.m4~
63}
64
65if test ! -f $top_srcdir/aclocal/version.m4; then
66  echo "${progname}:"
67  echo "        Installation problem: Can't find file aclocal/version.m4"
68  exit 1;
69fi
70
71while test $# -gt 0; do
72case $1 in
73-h|--he|--hel|--help)
74  usage ;;
75-q|--qu|--qui|--quie|--quiet)
76  quiet="true";
77  shift;;
78-v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
79  verbose="-v";
80  shift;;
81-c|--cl|--cle|--clea|--clean)
82  mode="clean";
83  shift;;
84-p|--pr|--pre|--prei|--prein|--preins|--preinst)
85  mode="preinstall";
86  shift;;
87-r|--re|--rec|--reco|--recon|--reconf)
88  mode="autoreconf";
89  shift;;
90-g|--ge|--gen|--gene|--gener|--genera|--generat|--generate)
91  mode="generate";
92  shift;;
93-*) echo "unknown option $1" ;
94  usage ;;
95*) echo "invalid parameter $1" ;
96  usage ;;
97esac
98done
99
100case $mode in
101preinstall)
102  confs=`find . -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
103  for i in $confs; do
104    dir=$(dirname $i);
105    test "$quite" = "true" || echo "Generating $dir/preinstall.am"
106    ${top_srcdir}/ampolish3 "$dir/Makefile.am" > "$dir/preinstall.am"
107  done
108  ;;
109
110generate)
111  AUTOCONF=${AUTOCONF-autoconf}
112  if test -z "$AUTOCONF"; then
113    echo "You must have autoconf installed to run $program"
114    exit 1
115  fi
116 
117  AUTOHEADER=${AUTOHEADER-autoheader}
118  if test -z "$AUTOHEADER"; then
119    echo "You must have autoconf installed to run $program"
120    exit 1
121  fi
122 
123  AUTOMAKE=${AUTOMAKE-automake}
124  if test -z "$AUTOMAKE"; then
125    echo "You must have automake installed to run $program"
126    exit 1
127  fi
128 
129  ACLOCAL=${ACLOCAL-aclocal}
130  if test -z "$ACLOCAL"; then
131    echo "You must have automake installed to run $program"
132    exit 1
133  fi
134
135  case $top_srcdir in
136  /* ) aclocal_dir=$top_srcdir
137    ;;
138  *) aclocal_dir=`pwd`/$top_srcdir
139    ;;
140  esac
141
142  confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
143  for i in $confs; do
144  dir=`dirname $i`;
145  configure=`basename $i`;
146  ( test "$quiet" = "true" || echo "$dir";
147    cd $dir;
148    test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
149      generate_bspdir_acinclude;
150    pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
151    aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
152      sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat ` ;
153    test "$verbose" = "-v" && echo "${ACLOCAL} $aclocal_args"
154    ${ACLOCAL} $aclocal_args;
155    test -n "`grep CONFIG_HEADER ${configure}`" && ${AUTOHEADER} \
156      && test "$verbose" = "-v" && echo "${AUTOHEADER}";
157    test -n "`grep RTEMS_BSP_CONFIGURE ${configure}`" && ${AUTOHEADER} \
158      && test "$verbose" = "-v" && echo "${AUTOHEADER}";
159    test -f Makefile.am && ${AUTOMAKE} -a -c $verbose ;
160    ${AUTOCONF};
161    test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
162      && echo timestamp > stamp-h.in
163  )
164  done
165  ;;
166
167autoreconf)
168  AUTORECONF=${AUTORECONF-autoreconf}
169  if test -z "$AUTORECONF"; then
170    echo "You must have autoreconf installed to run $program"
171    exit 1
172  fi
173
174  confs=`find . -name 'configure.ac' -print`
175  for i in $confs; do
176  dir=`dirname $i`;
177  configure=`basename $i`;
178  ( test "$quiet" = "true" || echo "$dir";
179    cd $dir;
180    test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
181      generate_bspdir_acinclude;
182    ${AUTORECONF} -i --no-recursive $verbose;
183    test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
184      && echo timestamp > stamp-h.in
185  )
186  done
187  ;;
188
189clean)
190  test "$quiet" = "true" || echo "removing automake generated Makefile.in files"
191  files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'` ;
192  for i in $files; do if test -f $i; then
193    rm -f $i
194    test "$verbose" = "-v" && echo "$i"   
195  fi; done
196
197  test "$quiet" = "true" || echo "removing configure files"
198  files=`find . -name 'configure' -print` ;
199  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
200  for i in $files; do if test -f $i; then
201    rm -f $i config.sub config.guess install-sh missing mkinstalldirs
202# rm -f depcomp compile texinfo.tex mdate-sh
203    test "$verbose" = "-v" && echo "$i"   
204  fi; done
205 
206  test "$quiet" = "true" || echo "removing aclocal.m4 files"
207  files=`find . -name 'aclocal.m4' -print` ;
208  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
209  for i in $files; do if test -f $i; then
210    rm -f $i
211    test "$verbose" = "-v" && echo "$i"   
212  fi; done
213
214  find . -name '*~' -print | xargs rm -f
215  find . -name 'bspopts.h.in' -print | xargs rm -f
216  find . -name '*.orig' -print | xargs rm -f
217  find . -name '*.rej' -print | xargs rm -f
218  find . -name 'config.status' -print | xargs rm -f
219  find . -name 'config.log' -print | xargs rm -f
220  find . -name 'config.cache' -print | xargs rm -f
221  find . -name 'Makefile' -print | xargs rm -f
222  find . -name '.deps' -print | xargs rm -rf
223  find . -name '.libs' -print | xargs rm -rf
224  find . -name 'stamp-h.in' | xargs rm -rf
225  find . -name 'autom4te*.cache' | xargs rm -rf
226  ;;
227esac
228
229exit 0
Note: See TracBrowser for help on using the repository browser.