From: Mumit Khan Date: Mon, 12 Apr 1999 18:35:43 +0000 (+0000) Subject: g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is null to decide whethe... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29bf433b8531c5c571b0bbaafa6663595eb862c4;p=gcc.git 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 --- diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 291745c801e..9d2f1342d6c 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,8 @@ +Sun Apr 11 21:33:33 1999 Mumit Khan + + * 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 * ansify.c (die): Specify void argument. diff --git a/gcc/f/g77spec.c b/gcc/f/g77spec.c index 3cc2ac7724c..f1e85de6fce 100644 --- a/gcc/f/g77spec.c +++ b/gcc/f/g77spec.c @@ -286,6 +286,9 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) 2 => last two args were -l -lm. */ 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. */ int n_infiles = 0; int n_outfiles = 0; @@ -466,7 +469,7 @@ Report bugs to .\n"); { /* Not a filename or library. */ - if (saw_library == 1) /* -l. */ + if (saw_library == 1 && need_math) /* -l. */ append_arg (MATH_LIBRARY); saw_library = 0; @@ -521,7 +524,7 @@ Report bugs to .\n"); saw_library = 1; /* -l. */ else { /* Other library, or filename. */ - if (saw_library == 1) + if (saw_library == 1 && need_math) append_arg (MATH_LIBRARY); saw_library = 0; } @@ -541,7 +544,8 @@ Report bugs to .\n"); case 0: append_arg (library); case 1: - append_arg (MATH_LIBRARY); + if (need_math) + append_arg (MATH_LIBRARY); default: break; }