mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-04 06:00:33 +01:00
2001-07-11 Havoc Pennington <hp@pobox.com>
Author: hp Date: 2001-07-10 22:51:39 GMT 2001-07-11 Havoc Pennington <hp@pobox.com> * parse.c (parse_cflags): fix failure to put space between cflags, reported by Chema (parse_line): allow spelling Cflags as CFlags, pointed out by Tim (get_compat_package): support legacy script gnome-vfs-config for package name "libgnomevfs"
This commit is contained in:
parent
2f5befc9f7
commit
e7323695df
6 changed files with 66 additions and 10 deletions
|
|
@ -1,3 +1,11 @@
|
|||
2001-07-11 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* parse.c (parse_cflags): fix failure to put space between cflags,
|
||||
reported by Chema
|
||||
(parse_line): allow spelling Cflags as CFlags, pointed out by Tim
|
||||
(get_compat_package): support legacy script gnome-vfs-config for
|
||||
package name "libgnomevfs"
|
||||
|
||||
2001-06-18 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* pkg.m4: print the error, not the name of the variable containing
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ AC_INIT(pkg-config.1)
|
|||
|
||||
AC_CONFIG_SUBDIRS(glib-1.2.8)
|
||||
|
||||
AM_INIT_AUTOMAKE(pkgconfig, 0.7.0)
|
||||
AM_INIT_AUTOMAKE(pkgconfig, 0.8.0)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
|
|
|
|||
15
main.c
15
main.c
|
|
@ -71,6 +71,8 @@ popt_callback (poptContext con,
|
|||
const struct poptOption * opt,
|
||||
const char * arg, void * data)
|
||||
{
|
||||
debug_spew ("Option --%s seen\n", opt->longName);
|
||||
|
||||
if (opt->val == DEFINE_VARIABLE)
|
||||
{
|
||||
char *varname;
|
||||
|
|
@ -214,6 +216,7 @@ main (int argc, char **argv)
|
|||
want_debug_spew = TRUE;
|
||||
want_verbose_errors = TRUE;
|
||||
want_silence_errors = FALSE;
|
||||
debug_spew ("PKG_CONFIG_DEBUG_SPEW variable enabling debug spew\n");
|
||||
}
|
||||
|
||||
search_path = getenv ("PKG_CONFIG_PATH");
|
||||
|
|
@ -284,6 +287,8 @@ main (int argc, char **argv)
|
|||
want_I_cflags ||
|
||||
want_list)
|
||||
{
|
||||
debug_spew ("Error printing enabled by default due to use of --version, --libs, --cflags, --libs-only-l, --libs-only-L, --cflags-only-I, or --list. Value of --silence-errors: %d\n", want_silence_errors);
|
||||
|
||||
if (want_silence_errors && getenv ("PKG_CONFIG_DEBUG_SPEW") == NULL)
|
||||
want_verbose_errors = FALSE;
|
||||
else
|
||||
|
|
@ -291,8 +296,16 @@ main (int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
debug_spew ("Error printing disabled by default, value of --print-errors: %d\n",
|
||||
want_verbose_errors);
|
||||
|
||||
/* Leave want_verbose_errors unchanged, reflecting --print-errors */
|
||||
}
|
||||
}
|
||||
|
||||
if (want_verbose_errors)
|
||||
debug_spew ("Error printing enabled\n");
|
||||
else
|
||||
debug_spew ("Error printing disabled\n");
|
||||
|
||||
if (want_my_version)
|
||||
{
|
||||
|
|
|
|||
37
parse.c
37
parse.c
|
|
@ -742,6 +742,8 @@ parse_cflags (Package *pkg, const char *str, const char *path)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (other->len > 0)
|
||||
g_string_append (other, " ");
|
||||
g_string_append (other, arg);
|
||||
}
|
||||
|
||||
|
|
@ -805,7 +807,8 @@ parse_line (Package *pkg, const char *untrimmed, const char *path)
|
|||
parse_requires (pkg, p, path);
|
||||
else if (strcmp (tag, "Libs") == 0)
|
||||
parse_libs (pkg, p, path);
|
||||
else if (strcmp (tag, "Cflags") == 0)
|
||||
else if (strcmp (tag, "Cflags") == 0 ||
|
||||
strcmp (tag, "CFlags") == 0)
|
||||
parse_cflags (pkg, p, path);
|
||||
else if (strcmp (tag, "Conflicts") == 0)
|
||||
parse_conflicts (pkg, p, path);
|
||||
|
|
@ -949,7 +952,10 @@ get_compat_package (const char *name)
|
|||
{
|
||||
Package *pkg;
|
||||
|
||||
debug_spew ("Looking for '%s' using old-style -config scripts\n", name);
|
||||
if (name_ends_in_uninstalled (name))
|
||||
debug_spew ("Suspiciously looking for compat package for -uninstalled: %s\n", name);
|
||||
|
||||
debug_spew ("Looking for '%s' using legacy -config scripts\n", name);
|
||||
|
||||
pkg = g_new0 (Package, 1);
|
||||
|
||||
|
|
@ -1005,6 +1011,33 @@ get_compat_package (const char *name)
|
|||
parse_cflags (pkg, output, "gtk-config");
|
||||
g_free (output);
|
||||
|
||||
return pkg;
|
||||
}
|
||||
else if (strcmp (name, "libgnomevfs") == 0)
|
||||
{
|
||||
char *output;
|
||||
|
||||
debug_spew ("Calling gnome-vfs-config\n");
|
||||
|
||||
pkg->version = backticks ("gnome-vfs-config --version");
|
||||
if (pkg->version == NULL)
|
||||
{
|
||||
g_free (pkg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pkg->name = g_strdup ("GNOME VFS");
|
||||
pkg->key = g_strdup ("libgnomevfs");
|
||||
pkg->description = g_strdup ("GNOME Virtual File System");
|
||||
|
||||
output = backticks ("gnome-vfs-config --libs");
|
||||
parse_libs (pkg, output, "gnome-vfs-config");
|
||||
g_free (output);
|
||||
|
||||
output = backticks ("gnome-vfs-config --cflags");
|
||||
parse_cflags (pkg, output, "gnome-vfs-config");
|
||||
g_free (output);
|
||||
|
||||
return pkg;
|
||||
}
|
||||
else if (strcmp (name, "imlib") == 0)
|
||||
|
|
|
|||
12
pkg.c
12
pkg.c
|
|
@ -52,10 +52,10 @@ ends_in_dotpc (const char *str)
|
|||
}
|
||||
|
||||
/* strlen ("uninstalled") */
|
||||
#define UNINSTALLED_LEN 11
|
||||
#define UNINSTALLED_LEN 11
|
||||
|
||||
static gboolean
|
||||
ends_in_uninstalled (const char *str)
|
||||
gboolean
|
||||
name_ends_in_uninstalled (const char *str)
|
||||
{
|
||||
int len = strlen (str);
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ internal_get_package (const char *name, gboolean warn, gboolean check_compat)
|
|||
{
|
||||
/* See if we should auto-prefer the uninstalled version */
|
||||
if (!disable_uninstalled &&
|
||||
!ends_in_uninstalled (name))
|
||||
!name_ends_in_uninstalled (name))
|
||||
{
|
||||
char *un;
|
||||
|
||||
|
|
@ -201,7 +201,6 @@ internal_get_package (const char *name, gboolean warn, gboolean check_compat)
|
|||
}
|
||||
|
||||
location = g_hash_table_lookup (locations, name);
|
||||
debug_spew ("Reading '%s' from file '%s'\n", name, location);
|
||||
}
|
||||
|
||||
if (location == NULL && check_compat)
|
||||
|
|
@ -227,7 +226,8 @@ internal_get_package (const char *name, gboolean warn, gboolean check_compat)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
debug_spew ("Reading '%s' from file '%s'\n", name, location);
|
||||
pkg = parse_package_file (location);
|
||||
|
||||
if (pkg == NULL)
|
||||
|
|
|
|||
2
pkg.h
2
pkg.h
|
|
@ -84,6 +84,8 @@ void define_global_variable (const char *varname,
|
|||
void debug_spew (const char *format, ...);
|
||||
void verbose_error (const char *format, ...);
|
||||
|
||||
gboolean name_ends_in_uninstalled (const char *str);
|
||||
|
||||
/* If TRUE, do not automatically prefer uninstalled versions */
|
||||
extern gboolean disable_uninstalled;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue