This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -M and Friends for cpplib enabled compilers
- To: egcs-patches at cygnus dot com
- Subject: Re: -M and Friends for cpplib enabled compilers
- From: Dave Brolley <brolley at cygnus dot com>
- Date: Tue, 11 May 1999 11:53:12 -0400
- Organization: Cygnus Solutions Canada Ltd
- References: <3730B5B8.A9A20052@cygnus.com>
I went ahead and installed this.......
Dave Brolley wrote:
> Hi,
>
> Current compilers configured with --enable-c-cpplib complain about -M,
> -MM, -MD, -MMD unless you happen to have gcc/java in your source tree.
> This is because these options are added to documented_lang_options via
> gcc/java/lang-options.h. This patch moves them to toplev.c so that
> they're added along with the other cpplib-required options.
>
> One possible variation is to just unconditinally move them there (i.e.
> without the ifdefs). The only difference would be that they would be
> silently ignored by non-cpplib compilers without java. They are
> currently ignored already if you have java in your source tree.
>
> Comments?
>
> Dave
>
> ----------------------------------------------------------------------
> Index: toplev.c
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
> retrieving revision 1.182
> diff -c -p -c -p -r1.182 toplev.c
> *** toplev.c 1999/05/02 17:43:33 1.182
> --- toplev.c 1999/05/05 21:07:46
> *************** documented_lang_options[] =
> *** 1093,1098 ****
> --- 1093,1104 ----
> { "-A", "" },
> { "-D", "" },
> { "-I", "" },
> + #if USE_CPPLIB
> + { "-MD", "Print dependencies to FILE.d" },
> + { "-MMD", "Print dependencies to FILE.d" },
> + { "-M", "Print dependencies to stdout" },
> + { "-MM", "Print dependencies to stdout" },
> + #endif /* USE_CPPLIB */
> { "-U", "" },
> { "-H", "" },
> { "-idirafter", "" },
> Index: java/lang-options.h
> ===================================================================
> RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/lang-options.h,v
> retrieving revision 1.9
> diff -c -p -c -p -r1.9 lang-options.h
> *** lang-options.h 1999/05/03 16:45:01 1.9
> --- lang-options.h 1999/05/05 21:07:48
> *************** DEFINE_LANG_NAME ("Java")
> *** 33,42 ****
> --- 33,44 ----
> { "-fno-assume-compiled", "" },
> { "-femit-class-file", "" },
> { "-femit-class-files", "Dump class files to <name>.class" },
> + #if ! USE_CPPLIB
> { "-MD", "Print dependencies to FILE.d" },
> { "-MMD", "Print dependencies to FILE.d" },
> { "-M", "Print dependencies to stdout" },
> { "-MM", "Print dependencies to stdout" },
> + #endif /* ! USE_CPPLIB */
> { "-fclasspath", "Set class path and suppress system path" },
> { "-fCLASSPATH", "Set class path" },
> { "-I", "Add directory to class path" },