summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2018-07-01 22:12:24 (GMT)
committerTony Theodore <tonyt@logyst.com>2018-07-01 22:12:24 (GMT)
commit38d301e9138e0718cb735706647f834dcec04d7c (patch)
treef97565a58cd6080a60546d9b15bfc5f482a5db87
parente65f683f8428a94a5f4ec6e1ad3927ab5262b2ec (diff)
downloadmxe-38d301e9138e0718cb735706647f834dcec04d7c.zip
mxe-38d301e9138e0718cb735706647f834dcec04d7c.tar.gz
mxe-38d301e9138e0718cb735706647f834dcec04d7c.tar.bz2
zstd: install *.pc file for mingw
see: https://github.com/facebook/zstd/pull/1203 closes #2164
-rw-r--r--src/zstd-1-fixes.patch33
-rw-r--r--src/zstd.mk11
2 files changed, 34 insertions, 10 deletions
diff --git a/src/zstd-1-fixes.patch b/src/zstd-1-fixes.patch
new file mode 100644
index 0000000..fbc4ca5
--- /dev/null
+++ b/src/zstd-1-fixes.patch
@@ -0,0 +1,33 @@
+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: Mon, 2 Jul 2018 08:03:47 +1000
+Subject: [PATCH 1/1] install .pc file on mingw
+
+see: https://github.com/facebook/zstd/pull/1203
+
+diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
+index 1111111..2222222 100644
+--- a/build/cmake/lib/CMakeLists.txt
++++ b/build/cmake/lib/CMakeLists.txt
+@@ -154,7 +154,7 @@ IF (ZSTD_BUILD_STATIC)
+ OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
+ ENDIF (ZSTD_BUILD_STATIC)
+
+-IF (UNIX)
++IF (UNIX OR MINGW)
+ # pkg-config
+ SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
+ SET(LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+@@ -167,7 +167,7 @@ IF (UNIX)
+ COMMENT "Creating pkg-config file")
+
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${LIBDIR}/pkgconfig")
+-ENDIF (UNIX)
++ENDIF (UNIX OR MINGW)
+
+ # install target
+ INSTALL(FILES
diff --git a/src/zstd.mk b/src/zstd.mk
index 126d79c..f9df4e3 100644
--- a/src/zstd.mk
+++ b/src/zstd.mk
@@ -18,18 +18,9 @@ define $(PKG)_BUILD
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
- # create pkg-config files
- $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
- (echo 'Name: $(PKG)'; \
- echo 'Version: $($(PKG)_VERSION)'; \
- echo 'Description: $($(PKG)_DESCR)'; \
- echo 'Libs: -L$(PREFIX)/$(TARGET)/lib -l$(PKG)'; \
- echo 'Cflags: -I$(PREFIX)/$(TARGET)/include';) \
- > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
-
# compile test
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
- `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
+ `'$(TARGET)-pkg-config' lib$(PKG) --cflags --libs`
endef