Commit 29bf433b by Mumit Khan Committed by Jeff Law

g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is null to decide whether to use it.

        * g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
        null to decide whether to use it.

From-SVN: r26383
parent b3edebcf
Sun Apr 11 21:33:33 1999 Mumit Khan <khan@xraylith.wisc.edu>
* g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
null to decide whether to use it.
Wed Apr 7 09:47:09 1999 Kaveh R. Ghazi <ghazi@snafu.rutgers.edu> Wed Apr 7 09:47:09 1999 Kaveh R. Ghazi <ghazi@snafu.rutgers.edu>
* ansify.c (die): Specify void argument. * ansify.c (die): Specify void argument.
......
...@@ -286,6 +286,9 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -286,6 +286,9 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
2 => last two args were -l<library> -lm. */ 2 => last two args were -l<library> -lm. */
int saw_library = 0; int saw_library = 0;
/* By default, we throw on the math library if we have one. */
int need_math = (MATH_LIBRARY[0] != '\0');
/* The number of input and output files in the incoming arg list. */ /* The number of input and output files in the incoming arg list. */
int n_infiles = 0; int n_infiles = 0;
int n_outfiles = 0; int n_outfiles = 0;
...@@ -466,7 +469,7 @@ Report bugs to <egcs-bugs@cygnus.org>.\n"); ...@@ -466,7 +469,7 @@ Report bugs to <egcs-bugs@cygnus.org>.\n");
{ {
/* Not a filename or library. */ /* Not a filename or library. */
if (saw_library == 1) /* -l<library>. */ if (saw_library == 1 && need_math) /* -l<library>. */
append_arg (MATH_LIBRARY); append_arg (MATH_LIBRARY);
saw_library = 0; saw_library = 0;
...@@ -521,7 +524,7 @@ Report bugs to <egcs-bugs@cygnus.org>.\n"); ...@@ -521,7 +524,7 @@ Report bugs to <egcs-bugs@cygnus.org>.\n");
saw_library = 1; /* -l<library>. */ saw_library = 1; /* -l<library>. */
else else
{ /* Other library, or filename. */ { /* Other library, or filename. */
if (saw_library == 1) if (saw_library == 1 && need_math)
append_arg (MATH_LIBRARY); append_arg (MATH_LIBRARY);
saw_library = 0; saw_library = 0;
} }
...@@ -541,7 +544,8 @@ Report bugs to <egcs-bugs@cygnus.org>.\n"); ...@@ -541,7 +544,8 @@ Report bugs to <egcs-bugs@cygnus.org>.\n");
case 0: case 0:
append_arg (library); append_arg (library);
case 1: case 1:
append_arg (MATH_LIBRARY); if (need_math)
append_arg (MATH_LIBRARY);
default: default:
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment