public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Include generated jni.hxx in jni.cxx. Date: Fri, 09 May 2008 19:31:00 -0000 [thread overview] Message-ID: <20080509193149.28194.qmail@sourceware.org> (raw) The branch, master has been updated via 3a67b7fb24ac50fc6ad63b2672084c5691526fb6 (commit) from 57fc116cd48ffb2388ccc34c8319f61eaa9c01e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 3a67b7fb24ac50fc6ad63b2672084c5691526fb6 Author: Andrew Cagney <cagney@redhat.com> Date: Fri May 9 15:30:55 2008 -0400 Include generated jni.hxx in jni.cxx. frysk-common/ChangeLog 2008-05-09 Andrew Cagney <cagney@redhat.com> * Makefile.gen.sh (jni.cxx, jni.hxx): Pass header name to jnixx. (jni.o): Explicitly specify dependencies. frysk-sys/frysk/jnixx/ChangeLog 2008-05-09 Andrew Cagney <cagney@redhat.com> * Main.java: Add a header filename parameter; in .cxx file, generate #include of header, instead of header contents. ----------------------------------------------------------------------- Summary of changes: frysk-common/ChangeLog | 5 +++++ frysk-common/Makefile.gen.sh | 9 +++++---- frysk-sys/frysk/jnixx/ChangeLog | 3 +++ frysk-sys/frysk/jnixx/Main.java | 33 +++++++++++++++++++++------------ 4 files changed, 34 insertions(+), 16 deletions(-) First 500 lines of diff: diff --git a/frysk-common/ChangeLog b/frysk-common/ChangeLog index 1650286..938763a 100644 --- a/frysk-common/ChangeLog +++ b/frysk-common/ChangeLog @@ -1,3 +1,8 @@ +2008-05-09 Andrew Cagney <cagney@redhat.com> + + * Makefile.gen.sh (jni.cxx, jni.hxx): Pass header name to jnixx. + (jni.o): Explicitly specify dependencies. + 2008-05-07 Andrew Cagney <cagney@redhat.com> * Makefile.gen.sh (JNIXX_CLASSES): Generate list of classes. diff --git a/frysk-common/Makefile.gen.sh b/frysk-common/Makefile.gen.sh index 42f509f..5fb1b41 100755 --- a/frysk-common/Makefile.gen.sh +++ b/frysk-common/Makefile.gen.sh @@ -673,7 +673,7 @@ generate_jnixx_class() { local j=$(echo $(dirname $dir)/$base) if has_java_source $j ; then automake_variable JNIXX_CLASSES += $(echo $j | tr '[/]' '[.]') - echo "${dir}/${base}.o: $j.java" + echo "${dir}/${base}.o: $j.java | jni.hxx.gch" fi } @@ -901,15 +901,16 @@ CLEANFILES += jni.hxx jni.cxx jni.hxx.gch \$(lib${GEN_MAKENAME}_jni_a_SOURCES): | jni.hxx jni.hxx.gch jni.hxx: \$(jnixx_sources) | ${GEN_DIRNAME}.jar CLASSPATH=\$(GEN_DIRNAME).jar:\$(CLASSPATH) \ - \$(JAVA) frysk.jnixx.Main hxx \$(JNIXX_CLASSES) \ + \$(JAVA) frysk.jnixx.Main hxx jni.hxx \$(JNIXX_CLASSES) \ > \$@.tmp mv \$@.tmp \$@ jni.hxx.gch: jni.hxx \$(CXXCOMPILE) -c -x c++-header jni.hxx -jni.cxx: \$(jnixx_sources) | ${GEN_DIRNAME}.jar jni.hxx.gch +jni.cxx: \$(jnixx_sources) | ${GEN_DIRNAME}.jar CLASSPATH=\$(GEN_DIRNAME).jar:\$(CLASSPATH) \ - \$(JAVA) frysk.jnixx.Main cxx \$(JNIXX_CLASSES) \ + \$(JAVA) frysk.jnixx.Main cxx jni.hxx \$(JNIXX_CLASSES) \ > \$@.tmp mv \$@.tmp \$@ +jni.o: jni.hxx | jni.hxx.gch EOF fi diff --git a/frysk-sys/frysk/jnixx/ChangeLog b/frysk-sys/frysk/jnixx/ChangeLog index 9590e1b..720b855 100644 --- a/frysk-sys/frysk/jnixx/ChangeLog +++ b/frysk-sys/frysk/jnixx/ChangeLog @@ -1,5 +1,8 @@ 2008-05-09 Andrew Cagney <cagney@redhat.com> + * Main.java: Add a header filename parameter; in .cxx file, + generate #include of header, instead of header contents. + * PrintDeclarations.java: Generate a protected constructor; and a static Cast method. * jnixx.hxx (jnixx::array): Add Cast method. diff --git a/frysk-sys/frysk/jnixx/Main.java b/frysk-sys/frysk/jnixx/Main.java index aeb1b19..7146d51 100644 --- a/frysk-sys/frysk/jnixx/Main.java +++ b/frysk-sys/frysk/jnixx/Main.java @@ -79,37 +79,46 @@ class Main { return false; } - private static void printHxxFile(Printer p, Class[] classes) { + private static void printHxxFile(Printer p, String headerFile, + Class[] classes) { p.println("#include \"frysk/jnixx/jnixx.hxx\""); new PrintNamespaces(p).walk(classes); + p.println(); + p.println("\f"); new PrintDeclarations(p).walk(classes); + p.println(); + p.println("\f"); new PrintHxxDefinitions(p).walk(classes); } - private static void printCxxFile(Printer p, Class[] classes) { - printHxxFile(p, classes); // #include - p.println(); - p.println("\f"); + private static void printCxxFile(Printer p, String headerFile, + Class[] classes) { + p.print("#include \""); + p.print(headerFile); + p.println("\""); p.println(); new PrintCxxDefinitions(p).walk(classes); } public static void main(String[] args) throws ClassNotFoundException { - if (args.length < 2) { - throw new RuntimeException("Usage: jnixx cxx}hxx <class-name> ..."); + if (args.length < 3) { + throw new RuntimeException("Usage: jnixx cxx|hxx <header-filename> <class-name> ..."); } - Class[] classes = new Class[args.length - 1]; + boolean generateHeader = args[0].equals("hxx"); + String headerFile = args[1]; + final int firstClass = 2; + Class[] classes = new Class[args.length - firstClass]; for (int i = 0; i < classes.length; i++) { - classes[i] = Class.forName(args[i + 1], false, + classes[i] = Class.forName(args[i + firstClass], false, Main.class.getClassLoader()); } Printer p = new Printer(new PrintWriter(System.out)); - if (args[0].equals("hxx")) - printHxxFile(p, classes); + if (generateHeader) + printHxxFile(p, headerFile, classes); else - printCxxFile(p, classes); + printCxxFile(p, headerFile, classes); p.flush(); } } hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-05-09 19:31 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080509193149.28194.qmail@sourceware.org \ --to=cagney@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).