diff options
author | Arch Librarian <arch@canonical.com> | 2005-07-14 13:05:17 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2005-07-14 13:05:17 +0000 |
commit | fcb804effea60a9b7af3b40fdad5c49eda8fd6c9 (patch) | |
tree | 126245927bd94164f24a0b5605fe08b8e48611cc /pkg.c | |
parent | e3b14fd5e88cdf2d6b06a9be4b193e1abac88343 (diff) | |
download | pkg-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 'pkg.c')
-rw-r--r-- | pkg.c | 72 |
1 files changed, 22 insertions, 50 deletions
@@ -438,6 +438,12 @@ get_L_libs (Package *pkg) return pkg->L_libs; } +static GSList* +get_other_libs (Package *pkg) +{ + return pkg->other_libs; +} + static GSList * get_I_cflags (Package *pkg) { @@ -445,6 +451,12 @@ get_I_cflags (Package *pkg) } static GSList * +get_other_cflags (Package *pkg) +{ + return pkg->other_cflags; +} + +static GSList * get_conflicts (Package *pkg) { return pkg->conflicts; @@ -917,36 +929,16 @@ packages_get_L_libs (GSList *pkgs) char * package_get_other_libs (Package *pkg) { - return g_strdup (pkg->other_libs); + if (pkg->other_libs_merged == NULL) + pkg->other_libs_merged = get_merged (pkg, get_other_libs, TRUE); + + return pkg->other_libs_merged; } char * packages_get_other_libs (GSList *pkgs) { - GSList *tmp; - GString *str; - char *retval; - - str = g_string_new (""); - - tmp = pkgs; - while (tmp != NULL) - { - Package *pkg = tmp->data; - - if (pkg->other_libs) - { - g_string_append (str, pkg->other_libs); - g_string_append (str, " "); - } - - tmp = g_slist_next (tmp); - } - - retval = str->str; - g_string_free (str, FALSE); - - return retval; + return get_multi_merged (pkgs, get_other_libs, TRUE); } char * @@ -1004,36 +996,16 @@ packages_get_I_cflags (GSList *pkgs) char * package_get_other_cflags (Package *pkg) { - return g_strdup (pkg->other_cflags); + if (pkg->other_cflags_merged == NULL) + pkg->other_cflags_merged = get_merged (pkg, get_other_cflags, TRUE); + + return pkg->other_cflags_merged; } char * packages_get_other_cflags (GSList *pkgs) { - GSList *tmp; - GString *str; - char *retval; - - str = g_string_new (""); - - tmp = pkgs; - while (tmp != NULL) - { - Package *pkg = tmp->data; - - if (pkg->other_cflags) - { - g_string_append (str, pkg->other_cflags); - g_string_append (str, " "); - } - - tmp = g_slist_next (tmp); - } - - retval = str->str; - g_string_free (str, FALSE); - - return retval; + return get_multi_merged (pkgs, get_other_cflags, TRUE); } char * |