mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-26 08:30:12 +01:00
2005-03-18 Tollef Fog Heen <tfheen@err.no>
Author: tfheen
Date: 2005-03-26 14:59:26 GMT
2005-03-18 Tollef Fog Heen <tfheen@err.no>
* main.c (main): Use add_search_dirs for both the compile-time
defined pc_path and the run-time defined PKG_CONFIG_PATH.
* pkg.h: Add prototype for add_search_dirs.
* pkg.c (add_search_dirs): Add new function which takes a
delimiter-separated list as input and add_search_dir's it.
(package_init): Remove knowledge about which dirs should be
initially added. Moved this to main.c(main)
* ChangeLog: Add emacs variables to set the date to this
ChangeLog's standard format
* Makefile.am (INCLUDES): Pass PKG_CONFIG_PCPATH on to main.c
* configure.in: Add --with-pc-path to define the default search
path for .pc files. (Freedesktop #119, #648)
This commit is contained in:
parent
03723d4caa
commit
d2080ec6d8
6 changed files with 77 additions and 31 deletions
26
ChangeLog
26
ChangeLog
|
|
@ -11,11 +11,32 @@
|
||||||
|
|
||||||
(Freedesktop #191, Debian #232719)
|
(Freedesktop #191, Debian #232719)
|
||||||
|
|
||||||
|
2005-03-18 Tollef Fog Heen <tfheen@err.no>
|
||||||
|
|
||||||
|
* main.c (main): Use add_search_dirs for both the compile-time
|
||||||
|
defined pc_path and the run-time defined PKG_CONFIG_PATH.
|
||||||
|
|
||||||
|
* pkg.h: Add prototype for add_search_dirs.
|
||||||
|
|
||||||
|
* pkg.c (add_search_dirs): Add new function which takes a
|
||||||
|
delimiter-separated list as input and add_search_dir's it.
|
||||||
|
(package_init): Remove knowledge about which dirs should be
|
||||||
|
initially added. Moved this to main.c(main)
|
||||||
|
|
||||||
|
* ChangeLog: Add emacs variables to set the date to this
|
||||||
|
ChangeLog's standard format
|
||||||
|
|
||||||
|
* Makefile.am (INCLUDES): Pass PKG_CONFIG_PCPATH on to main.c
|
||||||
|
|
||||||
|
* configure.in: Add --with-pc-path to define the default search
|
||||||
|
path for .pc files. (Freedesktop #119, #648)
|
||||||
|
|
||||||
2005-03-18 Tollef Fog Heen <tfheen@err.no>
|
2005-03-18 Tollef Fog Heen <tfheen@err.no>
|
||||||
|
|
||||||
* glib-patches/pthread-config-fix.diff: Add patch to detect
|
* glib-patches/pthread-config-fix.diff: Add patch to detect
|
||||||
pthreads properly on some architectures. Thanks to Michael
|
pthreads properly on some architectures. Thanks to Michael
|
||||||
Haubenwallner for reporting this bug and providing a patch.
|
Haubenwallner for reporting this bug and providing a patch.
|
||||||
|
(Freedesktop #1617)
|
||||||
|
|
||||||
2005-02-21 Tollef Fog Heen <tfheen@err.no>
|
2005-02-21 Tollef Fog Heen <tfheen@err.no>
|
||||||
|
|
||||||
|
|
@ -801,3 +822,8 @@ Tue Jun 6 2000 Martijn van Beers <martijn@earthling.net>
|
||||||
* pkg-config: removed the pc_name_pkg functionality
|
* pkg-config: removed the pc_name_pkg functionality
|
||||||
* pkg-config: show help and error out when there are no arguments
|
* pkg-config: show help and error out when there are no arguments
|
||||||
* pkg-config: get the version from configure
|
* pkg-config: get the version from configure
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Local variables:
|
||||||
|
;; add-log-time-format: add-log-iso8601-time-string
|
||||||
|
;; End:
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ EXTRA_DIST = $(m4_DATA) $(man_MANS) README.win32
|
||||||
|
|
||||||
bin_PROGRAMS = pkg-config
|
bin_PROGRAMS = pkg-config
|
||||||
|
|
||||||
INCLUDES=-DPKGLIBDIR="\"$(pkglibdir)\"" $(included_glib_includes)
|
INCLUDES=-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" $(included_glib_includes)
|
||||||
|
|
||||||
pkg_config_SOURCES= \
|
pkg_config_SOURCES= \
|
||||||
pkg.h \
|
pkg.h \
|
||||||
|
|
|
||||||
14
configure.in
14
configure.in
|
|
@ -10,6 +10,20 @@ AM_PROG_LIBTOOL
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
AC_DEFUN([PKG_CONFIG_FIND_PC_PATH],
|
||||||
|
[AC_ARG_WITH(pc_path,
|
||||||
|
[ --with-pc-path" Override the default search path for .pc files ],
|
||||||
|
[ pc_path="$withval"
|
||||||
|
AC_MSG_CHECKING([for default search path for .pc files])
|
||||||
|
AC_MSG_RESULT([$pc_path])],
|
||||||
|
[pc_path=`echo $pkglibdir:$pkgdatadir`])
|
||||||
|
AC_SUBST([pc_path])
|
||||||
|
dnl AC_DEFINE_UNQUOTED(PKG_CONFIG_PC_PATH,["$pc_path"],[Default search path for .pc files])
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
PKG_CONFIG_FIND_PC_PATH
|
||||||
|
|
||||||
AC_MSG_CHECKING([for Win32])
|
AC_MSG_CHECKING([for Win32])
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
|
|
|
||||||
31
main.c
31
main.c
|
|
@ -36,6 +36,13 @@
|
||||||
#undef STRICT
|
#undef STRICT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
/* No hardcoded paths in the binary, thanks */
|
||||||
|
#undef PKGLIBDIR
|
||||||
|
/* It's OK to leak this, as PKGLIBDIR is invoked only once */
|
||||||
|
#define PKG_CONFIG_PATH g_strconcat (g_win32_get_package_installation_directory (PACKAGE, NULL), "\\lib\\pkgconfig", NULL)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int want_debug_spew = 0;
|
static int want_debug_spew = 0;
|
||||||
static int want_verbose_errors = 0;
|
static int want_verbose_errors = 0;
|
||||||
static int want_stdout_errors = 0;
|
static int want_stdout_errors = 0;
|
||||||
|
|
@ -188,6 +195,9 @@ main (int argc, char **argv)
|
||||||
GSList *packages = NULL;
|
GSList *packages = NULL;
|
||||||
char *search_path;
|
char *search_path;
|
||||||
char *pcbuilddir;
|
char *pcbuilddir;
|
||||||
|
const char *pkglibdir;
|
||||||
|
char **search_dirs;
|
||||||
|
char **iter;
|
||||||
gboolean need_newline;
|
gboolean need_newline;
|
||||||
|
|
||||||
const char *pkgname;
|
const char *pkgname;
|
||||||
|
|
@ -266,26 +276,13 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
search_path = getenv ("PKG_CONFIG_PATH");
|
search_path = getenv ("PKG_CONFIG_PATH");
|
||||||
if (search_path)
|
if (search_path)
|
||||||
{
|
{
|
||||||
char **search_dirs;
|
add_search_dirs(search_path, G_SEARCHPATH_SEPARATOR_S);
|
||||||
char **iter;
|
|
||||||
|
|
||||||
search_dirs = g_strsplit (search_path, G_SEARCHPATH_SEPARATOR_S, -1);
|
|
||||||
|
|
||||||
iter = search_dirs;
|
|
||||||
while (*iter)
|
|
||||||
{
|
|
||||||
debug_spew ("Adding directory '%s' from PKG_CONFIG_PATH\n",
|
|
||||||
*iter);
|
|
||||||
add_search_dir (*iter);
|
|
||||||
|
|
||||||
++iter;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev (search_dirs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add_search_dirs(PKG_CONFIG_PC_PATH, G_SEARCHPATH_SEPARATOR_S);
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
{
|
{
|
||||||
/* Add search directories from the Registry */
|
/* Add search directories from the Registry */
|
||||||
|
|
|
||||||
34
pkg.c
34
pkg.c
|
|
@ -44,13 +44,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
/* No hardcoded paths in the binary, thanks */
|
|
||||||
#undef PKGLIBDIR
|
|
||||||
/* It's OK to leak this, as PKGLIBDIR is invoked only once */
|
|
||||||
#define PKGLIBDIR g_strconcat (g_win32_get_package_installation_directory (PACKAGE, NULL), "\\lib\\pkgconfig", NULL)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void verify_package (Package *pkg);
|
static void verify_package (Package *pkg);
|
||||||
|
|
||||||
static GHashTable *packages = NULL;
|
static GHashTable *packages = NULL;
|
||||||
|
|
@ -69,6 +62,27 @@ add_search_dir (const char *path)
|
||||||
search_dirs = g_slist_append (search_dirs, g_strdup (path));
|
search_dirs = g_slist_append (search_dirs, g_strdup (path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
add_search_dirs (const char *path, const char *separator)
|
||||||
|
{
|
||||||
|
char **search_dirs;
|
||||||
|
char **iter;
|
||||||
|
|
||||||
|
search_dirs = g_strsplit (path, separator, -1);
|
||||||
|
|
||||||
|
iter = search_dirs;
|
||||||
|
while (*iter)
|
||||||
|
{
|
||||||
|
debug_spew ("Adding directory '%s' from PKG_CONFIG_PATH\n",
|
||||||
|
*iter);
|
||||||
|
add_search_dir (*iter);
|
||||||
|
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_strfreev (search_dirs);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
/* Guard against .pc file being installed with UPPER CASE name */
|
/* Guard against .pc file being installed with UPPER CASE name */
|
||||||
# define FOLD(x) tolower(x)
|
# define FOLD(x) tolower(x)
|
||||||
|
|
@ -208,11 +222,6 @@ void
|
||||||
package_init ()
|
package_init ()
|
||||||
{
|
{
|
||||||
static gboolean initted = FALSE;
|
static gboolean initted = FALSE;
|
||||||
const char *pkglibdir;
|
|
||||||
|
|
||||||
pkglibdir = g_getenv ("PKG_CONFIG_LIBDIR");
|
|
||||||
if (pkglibdir == NULL)
|
|
||||||
pkglibdir = PKGLIBDIR;
|
|
||||||
|
|
||||||
if (!initted)
|
if (!initted)
|
||||||
{
|
{
|
||||||
|
|
@ -225,7 +234,6 @@ package_init ()
|
||||||
add_virtual_pkgconfig_package ();
|
add_virtual_pkgconfig_package ();
|
||||||
|
|
||||||
g_slist_foreach (search_dirs, (GFunc)scan_dir, NULL);
|
g_slist_foreach (search_dirs, (GFunc)scan_dir, NULL);
|
||||||
scan_dir (pkglibdir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1
pkg.h
1
pkg.h
|
|
@ -94,6 +94,7 @@ char * packages_get_var (GSList *pkgs,
|
||||||
|
|
||||||
|
|
||||||
void add_search_dir (const char *path);
|
void add_search_dir (const char *path);
|
||||||
|
void add_search_dirs (const char *path, const char *separator);
|
||||||
void package_init (void);
|
void package_init (void);
|
||||||
int compare_versions (const char * a, const char *b);
|
int compare_versions (const char * a, const char *b);
|
||||||
gboolean version_test (ComparisonType comparison,
|
gboolean version_test (ComparisonType comparison,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue