summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am3
-rw-r--r--tools/Makefile.in4
-rw-r--r--tools/mpicalc.c13
3 files changed, 18 insertions, 2 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index a23b8d349..31ac04bcb 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -7,6 +7,7 @@ bin_PROGRAMS = mpicalc
mpicalc_SOURCES = mpicalc.c
-LDADD = -L ../cipher -L ../mpi -L ../util -lcipher -lmpi -lutil
+LDADD = -L ../cipher -L ../mpi -L ../util -lmpi -lutil
+$(PROGRAMS): ../mpi/libmpi.a
diff --git a/tools/Makefile.in b/tools/Makefile.in
index b9f55a889..67e3d6f89 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -44,7 +44,7 @@ bin_PROGRAMS = mpicalc
mpicalc_SOURCES = mpicalc.c
-LDADD = -L ../cipher -L ../mpi -L ../util -lcipher -lmpi -lutil
+LDADD = -L ../cipher -L ../mpi -L ../util -lmpi -lutil
mkinstalldirs = $(top_srcdir)/scripts/mkinstalldirs
CONFIG_HEADER = ../config.h
PROGRAMS = $(bin_PROGRAMS)
@@ -244,6 +244,8 @@ install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+$(PROGRAMS): ../mpi/libmpi.a
.SUFFIXES:
.SUFFIXES: .c .o
diff --git a/tools/mpicalc.c b/tools/mpicalc.c
index 2402695d7..828b475b3 100644
--- a/tools/mpicalc.c
+++ b/tools/mpicalc.c
@@ -179,6 +179,16 @@ do_gcd(void)
stackidx--;
}
+static void
+do_rshift(void)
+{
+ if( stackidx < 1 ) {
+ fputs("stack underflow\n", stderr);
+ return;
+ }
+ mpi_rshift( stack[stackidx-1],stack[stackidx-1], 1 );
+}
+
int
main(int argc, char **argv)
@@ -259,6 +269,9 @@ main(int argc, char **argv)
case 'G':
do_gcd();
break;
+ case '>':
+ do_rshift();
+ break;
case 'i': /* dummy */
if( !stackidx )
fputs("stack underflow\n", stderr);