Add BSD license file
[platform/upstream/db4.git] / dist / s_apiflags
1 #!/bin/sh -
2 #       $Id$
3 #
4 # Build the automatically generated API flag #defines.
5
6 msgc="/* DO NOT EDIT: automatically built by dist/s_apiflags. */"
7
8 b=/tmp/api_flags_binary
9 t=/tmp/__db_a
10
11 trap 'rm -f $b $t; exit 0' 0
12 trap 'rm -f $b $t; exit 1' 1 2 3 13 15
13
14 cc api_flags.c -o $b || {
15         echo 's_apiflags: unable to compile api_flags.c'
16         exit 1
17 }
18
19 (echo "$msgc"
20  $b < api_flags) > $t
21
22 f=../dbinc_auto/api_flags.in
23 cmp $f $t > /dev/null 2>&1 ||
24     (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)