]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
authorGeoffrey Keating <geoffk@apple.com>
Mon, 26 Jul 2004 19:24:55 +0000 (19:24 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Mon, 26 Jul 2004 19:24:55 +0000 (19:24 +0000)
* g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
(lang_specific_driver): If the C++ or math library options don't
start with '-l', don't count them as added libraries.

From-SVN: r85201

gcc/cp/ChangeLog
gcc/cp/g++spec.c

index 1fb00277f9aae19eb1d1e9282ae682dfa045f170..329b12e5c7be1607e5e8f47cc02d20366b0e41e7 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-26  Geoffrey Keating  <geoffk@apple.com>
+
+       * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
+       (lang_specific_driver): If the C++ or math library options don't
+       start with '-l', don't count them as added libraries.
+
 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * decl.c (xref_basetypes): Adjust base access vector creation.
index 69cf1864cf8c69e80d5006763a18b6518ec10479..286134b0e9724a6678c1e56c9f3193c10749f5eb 100644 (file)
@@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA.  */
 #define LIBSTDCXX "-lstdc++"
 #endif
 #ifndef LIBSTDCXX_PROFILE
-#define LIBSTDCXX_PROFILE "-lstdc++"
+#define LIBSTDCXX_PROFILE LIBSTDCXX
 #endif
 
 void
@@ -297,15 +297,19 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
   /* Add `-lstdc++' if we haven't already done so.  */
   if (library > 0)
     {
-      arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX;
-      added_libraries++;
+      arglist[j] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX;
+      if (arglist[j][0] != '-' || arglist[j][1] == 'l')
+       added_libraries++;
+      j++;
     }
   if (saw_math)
     arglist[j++] = saw_math;
   else if (library > 0 && need_math)
     {
-      arglist[j++] = saw_profile_flag ? MATH_LIBRARY_PROFILE : MATH_LIBRARY;
-      added_libraries++;
+      arglist[j] = saw_profile_flag ? MATH_LIBRARY_PROFILE : MATH_LIBRARY;
+      if (arglist[j][0] != '-' || arglist[j][1] == 'l')
+       added_libraries++;
+      j++;
     }
   if (saw_libc)
     arglist[j++] = saw_libc;