(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>
* glib-patches/pthread-config-fix.diff: Add patch to detect
pthreads properly on some architectures. Thanks to Michael
Haubenwallner for reporting this bug and providing a patch.
+ (Freedesktop #1617)
2005-02-21 Tollef Fog Heen <tfheen@err.no>
* pkg-config: removed the pc_name_pkg functionality
* pkg-config: show help and error out when there are no arguments
* pkg-config: get the version from configure
+
+;;
+;; Local variables:
+;; add-log-time-format: add-log-iso8601-time-string
+;; End:
bin_PROGRAMS = pkg-config
-INCLUDES=-DPKGLIBDIR="\"$(pkglibdir)\"" $(included_glib_includes)
+INCLUDES=-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" $(included_glib_includes)
pkg_config_SOURCES= \
pkg.h \
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])
case "$host" in
*-*-mingw*)
#undef STRICT
#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_verbose_errors = 0;
static int want_stdout_errors = 0;
GSList *packages = NULL;
char *search_path;
char *pcbuilddir;
+ const char *pkglibdir;
+ char **search_dirs;
+ char **iter;
gboolean need_newline;
const char *pkgname;
}
search_path = getenv ("PKG_CONFIG_PATH");
- if (search_path)
+ if (search_path)
{
- char **search_dirs;
- 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(search_path, G_SEARCHPATH_SEPARATOR_S);
}
+ add_search_dirs(PKG_CONFIG_PC_PATH, G_SEARCHPATH_SEPARATOR_S);
+
#ifdef G_OS_WIN32
{
/* Add search directories from the Registry */
#include <stdlib.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 GHashTable *packages = NULL;
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
/* Guard against .pc file being installed with UPPER CASE name */
# define FOLD(x) tolower(x)
package_init ()
{
static gboolean initted = FALSE;
- const char *pkglibdir;
-
- pkglibdir = g_getenv ("PKG_CONFIG_LIBDIR");
- if (pkglibdir == NULL)
- pkglibdir = PKGLIBDIR;
if (!initted)
{
add_virtual_pkgconfig_package ();
g_slist_foreach (search_dirs, (GFunc)scan_dir, NULL);
- scan_dir (pkglibdir);
}
}
void add_search_dir (const char *path);
+void add_search_dirs (const char *path, const char *separator);
void package_init (void);
int compare_versions (const char * a, const char *b);
gboolean version_test (ComparisonType comparison,