This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
PATCH: Add DEBUG flag
- To: java-patches at sources dot redhat dot com
- Subject: PATCH: Add DEBUG flag
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 24 Nov 2000 16:45:52 +1300
As discussed in java-discuss (when the lists get renamed, can we make it
just "java@gcc.gnu.org"?) , this patch adds a DEBUG compile time
constant defined in gnu/classpath/Configuration.java. It is set to true
if --enable-libgcj-debug was passed to `configure'. Java code made
conditional based on the value of this flag will be removed by the
optimizer in a non-debug build.
ok?
[ bryce ]
2000-11-24 Bryce McKinlay <bryce@albatross.co.nz>
* configure: Rebuilt.
* Makefile.in: Rebuilt.
* Makefile.am (built_java_source_files): Add Configuration.java.
* configure.in: Add Configuration.java to CONFIG_FILES. Set
LIBGCJDEBUG substitution if --enable-libgcj-debug is specified.
Create `gnu' directory in the build tree.
* gnu/classpath/Configuration.java.in: New file.
Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.104
diff -u -r1.104 Makefile.am
--- Makefile.am 2000/11/22 11:59:59 1.104
+++ Makefile.am 2000/11/24 03:31:47
@@ -758,7 +758,8 @@
## Java files which are created by configure and thus are in the build
## directory.
-built_java_source_files = java/lang/ConcreteProcess.java
+built_java_source_files = java/lang/ConcreteProcess.java \
+ gnu/classpath/Configuration.java
## Java files in the core packages java.lang, java.io, and java.util.
## These are built before the other source files, in order to reduce
Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.67
diff -u -r1.67 configure.in
--- configure.in 2000/11/01 16:47:06 1.67
+++ configure.in 2000/11/24 03:31:49
@@ -65,10 +65,13 @@
fi
dnl See if the user has requested runtime debugging.
+LIBGCJDEBUG="false"
+AC_SUBST(LIBGCJDEBUG)
AC_ARG_ENABLE(libgcj-debug,
[ --enable-libgcj-debug enable runtime debugging code],
if test "$enable_libgcj_debug" = yes; then
- AC_DEFINE(DEBUG)
+ AC_DEFINE(DEBUG)
+ LIBGCJDEBUG="true"
fi)
dnl See if the user has the interpreter included.
@@ -173,6 +176,7 @@
dnl to create the link will fail.
test -d java || mkdir java
test -d java/io || mkdir java/io
+test -d gnu || mkdir gnu
AC_LINK_FILES(java/io/$FILE_DESCRIPTOR, java/io/natFileDescriptor.cc)
dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
@@ -770,7 +774,7 @@
AC_SUBST(here)
-AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gcj/Makefile include/Makefile testsuite/Makefile,
+AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
[if test -n "$CONFIG_FILES"; then
ac_file=Makefile . ${libgcj_basedir}/../config-ml.in
fi
Index: gnu/classpath/Configuration.java.in
===================================================================
RCS file: Configuration.java.in
diff -N Configuration.java.in
--- /dev/null Tue May 5 13:32:27 1998
+++ Configuration.java.in Thu Nov 23 19:31:49 2000
@@ -0,0 +1,14 @@
+// This file defines compile-time constants that can be accessed by java code.
+// It is pre-processed by configure.
+
+package gnu.classpath;
+
+public interface Configuration
+{
+ // The value of DEBUG is substituted according to whether the
+ // "--enable-libgcj-debug" argument was passed to configure. Code
+ // which is made conditional based on the value of this flag will
+ // be removed by the optimizer in a non-debug build.
+
+ boolean DEBUG = @LIBGCJDEBUG@;
+}