libarchive: use pkgconfig instead of sed for static defs

This commit is contained in:
Tony Theodore 2017-08-13 14:54:46 +10:00
parent 18ec6907bb
commit b0fdbc9e8b
2 changed files with 20 additions and 5 deletions

View File

@ -19,3 +19,22 @@ index 1111111..2222222 100644
-Libs.private: @LIBS@
+Libs.private: @LIBS@ -liconv
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Sun, 13 Aug 2017 14:38:47 +1000
Subject: [PATCH] libarchive.pc.in: add Cflags.private for static linking
taken from:
https://github.com/libarchive/libarchive/pull/934
diff --git a/build/pkgconfig/libarchive.pc.in b/build/pkgconfig/libarchive.pc.in
index 1111111..2222222 100644
--- a/build/pkgconfig/libarchive.pc.in
+++ b/build/pkgconfig/libarchive.pc.in
@@ -7,5 +7,6 @@ Name: libarchive
Description: library that can create and read several streaming archive formats
Version: @VERSION@
Cflags: -I${includedir}
+Cflags.private: -DLIBARCHIVE_STATIC
Libs: -L${libdir} -larchive
Libs.private: @LIBS@ -liconv

View File

@ -19,10 +19,6 @@ define $(PKG)_UPDATE
endef
define $(PKG)_BUILD
$(if $(BUILD_STATIC),\
$(SED) -i '1i#ifndef LIBARCHIVE_STATIC\n#define LIBARCHIVE_STATIC\n#endif' -i '$(1)/libarchive/archive.h'
$(SED) -i '1i#ifndef LIBARCHIVE_STATIC\n#define LIBARCHIVE_STATIC\n#endif' -i '$(1)/libarchive/archive_entry.h')
# use nettle instead of bcrypt for CNG(Crypto Next Generation)
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
@ -38,5 +34,5 @@ define $(PKG)_BUILD
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-libarchive.exe' \
`'$(TARGET)-pkg-config' --libs-only-l libarchive`
`'$(TARGET)-pkg-config' --libs-only-l --cflags libarchive`
endef