summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2005-07-14 13:05:17 +0000
committerArch Librarian <arch@canonical.com>2005-07-14 13:05:17 +0000
commitfcb804effea60a9b7af3b40fdad5c49eda8fd6c9 (patch)
tree126245927bd94164f24a0b5605fe08b8e48611cc /parse.c
parente3b14fd5e88cdf2d6b06a9be4b193e1abac88343 (diff)
downloadpkg-config-fcb804effea60a9b7af3b40fdad5c49eda8fd6c9.tar.gz
2002-09-06 Havoc Pennington <hp@redhat.com>
Author: hp Date: 2002-09-06 20:00:08 GMT 2002-09-06 Havoc Pennington <hp@redhat.com> * parse.c, pkg.c: handle other_libs other_cflags same as -l/-L/-I flags, so we pull in from dependent packages. Closes #85244, #90706, #89851
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/parse.c b/parse.c
index d1a66b4..4cd32ee 100644
--- a/parse.c
+++ b/parse.c
@@ -587,7 +587,6 @@ parse_libs (Package *pkg, const char *str, const char *path)
/* Strip out -l and -L flags, put them in a separate list. */
char *trimmed;
- GString *other;
char **argv = NULL;
int argc;
int result;
@@ -620,8 +619,6 @@ parse_libs (Package *pkg, const char *str, const char *path)
exit (1);
}
-
- other = g_string_new ("");
i = 0;
while (i < argc)
@@ -675,9 +672,9 @@ parse_libs (Package *pkg, const char *str, const char *path)
}
else
{
- g_string_append_c (other, ' ');
- g_string_append (other, arg);
- g_string_append_c (other, ' ');
+ if (*arg != '\0')
+ pkg->other_libs = g_slist_prepend (pkg->other_libs,
+ g_strdup (arg));
}
g_free (arg);
@@ -688,12 +685,9 @@ parse_libs (Package *pkg, const char *str, const char *path)
g_free (argv);
g_free (trimmed);
- pkg->other_libs = other->str;
-
- g_string_free (other, FALSE);
-
pkg->l_libs = g_slist_reverse (pkg->l_libs);
pkg->L_libs = g_slist_reverse (pkg->L_libs);
+ pkg->other_libs = g_slist_reverse (pkg->other_libs);
}
static void
@@ -702,7 +696,6 @@ parse_cflags (Package *pkg, const char *str, const char *path)
/* Strip out -I flags, put them in a separate list. */
char *trimmed;
- GString *other;
char **argv = NULL;
int argc;
int result;
@@ -726,8 +719,6 @@ parse_cflags (Package *pkg, const char *str, const char *path)
exit (1);
}
-
- other = g_string_new ("");
i = 0;
while (i < argc)
@@ -761,9 +752,9 @@ parse_cflags (Package *pkg, const char *str, const char *path)
}
else
{
- if (other->len > 0)
- g_string_append (other, " ");
- g_string_append (other, arg);
+ if (*arg != '\0')
+ pkg->other_cflags = g_slist_prepend (pkg->other_cflags,
+ g_strdup (arg));
}
g_free (arg);
@@ -774,11 +765,8 @@ parse_cflags (Package *pkg, const char *str, const char *path)
g_free (argv);
g_free (trimmed);
- pkg->other_cflags = other->str;
-
- g_string_free (other, FALSE);
-
pkg->I_cflags = g_slist_reverse (pkg->I_cflags);
+ pkg->other_cflags = g_slist_reverse (pkg->other_cflags);
}
static void