aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2010-11-22 11:39:01 +0000
committerMichael Matz <matz@gcc.gnu.org>2010-11-22 11:39:01 +0000
commit52dfc05bb4e58ca3c249ebc7d3c3d247b875fcdc (patch)
tree001d95fb5f3bc7499deea0f8df814bd0ae775d15
parent3e52c27bc6edc1ffa3e1a2fc7b04fabfbc793cd6 (diff)
downloadgcc-52dfc05bb4e58ca3c249ebc7d3c3d247b875fcdc.zip
gcc-52dfc05bb4e58ca3c249ebc7d3c3d247b875fcdc.tar.gz
gcc-52dfc05bb4e58ca3c249ebc7d3c3d247b875fcdc.tar.bz2
gfortranspec.c (library): New global, moved from ...
* gfortranspec.c (library): New global, moved from ... (lang_specific_driver): ... here. (lang_specific_pre_link): Test it here before including libgfortran.spec. From-SVN: r167027
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/gfortranspec.c14
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index db4380f..aa90bcb 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-22 Michael Matz <matz@suse.de>
+
+ * gfortranspec.c (library): New global, moved from ...
+ (lang_specific_driver): ... here.
+ (lang_specific_pre_link): Test it here before including
+ libgfortran.spec.
+
2010-11-21 Michael Matz <matz@suse.de>
Tobias Burnus <burnus@net-b.de>
diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index d8d9fc2..4bf9bf1 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -76,7 +76,11 @@ static unsigned int g77_newargc;
static struct cl_decoded_option *g77_new_decoded_options;
/* The path to the spec file. */
-char *spec_file = NULL;
+static char *spec_file = NULL;
+
+/* This will be NULL if we encounter a situation where we should not
+ link in the fortran libraries. */
+static const char *library = NULL;
/* Return full path name of spec file if it is in DIR, or NULL if
@@ -207,10 +211,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
unsigned int i;
int verbose = 0;
- /* This will be NULL if we encounter a situation where we should not
- link in libf2c. */
- const char *library = FORTRAN_LIBRARY;
-
/* 0 => -xnone in effect.
1 => -xfoo in effect. */
int saw_speclang = 0;
@@ -233,6 +233,8 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
int n_infiles = 0;
int n_outfiles = 0;
+ library = FORTRAN_LIBRARY;
+
#if 0
fprintf (stderr, "Incoming:");
for (i = 0; i < argc; i++)
@@ -472,7 +474,7 @@ lang_specific_pre_link (void)
{
if (spec_file)
free (spec_file);
- else
+ else if (library)
do_spec ("%:include(libgfortran.spec)");
return 0;