From 7aef3b6947bcee9822761622d857522a3317afc2 Mon Sep 17 00:00:00 2001 From: tromey Date: Wed, 11 Nov 1998 22:48:27 +0000 Subject: [PATCH] * 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_. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23612 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 7 +++++++ gcc/java/Make-lang.in | 2 +- gcc/java/jvspec.c | 17 +++++++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 7abcc0a..0610160 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +1998-11-11 Tom Tromey + + * 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_. + Wed Nov 11 19:08:52 1998 Per Bothner * jcf-dump.c (TABLE_SWITCH): Fix typos. diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index 9a09e14..6c37ef6 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -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 diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 21277d1..4b44ba0 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -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. */ -- 2.7.4