From 206318ea4505f9e7794b1fdded907be0d508a908 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Fri, 25 Mar 2005 00:38:43 +0000 Subject: From libjava... 2005-03-24 Anthony Green * gnu/gcj/tools/gcj_dbtool/Main.java: Accept libdir argument with -p option. (usage): Add [LIBDIR] to help output. * gnu/gcj/tools/gcj_dbtool/natMain.cc: New file. * Makefile.am (AM_CXXFLAGS): Define LIBGCJ_DEFAULT_DATABASE_PATH_TAIL. (db_pathtail): New macro. From gcc/java... 2005-03-24 Anthony Green * gcj.texi (Invoking gcj-dbtool): Document new LIBDIR option to 'gcj-dbtool -p'. From-SVN: r97028 --- libjava/gnu/gcj/tools/gcj_dbtool/Main.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libjava/gnu/gcj') diff --git a/libjava/gnu/gcj/tools/gcj_dbtool/Main.java b/libjava/gnu/gcj/tools/gcj_dbtool/Main.java index b4b0329..cfd22bd 100644 --- a/libjava/gnu/gcj/tools/gcj_dbtool/Main.java +++ b/libjava/gnu/gcj/tools/gcj_dbtool/Main.java @@ -259,9 +259,16 @@ public class Main if (s[0].equals("-p")) { - insist (s.length == 1); - String result = System.getProperty("gnu.gcj.precompiled.db.path", - ""); + insist (s.length == 1 || s.length == 2); + String result; + + if (s.length == 1) + result = System.getProperty("gnu.gcj.precompiled.db.path", ""); + else + result = (s[1] + + (s[1].endsWith(File.separator) ? "" : File.separator) + + getDbPathTail ()); + System.out.println (result); return; } @@ -270,6 +277,8 @@ public class Main System.exit(1); } + private static native String getDbPathTail (); + private static void insist(boolean ok) { if (! ok) @@ -296,7 +305,7 @@ public class Main + " - Merge gcj map databases into dest\n" + " Replaces dest\n" + " To add to dest, include dest in the list of sources\n" - + " gcj-dbtool -p - Print default database name"); + + " gcj-dbtool -p [LIBDIR] - Print default database name"); } // Add a jar to a map. This copies the map first and returns a -- cgit v1.1