mariadb/bdb/dist/s_java
unknown dbbcc4223b removed auto-generated files, some fixups
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
2002-11-11 17:17:28 +01:00

273 lines
7.6 KiB
Bash
Executable file

#!/bin/sh -
# $Id: s_java,v 1.13 2002/09/09 20:47:30 bostic Exp $
#
# Build the Java files.
msgjava="/* DO NOT EDIT: automatically built by dist/s_java. */"
. RELEASE
t=/tmp/__java
c=/tmp/__javajnic
h=/tmp/__javajnih
trap 'rm -f $t $c $h; exit 0' 0 1 2 3 13 15
# Build DbConstants.java.
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo 'class DbConstants' &&
echo '{' &&
for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \
egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \
done |
sed -e "s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/" \
-e "s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/" \
-e "s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/" \
-e 's/^#define[ ][ ]*//' \
-e 's/[()=,]/ /g' \
-e 's/\/\*/ /' | \
awk '{ print " static final int " $1 " = " $2 ";" }' &&
echo '}' &&
echo &&
echo '// end of DbConstants.java') > $t
f=../java/src/com/sleepycat/db/DbConstants.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build Db.java.
f=../java/src/com/sleepycat/db/Db.java.in
sed '/BEGIN-JAVA-SPECIAL-CONSTANTS/q' < $f > $t
(echo " $msgjava" &&
for i in `egrep '^DB_.*C$' pubdef.in | awk '{print $1}'`; do \
egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \
done |
sed -e 's/^#define[ ][ ]*//' \
-e 's/[()=,]/ /g' |
awk '{ print " public static final int " $1 " = " $2 ";" }') >> $t
(for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \
egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \
done |
sed -e 's/^#define[ ][ ]*//' \
-e 's/[()=,]/ /g' |
awk '{ print " public static final int " $1 ";" }') >> $t
sed -n \
'/END-JAVA-SPECIAL-CONSTANTS/,/BEGIN-JAVA-CONSTANT-INITIALIZATION/p' \
< $f >> $t
(echo " $msgjava" &&
for i in `egrep '^DB_.*J$' pubdef.in | awk '{print $1}'`; do \
egrep -w "^#define[ ]$i|^[ ][ ]*$i" ../dbinc/db.in; \
done |
sed -e 's/^#define[ ][ ]*//' \
-e 's/[()=,]/ /g' \
-e 's/\/\*/ /' | \
awk '{ print " " $1 " = DbConstants." $1 ";" }') >> $t
sed -n '/END-JAVA-CONSTANT-INITIALIZATION/,$p' < $f >> $t
f=../java/src/com/sleepycat/db/Db.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Script to convert DB C structure declarations into Java declarations.
jclass()
{
cat ../dbinc/db.in |
sed -n \
-e "/struct $1 {/,/^}/{" \
-e "/$1/d" \
-e '/;/!d' \
-e '/^}/d' \
-e '/char[ ]*\*/{' \
-e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/$2 public String \1;/p"\
-e 'd' \
-e '}' \
-e '/time_t/{' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public long \1;/p" \
-e 'd' \
-e '}' \
-e '/DB_LSN[ ]*/{' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public DbLsn \1;/p"\
-e 'd' \
-e '}' \
-e '/DB_TXN_ACTIVE[ ]*\*/{' \
-e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/$2 public Active \1[];/p"\
-e 'd' \
-e '}' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/$2 public int \1;/p" \
-e '}'
}
# Script to convert DB C structure declarations into Java declarations.
jclass_jni()
{
c=$3
h=$4
echo "extern int $2(JNIEnv *jnienv, jclass cl, jobject jobj, struct $1 *statp);" >> $h
echo "int $2(JNIEnv *jnienv, jclass cl," >> $c
echo " jobject jobj, struct $1 *statp) {" >> $c
cat ../dbinc/db.in |
sed -n \
-e "/struct $1 {/,/^}/{" \
-e "/$1/d" \
-e '/;/!d' \
-e '/^}/d' \
-e '/char[ ]*\*/{' \
-e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/ JAVADB_STAT_STRING(jnienv, cl, jobj, statp, \1);/p"\
-e 'd' \
-e '}' \
-e '/time_t/{' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_LONG(jnienv, cl, jobj, statp, \1);/p" \
-e 'd' \
-e '}' \
-e '/DB_LSN[ ]*/{' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_LSN(jnienv, cl, jobj, statp, \1);/p"\
-e 'd' \
-e '}' \
-e '/DB_TXN_ACTIVE[ ]*\*/{' \
-e "s/^[ ]*[^\*]*\*[ ]*\([^;]*\).*/ JAVADB_STAT_ACTIVE(jnienv, cl, jobj, statp, \1);/p"\
-e 'd' \
-e '}' \
-e "s/^[ ]*[^ ]*[ ]*\([^;]*\).*/ JAVADB_STAT_INT(jnienv, cl, jobj, statp, \1);/p" \
-e '}' >> $c
echo ' return (0);' >> $c
echo '}' >> $c
}
echo "$msgjava" >> $c
echo "$msgjava" >> $h
echo '#include "java_util.h"' >> $c
# Build DbBtreeStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbBtreeStat"
echo '{'
jclass __db_bt_stat &&
echo '}' &&
echo '// end of DbBtreeStat.java') > $t
jclass_jni __db_bt_stat __jv_fill_bt_stat $c $h
f=../java/src/com/sleepycat/db/DbBtreeStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbHashStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbHashStat"
echo '{'
jclass __db_h_stat &&
echo '}' &&
echo '// end of DbHashStat.java') > $t
jclass_jni __db_h_stat __jv_fill_h_stat $c $h
f=../java/src/com/sleepycat/db/DbHashStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbLockStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbLockStat"
echo '{'
jclass __db_lock_stat &&
echo '}' &&
echo '// end of DbLockStat.java') > $t
jclass_jni __db_lock_stat __jv_fill_lock_stat $c $h
f=../java/src/com/sleepycat/db/DbLockStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbLogStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbLogStat"
echo '{'
jclass __db_log_stat &&
echo '}' &&
echo '// end of DbLogStat.java') > $t
jclass_jni __db_log_stat __jv_fill_log_stat $c $h
f=../java/src/com/sleepycat/db/DbLogStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbMpoolFStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbMpoolFStat"
echo '{'
jclass __db_mpool_fstat &&
echo '}' &&
echo '// end of DbMpoolFStat.java') > $t
jclass_jni __db_mpool_stat __jv_fill_mpool_stat $c $h
f=../java/src/com/sleepycat/db/DbMpoolFStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbQueueStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbQueueStat"
echo '{'
jclass __db_qam_stat &&
echo '}' &&
echo '// end of DbQueueStat.java') > $t
jclass_jni __db_qam_stat __jv_fill_qam_stat $c $h
f=../java/src/com/sleepycat/db/DbQueueStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbRepStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbRepStat"
echo '{'
jclass __db_rep_stat &&
echo '}' &&
echo '// end of DbRepStat.java') > $t
jclass_jni __db_rep_stat __jv_fill_rep_stat $c $h
f=../java/src/com/sleepycat/db/DbRepStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
# Build DbTxnStat.java
(echo "$msgjava" &&
echo &&
echo 'package com.sleepycat.db;' &&
echo &&
echo "public class DbTxnStat"
echo '{'
echo " public static class Active {"
jclass __db_txn_active " " &&
echo ' };' &&
jclass __db_txn_stat &&
echo '}' &&
echo '// end of DbTxnStat.java') > $t
jclass_jni __db_txn_stat __jv_fill_txn_stat $c $h
f=../java/src/com/sleepycat/db/DbTxnStat.java
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
mv $c $t
f=../libdb_java/java_stat_auto.c
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
mv $h $t
f=../libdb_java/java_stat_auto.h
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)