OSDN Git Service

* jvspec.c (GC_NAME): New define.
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Nov 1998 22:48:27 +0000 (22:48 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Nov 1998 22:48:27 +0000 (22:48 +0000)
(lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
if required.
* Make-lang.in (jvspec.o): Define WITH_GC_<name>.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23612 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/Make-lang.in
gcc/java/jvspec.c

index 7abcc0a..0610160 100644 (file)
@@ -1,3 +1,10 @@
+1998-11-11  Tom Tromey  <tromey@cygnus.com>
+
+       * jvspec.c (GC_NAME): New define.
+       (lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
+       if required.
+       * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
+
 Wed Nov 11 19:08:52 1998  Per Bothner  <bothner@cygnus.com>
 
        * jcf-dump.c (TABLE_SWITCH):  Fix typos.
index 9a09e14..6c37ef6 100644 (file)
@@ -84,7 +84,7 @@ $(GCJ).c: $(srcdir)/gcc.c
        $(LN_S) $(srcdir)/gcc.c $@
 
 jvspec.o: $(srcdir)/java/jvspec.c
-       $(CC) -c -DWITH_THREAD_$(GCC_THREAD_FILE) \
+       $(CC) -c -DWITH_THREAD_$(GCC_THREAD_FILE) -DWITH_GC_$(JAVAGC) \
                $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
                $(INCLUDES) $(srcdir)/java/jvspec.c
 
index 21277d1..4b44ba0 100644 (file)
@@ -35,6 +35,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc.  */
 #define THREAD_NAME "-lqthreads"
 #endif
 
+#if defined (WITH_GC_boehm)
+#define GC_NAME "-lgc"
+#endif
+
 /* This bit is set if we saw a `-xfoo' language specification.  */
 #define LANGSPEC       (1<<1)
 /* This bit is set if they did `-lm' or `-lmath'.  */
@@ -231,7 +235,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
            saw_libjava = 1;
          else if (strcmp (argv[i], "-lc") == 0)
            args[i] |= WITHLIBC;
-         else if (strcmp (argv[i], "-lgc") == 0)
+         else if (strcmp (argv[i], GC_NAME) == 0)
            args[i] |= GCLIB;
 #ifdef THREAD_NAME
          else if (strcmp (argv[i], THREAD_NAME) == 0)
@@ -372,7 +376,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
     {
       lang_specific_extra_outfiles++;
     }
-  arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *));
+  arglist = (char **) xmalloc ((num_args + 4) * sizeof (char *));
 
   for (i = 0, j = 0; i < argc; i++, j++)
     {
@@ -474,10 +478,15 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
       added_libraries++;
     }
 
-  /* FIXME: we need a way to know when the GC library should be
-     added.  Then we can add it if the user hasn't already.  */
   if (saw_gc)
     arglist[j++] = saw_gc;
+#ifdef GC_NAME
+  else if (library)
+    {
+      arglist[j++] = GC_NAME;
+      added_libraries++;
+    }
+#endif
 
   /* Thread library must come after GC library as well as after
      -ljava.  */