From e330c85907ad3fe482208382b06d42738aba177c Mon Sep 17 00:00:00 2001 From: Martin Lambers Date: Wed, 27 Apr 2011 16:11:54 +0200 Subject: package libidn: add "-liconv" to libidn.pc This is necessary for static linking, as demonstrated by the test program that this patch also adds. --- src/libidn-1-fix-pc.patch | 14 ++++++++++++++ src/libidn-test.c | 20 ++++++++++++++++++++ src/libidn.mk | 5 +++++ 3 files changed, 39 insertions(+) create mode 100644 src/libidn-1-fix-pc.patch create mode 100644 src/libidn-test.c diff --git a/src/libidn-1-fix-pc.patch b/src/libidn-1-fix-pc.patch new file mode 100644 index 0000000..1a34401 --- /dev/null +++ b/src/libidn-1-fix-pc.patch @@ -0,0 +1,14 @@ +This file is part of mingw-cross-env. +See doc/index.html for further information. + +Hack to use pkg-config with static linking. + +--- a/libidn.pc.in ++++ b/libidn.pc.in +@@ -19,5 +19,5 @@ + Description: IETF stringprep, nameprep, punycode, IDNA text processing. + URL: http://www.gnu.org/software/libidn/ + Version: @VERSION@ +-Libs: -L${libdir} -lidn ++Libs: -L${libdir} -lidn -liconv + Cflags: -I${includedir} diff --git a/src/libidn-test.c b/src/libidn-test.c new file mode 100644 index 0000000..24d9f0a --- /dev/null +++ b/src/libidn-test.c @@ -0,0 +1,20 @@ +/* This file is part of mingw-cross-env. */ +/* See doc/index.html for further information. */ + +#include +#include + +int main(int argc, char *argv[]) +{ + char *hostname_ascii; + + (void)argc; + (void)argv; + + if (idna_to_ascii_lz("www.google.com", &hostname_ascii, 0) == IDNA_SUCCESS) + { + free(hostname_ascii); + } + + return 0; +} diff --git a/src/libidn.mk b/src/libidn.mk index de4fcd3..80f9c5f 100644 --- a/src/libidn.mk +++ b/src/libidn.mk @@ -29,4 +29,9 @@ define $(PKG)_BUILD --prefix='$(PREFIX)/$(TARGET)' \ --with-libiconv-prefix='$(PREFIX)/$(TARGET)' $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libidn.exe' \ + `'$(TARGET)-pkg-config' libidn --cflags --libs` endef -- cgit v0.12