The current scripts in the cp-tools project fail to work as they don't add the classes to the classpath. This fixes the issue by installing generated scripts in the same style as those for the Classpath tools.
ChangeLog: 2008-06-29 Andrew John Hughes <[EMAIL PROTECTED]> * Makefile.am: Remove previous rules for scripts and install in share/cp-tools instead of share/java. * bin/currencygen, * bin/localegen, * bin/javah, * bin/javap: Removed. * bin/currencygen.in, * bin/gjavah.in, * bin/gjavap.in, * bin/localegen.in: New script templates. * configure.ac: Generate scripts if GCJ is not used. -- Andrew :) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
Index: Makefile.am =================================================================== RCS file: /sources/classpath/cp-tools/Makefile.am,v retrieving revision 1.12 diff -u -u -r1.12 Makefile.am --- Makefile.am 29 Jun 2008 00:04:13 -0000 1.12 +++ Makefile.am 29 Jun 2008 01:00:54 -0000 @@ -21,37 +21,36 @@ BUILT_SOURCES = $(data_JARS) -lib_LTLIBRARIES = libcpgenerators.la - if ENABLE_GCJ_BINARY bin_PROGRAMS = localegen currencygen +lib_LTLIBRARIES = libcpgenerators.la if USE_GNUBYTECODE -bin_PROGRAMS += javap javah +bin_PROGRAMS += gjavap gjavah lib_LTLIBRARIES += libcptools.la libbytecode.la libbytecode_la_LINK = $(GCJLINK) nodist_libbytecode_la_SOURCES = $(BYTECODE_JAR) endif else -bin_SCRIPTS = localegen currencygen +bin_SCRIPTS = bin/localegen bin/currencygen if USE_GNUBYTECODE -bin_SCRIPTS += javap javah +bin_SCRIPTS += bin/gjavap bin/gjavah endif endif if ENABLE_GCJ_BINARY if USE_GNUBYTECODE -javap_SOURCES = -javap_LINK = $(GCJLINK) -javap_LDADD = libcptools.la -javap_LDADD += libbytecode.la -javap_LDFLAGS = --main=gnu.classpath.tools.javap.JavapMain \ +gjavap_SOURCES = +gjavap_LINK = $(GCJLINK) +gjavap_LDADD = libcptools.la +gjavap_LDADD += libbytecode.la +gjavap_LDFLAGS = --main=gnu.classpath.tools.javap.JavapMain \ -Dgnu.gcj.runtime.VMClassLoader.library_control=never -javah_SOURCES = -javah_LINK = $(GCJLINK) -javah_LDADD = libcptools.la -javah_LDADD += libbytecode.la -javah_LDFLAGS = --main=gnu.classpath.tools.javah.JavahMain \ +gjavah_SOURCES = +gjavah_LINK = $(GCJLINK) +gjavah_LDADD = libcptools.la +gjavah_LDADD += libbytecode.la +gjavah_LDFLAGS = --main=gnu.classpath.tools.javah.JavahMain \ -Dgnu.gcj.runtime.VMClassLoader.library_control=never endif @@ -64,27 +63,15 @@ currencygen_SOURCES = currencygen_LINK = $(GCJLINK) currencygen_LDADD = libcpgenerators.la -currencygen_LDFLAGS = --main=gnu.currencygen.Main +currencygen_LDFLAGS = --main=gnu.currencygen.Main \ + -Dgnu.gcj.runtime.VMClassLoader.library_control=never else -if USE_GNUBYTECODE -javap: $(srcdir)/bin/javap - cp $< $@ - chmod +x $@ - -javah: $(srcdir)/bin/javah - cp $< $@ - chmod +x $@ -endif - -localegen: $(srcdir)/bin/localegen - cp $< $@ - chmod +x $@ - -currencygen: $(srcdir)/bin/currencygen - cp $< $@ - chmod +x $@ +gjavap: $(srcdir)/bin/gjavap.in +gjavah: $(srcdir)/bin/gjavah.in +localegen: $(srcdir)/bin/localegen.in +currencygen: $(srcdir)/bin/currencygen.in endif # if ENABLE_GCJ_BINARY @@ -165,21 +152,12 @@ clean-local: rm -rf classes $(data_JARS) -dist-hook: - test -d $(distdir)/bin/ || mkdir $(distdir)/bin - cp $(srcdir)/bin/currencygen $(distdir)/bin/ - cp $(srcdir)/bin/javah $(distdir)/bin/ - cp $(srcdir)/bin/javap $(distdir)/bin/ - cp $(srcdir)/bin/localegen $(distdir)/bin/ - cp $(srcdir)/bin/native2ascii $(distdir)/bin/ - - install-data-hook: - $(INSTALL) -d $(datadir)/java - $(INSTALL) --mode 644 $(data_JARS) $(datadir)/java - $(LN_S) -f $(datadir)/java/cpgenerators-$(VERSION).jar $(datadir)/java/cpgenerators.jar + $(INSTALL) -d $(datadir)/cp-tools + $(INSTALL) --mode 644 $(data_JARS) $(datadir)/cp-tools + $(LN_S) -f $(datadir)/cp-tools/cpgenerators-$(VERSION).jar $(datadir)/cp-tools/cpgenerators.jar if [ -e cptools-$(VERSION).jar ]; then \ - $(LN_S) -f $(datadir)/java/cptools-$(VERSION).jar $(datadir)/java/cptools.jar; \ + $(LN_S) -f $(datadir)/cp-tools/cptools-$(VERSION).jar $(datadir)/cp-tools/cptools.jar; \ fi test: tests/%.class $(srcdir)/src/test/%.java Index: configure.ac =================================================================== RCS file: /sources/classpath/cp-tools/configure.ac,v retrieving revision 1.6 diff -u -u -r1.6 configure.ac --- configure.ac 28 Jun 2008 22:35:38 -0000 1.6 +++ configure.ac 29 Jun 2008 01:00:54 -0000 @@ -43,7 +43,7 @@ AC_ARG_ENABLE([native], [AS_HELP_STRING(--disable-native, disable generation of native binaries [[default=no]])], [ - if test "x${withval}" != xno; then + if test "x${enableval}" = xno; then enable_gcj=no else enable_gcj=yes @@ -99,4 +99,15 @@ AC_CHECK_RQRD_CLASS([javax.xml.transform.Transformer]) AC_CONFIG_FILES([Makefile]) +if test "x${enable_gcj}" = xno; then + AC_CONFIG_FILES([bin/localegen bin/currencygen]) + AC_CONFIG_COMMANDS([localegen],[chmod 755 bin/localegen]) + AC_CONFIG_COMMANDS([currencygen],[chmod 755 bin/currencygen]) + if test "x${with_gnubytecode}" = xyes + then + AC_CONFIG_FILES([bin/gjavap bin/gjavah]) + AC_CONFIG_COMMANDS([gjavap], [chmod 755 bin/gjavap]) + AC_CONFIG_COMMANDS([gjavah], [chmod 755 bin/gjavah]) + fi +fi AC_OUTPUT Index: bin/currencygen =================================================================== RCS file: bin/currencygen diff -N bin/currencygen --- bin/currencygen 17 Jan 2005 05:39:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -# -# gnu.currencygen -# Convenience script for Unix boxes -# - -java gnu.currencygen.Main "$@" - Index: bin/currencygen.in =================================================================== RCS file: bin/currencygen.in diff -N bin/currencygen.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/currencygen.in 29 Jun 2008 01:00:54 -0000 @@ -0,0 +1,48 @@ +#!/bin/sh + +## Copyright (C) 2008 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 currencygen tool. +## + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@/@PACKAGE@ +tools_cp=${tools_dir}/cpgenerators.jar + +exec @JAVA@ -classpath "${tools_cp}" gnu.currencygen.Main "$@" Index: bin/gjavah.in =================================================================== RCS file: bin/gjavah.in diff -N bin/gjavah.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/gjavah.in 29 Jun 2008 01:00:54 -0000 @@ -0,0 +1,48 @@ +#!/bin/sh + +## Copyright (C) 2008 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 javah tool. +## + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@/@PACKAGE@ +tools_cp=${tools_dir}/cptools.zip + +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.javah.JavahMain "$@" Index: bin/gjavap.in =================================================================== RCS file: bin/gjavap.in diff -N bin/gjavap.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/gjavap.in 29 Jun 2008 01:00:54 -0000 @@ -0,0 +1,48 @@ +#!/bin/sh + +## Copyright (C) 2008 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 javap tool. +## + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@/@PACKAGE@ +tools_cp=${tools_dir}/cptools.zip + +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.javap.JavapMain "$@" Index: bin/javah =================================================================== RCS file: bin/javah diff -N bin/javah --- bin/javah 30 Jan 2005 04:19:27 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -# -# gnu.classpath.tools -# Convenience script for Unix boxes -# - -java gnu.classpath.tools.javah.JavahMain "$@" - Index: bin/javap =================================================================== RCS file: bin/javap diff -N bin/javap --- bin/javap 30 Jan 2005 04:19:27 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -# -# gnu.classpath.tools -# Convenience script for Unix boxes -# - -java gnu.classpath.tools.javap.JavapMain "$@" - Index: bin/localegen =================================================================== RCS file: bin/localegen diff -N bin/localegen --- bin/localegen 17 Jan 2005 05:39:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -# -# gnu.localegen -# Convenience script for Unix boxes -# - -java gnu.localegen.Main "$@" - Index: bin/localegen.in =================================================================== RCS file: bin/localegen.in diff -N bin/localegen.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/localegen.in 29 Jun 2008 01:00:54 -0000 @@ -0,0 +1,48 @@ +#!/bin/sh + +## Copyright (C) 2008 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 localegen tool. +## + [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@/@PACKAGE@ +tools_cp=${tools_dir}/cpgenerators.jar + +exec @JAVA@ -classpath "${tools_cp}" gnu.localegen.Main "$@"