4 # Build structure signature code.
8 trap 'rm -f $a $b; exit 0' 0 1 2 3 13 15
10 cat ../dbinc/db.in ../dbinc/db_int.in ../dbinc/*.h |
11 sed -e '/__addrinfo/d' \
12 -e '/__aes_cipher/d' \
14 -e '/__queued_output/d' \
15 -e '/__repmgr_connection/d' \
16 -e '/__repmgr_message/d' \
17 -e '/__repmgr_retry/d' \
18 -e '/__repmgr_runnable/d' \
19 -e '/__repmgr_site/d' \
20 -e '/struct.*mutex.*{/i\
21 #ifdef HAVE_MUTEX_SUPPORT' \
22 -e '/struct.*mutex.*{/a\
24 -e 's/.*[ ]*struct[ ]*\(__[a-z_]*\)[ ]*{.*/ __ADD(\1);/p' \
27 cnt=`sed -e '$=' -e d $a`
29 cat << END_OF_TEXT > $b
31 * DO NOT EDIT: automatically built by dist/s_sig.
36 #include "db_config.h"
38 #define __INCLUDE_NETWORKING 1
39 #define __INCLUDE_SELECT_H 1
42 #include "dbinc/db_page.h"
43 #include "dbinc/btree.h"
44 #include "dbinc/crypto.h"
45 #include "dbinc/db_join.h"
46 #include "dbinc/db_verify.h"
47 #include "dbinc/hash.h"
48 #include "dbinc/lock.h"
49 #include "dbinc/log.h"
51 #include "dbinc/partition.h"
52 #include "dbinc/qam.h"
53 #include "dbinc/txn.h"
57 echo "#define __STRUCTURE_COUNT $cnt" >> $b
59 cat << END_OF_TEXT >> $b
63 * Compute signature of structures.
65 * PUBLIC: u_int32_t __env_struct_sig __P((void));
70 u_short t[__STRUCTURE_COUNT + 5];
74 #define __ADD(s) (t[i++] = sizeof(struct s))
80 cat << END_OF_TEXT >> $b
82 return (__ham_func5(NULL, t, i * sizeof(t[0])));
87 cmp $b $f > /dev/null 2>&1 ||
88 (echo "Building $f" && rm -f $f && cp $b $f && chmod 444 $f)