aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2014-01-30 04:24:49 +0800
committertijl <tijl@FreeBSD.org>2014-01-30 04:24:49 +0800
commit723cbd3b9d0bbe044741da8921368e6e3f3f6ecd (patch)
tree81efc99ecce690aaf994c38365ad6855aaf5dc09 /Mk
parent7145f85c00496a602ed24f1aac701bbbe3582dff (diff)
downloadfreebsd-ports-gnome-723cbd3b9d0bbe044741da8921368e6e3f3f6ecd.tar.gz
freebsd-ports-gnome-723cbd3b9d0bbe044741da8921368e6e3f3f6ecd.tar.zst
freebsd-ports-gnome-723cbd3b9d0bbe044741da8921368e6e3f3f6ecd.zip
- Add two new arguments to USES=iconv so ports can indicate they use GNU
iconv extensions that the base system iconv doesn't support yet: * wchar_t: port uses the special WCHAR_T character conversion. * translit: port uses //TRANSLIT or //IGNORE conversion options. Adding one or both of these arguments makes the port depend on converters/libiconv for now. - Allow installation of converters/libiconv on FreeBSD 10+. - Use ICONV_CONFIGURE_ARG in devel/gettext instead of defining CPPFLAGS and LDFLAGS to fix compilation with libiconv installed. - Stage converters/libiconv and devel/gettext. Approved by: bapt (on trust)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/iconv.mk27
1 files changed, 16 insertions, 11 deletions
diff --git a/Mk/Uses/iconv.mk b/Mk/Uses/iconv.mk
index 7a12a843ece2..2709a6b9efca 100644
--- a/Mk/Uses/iconv.mk
+++ b/Mk/Uses/iconv.mk
@@ -6,17 +6,16 @@
#
# Feature: iconv
# Usage: USES=iconv or USES=iconv:ARGS
-# Valid ARGS: lib (default, implicit), build, patch
-#
-#
+# Valid ARGS: lib (default, implicit), build, patch,
+# wchar_t (port uses "WCHAR_T" extension),
+# translit (port uses "//TRANSLIT" extension)
+
.if !defined(_INCLUDE_USES_ICONV_MK)
_INCLUDE_USES_ICONV_MK= yes
-.if !defined(iconv_ARGS)
-iconv_ARGS= lib
-.endif
+iconv_ARGS:= ${iconv_ARGS:S/,/ /g}
-.if !exists(/usr/include/iconv.h)
+.if !exists(/usr/include/iconv.h) || ${iconv_ARGS:Mwchar_t} || ${iconv_ARGS:Mtranslit}
ICONV_CMD= ${LOCALBASE}/bin/iconv
ICONV_LIB= -liconv
@@ -24,12 +23,12 @@ ICONV_PREFIX= ${LOCALBASE}
ICONV_CONFIGURE_ARG= --with-libiconv-prefix=${LOCALBASE}
ICONV_CONFIGURE_BASE= --with-libiconv=${LOCALBASE}
-.if ${iconv_ARGS} == "lib"
-LIB_DEPENDS+= libiconv.so.3:${PORTSDIR}/converters/libiconv
-.elif ${iconv_ARGS} == "build"
+.if ${iconv_ARGS:Mbuild}
BUILD_DEPENDS+= ${ICONV_CMD}:${PORTSDIR}/converters/libiconv
-.elif ${iconv_ARGS} == "patch"
+.elif ${iconv_ARGS:Mpatch}
PATCH_DEPENDS+= ${ICONV_CMD}:${PORTSDIR}/converters/libiconv
+.else
+LIB_DEPENDS+= libiconv.so.3:${PORTSDIR}/converters/libiconv
.endif
.else
@@ -40,6 +39,12 @@ ICONV_PREFIX= /usr
ICONV_CONFIGURE_ARG=
ICONV_CONFIGURE_BASE=
+.if exists(${LOCALBASE}/include/iconv.h)
+CPPFLAGS+= -DLIBICONV_PLUG
+CFLAGS+= -DLIBICONV_PLUG
+CXXFLAGS+= -DLIBICONV_PLUG
+.endif
+
.endif
.endif