source: rtems/bootstrap @ aee474b

4.104.114.84.95
Last change on this file since aee474b was ceb9f8f, checked in by Joel Sherrill <joel.sherrill@…>, on 09/21/01 at 15:01:28

2001-09-21 Ralf Corsepius <corsepiu@…>

  • bootstrap: remove/add automake added files.
  • .cvsignore: reflect changes to bootstrap.
  • Property mode set to 100755
File size: 3.4 KB
Line 
1#!/bin/sh
2#
3# helps bootstrapping, when checked out from CVS
4# requires GNU autoconf and GNU automake
5#
6# $Id$
7
8# this is not meant to be exported outside the source tree
9
10# NOTE: Inspired by libtool's autogen script
11
12# to be run from the toplevel directory of RTEMS'
13# source tree
14
15progname=`basename $0`
16top_srcdir=`dirname $0`
17
18verbose="";
19quiet="false"
20mode="generate"
21
22usage()
23{
24  echo
25  echo "usage: ${progname} [-h|-q|-v]"
26  echo
27  echo "options:"
28  echo "        -h .. display this message and exit";
29  echo "        -q .. quiet, don't display directories";
30  echo "        -v .. verbose, pass -v to automake when invoking automake"
31  echo "        -c .. clean, remove all aclocal/autoconf/automake generated files"
32  echo
33  exit 1;
34}
35
36if test ! -f $top_srcdir/VERSION; then
37  echo "${progname}:"
38  echo "        Installation problem: Can't find file VERSION"
39  exit 1;
40fi
41
42while test $# -gt 0; do
43case $1 in
44-h|--he|--hel|--help)
45  usage ;;
46-q|--qu|--qui|--quie|--quiet)
47  quiet="true";
48  shift;;
49-v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
50  verbose="-v";
51  shift;;
52-c|--cl|--cle|--clea|--clean)
53  mode="clean";
54  shift;;
55-*) echo "unknown option $1" ;
56  usage ;;
57*) echo "invalid parameter $1" ;
58  usage ;;
59esac
60done
61
62case $mode in
63generate)
64
65  case $top_srcdir in
66  /* ) aclocal_dir=$top_srcdir
67    ;;
68  *) aclocal_dir=`pwd`/$top_srcdir
69    ;;
70  esac
71
72  confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
73  for i in $confs; do
74  dir=`dirname $i`;
75  configure=`basename $i`;
76  ( test "$quiet" = "true" || echo "$dir";
77    cd $dir;
78    pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
79    aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
80      sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat ` ;
81    test "$verbose" = "-v" && echo "aclocal $aclocal_args"
82    aclocal $aclocal_args;
83    test -n "`grep CONFIG_HEADER ${configure}`" && autoheader \
84      && test "$verbose" = "-v" && echo "autoheader";
85    test -f Makefile.am && automake -a -c $verbose ;
86    autoconf;
87    test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
88      && echo timestamp > stamp-h.in
89  )
90  done
91  ;;
92
93clean)
94  test "$quiet" = "true" || echo "removing automake generated Makefile.in files"
95  files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'` ;
96  for i in $files; do if test -f $i; then
97    rm -f $i
98    test "$verbose" = "-v" && echo "$i"   
99  fi; done
100
101  test "$quiet" = "true" || echo "removing configure files"
102  files=`find . -name 'configure' -print` ;
103  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
104  for i in $files; do if test -f $i; then
105    rm -f $i config.guess config.sub depcomp install-sh missing mkinstalldirs
106    test "$verbose" = "-v" && echo "$i"   
107  fi; done
108 
109  test "$quiet" = "true" || echo "removing aclocal.m4 files"
110  files=`find . -name 'aclocal.m4' -print` ;
111  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
112  for i in $files; do if test -f $i; then
113    rm -f $i
114    test "$verbose" = "-v" && echo "$i"   
115  fi; done
116
117  find . -name '*~' -print | xargs rm -f
118  find . -name '*.orig' -print | xargs rm -f
119  find . -name '*.rej' -print | xargs rm -f
120  find . -name 'config.status' -print | xargs rm -f
121  find . -name 'config.log' -print | xargs rm -f
122  find . -name 'config.cache' -print | xargs rm -f
123  find . -name 'Makefile' -print | xargs rm -f
124  find . -name '.deps' -print | xargs rm -rf
125  find . -name '.libs' -print | xargs rm -rf
126  find . -name 'stamp-h.in' | xargs rm -rf
127  ;;
128esac
Note: See TracBrowser for help on using the repository browser.