mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
dbbcc4223b
BitKeeper/deleted/.del-rpc_server_ext.h~7c955499fca6dc77: Delete: bdb/dbinc_auto/rpc_server_ext.h BitKeeper/deleted/.del-btree_ext.h~35de1585d63d72ff: Delete: bdb/dbinc_auto/btree_ext.h BitKeeper/deleted/.del-clib_ext.h~f279b5b64b6b5ade: Delete: bdb/dbinc_auto/clib_ext.h BitKeeper/deleted/.del-common_ext.h~d8ab025e1be030ae: Delete: bdb/dbinc_auto/common_ext.h BitKeeper/deleted/.del-db_ext.h~a62714b06359a95e: Delete: bdb/dbinc_auto/db_ext.h BitKeeper/deleted/.del-dbreg_ext.h~4d2ca3859b11d8c2: Delete: bdb/dbinc_auto/dbreg_ext.h BitKeeper/deleted/.del-env_ext.h~6f604f4533cc5427: Delete: bdb/dbinc_auto/env_ext.h BitKeeper/deleted/.del-ext_185_def.in~a6545f6dd455a6bd: Delete: bdb/dbinc_auto/ext_185_def.in BitKeeper/deleted/.del-ext_185_prot.in~51f8b1efdc79204c: Delete: bdb/dbinc_auto/ext_185_prot.in BitKeeper/deleted/.del-ext_def.in~eb85579468346302: Delete: bdb/dbinc_auto/ext_def.in BitKeeper/deleted/.del-ext_prot.in~1123bab8d321561d: Delete: bdb/dbinc_auto/ext_prot.in BitKeeper/deleted/.del-fileops_ext.h~cb8ee1d24c011cac: Delete: bdb/dbinc_auto/fileops_ext.h BitKeeper/deleted/.del-hash_ext.h~9cc6cefb2d5cdee: Delete: bdb/dbinc_auto/hash_ext.h BitKeeper/deleted/.del-hmac_ext.h~da1552dc3f7b9f46: Delete: bdb/dbinc_auto/hmac_ext.h BitKeeper/deleted/.del-lock_ext.h~f9ce9b184d784d74: Delete: bdb/dbinc_auto/lock_ext.h BitKeeper/deleted/.del-log_ext.h~f1309f8f47b5e812: Delete: bdb/dbinc_auto/log_ext.h BitKeeper/deleted/.del-mp_ext.h~863c07eb97ff21fb: Delete: bdb/dbinc_auto/mp_ext.h BitKeeper/deleted/.del-mutex_ext.h~f0c6b65f493723e6: Delete: bdb/dbinc_auto/mutex_ext.h BitKeeper/deleted/.del-os_ext.h~6f51a66237a20ca3: Delete: bdb/dbinc_auto/os_ext.h BitKeeper/deleted/.del-qam_ext.h~a0e8f87ead2e3846: Delete: bdb/dbinc_auto/qam_ext.h BitKeeper/deleted/.del-rep_ext.h~94f25917d5d2623: Delete: bdb/dbinc_auto/rep_ext.h BitKeeper/deleted/.del-rpc_client_ext.h~8fb31274cb4dc50: Delete: bdb/dbinc_auto/rpc_client_ext.h BitKeeper/deleted/.del-tcl_ext.h~6004cb009c5424ee: Delete: bdb/dbinc_auto/tcl_ext.h BitKeeper/deleted/.del-txn_ext.h~c30807d88c7b11ea: Delete: bdb/dbinc_auto/txn_ext.h BitKeeper/deleted/.del-xa_ext.h~3f131d16d9cc5e: Delete: bdb/dbinc_auto/xa_ext.h bdb/java/src/com/sleepycat/db/Db.java.in: Rename: bdb/java/src/com/sleepycat/db/Db.java -> bdb/java/src/com/sleepycat/db/Db.java.in bdb/dist/s_java: avoid in-place editing bdb/dist/s_rpc: be consistent
134 lines
3.7 KiB
Bash
134 lines
3.7 KiB
Bash
#!/bin/sh -
|
|
# $Id: s_rpc,v 11.18 2002/08/15 15:22:09 bostic Exp $
|
|
#
|
|
# Build the automatically generated RPC files
|
|
|
|
echo "Building RPC client/server files"
|
|
|
|
. ./RELEASE
|
|
|
|
t=/tmp/__db_a
|
|
trap 'rm -f $t ; exit 0' 0
|
|
trap 'rm -f $t ; exit 1' 1 2 3 13 15
|
|
|
|
client_file=../rpc_client/gen_client.c
|
|
ctmpl_file=./template/gen_client_ret
|
|
dbinc_file=../dbinc/db.in
|
|
defs_file=../dbinc_auto/rpc_defs.in
|
|
header_file=../dbinc_auto/db_server.h
|
|
proc_file=../rpc_server/c/db_server_proc.c
|
|
rpcclnt_file=../rpc_client/db_server_clnt.c
|
|
rpcsvc_file=../rpc_server/c/db_server_svc.c
|
|
rpcxdr_file=../rpc_server/c/db_server_xdr.c
|
|
sed_file=../rpc_server/c/db_server_proc.sed
|
|
server_file=../rpc_server/c/gen_db_server.c
|
|
stmpl_file=./template/db_server_proc
|
|
xdr_file=../rpc_server/db_server.x
|
|
|
|
rm -f $client_file \
|
|
$ctmpl_file \
|
|
$header_file \
|
|
$rpcclnt_file \
|
|
$rpcsvc_file \
|
|
$proc_file \
|
|
$rpcxdr_file \
|
|
$sed_file \
|
|
$server_file \
|
|
$stmpl_file \
|
|
$xdr_file
|
|
|
|
#
|
|
# Generate client/server/XDR code
|
|
#
|
|
xidsize=\
|
|
`awk '/^#define/ { if ($2 == "DB_XIDDATASIZE") { print $3 }}' $dbinc_file`
|
|
|
|
awk -f gen_rpc.awk \
|
|
-v major=$DB_VERSION_MAJOR \
|
|
-v minor=$DB_VERSION_MINOR \
|
|
-v xidsize=$xidsize \
|
|
-v client_file=$client_file \
|
|
-v ctmpl_file=$ctmpl_file \
|
|
-v sed_file=$sed_file \
|
|
-v server_file=$server_file \
|
|
-v stmpl_file=$stmpl_file \
|
|
-v xdr_file=$xdr_file < ../rpc_server/rpc.src
|
|
chmod 444 $client_file $server_file
|
|
|
|
#
|
|
# Now run rpcgen to generate all our sources from the XDR file
|
|
#
|
|
rpcgen -h $xdr_file > $header_file
|
|
rpcgen -l $xdr_file > $rpcclnt_file
|
|
rpcgen -s tcp $xdr_file > $rpcsvc_file
|
|
rpcgen -c $xdr_file > $rpcxdr_file
|
|
|
|
#
|
|
# Run various server files through sed.
|
|
#
|
|
cat <<ENDOFSEDTEXT>$t
|
|
s/^#include[ ]"db_server.h"/#include "db_config.h"\\
|
|
\\
|
|
\\#ifndef NO_SYSTEM_INCLUDES\\
|
|
\\#include <rpc\\/rpc.h>\\
|
|
\\#include <rpc\\/pmap_clnt.h>/
|
|
/^#include <netinet.in.h>/a\\
|
|
\\#endif\\
|
|
\\
|
|
\\#include "db_int.h"\\
|
|
\\#include "dbinc_auto/db_server.h"\\
|
|
\\#include "dbinc/db_server_int.h"\\
|
|
\\#include "dbinc_auto/rpc_server_ext.h"
|
|
/^ return;/i\\
|
|
\\ __dbsrv_timeout(0);
|
|
s/svc_sendreply(transp, xdr_void,/svc_sendreply(transp, (xdrproc_t)xdr_void,/
|
|
s/svc_getargs(transp, xdr_argument, &argument)/svc_getargs(transp, (xdrproc_t)xdr_argument, (char *)\&argument)/
|
|
s/svc_sendreply(transp, xdr_result, result)/svc_sendreply(transp, (xdrproc_t)xdr_result, result)/
|
|
s/svc_freeargs(transp, xdr_argument, &argument)/svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)\&argument)/
|
|
s/^main/void __dbsrv_main/
|
|
ENDOFSEDTEXT
|
|
sed -f $t $rpcsvc_file > ${rpcsvc_file}.new
|
|
mv ${rpcsvc_file}.new $rpcsvc_file
|
|
|
|
sed -f $sed_file ${proc_file}.in > ${proc_file}
|
|
|
|
# Run rpcgen files through sed to add HAVE_RPC ifdef and appropriate
|
|
# includes.
|
|
cat <<ENDOFSEDTEXT>$t
|
|
1i\\
|
|
\\#include "db_config.h"\\
|
|
\\
|
|
\\#ifdef HAVE_RPC
|
|
/^#include "db_server.h"/c\\
|
|
\\#ifndef NO_SYSTEM_INCLUDES\\
|
|
\\#include <rpc/rpc.h>\\
|
|
\\
|
|
\\#include <strings.h>\\
|
|
\\#endif\\
|
|
\\
|
|
\\#include "db_int.h"\\
|
|
\\#include "dbinc_auto/db_server.h"
|
|
\$a\\
|
|
\\#endif /* HAVE_RPC */
|
|
ENDOFSEDTEXT
|
|
|
|
sed -f $t $rpcxdr_file > ${rpcxdr_file}.new
|
|
mv ${rpcxdr_file}.new $rpcxdr_file
|
|
sed -f $t $rpcclnt_file > ${rpcclnt_file}.new
|
|
mv ${rpcclnt_file}.new $rpcclnt_file
|
|
|
|
# Copy the DB_RPC SERVER #defines into a separate file so
|
|
# they can be part of db.h.
|
|
msgc="/* DO NOT EDIT: automatically built by dist/s_rpc. */"
|
|
(echo "" && echo "$msgc" &&
|
|
sed -n -e "/DB_RPC_SERVER/p" $header_file) > $defs_file
|
|
|
|
# Fix up the header file:
|
|
# Remove the DB_RPC_SERVER #defines.
|
|
# Remove the <rpc/rpc.h> include, it needs to be included earlier
|
|
# than that.
|
|
sed -e "/DB_RPC_SERVER/d"\
|
|
-e "/^#include.*<rpc\/rpc.h>/d" $header_file > ${header_file}.new
|
|
mv ${header_file}.new $header_file
|
|
|
|
chmod 444 $header_file $rpcclnt_file $rpcsvc_file $rpcxdr_file
|