39 lines
818 B
Text
39 lines
818 B
Text
|
#!/bin/sh -
|
||
|
#
|
||
|
# $Id: chk.code 7 2007-02-03 13:34:17Z gburd $
|
||
|
#
|
||
|
# Check to make sure that the code samples in the documents build.
|
||
|
|
||
|
d=../../../db_docs
|
||
|
|
||
|
[ -d $d ] || {
|
||
|
echo 'FAIL: cannot find source distribution directory.'
|
||
|
exit 1
|
||
|
}
|
||
|
[ -f ../libsqldb.a ] || (cd .. && make libsqldb.a) || {
|
||
|
echo 'FAIL: unable to find or build libsqldb.a'
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
exitv=0
|
||
|
for i in `find $d -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 -pthread -Wall -Werror -I.. t.c ../libdbsql.a -o t; then
|
||
|
:
|
||
|
else
|
||
|
echo "FAIL: unable to compile $i"
|
||
|
exitv=1
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
exit $exitv
|