summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-06-20 09:50:30 (GMT)
committerGitHub <noreply@github.com>2017-06-20 09:50:30 (GMT)
commitbe9e0856f28793e35251ff547134509b58af3e4f (patch)
treee8c0b8da1e8d5daf9b39cf1d669cb64cf5d29daa
parent07002736f0c8ad611d727aa9b445215d6e121a10 (diff)
parentb8df830562aa062201d4cb02c61e1f2004c2300e (diff)
downloadmxe-be9e0856f28793e35251ff547134509b58af3e4f.zip
mxe-be9e0856f28793e35251ff547134509b58af3e4f.tar.gz
mxe-be9e0856f28793e35251ff547134509b58af3e4f.tar.bz2
Merge pull request #1788 from mabrand/clean-cflags-v3
Clean cflags v3
-rw-r--r--src/pkgconf-1-fixes.patch50
-rw-r--r--src/pkgconf.mk7
-rw-r--r--src/qtbase.mk2
-rw-r--r--src/sqlite.mk3
4 files changed, 57 insertions, 5 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;
diff --git a/src/pkgconf.mk b/src/pkgconf.mk
index 49f363a..5b46267 100644
--- a/src/pkgconf.mk
+++ b/src/pkgconf.mk
@@ -21,7 +21,12 @@ endef
define $(PKG)_BUILD
# create pkg-config script
(echo '#!/bin/sh'; \
- echo 'PKG_CONFIG_PATH="$(PREFIX)/$(TARGET)/qt5/lib/pkgconfig":"$$PKG_CONFIG_PATH_$(subst .,_,$(subst -,_,$(TARGET)))" PKG_CONFIG_LIBDIR='\''$(PREFIX)/$(TARGET)/lib/pkgconfig'\'' exec '$(PREFIX)/$(BUILD)/bin/pkgconf' $(if $(BUILD_STATIC),--static) "$$@"') \
+ echo 'PKG_CONFIG_PATH="$(PREFIX)/$(TARGET)/qt5/lib/pkgconfig":"$$PKG_CONFIG_PATH_$(subst .,_,$(subst -,_,$(TARGET)))" \
+ PKG_CONFIG_SYSROOT_DIR= \
+ PKG_CONFIG_LIBDIR="$(PREFIX)/$(TARGET)/lib/pkgconfig" \
+ PKG_CONFIG_SYSTEM_INCLUDE_PATH="$(PREFIX)/$(TARGET)/include" \
+ PKG_CONFIG_SYSTEM_LIBRARY_PATH="$(PREFIX)/$(TARGET)/lib" \
+ exec "$(PREFIX)/$(BUILD)/bin/pkgconf" $(if $(BUILD_STATIC),--static) "$$@"') \
> '$(PREFIX)/bin/$(TARGET)-pkg-config'
chmod 0755 '$(PREFIX)/bin/$(TARGET)-pkg-config'
diff --git a/src/qtbase.mk b/src/qtbase.mk
index f7453c9..3302e47 100644
--- a/src/qtbase.mk
+++ b/src/qtbase.mk
@@ -27,7 +27,7 @@ define $(PKG)_BUILD
SYBASE_LIBS="-lsybdb `'$(TARGET)-pkg-config' --libs-only-l gnutls` -liconv -lws2_32" \
PKG_CONFIG="${TARGET}-pkg-config" \
PKG_CONFIG_SYSROOT_DIR="/" \
- PKG_CONFIG_LIBDIR="$(PREFIX)/$(TARGET)/lib/pc" \
+ PKG_CONFIG_LIBDIR="$(PREFIX)/$(TARGET)/lib/pkgconfig" \
./configure \
-opensource \
-confirm-license \
diff --git a/src/sqlite.mk b/src/sqlite.mk
index 01a876b..d317d71 100644
--- a/src/sqlite.mk
+++ b/src/sqlite.mk
@@ -18,9 +18,6 @@ define $(PKG)_UPDATE
endef
define $(PKG)_BUILD
- # The system include path doesn't belong in CFLAGS
- # Causes problems like https://gitlab.kitware.com/cmake/cmake/issues/16919
- $(SED) -i 's/^Cflags/#Cflags/;' '$(1)/sqlite3.pc.in'
cd '$(1)' && ./configure \
$(MXE_CONFIGURE_OPTS) \
--disable-readline \