From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10211 invoked from network); 3 Aug 2006 18:06:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,LONGWORDS autolearn=no version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Aug 2006 18:06:35 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 27602 invoked from network); 3 Aug 2006 18:06:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Aug 2006 18:06:25 -0000 Received: (qmail 3291 invoked by alias); 3 Aug 2006 18:06:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22582 Received: (qmail 3281 invoked from network); 3 Aug 2006 18:06:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Aug 2006 18:06:20 -0000 Received: (qmail 27211 invoked from network); 3 Aug 2006 18:06:20 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 3 Aug 2006 18:06:17 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly19d.srv.mailcontrol.com (MailControl) with ESMTP id k73I6Efw021710 for ; Thu, 3 Aug 2006 19:06:15 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Aug 2006 19:06:14 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k73I6EPh017324 for ; Thu, 3 Aug 2006 19:06:14 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k73I6Ea2017321 for ; Thu, 3 Aug 2006 19:06:14 +0100 Message-Id: <200608031806.k73I6Ea2017321@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: autoconf test for multibyte support Date: Thu, 03 Aug 2006 19:06:14 +0100 From: Peter Stephenson X-OriginalArrivalTime: 03 Aug 2006 18:06:14.0813 (UTC) FILETIME=[8286FCD0:01C6B727] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-04-01 (www.mailcontrol.com) on 10.68.0.129 This should do a better job of working out whether multibyte support can be enabled by looking for all the functions we use. I may have missed some out; see if the list jogs any recollections. If this works I will need to change some of the installation documentation. RCS file: /cvsroot/zsh/zsh/configure.ac,v retrieving revision 1.55 diff -u -r1.55 configure.ac --- configure.ac 19 Jun 2006 10:55:26 -0000 1.55 +++ configure.ac 3 Aug 2006 17:51:52 -0000 @@ -1122,7 +1122,7 @@ pcre_compile pcre_study pcre_exec \ nl_langinfo \ erand48 open_memstream \ - wctomb mbrtowc wcrtomb iconv \ + wctomb iconv \ grantpt unlockpt ptsname \ htons ntohs) AC_FUNC_STRCOLL @@ -2079,33 +2079,34 @@ fi fi -dnl --------------------- -dnl multibyte ZLE support -dnl --------------------- +dnl ----------------- +dnl multibyte support +dnl ----------------- AC_ARG_ENABLE(multibyte, -AC_HELP_STRING([--enable-multibyte], [support multibyte chars in the zsh line editor]), -[zsh_cv_c_zle_unicode_support=$enableval], -[AC_CACHE_CHECK(if the system adequately supports multibyte chars, - zsh_cv_c_zle_unicode_support, - [AC_TRY_COMPILE([ -#ifdef HAVE_LOCALE_H -# include -#endif - ], [ -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) \ - && defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) \ - && defined (__STDC_ISO_10646__) - /* All is well */ -#else -# error Not supported. -#endif - ], - zsh_cv_c_zle_unicode_support=yes, - zsh_cv_c_zle_unicode_support=no)]) +AC_HELP_STRING([--enable-multibyte], [support multibyte characters]), +[zsh_cv_c_unicode_support=$enableval], +[AC_CACHE_VAL(zsh_cv_c_unicode_support, + AC_MSG_NOTICE([checking for functions supporting multibyte characters]) + [zfuncs_absent= + for zfunc in iswalnum iswcntrl iswdigit iswgraph iswlower iswprint \ +iswpunct iswspace iswupper iswxdigit mbrlen mbrtowc towupper towlower \ +wcschr wcscpy wcslen wcsncmp wcsncpy wcrtomb wcwidth wmemchr wmemcmp \ +wmemcpy wmemmove wmemset; do + AC_CHECK_FUNC($zfunc, + [:], [zfuncs_absent="$zfuncs_absent $zfunc"]) + done + if test x"$zfuncs_absent" = x; then + AC_MSG_NOTICE([all functions found, multibyte support enabled]) + zsh_cv_c_unicode_support=yes + else + AC_MSG_NOTICE([missing functions, multibyte support disabled]) + zsh_cv_c_unicode_support=no + fi + ]) ]) AH_TEMPLATE([MULTIBYTE_SUPPORT], [Define to 1 if you want support for multibyte character sets.]) -if test x$zsh_cv_c_zle_unicode_support = xyes; then +if test x$zsh_cv_c_unicode_support = xyes; then AC_DEFINE(MULTIBYTE_SUPPORT) fi -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php