summaryrefslogtreecommitdiffstats
path: root/tools/cpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-02-27 18:18:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-02-27 18:18:47 +0000
commit79597c724bdbf69ea3b7a3a592954cfce636163e (patch)
tree93bd4cf8f8b9ca965d6b2f7e804a1225102a839e /tools/cpu
parent0799dec022491276c05a5dcf055940a572d1f773 (diff)
downloadrtems-79597c724bdbf69ea3b7a3a592954cfce636163e.tar.bz2
Removed use of dc. David Fiddes reported that this is part of the
GNU tool bc which is not always installed under Linux and seldom present under non-UNIX environments like Win32.
Diffstat (limited to 'tools/cpu')
-rw-r--r--tools/cpu/generic/size_rtems.in18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/cpu/generic/size_rtems.in b/tools/cpu/generic/size_rtems.in
index 8ba1c376fe..fb7b40d212 100644
--- a/tools/cpu/generic/size_rtems.in
+++ b/tools/cpu/generic/size_rtems.in
@@ -201,10 +201,26 @@ sizedir()
done
}
+# adds the numbers passed on the command line
+addit()
+{
+ sumx=0
+ for x in $*
+ do
+ sumx=`expr $sumx + $x`
+ done
+ echo $sumx
+}
+
# adds a column from the output of sizedir
addsizes()
{
- cut -d' ' -f${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
+ # dc version is not portable enough -- It can be left out during
+ # installing linux and may not be available on non-UNIX hosts.
+ #cut -d' ' -f${2} ${1} | sed -e '2,$s/$/ + /' -e '$,$s/$/ p/' | dc
+
+ # This may not be as fast but it is probably more portable.
+ addit `cut -d' ' -f${2} ${1}`
}
# calculates total size of a directory and prints report line