source: rtems/bootstrap @ 4ae4728

4.104.114.84.95
Last change on this file since 4ae4728 was 23557f5, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/13/03 at 16:21:33

2003-07-13 Ralf Corsepius <corsepiu@…>

  • config.sub: Remove (Automatically added by automake, again).
  • bootstrap: Reflect change above.
  • configure.ac: Require automake >= 1.7.6.
  • Property mode set to 100755
File size: 4.9 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
36generate_bspdir_acinclude()
37{
38cat << EOF > acinclude.m4~
39# RTEMS_CHECK_BSPDIR(RTEMS_BSP)
40AC_DEFUN([RTEMS_CHECK_BSPDIR],
41[
42  RTEMS_BSP_ALIAS(ifelse([\$1],,[\${RTEMS_BSP}],[\$1]),bspdir)
43  case "\$bspdir" in
44EOF
45
46for i in */bsp_specs; do
47  d=`dirname $i`
48cat << EOF >> acinclude.m4~
49  $d )
50    AC_CONFIG_SUBDIRS([$d]);;
51EOF
52done
53cat << EOF >> acinclude.m4~
54  *)
55    AC_MSG_ERROR([Invalid BSP]);;
56  esac
57])
58EOF
59if cmp -s acinclude.m4 acinclude.m4~ 2>/dev/null; then
60  echo "acinclude.m4 is unchanged";
61else
62  cp acinclude.m4~ acinclude.m4
63fi
64rm -f acinclude.m4~
65}
66
67if test ! -f $top_srcdir/aclocal/version.m4; then
68  echo "${progname}:"
69  echo "        Installation problem: Can't find file aclocal/version.m4"
70  exit 1;
71fi
72
73while test $# -gt 0; do
74case $1 in
75-h|--he|--hel|--help)
76  usage ;;
77-q|--qu|--qui|--quie|--quiet)
78  quiet="true";
79  shift;;
80-v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
81  verbose="-v";
82  shift;;
83-c|--cl|--cle|--clea|--clean)
84  mode="clean";
85  shift;;
86-*) echo "unknown option $1" ;
87  usage ;;
88*) echo "invalid parameter $1" ;
89  usage ;;
90esac
91done
92
93case $mode in
94generate)
95  AUTOCONF=${AUTOCONF-autoconf}
96  if test -z "$AUTOCONF"; then
97    echo "You must have autoconf installed to run $program"
98    exit 1
99  fi
100 
101  AUTOHEADER=${AUTOHEADER-autoheader}
102  if test -z "$AUTOHEADER"; then
103    echo "You must have autoconf installed to run $program"
104    exit 1
105  fi
106 
107  AUTOMAKE=${AUTOMAKE-automake}
108  if test -z "$AUTOMAKE"; then
109    echo "You must have automake installed to run $program"
110    exit 1
111  fi
112 
113  ACLOCAL=${ACLOCAL-aclocal}
114  if test -z "$ACLOCAL"; then
115    echo "You must have automake installed to run $program"
116    exit 1
117  fi
118
119  case $top_srcdir in
120  /* ) aclocal_dir=$top_srcdir
121    ;;
122  *) aclocal_dir=`pwd`/$top_srcdir
123    ;;
124  esac
125
126  confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
127  for i in $confs; do
128  dir=`dirname $i`;
129  configure=`basename $i`;
130  ( test "$quiet" = "true" || echo "$dir";
131    cd $dir;
132    test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \
133      generate_bspdir_acinclude;
134    pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g"
135    aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \
136      sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat ` ;
137    test "$verbose" = "-v" && echo "${ACLOCAL} $aclocal_args"
138    ${ACLOCAL} $aclocal_args;
139    test -n "`grep CONFIG_HEADER ${configure}`" && ${AUTOHEADER} \
140      && test "$verbose" = "-v" && echo "${AUTOHEADER}";
141    test -n "`grep RTEMS_BSP_CONFIGURE ${configure}`" && ${AUTOHEADER} \
142      && test "$verbose" = "-v" && echo "${AUTOHEADER}";
143    test -f Makefile.am && ${AUTOMAKE} -a -c $verbose ;
144    ${AUTOCONF};
145    test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \
146      && echo timestamp > stamp-h.in
147  )
148  done
149  ;;
150
151clean)
152  test "$quiet" = "true" || echo "removing automake generated Makefile.in files"
153  files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'` ;
154  for i in $files; do if test -f $i; then
155    rm -f $i
156    test "$verbose" = "-v" && echo "$i"   
157  fi; done
158
159  test "$quiet" = "true" || echo "removing configure files"
160  files=`find . -name 'configure' -print` ;
161  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
162  for i in $files; do if test -f $i; then
163    rm -f $i config.sub config.guess depcomp install-sh mdate-sh missing \
164        mkinstalldirs texinfo.tex
165    test "$verbose" = "-v" && echo "$i"   
166  fi; done
167 
168  test "$quiet" = "true" || echo "removing aclocal.m4 files"
169  files=`find . -name 'aclocal.m4' -print` ;
170  test "$verbose" = "-v" && test -n "$files" && echo "$files" ;
171  for i in $files; do if test -f $i; then
172    rm -f $i
173    test "$verbose" = "-v" && echo "$i"   
174  fi; done
175
176  find . -name '*~' -print | xargs rm -f
177  find . -name 'bspopts.h*' -print | xargs rm -f
178  find . -name '*.orig' -print | xargs rm -f
179  find . -name '*.rej' -print | xargs rm -f
180  find . -name 'config.status' -print | xargs rm -f
181  find . -name 'config.log' -print | xargs rm -f
182  find . -name 'config.cache' -print | xargs rm -f
183  find . -name 'Makefile' -print | xargs rm -f
184  find . -name '.deps' -print | xargs rm -rf
185  find . -name '.libs' -print | xargs rm -rf
186  find . -name 'stamp-h.in' | xargs rm -rf
187  find . -name 'autom4te*.cache' | xargs rm -rf
188  ;;
189esac
190
191exit 0
Note: See TracBrowser for help on using the repository browser.