summaryrefslogtreecommitdiff
path: root/db-4.8.30/dist/s_message
blob: 19e621ad0f6e777a44d3cf921f1ce6d5757384c7 (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
#!/bin/sh -
#	$Id$
#
# Build the automatically generated rep & repmgr message files.

header=/tmp/__db_a
source=/tmp/__db_b

trap 'rm -f /tmp/__db_[ab]; exit 1' 1 2 3 13 15
trap 'rm -f /tmp/__db_[ab]; exit 0' 0

DIR="rep repmgr"

# Build DB's message marshaling/unmarshaling routines.
for i in $DIR; do
	for f in ../$i/*.src; do
		subsystem=`basename $f .src`
		awk -f gen_msg.awk \
		    -v header_file=$header \
		    -v source_file=$source < $f

		f=../dbinc_auto/${subsystem}_auto.h
		cmp $header $f > /dev/null 2>&1 ||
		    (echo "Building $f" &&
		    rm -f $f && cp $header $f && chmod 444 $f)
		f=../$i/${subsystem}_auto.c
		cmp $source $f > /dev/null 2>&1 ||
		    (echo "Building $f" &&
		    rm -f $f && cp $source $f && chmod 444 $f)
	done
done