1#!/bin/sh
2#
3# $RoughId: test.sh,v 1.5 2001/07/13 15:38:27 knu Exp $
4# $Id: test.sh 25189 2009-10-02 12:04:37Z akr $
5
6RUBY=${RUBY:=ruby}
7MAKE=${MAKE:=make}
8CFLAGS=${CFLAGS:=-Wall}
9
10${RUBY} extconf.rb --with-cflags="${CFLAGS}"
11${MAKE} clean
12${MAKE}
13
14for algo in md5 rmd160 sha1 sha2; do
15    args=--with-cflags="${CFLAGS}"
16
17    if [ $WITH_BUNDLED_ENGINES ]; then
18	args="$args --with-bundled-$algo"
19    fi
20
21    (cd $algo &&
22	${RUBY} extconf.rb $args;
23	${MAKE} clean;
24	${MAKE})
25    ln -sf ../../$algo/$algo.so lib/digest/
26done
27
28${RUBY} -I. -I./lib ../../test/digest/test_digest.rb
29
30rm lib/digest/*.so
31