Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Kris Warkentin" <kewarken@qnx.com>
To: "Daniel Jacobowitz" <drow@mvista.com>
Cc: <gdb-patches@sources.redhat.com>
Subject: Re: [Patch] correctly configure wcwidth in readline
Date: Wed, 26 Feb 2003 18:43:00 -0000	[thread overview]
Message-ID: <013401c2ddc7$000abf90$0202040a@catdog> (raw)
In-Reply-To: <20030226175915.GA15700@nevyn.them.org>

> Try:
> AC_CHECK_FUNC(wcwidth, have_wcwidth=yes, have_wcwidth=no)
> if test $have_wcwidth = yes; then
>   AC_DEFINE(HAVE_WCWIDTH)
>   AC_SUBST(WCWIDTH_OBJ,wcwidth.o)
> else
>   AC_SUBST(WCWIDTH_OBJ,)
> fi
>
> You'd have to test it though.

Okay.  This works great on systems with and without wcwidth.

Kris

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/readline/Makefile.in,v
retrieving revision 1.4
diff -u -r1.4 Makefile.in
--- Makefile.in 8 Dec 2002 22:31:37 -0000 1.4
+++ Makefile.in 26 Feb 2003 18:41:35 -0000
@@ -86,6 +86,8 @@
 LIBRARY_NAME = libreadline.a
 STATIC_LIBS = libreadline.a libhistory.a

+WCWIDTH_OBJ = @WCWIDTH_OBJ@
+
 # The C code source files for this library.
 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
     $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
@@ -98,7 +100,7 @@
     $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
     $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
     $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \
-    $(srcdir)/mbutil.c
+    $(srcdir)/mbutil.c $(srcdir)/support/wcwidth.c

 # The header files for this library.
 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
@@ -111,7 +113,8 @@
 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
    rltty.o complete.o bind.o isearch.o display.o signals.o \
    util.o kill.o undo.o macro.o input.o callback.o terminal.o \
-   text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
+   text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ) \
+   $(WCWIDTH_OBJ)

 # The texinfo files which document this library.
 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
@@ -146,6 +149,10 @@
  $(RM) $@
  $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
  -test -n "$(RANLIB)" && $(RANLIB) $@
+
+wcwidth.o: $(srcdir)/support/wcwidth.c
+ $(RM) $@
+ $(CC) $(CCFLAGS) -c $(srcdir)/support/wcwidth.c

 # Since tilde.c is shared between readline and bash, make sure we compile
 # it with the right flags when it's built as part of readline
Index: aclocal.m4
===================================================================
RCS file: /cvs/src/src/readline/aclocal.m4,v
retrieving revision 1.4
diff -u -r1.4 aclocal.m4
--- aclocal.m4 8 Dec 2002 22:31:37 -0000 1.4
+++ aclocal.m4 26 Feb 2003 18:41:35 -0000
@@ -1653,7 +1653,13 @@
 AC_CHECK_HEADERS(langinfo.h)

 AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
-AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
+AC_CHECK_FUNC(wcwidth, have_wcwidth=yes)
+if test "$have_wcwidth" = yes; then
+  AC_DEFINE(HAVE_WCWIDTH)
+  AC_SUBST(WCWIDTH_OBJ,)
+else
+  AC_SUBST(WCWIDTH_OBJ,wcwidth.o)
+fi

 AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
 [AC_TRY_RUN([
Index: shlib/Makefile.in
===================================================================
RCS file: /cvs/src/src/readline/shlib/Makefile.in,v
retrieving revision 1.4
diff -u -r1.4 Makefile.in
--- shlib/Makefile.in 8 Dec 2002 22:31:38 -0000 1.4
+++ shlib/Makefile.in 26 Feb 2003 18:41:36 -0000
@@ -103,6 +103,8 @@
 SHARED_HISTORY = libhistory.$(SHLIB_LIBVERSION)
 SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)

+WCWIDTH_OBJ = @WCWIDTH_OBJ@
+
 # The C code source files for this library.
 CSOURCES = $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \
     $(topdir)/vi_mode.c $(topdir)/parens.c $(topdir)/rltty.c \
@@ -115,7 +117,7 @@
     $(topdir)/histfile.c $(topdir)/nls.c $(topdir)/search.c \
     $(topdir)/shell.c $(topdir)/savestring.c $(topdir)/tilde.c \
     $(topdir)/text.c $(topdir)/misc.c $(topdir)/compat.c \
-    $(topdir)/mbutil.c
+    $(topdir)/mbutil.c $(WCWIDTH_SRC)

 # The header files for this library.
 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
@@ -129,7 +131,7 @@
    rltty.so complete.so bind.so isearch.so display.so signals.so \
    util.so kill.so undo.so macro.so input.so callback.so terminal.so \
    text.so nls.so misc.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ) \
-   compat.so
+   compat.so $(WCWIDTH_OBJ)

 ##########################################################################

@@ -152,6 +154,10 @@
 $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
  $(RM) $@
  $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ)
xmalloc.so $(SHLIB_LIBS)
+
+wcwidth.o: $(srcdir)/support/wcwidth.c
+ $(RM) $@
+ $(SHOBJ_CC) -c $(CCFLAGS) $(SHOBJ_FLAGS) $(srcdir)/support/wcwidth.c

 # Since tilde.c is shared between readline and bash, make sure we compile
 # it with the right flags when it's built as part of readline


  parent reply	other threads:[~2003-02-26 18:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-26 17:35 Kris Warkentin
2003-02-26 18:06 ` Daniel Jacobowitz
2003-02-26 17:44   ` Kris Warkentin
2003-02-26 17:51     ` Daniel Jacobowitz
     [not found]       ` <00fd01c2ddc0$28ab75e0$0202040a@catdog>
     [not found]         ` <20030226175915.GA15700@nevyn.them.org>
2003-02-26 18:43           ` Kris Warkentin [this message]
2003-02-26 20:14             ` Daniel Jacobowitz
2003-02-26 20:40               ` Kris Warkentin
2003-02-26 20:49                 ` Daniel Jacobowitz
2003-02-26 20:52                   ` Kris Warkentin
2003-03-03  2:55                     ` Elena Zannoni
2003-03-03 14:46                       ` Kris Warkentin
2003-02-26 21:26       ` Andreas Schwab
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26 20:14 Michael Elizabeth Chastain
2003-02-26 16:57 Michael Elizabeth Chastain
2003-02-26 18:23 ` Andrew Cagney
2003-02-26 16:47 Kris Warkentin
2003-02-26 16:54 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='013401c2ddc7$000abf90$0202040a@catdog' \
    --to=kewarken@qnx.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox