This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RFA: enable gappletviewer, gjarsigner and gkeytool tools
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Mon, 26 Jun 2006 20:04:59 -0400
- Subject: RFA: enable gappletviewer, gjarsigner and gkeytool tools
Hi,
This patch enables the gappletviewer, gjarsigner and gkeytool tools. These tool
binaries dlopen the new libjvm.so library, using the libgcj's imported libltdl.
For now I've hard-coded the full path to libjvm.so in the dlopen call. If the
install tree is relocated, these tools will cease to work. I've filed a general
bug report for this, since there are already other places in libgcj where we
hard-code full paths:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28175
I think the relocation work should be done as a separate patch though.
OK to commit?
Tom
2006-06-26 Thomas Fitzsimmons <fitzsim@redhat.com>
* classpath/tools/toolwrapper.c: dlopen libjvm.so.
* classpath/tools/Makefile.am: Comment out binary wrapper build
logic. Rename tools.zip libgcj-tools-$(gcc_version).jar and
install in jardir.
* classpath/tools/Makefile.in: Regenerate.
* classpath/tools/jarsigner.in: Rename ...
* classpath/tools/gjarsigner.in: New file.
* classpath/tools/keytool.in: Rename ...
* classpath/tools/gkeytool.in: New file.
* classpath/tools/appletviewer.in: Rename ...
* classpath/tools/gappletviewer.in: New file.
* classpath/configure.ac: Rename tool wrapper scripts.
* classpath/configure: Regenerate.
* classpath/Makefile.am (SUBDIRS, DIST_SUBDIRS): Add tools.
* classpath/Makefile.in: Regenerate.
* classpath/aclocal.m4: Regenerate.
* Makefile.am (bin_PROGRAMS): Add gappletviewer, gjarsigner and
gkeytool.
* Makefile.in: Regenerate.
Index: classpath/tools/toolwrapper.c
===================================================================
--- classpath/tools/toolwrapper.c (revision 115021)
+++ classpath/tools/toolwrapper.c (working copy)
@@ -37,6 +37,8 @@
exception statement from your version. */
#include <jni.h>
+/* GCJ LOCAL: include ltdl.h */
+#include <ltdl.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
@@ -51,6 +53,9 @@
JNIEnv *jni_env;
};
+/* GCJ LOCAL: typedef for JNI_CreateJavaVM dlopen call */
+typedef jint createVM (JavaVM **, void **, void *);
+
int
main (int argc, const char** argv)
{
@@ -68,6 +73,9 @@
int non_vm_argc;
int i;
int classpath_found = 0;
+ /* GCJ LOCAL: variables for JNI_CreateJavaVM dlopen call */
+ lt_dlhandle libjvm_handle;
+ createVM* libjvm_create;
env = NULL;
jvm = NULL;
@@ -152,7 +160,11 @@
vm_args.version = JNI_VERSION_1_2;
vm_args.ignoreUnrecognized = JNI_TRUE;
- result = JNI_CreateJavaVM (&jvm, &tmp.void_env, &vm_args);
+ /* GCJ LOCAL: dlopen libjvm.so */
+ lt_dlinit ();
+ libjvm_handle = lt_dlopen (LIBJVM);
+ libjvm_create = (createVM*) lt_dlsym (libjvm_handle, "JNI_CreateJavaVM");
+ result = (*libjvm_create) (&jvm, &tmp.void_env, &vm_args);
if (result < 0)
{
Index: classpath/tools/gjarsigner.in
===================================================================
--- classpath/tools/gjarsigner.in (revision 0)
+++ classpath/tools/gjarsigner.in (revision 0)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath jarsigner tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.jarsigner.Main $@
Index: classpath/tools/gkeytool.in
===================================================================
--- classpath/tools/gkeytool.in (revision 0)
+++ classpath/tools/gkeytool.in (revision 0)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+##
+## A simple shell script to launch the GNU Classpath keytool tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.keytool.Main $@
Index: classpath/tools/gappletviewer.in
===================================================================
--- classpath/tools/gappletviewer.in (revision 0)
+++ classpath/tools/gappletviewer.in (revision 0)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+## Copyright (C) 2006 Free Software Foundation, Inc.
+##
+## This file is a part of GNU Classpath.
+##
+## GNU Classpath is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## GNU Classpath is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with GNU Classpath; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+## USA.
+##
+## Linking this library statically or dynamically with other modules is
+## making a combined work based on this library. Thus, the terms and
+## conditions of the GNU General Public License cover the whole
+## combination.
+##
+## As a special exception, the copyright holders of this library give you
+## permission to link this library with independent modules to produce an
+## executable, regardless of the license terms of these independent
+## modules, and to copy and distribute the resulting executable under
+## terms of your choice, provided that you also meet, for each linked
+## independent module, the terms and conditions of the license of that
+## module. An independent module is a module which is not derived from
+## or based on this library. If you modify this library, you may extend
+## this exception to your version of the library, but you are not
+## obligated to do so. If you do not wish to do so, delete this
+## exception statement from your version.
+##
+## A simple shell script to launch the GNU Classpath appletviewer tool.
+##
+
+prefix=@prefix@
+tools_dir=@datadir@/@PACKAGE@
+tools_cp=${tools_dir}/tools.zip
+
+exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.appletviewer.Main $@
Index: classpath/tools/Makefile.am
===================================================================
--- classpath/tools/Makefile.am (revision 115021)
+++ classpath/tools/Makefile.am (working copy)
@@ -21,67 +21,59 @@
endif
endif
-if CREATE_WRAPPERS
-bin_SCRIPTS =
-bin_PROGRAMS = gappletviewer gjarsigner gkeytool
+## GCJ LOCAL: do not build and install wrapper binaries here, since
+## the build ordering will not work. Instead build them in
+## gcc/libjava/Makefile.am.
+# if CREATE_WRAPPERS
+# bin_SCRIPTS =
+# bin_PROGRAMS = gappletviewer gjarsigner gkeytool
-if FOUND_GCJ
-LIBJVM = -lgcj
-else
-if FOUND_CACAO
-LIBJVM = -ljvm
-else
-LIBJVM =
-endif
-endif
+# if FOUND_GCJ
+# LIBJVM = -lgcj
+# else
+# if FOUND_CACAO
+# LIBJVM = -ljvm
+# else
+# LIBJVM =
+# endif
+# endif
-# Some architecture independent data to be installed.
-TOOLS_DATA = $(TOOLS_ZIP)
+# AM_CPPFLAGS = -Wall \
+# -I$(top_srcdir)/include \
+# -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
-# Where we want these data files installed.
-## GCJ LOCAL: install libgcj-tools.jar alongside libgcj.jar.
-TOOLSdir = $(datadir)/java
+# gappletviewer_SOURCES = toolwrapper.c
+# gappletviewer_CFLAGS = \
+# -DTOOLPACKAGE="\"appletviewer\"" \
+# -DTOOLNAME="\"gappletviewer\""
+# gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
-# The zip files with classes we want to produce.
-## GCJ LOCAL: rename tools.zip libgcj-tools-$(gcc_version).jar
-TOOLS_ZIP = libgcj-tools-$(gcc_version).jar
+# gjarsigner_SOURCES = toolwrapper.c
+# gjarsigner_CFLAGS = \
+# -DTOOLPACKAGE="\"jarsigner\"" \
+# -DTOOLNAME="\"gjarsigner\""
+# gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
-## GCJ LOCAL: calculate GCC version
-gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+# gkeytool_SOURCES = toolwrapper.c
+# gkeytool_CFLAGS = \
+# -DTOOLPACKAGE="\"keytool\"" \
+# -DTOOLNAME="\"gkeytool\""
+# gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
-gappletviewer_SOURCES = toolwrapper.c
-gappletviewer_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"appletviewer\"" \
- -DTOOLNAME="\"gappletviewer\""
-gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
+# else
+# bin_SCRIPTS = gappletviewer gjarsigner gkeytool
+# bin_PROGRAMS =
+# endif
+EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in
-gjarsigner_SOURCES = toolwrapper.c
-gjarsigner_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"jarsigner\"" \
- -DTOOLNAME="\"gjarsigner\""
-gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
-
-gkeytool_SOURCES = toolwrapper.c
-gkeytool_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"keytool\"" \
- -DTOOLNAME="\"gkeytool\""
-gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
-
-else
-bin_SCRIPTS = appletviewer jarsigner keytool
-bin_PROGRAMS =
-endif
-EXTRA_DIST = toolwrapper.c appletviewer.in jarsigner.in keytool.in
-
# All our example java source files
TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+# The zip files with classes we want to produce.
+## GCJ LOCAL: rename tools.zip to libgcj-tools-$(gcc_version).jar
+gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+TOOLS_ZIP = libgcj-tools-$(gcc_version).jar
+
# Extra objects that will not exist until configure-time
BUILT_SOURCES = $(TOOLS_ZIP)
@@ -103,6 +95,13 @@
# All the files we find "interesting"
ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(TOOLS_HELPS)
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP)
+
+# Where we want these data files installed.
+## GCJ LOCAL: install libgcj-tools.jar alongside libgcj.jar.
+TOOLSdir = $(datadir)/java
+
# Make sure everything is included in the distribution.
dist-hook:
srcdir_cnt=`echo $(srcdir) | wc -c`; \
@@ -121,6 +120,7 @@
# the class files. Always regenerate all .class files and remove them
# immediately. And copy the template files we use to the classes dir
# so they get also included.
+## GCJ LOCAL: assume FASTJAR since we pass --with-fastjar to configure
$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
Index: classpath/tools/jarsigner.in
===================================================================
--- classpath/tools/jarsigner.in (revision 115021)
+++ classpath/tools/jarsigner.in (working copy)
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-## Copyright (C) 2006 Free Software Foundation, Inc.
-##
-## This file is a part of GNU Classpath.
-##
-## GNU Classpath is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or (at
-## your option) any later version.
-##
-## GNU Classpath is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Classpath; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-## USA.
-##
-## Linking this library statically or dynamically with other modules is
-## making a combined work based on this library. Thus, the terms and
-## conditions of the GNU General Public License cover the whole
-## combination.
-##
-## As a special exception, the copyright holders of this library give you
-## permission to link this library with independent modules to produce an
-## executable, regardless of the license terms of these independent
-## modules, and to copy and distribute the resulting executable under
-## terms of your choice, provided that you also meet, for each linked
-## independent module, the terms and conditions of the license of that
-## module. An independent module is a module which is not derived from
-## or based on this library. If you modify this library, you may extend
-## this exception to your version of the library, but you are not
-## obligated to do so. If you do not wish to do so, delete this
-## exception statement from your version.
-##
-##
-## A simple shell script to launch the GNU Classpath jarsigner tool.
-##
-
-prefix=@prefix@
-tools_dir=@datadir@/@PACKAGE@
-tools_cp=${tools_dir}/tools.zip
-
-exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.jarsigner.Main $@
Index: classpath/tools/keytool.in
===================================================================
--- classpath/tools/keytool.in (revision 115021)
+++ classpath/tools/keytool.in (working copy)
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-## Copyright (C) 2006 Free Software Foundation, Inc.
-##
-## This file is a part of GNU Classpath.
-##
-## GNU Classpath is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or (at
-## your option) any later version.
-##
-## GNU Classpath is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Classpath; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-## USA.
-##
-## Linking this library statically or dynamically with other modules is
-## making a combined work based on this library. Thus, the terms and
-## conditions of the GNU General Public License cover the whole
-## combination.
-##
-## As a special exception, the copyright holders of this library give you
-## permission to link this library with independent modules to produce an
-## executable, regardless of the license terms of these independent
-## modules, and to copy and distribute the resulting executable under
-## terms of your choice, provided that you also meet, for each linked
-## independent module, the terms and conditions of the license of that
-## module. An independent module is a module which is not derived from
-## or based on this library. If you modify this library, you may extend
-## this exception to your version of the library, but you are not
-## obligated to do so. If you do not wish to do so, delete this
-## exception statement from your version.
-##
-##
-## A simple shell script to launch the GNU Classpath keytool tool.
-##
-
-prefix=@prefix@
-tools_dir=@datadir@/@PACKAGE@
-tools_cp=${tools_dir}/tools.zip
-
-exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.keytool.Main $@
Index: classpath/tools/appletviewer.in
===================================================================
--- classpath/tools/appletviewer.in (revision 115021)
+++ classpath/tools/appletviewer.in (working copy)
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-## Copyright (C) 2006 Free Software Foundation, Inc.
-##
-## This file is a part of GNU Classpath.
-##
-## GNU Classpath is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or (at
-## your option) any later version.
-##
-## GNU Classpath is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with GNU Classpath; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-## USA.
-##
-## Linking this library statically or dynamically with other modules is
-## making a combined work based on this library. Thus, the terms and
-## conditions of the GNU General Public License cover the whole
-## combination.
-##
-## As a special exception, the copyright holders of this library give you
-## permission to link this library with independent modules to produce an
-## executable, regardless of the license terms of these independent
-## modules, and to copy and distribute the resulting executable under
-## terms of your choice, provided that you also meet, for each linked
-## independent module, the terms and conditions of the license of that
-## module. An independent module is a module which is not derived from
-## or based on this library. If you modify this library, you may extend
-## this exception to your version of the library, but you are not
-## obligated to do so. If you do not wish to do so, delete this
-## exception statement from your version.
-##
-## A simple shell script to launch the GNU Classpath appletviewer tool.
-##
-
-prefix=@prefix@
-tools_dir=@datadir@/@PACKAGE@
-tools_cp=${tools_dir}/tools.zip
-
-exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.appletviewer.Main $@
Index: classpath/configure.ac
===================================================================
--- classpath/configure.ac (revision 115021)
+++ classpath/configure.ac (working copy)
@@ -739,12 +739,12 @@
if test "x${COMPILE_WRAPPERS}" = xno
then
-AC_CONFIG_FILES([tools/appletviewer
-tools/jarsigner
-tools/keytool])
-AC_CONFIG_COMMANDS([appletviewer],[chmod 755 tools/appletviewer])
-AC_CONFIG_COMMANDS([jarsigner],[chmod 755 tools/jarsigner])
-AC_CONFIG_COMMANDS([keytool],[chmod 755 tools/keytool])
+AC_CONFIG_FILES([tools/gappletviewer
+tools/gjarsigner
+tools/gkeytool])
+AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
+AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
+AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
fi
AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
Index: classpath/Makefile.am
===================================================================
--- classpath/Makefile.am (revision 115021)
+++ classpath/Makefile.am (working copy)
@@ -1,9 +1,8 @@
## Input file for automake to generate the Makefile.in used by configure
# lib first, to compile .class files before native code, last examples
-## GCJ LOCAL: exclude tools directory
-SUBDIRS = lib doc external include native resource scripts $(EXAMPLESDIR)
-DIST_SUBDIRS = lib doc external include native resource scripts examples
+SUBDIRS = lib doc external include native resource scripts tools $(EXAMPLESDIR)
+DIST_SUBDIRS = lib doc external include native resource scripts tools examples
## GCJ LOCAL: we need an extra -I here.
ACLOCAL_AMFLAGS = -I m4 -I ../.. -I ../../config
Index: Makefile.am
===================================================================
--- Makefile.am (revision 115021)
+++ Makefile.am (working copy)
@@ -68,7 +68,8 @@
## For now, only on native systems. FIXME.
if NATIVE
-bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
+bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
+ gappletviewer gjarsigner gkeytool
## It is convenient to actually build and install the default database
## when gcj-dbtool is available.
@@ -721,6 +722,36 @@
## linking this program.
grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
+## These tools use libltdl to dlopen libjvm.so. The necessary ltdl
+## includes are inherited from AM_CPPFLAGS.
+gappletviewer_SOURCES = classpath/tools/toolwrapper.c
+gappletviewer_CFLAGS = \
+ -DLIBJVM="\"$(dbexecdir)/libjvm.so\"" \
+ -DTOOLS_ZIP="\"$(jardir)/libgcj-tools-$(gcc_version).jar\"" \
+ -DTOOLPACKAGE="\"appletviewer\"" \
+ -DTOOLNAME="\"gappletviewer\""
+gappletviewer_LDFLAGS = $(LIBLTDL)
+gappletviewer_DEPENDENCIES = $(LIBLTDL)
+
+gjarsigner_SOURCES = classpath/tools/toolwrapper.c
+gjarsigner_CFLAGS = \
+ -DLIBJVM="\"$(dbexecdir)/libjvm.so\"" \
+ -DTOOLS_ZIP="\"$(jardir)/libgcj-tools-$(gcc_version).jar\"" \
+ -DTOOLPACKAGE="\"jarsigner\"" \
+ -DTOOLNAME="\"gjarsigner\""
+gjarsigner_LDFLAGS = $(LIBLTDL)
+gjarsigner_DEPENDENCIES = $(LIBLTDL)
+
+gkeytool_SOURCES = classpath/tools/toolwrapper.c
+gkeytool_CFLAGS = \
+ -I$(top_srcdir)/libltdl \
+ -DLIBJVM="\"$(dbexecdir)/libjvm.so\"" \
+ -DTOOLS_ZIP="\"$(jardir)/libgcj-tools-$(gcc_version).jar\"" \
+ -DTOOLPACKAGE="\"keytool\"" \
+ -DTOOLNAME="\"gkeytool\""
+gkeytool_LDFLAGS = $(LIBLTDL)
+gkeytool_DEPENDENCIES = $(LIBLTDL)
+
## ################################################################
## This lists all the C++ source files in subdirectories.