Revision 19079,
1.5 KB
checked in by ghudson, 22 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r19078,
which included commits to RCS files with non-trunk default branches.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/sh - |
---|
2 | # Id: s_javah,v 1.1 2002/08/14 17:14:24 dda Exp |
---|
3 | # |
---|
4 | # Use javah to build the libdb_java/com_*.h header files. |
---|
5 | # |
---|
6 | # To run this, you will need a javac and javah in your PATH. |
---|
7 | # If possible, install tools with a recent vintage, JDK 1.3 or higher is good. |
---|
8 | # Using Sun's JDK rather than some other installation ensures |
---|
9 | # that the header files will not be constantly changed. |
---|
10 | |
---|
11 | . RELEASE |
---|
12 | |
---|
13 | JAVAC=javac |
---|
14 | JAVAH=javah |
---|
15 | export CLASSPATH |
---|
16 | CLASSPATH= |
---|
17 | |
---|
18 | # CLASSES are only those classes for which we have native methods. |
---|
19 | D=com.sleepycat.db |
---|
20 | CLASSES="$D.Dbc $D.DbEnv $D.Db $D.DbLock $D.DbLogc $D.DbLsn $D.Dbt $D.DbTxn $D.xa.DbXAResource" |
---|
21 | |
---|
22 | d=/tmp/__javah |
---|
23 | c=$d/classes |
---|
24 | trap 'rm -rf $d; exit 0' 0 1 2 3 13 15 |
---|
25 | |
---|
26 | rm -rf $d |
---|
27 | mkdir $d || exit 1 |
---|
28 | mkdir $c || exit 1 |
---|
29 | |
---|
30 | # Make skeleton versions of XA classes and interfaces |
---|
31 | # We only need to compile them, not run them. |
---|
32 | pkg="package javax.transaction.xa" |
---|
33 | echo "$pkg; public interface XAResource {}" > $d/XAResource.java |
---|
34 | echo "$pkg; public interface Xid {}" > $d/Xid.java |
---|
35 | echo "$pkg; public class XAException extends Exception {}" \ |
---|
36 | > $d/XAException.java |
---|
37 | |
---|
38 | |
---|
39 | # Create the .class files and use them with javah to create the .h files |
---|
40 | ${JAVAC} -d $c $d/*.java \ |
---|
41 | ../java/src/com/sleepycat/db/*.java \ |
---|
42 | ../java/src/com/sleepycat/db/xa/*.java || exit 1 |
---|
43 | ${JAVAH} -classpath $c -d $d ${CLASSES} || exit 1 |
---|
44 | |
---|
45 | for cl in ${CLASSES}; do |
---|
46 | h=`echo $cl | sed -e 's/\./_/g'`.h |
---|
47 | t=$d/$h |
---|
48 | f=../libdb_java/$h |
---|
49 | if [ ! -f $t ]; then |
---|
50 | echo "ERROR: $t does not exist" |
---|
51 | exit 1 |
---|
52 | fi |
---|
53 | cmp $t $f > /dev/null 2>&1 || |
---|
54 | (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f) |
---|
55 | done |
---|
Note: See
TracBrowser
for help on using the repository browser.