summaryrefslogtreecommitdiff
path: root/db/test/scr001/chk.code
blob: 7dd5a549ce220c995a0192fc0e8f7299cce3a256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh -
#
# Id: chk.code,v 1.8 2001/10/12 17:55:31 bostic Exp 
#
# Check to make sure that the code samples in the documents build.

d=../..

[ -d $d/docs_src ] || {
	echo 'FAIL: cannot find source distribution directory.'
	exit 1
}
[ -f ../libdb.a ] || make libdb.a || {
	echo 'FAIL: unable to find or build libdb.a'
	exit 1
}

for i in `find $d/docs_src -name '*.cs'`; do
	echo "	compiling $i"
	sed -e 's/m4_include(\(.*\))/#include <\1>/g' \
	    -e 's/m4_[a-z]*[(\[)]*//g' \
	    -e 's/(\[//g' \
	    -e '/argv/!s/])//g' \
	    -e 's/dnl//g' \
	    -e 's/__GT__/>/g' \
	    -e 's/__LB__/[/g' \
	    -e 's/__LT__/</g' \
	    -e 's/__RB__/]/g' < $i > t.c
	if cc -Wall -I.. t.c ../libdb.a -o t; then
		:
	else
		echo "FAIL: unable to compile $i"
		exit 1
	fi
done

exit 0