From owner-svn-src-stable@FreeBSD.ORG Thu Jun 28 09:18:12 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D12C1065672; Thu, 28 Jun 2012 09:18:12 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2648FC0A; Thu, 28 Jun 2012 09:18:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5S9IBwA064630; Thu, 28 Jun 2012 09:18:11 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5S9IBuu064627; Thu, 28 Jun 2012 09:18:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201206280918.q5S9IBuu064627@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 28 Jun 2012 09:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237698 - stable/9/lib/libkiconv X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 09:18:12 -0000 Author: gabor Date: Thu Jun 28 09:18:11 2012 New Revision: 237698 URL: http://svn.freebsd.org/changeset/base/237698 Log: MFC 236028, 236185, 236972 - Add support for BSD iconv when it is built into libc Modified: stable/9/lib/libkiconv/Makefile stable/9/lib/libkiconv/xlat16_iconv.c Directory Properties: stable/9/lib/libkiconv/ (props changed) Modified: stable/9/lib/libkiconv/Makefile ============================================================================== --- stable/9/lib/libkiconv/Makefile Thu Jun 28 08:25:19 2012 (r237697) +++ stable/9/lib/libkiconv/Makefile Thu Jun 28 09:18:11 2012 (r237698) @@ -1,7 +1,10 @@ # $FreeBSD$ -LIB= kiconv SHLIBDIR?= /lib + +.include + +LIB= kiconv SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c SRCS+= quirks.c @@ -17,4 +20,8 @@ CFLAGS+= -I${.CURDIR}/../../sys WARNS?= 1 +.if ${MK_ICONV} == "no" +CFLAGS+= -DICONV_DLOPEN +.endif + .include Modified: stable/9/lib/libkiconv/xlat16_iconv.c ============================================================================== --- stable/9/lib/libkiconv/xlat16_iconv.c Thu Jun 28 08:25:19 2012 (r237697) +++ stable/9/lib/libkiconv/xlat16_iconv.c Thu Jun 28 09:18:11 2012 (r237698) @@ -60,10 +60,18 @@ struct xlat16_table { static struct xlat16_table kiconv_xlat16_open(const char *, const char *, int); static int chklocale(int, const char *); +#ifdef ICONV_DLOPEN static int my_iconv_init(void); static iconv_t (*my_iconv_open)(const char *, const char *); static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *); static int (*my_iconv_close)(iconv_t); +#else +#include +#define my_iconv_init() 0 +#define my_iconv_open iconv_open +#define my_iconv iconv +#define my_iconv_close iconv_close +#endif static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *); int @@ -310,6 +318,7 @@ chklocale(int category, const char *code return (error); } +#ifdef ICONV_DLOPEN static int my_iconv_init(void) { @@ -327,6 +336,7 @@ my_iconv_init(void) return (0); } +#endif static size_t my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,