summaryrefslogtreecommitdiff
path: root/converters
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-08-05 21:26:04 +0000
committerjlam <jlam@pkgsrc.org>2002-08-05 21:26:04 +0000
commit3fefb9145b37d50820890b77ccc39202163fd7df (patch)
treeeb72b722ba97b5faa1326fd1e4f9761ebb90cdf1 /converters
parent8a830034b6443731603f239e0a5b13c079aa73f2 (diff)
downloadpkgsrc-3fefb9145b37d50820890b77ccc39202163fd7df.tar.gz
Allow system libiconv to be used if it's provided. If USE_GNU_ICONV is
defined, then we always use the pkgsrc libiconv. INCOMPAT_ICONV can be appended to with machine platform style entries, e.g. NetBSD-*-*, to note when a system libiconv can't be used. We currently default to needing pkgsrc libiconv on NetBSD only. This should fix pkg/17500.
Diffstat (limited to 'converters')
-rw-r--r--converters/libiconv/buildlink.mk25
1 files changed, 23 insertions, 2 deletions
diff --git a/converters/libiconv/buildlink.mk b/converters/libiconv/buildlink.mk
index 271451b06c8..81b66d126ce 100644
--- a/converters/libiconv/buildlink.mk
+++ b/converters/libiconv/buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink.mk,v 1.10 2002/05/14 15:57:55 wiz Exp $
+# $NetBSD: buildlink.mk,v 1.11 2002/08/05 21:26:04 jlam Exp $
#
# This Makefile fragment is included by packages that use libiconv.
#
@@ -18,10 +18,31 @@ ICONV_BUILDLINK_MK= # defined
.include "../../mk/bsd.buildlink.mk"
BUILDLINK_DEPENDS.iconv?= libiconv>=1.7nb2
-DEPENDS+= ${BUILDLINK_DEPENDS.iconv}:../../converters/libiconv
+.if defined(USE_GNU_ICONV)
+_NEED_ICONV= YES
+.else
+. if exists(/usr/include/iconv.h)
+_NEED_ICONV= NO
+. else
+_NEED_ICONV= YES
+. endif
+_INCOMPAT_ICONV= NetBSD-*-* ${INCOMPAT_ICONV}
+. for _pattern_ in ${_INCOMPAT_ICONV}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_NEED_ICONV= YES
+. endif
+. endfor
+.endif
+
+.if ${_NEED_ICONV} == "YES"
+DEPENDS+= ${BUILDLINK_DEPENDS.iconv}:../../converters/libiconv
EVAL_PREFIX+= BUILDLINK_PREFIX.iconv=libiconv
BUILDLINK_PREFIX.iconv_DEFAULT= ${LOCALBASE}
+.else
+BUILDLINK_PREFIX.iconv= /usr
+.endif
+
BUILDLINK_FILES.iconv= include/iconv.h
BUILDLINK_FILES.iconv+= include/libcharset.h
BUILDLINK_FILES.iconv+= lib/libcharset.*