summaryrefslogtreecommitdiff
path: root/db-4.8.30/test/scr012
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
committerJesse Morgan <jesse@jesterpm.net>2016-12-17 21:28:53 -0800
commit54df2afaa61c6a03cbb4a33c9b90fa572b6d07b8 (patch)
tree18147b92b969d25ffbe61935fb63035cac820dd0 /db-4.8.30/test/scr012
Berkeley DB 4.8 with rust build script for linux.
Diffstat (limited to 'db-4.8.30/test/scr012')
-rw-r--r--db-4.8.30/test/scr012/chk.vx_code85
1 files changed, 85 insertions, 0 deletions
diff --git a/db-4.8.30/test/scr012/chk.vx_code b/db-4.8.30/test/scr012/chk.vx_code
new file mode 100644
index 0000000..041124f
--- /dev/null
+++ b/db-4.8.30/test/scr012/chk.vx_code
@@ -0,0 +1,85 @@
+#!/bin/sh -
+#
+# $Id$
+#
+# Check to make sure the auto-generated utility code in the VxWorks build
+# directory compiles.
+
+d=../..
+
+[ -f $d/LICENSE ] || {
+ echo 'FAIL: cannot find source distribution directory.'
+ exit 1
+}
+[ -f ../libdb.a ] || (cd .. && make libdb.a) || {
+ echo 'FAIL: unable to find or build libdb.a'
+ exit 1
+}
+
+F="$d/clib/getopt.c $d/common/util_arg.c $d/common/util_cache.c
+ $d/common/util_log.c $d/common/util_sig.c $d/*/*_autop.c"
+
+header()
+{
+ echo "int $1(int, char *[]);"
+ echo "int"
+ echo "main(int argc, char *argv[])"
+ echo "{return ($1(argc, argv));}"
+}
+
+LIST="\
+ db_archive \
+ db_checkpoint \
+ db_deadlock \
+ db_dump \
+ db_hotbackup \
+ db_load \
+ db_printlog \
+ db_recover \
+ db_stat \
+ db_upgrade \
+ db_verify \
+ dbdemo \
+ test_micro"
+
+# Build each program individually.
+for i in $LIST; do
+ echo " compiling Vxworks version of $i"
+ header $i > MAIN.c
+ if cc -Wall -I.. -I$d -I$d/build_vxworks/$i \
+ $d/build_vxworks/$i/*.c MAIN.c $F ../libdb.a -o t; then
+ :
+ else
+ echo "FAIL: unable to compile VxWorks version of $i"
+ exit 1
+ fi
+done
+
+# Build all of the programs as one big binary.
+inc=`echo $LIST | sed 's/[^ ][^ ]*/-I$d\/build_vxworks\/&/g'`
+src=`echo $LIST | sed 's/[^ ][^ ]*/$d\/build_vxworks\/&\/*.c/g'`
+
+(
+for i in $LIST; do
+ echo "int ${i}_main(int, char *[]);"
+done
+echo "int"
+echo "main(int argc, char *argv[])"
+echo "{"
+echo "int r;"
+for i in $LIST; do
+ echo "r += ${i}_main(argc, argv);"
+done
+echo "return (r);"
+echo "}"
+) > MAIN.c
+
+echo " compiling VxWorks utility composite"
+if cc -Wall -I.. -I$d $inc `eval ls $src` MAIN.c $F ../libdb.a -o t; then
+ :
+else
+ echo 'FAIL: unable to compile VxWorks utility composite'
+ exit 1
+fi
+
+exit 0