From 2dcb563f6cccc1a1d222e1141c8b15f06798ac97 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 9 May 1992 07:00:44 +0000 Subject: *** empty log message *** From-SVN: r945 --- gcc/gcc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/gcc.c') diff --git a/gcc/gcc.c b/gcc/gcc.c index 6a6449d..39df4d5 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -94,6 +94,11 @@ extern int execv (), execvp (); #define MIN_FATAL_STATUS 1 +/* Flag saying to print the full filename of libgcc.a + as found through our usual search mechanism. */ + +static int print_libgcc_file_name; + /* Flag indicating whether we should print the command and arguments */ static int verbose_flag; @@ -1826,6 +1831,10 @@ process_command (argc, argv) printf ("%s\n", version_string); exit (0); } + else if (! strcmp (argv[i], "-print-libgcc-file-name")) + { + print_libgcc_file_name = 1; + } else if (! strcmp (argv[i], "-Xlinker")) { /* Pass the argument of this option to the linker when we link. */ @@ -1939,6 +1948,8 @@ process_command (argc, argv) { if (!strcmp (argv[i], "-Xlinker")) i++; + else if (! strcmp (argv[i], "-print-libgcc-file-name")) + i++; else if (argv[i][0] == '-' && argv[i][1] != 0 && argv[i][1] != 'l') { register char *p = &argv[i][1]; @@ -3038,6 +3049,12 @@ main (argc, argv) if (! switches[i].valid) error ("unrecognized option `-%s'", switches[i].part1); + if (print_libgcc_file_name) + { + printf ("%s\n", find_file ("libgcc.a")); + exit (0); + } + /* Obey some of the options. */ if (verbose_flag) -- cgit v1.1