classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: gcjx support


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: gcjx support
Date: 25 Dec 2004 16:05:37 -0700

I'm checking this in on the trunk.

I've been using Classpath as a real-world test case for gcjx.  Now
that there is another person doing some gcjx hacking, it is convenient
to make it easy to build Classpath with gcjx as is.  This patch adds
the necessary configury support.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * lib/Makefile.am (JAVAC): Handle GCJX.
        (GCJ): Removed.
        (JIKES): Likewise.
        (USER_JABBA): Likewise.
        (USER_JAVAH): Likewise.
        (FIND): Likewise.
        (USER_CLASSLIB): Likewise.
        * examples/Makefile.am (JCOMPILER): Handle gcjx.
        (GCJ): Removed.
        (JIKES): Likewise.
        * acinclude.m4 (CLASSPATH_WITH_GCJX): New macro.
        (CLASSPATH_CHECK_GCJX): Likewise.
        (CLASSPATH_FIND_JAVAC): Use it.

Index: acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/acinclude.m4,v
retrieving revision 1.44
diff -u -r1.44 acinclude.m4
--- acinclude.m4 21 Dec 2004 14:33:32 -0000 1.44
+++ acinclude.m4 25 Dec 2004 23:06:54 -0000
@@ -8,6 +8,7 @@
   CLASSPATH_WITH_GCJ
   CLASSPATH_WITH_JIKES
   CLASSPATH_WITH_KJC
+  CLASSPATH_WITH_GCJX
 
   if test "x${user_specified_javac}" = x; then
     AM_CONDITIONAL(FOUND_GCJ, test "x${GCJ}" != x)
@@ -17,9 +18,11 @@
     AM_CONDITIONAL(FOUND_JIKES, test "x${user_specified_javac}" = xjikes)
   fi
   AM_CONDITIONAL(FOUND_KJC, test "x${user_specified_javac}" = xkjc)
+  AM_CONDITIONAL(FOUND_GCJX, test "x${user_specified_javac}" = xgcjx)
 
-  if test "x${GCJ}" = x && test "x${JIKES}" = x && test 
"x${user_specified_javac}" != xkjc; then
-      echo "configure: cannot find javac, try --with-gcj, --with-jikes, or 
--with-kjc" 1>&2
+  if test "x${GCJ}" = x && test "x${JIKES}" = x && test 
"x${user_specified_javac}" != xkjc && test "x${user_specified_javac}" != xgcjx; 
then
+      # FIXME: use autoconf error function
+      echo "configure: cannot find javac, try --with-gcj, --with-jikes, 
--with-kjc, or --with-gcjx" 1>&2
       exit 1    
   fi
 ])
@@ -190,6 +193,41 @@
 ])
 
 dnl -----------------------------------------------------------
+AC_DEFUN([CLASSPATH_WITH_GCJX],
+[
+  AC_ARG_WITH([gcjx], 
+             [AS_HELP_STRING(--with-gcjx,bytecode compilation with gcjx)],
+  [
+    if test "x${withval}" != x && test "x${withval}" != xyes && test 
"x${withval}" != xno; then
+      CLASSPATH_CHECK_GCJX(${withval})
+    else
+      if test "x${withval}" != xno; then
+        CLASSPATH_CHECK_GCJX
+      fi
+    fi
+    user_specified_javac=gcjx
+  ],
+  [ 
+    CLASSPATH_CHECK_GCJX
+  ])
+  AC_SUBST(GCJX)
+])
+
+dnl -----------------------------------------------------------
+AC_DEFUN([CLASSPATH_CHECK_GCJX],
+[
+  if test "x$1" != x; then
+    if test -f "$1"; then
+      GCJX="$1"
+    else
+      AC_PATH_PROG(GCJX, "$1")
+    fi
+  else
+    AC_PATH_PROG(GCJX, "gcjx")
+  fi
+])
+
+dnl -----------------------------------------------------------
 AC_DEFUN([CLASSPATH_WITH_JAVAH],
 [
   AC_ARG_WITH([javah],
Index: examples/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/examples/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- examples/Makefile.am 1 Aug 2004 21:31:11 -0000 1.1
+++ examples/Makefile.am 25 Dec 2004 23:06:54 -0000
@@ -1,17 +1,19 @@
 ## Input file for automake to generate the Makefile.in used by configure
 
 # Setup the compiler to use the GNU Classpath library we just build
-GCJ = @GCJ@
-JIKES = @JIKES@
 if FOUND_GCJ
 JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
 else
 if FOUND_JIKES
 JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath 
$(top_builddir)/lib:.
 else
+if FOUND_GCJX
+JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath 
$(top_builddir)/lib:.
+else
 error dunno how to setup the JCOMPILER and compile
 endif
 endif
+endif
 
 # All our example java source files
 EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.75
diff -u -r1.75 Makefile.am
--- lib/Makefile.am 23 Dec 2004 22:38:45 -0000 1.75
+++ lib/Makefile.am 25 Dec 2004 23:06:54 -0000
@@ -5,14 +5,6 @@
 ## this file and restart the make process again
 sinclude $(JAVA_DEPEND)
 
-USER_CLASSLIB = @USER_CLASSLIB@
-
-GCJ = @GCJ@
-JIKES = @JIKES@
-USER_JABBA = @USER_JABBA@
-USER_JAVAH = @USER_JAVAH@
-FIND = @FIND@
-
 propertydirs :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org 
-type d ! -name CVS -print)
 propertyfiles :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org 
-name \*\.properties -print)
 
@@ -32,6 +24,10 @@
 else
 if FOUND_KJC
 JAVAC = $(KJC) -classpath .:$(USER_CLASSLIB) -d . @classes
+else
+if FOUND_GCJX
+JAVAC = $(GCJX) -classpath .:$(USER_CLASSLIB) -d . @classes
+endif # FOUND_GCJX
 endif # FOUND_KJC
 endif # FOUND_GCJ
 endif # FOUND_JIKES




reply via email to

[Prev in Thread] Current Thread [Next in Thread]