1 | #!/bin/sh |
---|
2 | |
---|
3 | # $Id$ |
---|
4 | |
---|
5 | # |
---|
6 | # Search RTEMS source tree for autoconf Makefile.ins and automake |
---|
7 | # Makefile.ams and run c/update-tools/acpolish rsp. c/update-tool/ampolish |
---|
8 | # on them. |
---|
9 | # |
---|
10 | # To be run from the toplevel directory of the source-tree |
---|
11 | # |
---|
12 | |
---|
13 | progname=`basename $0` |
---|
14 | |
---|
15 | perltools=c/update-tools |
---|
16 | ac_do="" |
---|
17 | am_do="" |
---|
18 | ci_do="" |
---|
19 | |
---|
20 | usage() |
---|
21 | { |
---|
22 | echo |
---|
23 | echo "usage: ./${perltools}/${progname} [-h][-ac|-am|-ci]"; |
---|
24 | echo |
---|
25 | echo "options:" |
---|
26 | echo " -h .. display this message and exit"; |
---|
27 | echo " -ac .. run acpolish on all autoconf Makefile.ins" |
---|
28 | echo " -am .. run ampolish on all automake Makefile.ams" |
---|
29 | echo " -ci .. run cipolish on all configure.in scripts" |
---|
30 | echo |
---|
31 | exit 1; |
---|
32 | } |
---|
33 | |
---|
34 | if test ! -f VERSION; then |
---|
35 | echo "${progname}:" |
---|
36 | echo " Please change directory to RTEMS's toplevel directory" |
---|
37 | exit 1; |
---|
38 | fi |
---|
39 | |
---|
40 | while test $# -gt 0; do |
---|
41 | case $1 in |
---|
42 | -h|--he|--hel|--help) |
---|
43 | usage ;; |
---|
44 | -ac) |
---|
45 | ac_do="yes"; |
---|
46 | shift ;; |
---|
47 | -am) |
---|
48 | am_do="yes"; |
---|
49 | shift ;; |
---|
50 | -ci) |
---|
51 | ci_do="yes"; |
---|
52 | shift ;; |
---|
53 | -*) echo "unknown option $1" ; |
---|
54 | usage ;; |
---|
55 | *) echo "invalid parameter $1" ; |
---|
56 | usage ;; |
---|
57 | esac |
---|
58 | done |
---|
59 | |
---|
60 | if test -z "$ac_do" && test -z "$am_do" && test -z "$ci_do"; then |
---|
61 | usage |
---|
62 | fi |
---|
63 | |
---|
64 | pwd=`pwd`; |
---|
65 | |
---|
66 | if test -n "$ac_do"; then |
---|
67 | ac_files=`find . -name 'Makefile.in' -print`; |
---|
68 | for f in $ac_files; do |
---|
69 | i=`dirname $f` |
---|
70 | dest="$i" |
---|
71 | if test ! -f $dest/Makefile.am; then |
---|
72 | echo "polishing : $dest/Makefile.in" |
---|
73 | ( cd $dest; |
---|
74 | mv Makefile.in Makefile.in~; |
---|
75 | ${pwd}/${perltools}/acpolish <Makefile.in~ >Makefile.in |
---|
76 | rm Makefile.in~ |
---|
77 | ) |
---|
78 | fi |
---|
79 | done |
---|
80 | fi |
---|
81 | |
---|
82 | if test -n "$am_do"; then |
---|
83 | am_files=`find . -name 'Makefile.am' -print`; |
---|
84 | for f in $am_files; do |
---|
85 | i=`dirname $f` |
---|
86 | dest="$i" |
---|
87 | echo "polishing : $dest/Makefile.am" |
---|
88 | ( cd $dest; |
---|
89 | mv Makefile.am Makefile.am~; |
---|
90 | ${pwd}/${perltools}/ampolish <Makefile.am~ >Makefile.am |
---|
91 | rm Makefile.am~ |
---|
92 | ) |
---|
93 | done |
---|
94 | fi |
---|
95 | |
---|
96 | if test -n "$ci_do"; then |
---|
97 | ci_files=`find . -name 'configure.in' -print`; |
---|
98 | for f in $ci_files; do |
---|
99 | i=`dirname $f` |
---|
100 | dest="$i" |
---|
101 | echo "polishing : $dest/configure.in" |
---|
102 | ( cd $dest; |
---|
103 | mv configure.in configure.in~; |
---|
104 | ${pwd}/${perltools}/cipolish <configure.in~ >configure.in |
---|
105 | rm configure.in~ |
---|
106 | ) |
---|
107 | done |
---|
108 | fi |
---|