summaryrefslogtreecommitdiffstats
path: root/src/pkgconf-1-fixes.patch
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-06-15 11:16:43 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-06-15 11:16:43 (GMT)
commitb35da9dd13f42a21190262ace1574c3a81f48bec (patch)
treed3ada6bc5e931ec23b79d8253fcec706ac41a104 /src/pkgconf-1-fixes.patch
parent07002736f0c8ad611d727aa9b445215d6e121a10 (diff)
downloadmxe-b35da9dd13f42a21190262ace1574c3a81f48bec.zip
mxe-b35da9dd13f42a21190262ace1574c3a81f48bec.tar.gz
mxe-b35da9dd13f42a21190262ace1574c3a81f48bec.tar.bz2
pkgconf: enable PKG_CONFIG_SYSTEM_INCLUDE_PATH environment variable
from #1785
Diffstat (limited to 'src/pkgconf-1-fixes.patch')
-rw-r--r--src/pkgconf-1-fixes.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/pkgconf-1-fixes.patch b/src/pkgconf-1-fixes.patch
new file mode 100644
index 0000000..9ed65e5
--- /dev/null
+++ b/src/pkgconf-1-fixes.patch
@@ -0,0 +1,50 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore <tonyt@logyst.com>
+Date: Thu, 15 Jun 2017 21:05:31 +1000
+Subject: [PATCH] main: support undocumented PKG_CONFIG_SYSTEM_INCLUDE_PATH and
+ PKG_CONFIG_SYSTEM_LIBRARY_PATH environment variables.
+
+Backported from:
+https://github.com/pkgconf/pkgconf/commit/7e6fa325eb668c3462981a16fb4c36270832e00f
+
+See:
+https://github.com/mxe/mxe/pull/1785
+
+diff --git a/main.c b/main.c
+index 1111111..2222222 100644
+--- a/main.c
++++ b/main.c
+@@ -56,16 +56,27 @@ static char *sysroot_dir = NULL;
+
+ FILE *error_msgout = NULL;
+
++static char *
++fallback_getenv(const char *envname, const char *fallback)
++{
++ const char *data = getenv(envname);
++
++ if (data == NULL)
++ data = fallback;
++
++ return strdup(data);
++}
++
+ static bool
+ fragment_has_system_dir(pkg_fragment_t *frag)
+ {
+ switch (frag->type)
+ {
+ case 'L':
+- if ((want_flags & PKG_KEEP_SYSTEM_CFLAGS) == 0 && !strcasecmp(SYSTEM_LIBDIR, frag->data))
++ if ((want_flags & PKG_KEEP_SYSTEM_CFLAGS) == 0 && !strcasecmp(fallback_getenv("PKG_CONFIG_SYSTEM_LIBRARY_PATH", SYSTEM_LIBDIR), frag->data))
+ return true;
+ case 'I':
+- if ((want_flags & PKG_KEEP_SYSTEM_LIBS) == 0 && !strcasecmp(SYSTEM_INCLUDEDIR, frag->data))
++ if ((want_flags & PKG_KEEP_SYSTEM_LIBS) == 0 && !strcasecmp(fallback_getenv("PKG_CONFIG_SYSTEM_INCLUDE_PATH", SYSTEM_INCLUDEDIR), frag->data))
+ return true;
+ default:
+ break;