2013-04-26 22:44:59 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# handle dependency on the iconv port
|
|
|
|
#
|
|
|
|
# Feature: iconv
|
2013-09-02 07:41:50 +02:00
|
|
|
# Usage: USES=iconv or USES=iconv:ARGS
|
2014-01-29 21:24:49 +01:00
|
|
|
# Valid ARGS: lib (default, implicit), build, patch,
|
|
|
|
# wchar_t (port uses "WCHAR_T" extension),
|
|
|
|
# translit (port uses "//TRANSLIT" extension)
|
2014-03-15 11:31:54 +01:00
|
|
|
#
|
|
|
|
# MAINTAINER: portmgr@FreeBSD.org
|
2014-01-29 21:24:49 +01:00
|
|
|
|
2013-04-26 22:44:59 +02:00
|
|
|
.if !defined(_INCLUDE_USES_ICONV_MK)
|
|
|
|
_INCLUDE_USES_ICONV_MK= yes
|
|
|
|
|
2014-01-29 21:24:49 +01:00
|
|
|
.if !exists(/usr/include/iconv.h) || ${iconv_ARGS:Mwchar_t} || ${iconv_ARGS:Mtranslit}
|
2013-09-04 20:06:07 +02:00
|
|
|
|
|
|
|
ICONV_CMD= ${LOCALBASE}/bin/iconv
|
|
|
|
ICONV_LIB= -liconv
|
2013-09-07 21:49:41 +02:00
|
|
|
ICONV_PREFIX= ${LOCALBASE}
|
2013-09-04 20:06:07 +02:00
|
|
|
ICONV_CONFIGURE_ARG= --with-libiconv-prefix=${LOCALBASE}
|
2013-09-05 22:18:30 +02:00
|
|
|
ICONV_CONFIGURE_BASE= --with-libiconv=${LOCALBASE}
|
2015-09-03 17:44:13 +02:00
|
|
|
ICONV_INCLUDE_PATH= ${LOCALBASE}/include
|
|
|
|
ICONV_LIB_PATH= ${LOCALBASE}/lib/libiconv.so
|
2013-09-04 20:06:07 +02:00
|
|
|
|
2014-01-29 21:24:49 +01:00
|
|
|
.if ${iconv_ARGS:Mbuild}
|
2016-03-27 03:23:25 +02:00
|
|
|
BUILD_DEPENDS+= ${ICONV_CMD}:converters/libiconv
|
2014-01-29 21:24:49 +01:00
|
|
|
.elif ${iconv_ARGS:Mpatch}
|
2016-03-27 03:23:25 +02:00
|
|
|
PATCH_DEPENDS+= ${ICONV_CMD}:converters/libiconv
|
2014-01-29 21:24:49 +01:00
|
|
|
.else
|
2016-03-27 03:23:25 +02:00
|
|
|
LIB_DEPENDS+= libiconv.so:converters/libiconv
|
2013-09-02 07:41:50 +02:00
|
|
|
.endif
|
2013-04-26 22:44:59 +02:00
|
|
|
|
2013-09-04 20:06:07 +02:00
|
|
|
.else
|
|
|
|
|
|
|
|
ICONV_CMD= /usr/bin/iconv
|
|
|
|
ICONV_LIB=
|
2013-09-07 21:49:41 +02:00
|
|
|
ICONV_PREFIX= /usr
|
2013-09-04 20:06:07 +02:00
|
|
|
ICONV_CONFIGURE_ARG=
|
2013-09-05 22:18:30 +02:00
|
|
|
ICONV_CONFIGURE_BASE=
|
2015-09-03 17:44:13 +02:00
|
|
|
ICONV_INCLUDE_PATH= /usr/include
|
|
|
|
ICONV_LIB_PATH= /usr/lib/libc.so
|
2013-09-04 20:06:07 +02:00
|
|
|
|
2016-03-28 22:53:56 +02:00
|
|
|
.if (${OPSYS} == FreeBSD && (${OSVERSION} < 1001514 \
|
2015-04-30 18:53:06 +02:00
|
|
|
|| (${OSVERSION} >= 1100000 && ${OSVERSION} < 1100069))) \
|
2015-04-15 10:20:27 +02:00
|
|
|
|| exists(${LOCALBASE}/include/iconv.h)
|
2016-03-27 03:23:25 +02:00
|
|
|
BUILD_DEPENDS+= libiconv>=1.14_9:converters/libiconv
|
2016-05-12 15:36:46 +02:00
|
|
|
ICONV_INCLUDE_PATH= ${LOCALBASE}/include
|
|
|
|
.endif
|
|
|
|
|
2014-01-29 21:24:49 +01:00
|
|
|
CPPFLAGS+= -DLIBICONV_PLUG
|
|
|
|
CFLAGS+= -DLIBICONV_PLUG
|
|
|
|
CXXFLAGS+= -DLIBICONV_PLUG
|
2015-07-01 15:50:28 +02:00
|
|
|
OBJCFLAGS+= -DLIBICONV_PLUG
|
2014-01-29 21:24:49 +01:00
|
|
|
|
2013-09-04 20:06:07 +02:00
|
|
|
.endif
|
|
|
|
|
2015-09-03 17:44:13 +02:00
|
|
|
# These are the most common names for the iconv-related variables found in
|
|
|
|
# CMake-based ports. We set them here via CMAKE_ARGS to make sure that the best
|
|
|
|
# combination is always used (ie. we prefer the version in libc whenever it is
|
|
|
|
# available, and sometimes have to fall back to the iconv.h header from ports
|
|
|
|
# while still using the library from base).
|
|
|
|
CMAKE_ARGS+= -DICONV_INCLUDE_DIR=${ICONV_INCLUDE_PATH} \
|
|
|
|
-DICONV_LIBRARIES=${ICONV_LIB_PATH} \
|
|
|
|
-DICONV_LIBRARY=${ICONV_LIB_PATH} \
|
|
|
|
-DLIBICONV_INCLUDE_DIR=${ICONV_INCLUDE_PATH} \
|
|
|
|
-DLIBICONV_LIBRARIES=${ICONV_LIB_PATH} \
|
|
|
|
-DLIBICONV_LIBRARY=${ICONV_LIB_PATH}
|
|
|
|
|
2013-04-26 22:44:59 +02:00
|
|
|
.endif
|