From owner-svn-doc-all@FreeBSD.ORG Tue Oct 29 01:38:54 2013 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 04E296E6; Tue, 29 Oct 2013 01:38:54 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4B3C2E6A; Tue, 29 Oct 2013 01:38:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9T1crLX029645; Tue, 29 Oct 2013 01:38:53 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9T1crZB029643; Tue, 29 Oct 2013 01:38:53 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201310290138.r9T1crZB029643@svn.freebsd.org> From: Warren Block Date: Tue, 29 Oct 2013 01:38:53 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r43068 - head/en_US.ISO8859-1/books/porters-handbook X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2013 01:38:54 -0000 Author: wblock Date: Tue Oct 29 01:38:53 2013 New Revision: 43068 URL: http://svnweb.freebsd.org/changeset/doc/43068 Log: Add updated iconv information. Modified version of diff supplied with PR. PR: docs/182872 Submitted by: Guido Falsi Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml head/en_US.ISO8859-1/books/porters-handbook/uses.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/book.xml Mon Oct 28 23:17:30 2013 (r43067) +++ head/en_US.ISO8859-1/books/porters-handbook/book.xml Tue Oct 29 01:38:53 2013 (r43068) @@ -9286,6 +9286,151 @@ CFLAGS+= -DLUA_VERSION_STRING="${VER_STR + + Using <command>iconv</command> + + After 2013-10-08 (254273), &os;  + 10-CURRENT and newer versions have a native + iconv in the operating system. On earlier + versions, + converters/libiconv was + used as a dependency. + + For software that needs iconv, define + USES=iconv. &os; versions before + 10-CURRENT on 2013-08-13 (254273) do not have + a native iconv. On these earlier versions, + a dependency on + converters/libiconv will + be added automatically. + + When a port defines USES=iconv, these + variables will be available: + + + + + + Variable name + Purpose + Value before &os; 10-CURRENT + 254273 (2013-08-13) + Value after &os; 10-CURRENT + 254273 (2013-08-13) + + + + + + ICONV_CMD + + Directory where the iconv + binary resides + ${LOCALBASE}/bin/iconv + /usr/bin/iconv + + + + ICONV_LIB + ld argument to link to + libiconv (if needed) + -liconv + (empty) + + + + ICONV_PREFIX + Directory where the iconv + implementation resides (useful for configure + scripts) + ${LOCALBASE} + /usr + + + + ICONV_CONFIGURE_ARG + Preconstructed configure argument for + configure scripts + --with-libiconv-prefix=${LOCALBASE} + (empty) + + + + ICONV_CONFIGURE_BASE + Preconstructed configure argument for + configure scripts + --with-libiconv=${LOCALBASE} + (empty) + + + + + + These two examples automatically populate the variables + with the correct value for systems using + converters/libiconv or the + native iconv respectively: + + + Simple <command>iconv</command> Usage + + USES= iconv +LDFLAGS+= -L${LOCALBASE}/lib ${ICONV_LIB} + + + + <command>iconv</command> Usage with + <command>configure</command> + + USES= iconv +CONFIGURE_ARGS+=${ICONV_CONFIGURE_ARG} + + + As shown above, ICONV_LIB is empty when + a native iconv is present. This can be + used to detect the native iconv and respond + appropriately. + + Sometimes a program has an ld argument + or search path hardcoded in a Makefile or + configure script. This approach can be used to solve that + problem: + + + Fixing Hardcoded <literal>-liconv</literal> + + USES= iconv + +post-patch: + @${REINPLACE_CMD} -e 's/-liconv/${ICONV_LIB}/' ${WRKSRC}/Makefile + + + In some cases it is necessary to set alternate values or + perform operations depending on whether there is a native + iconv. + bsd.port.pre.mk must be included before + testing the value of ICONV_LIB: + + + Checking for Native <command>iconv</command> + Availability + + USES= iconv + +.include <bsd.port.pre.mk> + +post-patch: +.if empty(ICONV_LIB) + # native iconv detected + @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.sh +.endif + +.include <bsd.port.post.mk> + + + Using Xfce Modified: head/en_US.ISO8859-1/books/porters-handbook/uses.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/uses.xml Mon Oct 28 23:17:30 2013 (r43067) +++ head/en_US.ISO8859-1/books/porters-handbook/uses.xml Tue Oct 29 01:38:53 2013 (r43068) @@ -106,10 +106,18 @@ iconv - (none) - Implies that the port uses converters/libiconv as build-time and - run-time dependency. + (none), lib, build, + patch + Implies that the port uses iconv functions, either from the port + converters/libiconv as + a build-time and run-time dependency, or from the base system on + 10-CURRENT after a native iconv was committed + in 254273. By default, with no arguments or with the + lib argument, implies iconv + with build-time and run-time dependencies, build + implies a build-time dependency, and patch + implies a patch-time dependency. For more information see + .