apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r124899 - /apr/apr/trunk/build/jlibtool.c
Date Tue, 11 Jan 2005 07:57:44 GMT
Author: jfclere
Date: Mon Jan 10 23:57:42 2005
New Revision: 124899

URL: http://svn.apache.org/viewcvs?view=rev&rev=124899
Log:
Arrange -l logic. (-l apr-1 should be -lapr-1)

Modified:
   apr/apr/trunk/build/jlibtool.c

Modified: apr/apr/trunk/build/jlibtool.c
Url: http://svn.apache.org/viewcvs/apr/apr/trunk/build/jlibtool.c?view=diff&rev=124899&p1=apr/apr/trunk/build/jlibtool.c&r1=124898&p2=apr/apr/trunk/build/jlibtool.c&r2=124899
==============================================================================
--- apr/apr/trunk/build/jlibtool.c	(original)
+++ apr/apr/trunk/build/jlibtool.c	Mon Jan 10 23:57:42 2005
@@ -969,6 +969,7 @@
 /* use -L -llibname to allow to use installed libraries */
 void add_minus_l(count_chars *cc, const char *arg)
 {
+    char *newarg;
     char *name = strrchr(arg, '/');
     char *file = strrchr(arg, '.');
     char *lib  = strstr(name, "lib");
@@ -978,10 +979,13 @@
         *file = '\0';
         file = name;
         file = file+4;
-        push_count_chars(cc, "-L ");
-        push_count_chars(cc, arg);
-        push_count_chars(cc, "-l");
-        push_count_chars(cc, file);
+        push_count_chars(cc, "-L");
+	push_count_chars(cc, arg);
+	/* we need one argument like -lapr-1 */
+        newarg = malloc(strlen(file) + 3);
+        strcpy(newarg, "-l");
+        strcat(newarg, file);
+        push_count_chars(cc, newarg);
     } else {
         push_count_chars(cc, arg);
     }
@@ -993,9 +997,9 @@
     push_count_chars(cc, arg);
 #else
     char *newarg;
-    newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX));
+    newarg = (char*)malloc(strlen(arg) + sizeof(LINKER_FLAG_PREFIX) + 1);
     strcpy(newarg, LINKER_FLAG_PREFIX);
-    strcpy(newarg, arg);
+    strcat(newarg, arg);
     push_count_chars(cc, newarg);
 #endif
 }

Mime
View raw message