wcwidth: Respect rules for use of AC_LIBOBJ.
authorBruno Haible <bruno@clisp.org>
Sun, 22 May 2011 16:58:19 +0000 (18:58 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:07:14 +0000 (00:07 +0200)
* m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Set HAVE_WCWIDTH. Move AC_LIBOBJ
invocation from here...
* modules/wcwidth (configure.ac): ... to here.
(Depends-on): Update conditions.

ChangeLog
m4/wcwidth.m4
modules/wcwidth

index 7d7be3a..3d6c7b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-05-22  Bruno Haible  <bruno@clisp.org>
 
+       wcwidth: Respect rules for use of AC_LIBOBJ.
+       * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Set HAVE_WCWIDTH. Move AC_LIBOBJ
+       invocation from here...
+       * modules/wcwidth (configure.ac): ... to here.
+       (Depends-on): Update conditions.
+
+2011-05-22  Bruno Haible  <bruno@clisp.org>
+
        wctype: Move AC_LIBOBJ invocations to module description.
        * m4/wctype.m4 (gl_FUNC_WCTYPE): Set HAVE_WCTYPE. Move AC_LIBOBJ
        invocation from here...
index dbcc231..8a97e38 100644 (file)
@@ -1,4 +1,4 @@
-# wcwidth.m4 serial 19
+# wcwidth.m4 serial 20
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
   fi
 
   if test $ac_cv_func_wcwidth = yes; then
+    HAVE_WCWIDTH=1
     dnl On MacOS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
     dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
     dnl This leads to bugs in 'ls' (coreutils).
@@ -89,9 +90,8 @@ changequote([,])dnl
       *yes) ;;
       *no) REPLACE_WCWIDTH=1 ;;
     esac
-  fi
-  if test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1; then
-    AC_LIBOBJ([wcwidth])
+  else
+    HAVE_WCWIDTH=0
   fi
   dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not
   dnl have the wcwidth function, then it does not declare it.
index 27327a1..7b6913b 100644 (file)
@@ -10,13 +10,16 @@ m4/wint_t.m4
 Depends-on:
 wchar
 extensions
-wctype-h        [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
-localcharset    [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
-streq           [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
-uniwidth/width  [test $ac_cv_func_wcwidth != yes || test $REPLACE_WCWIDTH = 1]
+wctype-h        [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
+localcharset    [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
+streq           [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
+uniwidth/width  [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]
 
 configure.ac:
 gl_FUNC_WCWIDTH
+if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
+  AC_LIBOBJ([wcwidth])
+fi
 gl_WCHAR_MODULE_INDICATOR([wcwidth])
 
 Makefile.am: