4 # Build the automatically generated function prototype files.
6 msgc="/* DO NOT EDIT: automatically built by dist/s_include. */"
28 if [ $defonly -eq 0 ]; then
29 echo "#if defined(__cplusplus)"
49 if [ $defonly -eq 0 ]; then
50 echo "#if defined(__cplusplus)"
54 echo "#endif /* !$name */"
57 # This script is run on a variety of systems. To avoid spurious changes, fix
58 # some variables that affect sort order of ls(1).
64 # We are building several files:
65 # 1 external #define file
66 # 1 external prototype file
67 # 1 internal #define file
68 # N internal prototype files
69 e_dfile=/tmp/__db_c.$$
70 e_pfile=/tmp/__db_a.$$
71 i_dfile=/tmp/__db_d.$$
72 i_pfile=/tmp/__db_b.$$
73 trap 'rm -f $e_dfile $e_pfile $i_dfile $i_pfile; exit 0' 0 1 2 3 13 15
75 head defonly space _DB_EXT_DEF_IN_ > $e_dfile
76 head space _DB_EXT_PROT_IN_ > $e_pfile
77 head defonly _DB_INT_DEF_IN_ > $i_dfile
79 # Process the standard directories, creating per-directory prototype
80 # files and adding to the external prototype and #define files.
81 for i in db btree clib common crypto dbreg env fileops hash hmac \
82 lock log mp mutex os qam rep repmgr rpc_client rpc_server \
84 head "_${i}_ext_h_" > $i_pfile
88 ../os_brew/*.c ../os_qnx/*.c ../os_vxworks/*.c ../os_windows/*.c`
89 elif [ $i = rpc_server ] ; then
91 elif [ $i = crypto ] ; then
92 f=`ls ../$i/*.c ../$i/*/*.c`
93 elif [ $i = env ] ; then
94 f=`ls ../$i/*.c ../repmgr/repmgr_stub.c`
99 -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
100 -v e_dfile=$e_dfile \
101 -v e_pfile=$e_pfile \
102 -v i_dfile=$i_dfile \
103 -v i_pfile=$i_pfile $f
105 tail "_${i}_ext_h_" >> $i_pfile
107 f=../dbinc_auto/${i}_ext.h
108 cmp $i_pfile $f > /dev/null 2>&1 ||
109 (echo "Building $f" && rm -f $f && cp $i_pfile $f && chmod 444 $f)
112 # Process directories which only add to the external prototype and #define
114 for i in dbm hsearch; do
117 -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
118 -v e_dfile=$e_dfile \
119 -v e_pfile=$e_pfile \
124 # There are a few global variables in DB -- add them to the external/internal
126 (echo "#define __db_global_values __db_global_values@DB_VERSION_UNIQUE_NAME@";
127 echo "#define __repmgr_guesstimated_max __repmgr_guesstimated_max@DB_VERSION_UNIQUE_NAME@") >> $i_dfile
129 # Wrap up the external #defines/prototypes, and internal #defines.
130 tail defonly _DB_EXT_DEF_IN_ >> $e_dfile
131 f=../dbinc_auto/ext_def.in
132 cmp $e_dfile $f > /dev/null 2>&1 ||
133 (echo "Building $f" && rm -f $f && cp $e_dfile $f && chmod 444 $f)
135 tail _DB_EXT_PROT_IN_ >> $e_pfile
136 f=../dbinc_auto/ext_prot.in
137 cmp $e_pfile $f > /dev/null 2>&1 ||
138 (echo "Building $f" && rm -f $f && cp $e_pfile $f && chmod 444 $f)
140 tail defonly _DB_INT_DEF_IN_ >> $i_dfile
141 f=../dbinc_auto/int_def.in
142 cmp $i_dfile $f > /dev/null 2>&1 ||
143 (echo "Building $f" && rm -f $f && cp $i_dfile $f && chmod 444 $f)
145 # DB185 compatibility support.
146 head space defonly _DB_EXT_185_DEF_IN_ > $e_dfile
147 head space _DB_EXT_185_PROT_IN_ > $e_pfile
151 -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \
152 -v e_dfile=$e_dfile \
153 -v e_pfile=$e_pfile \
157 tail defonly _DB_EXT_185_DEF_IN_ >> $e_dfile
158 f=../dbinc_auto/ext_185_def.in
159 cmp $e_dfile $f > /dev/null 2>&1 ||
160 (echo "Building $f" && rm -f $f && cp $e_dfile $f && chmod 444 $f)
162 tail _DB_EXT_185_PROT_IN_ >> $e_pfile
163 f=../dbinc_auto/ext_185_prot.in
164 cmp $e_pfile $f > /dev/null 2>&1 ||
165 (echo "Building $f" && rm -f $f && cp $e_pfile $f && chmod 444 $f)