From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23429 invoked by alias); 26 Feb 2003 16:47:06 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23420 invoked from network); 26 Feb 2003 16:47:03 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by 172.16.49.205 with SMTP; 26 Feb 2003 16:47:03 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id LAA07325 for ; Wed, 26 Feb 2003 11:34:47 -0500 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id LAA25088 for ; Wed, 26 Feb 2003 11:47:02 -0500 Message-ID: <008501c2ddb6$b33de6c0$0202040a@catdog> From: "Kris Warkentin" To: Subject: [Patch] correctly configure wcwidth in readline Date: Wed, 26 Feb 2003 16:47:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0082_01C2DD8C.CA589C80" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-02/txt/msg00707.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0082_01C2DD8C.CA589C80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 785 I have attached a patch that correctly deals with the absence of a wcwidth() function by building support/wcwidth.c and linking it into libreadline. Oddly enough, the HAVE_WCWIDTH check fails on other systems too (ie. Cygwin) but causes no problem since wcwidth() gets picked up elsewhere. On QNX Neutrino, however, we're actually missing wcwidth() so we get undefined references. What is the procedure for regenerating configure scripts? Should I regenerate it here and commit it or do you have a certain person who does it under a specific environment? cheers, Kris Changelog * aclocal.m4: Cause wcwidth check to substitute HAVE_WCWIDTH for building. * Makefile.in: Add wcwidth object to lib if required. * shlib/Makefile.in: Likewise. * configure: Regenerate. ------=_NextPart_000_0082_01C2DD8C.CA589C80 Content-Type: text/plain; name="readline_diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="readline_diff.txt" Content-length: 6816 Index: Makefile.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/readline/Makefile.in,v retrieving revision 1.4 diff -c -r1.4 Makefile.in *** Makefile.in 8 Dec 2002 22:31:37 -0000 1.4 --- Makefile.in 26 Feb 2003 16:36:15 -0000 *************** *** 86,91 **** --- 86,98 ---- LIBRARY_NAME =3D libreadline.a STATIC_LIBS =3D libreadline.a libhistory.a =20=20 + HAVE_WCWIDTH =3D @HAVE_WCWIDTH@ +=20 + ifeq ($(HAVE_WCWIDTH), no) + WCWIDTH_SRC =3D $(srcdir)/support/wcwidth.c + WCWIDTH_OBJ =3D wcwidth.o + endif +=20 # The C code source files for this library. CSOURCES =3D $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \ *************** *** 98,104 **** $(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 =20=20 # The header files for this library. HSOURCES =3D readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h= \ --- 105,111 ---- $(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 $(WCWIDTH_SRC) =20=20 # The header files for this library. HSOURCES =3D readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h= \ *************** *** 111,117 **** OBJECTS =3D 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) =20=20 # The texinfo files which document this library. DOCSOURCE =3D doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo --- 118,125 ---- OBJECTS =3D 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) \ ! $(WCWIDTH_OBJ) =20=20 # The texinfo files which document this library. DOCSOURCE =3D doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo *************** *** 146,151 **** --- 154,165 ---- $(RM) $@ $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o -test -n "$(RANLIB)" && $(RANLIB) $@ +=20 + ifeq ($(HAVE_WCWIDTH), no) + $(WCWIDTH_OBJ): $(WCWIDTH_SRC) + $(RM) $@ + $(CC) $(CCFLAGS) -c $(WCWIDTH_SRC) + endif =20=20 # 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/readline/aclocal.m4,v retrieving revision 1.4 diff -c -r1.4 aclocal.m4 *** aclocal.m4 8 Dec 2002 22:31:37 -0000 1.4 --- aclocal.m4 26 Feb 2003 16:36:15 -0000 *************** *** 1653,1659 **** AC_CHECK_HEADERS(langinfo.h) =20=20 AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) ! AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) =20=20 AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t, [AC_TRY_RUN([ --- 1653,1659 ---- AC_CHECK_HEADERS(langinfo.h) =20=20 AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) ! AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH), AC_SUBST(HAVE_WCWIDTH,no)) =20=20 AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t, [AC_TRY_RUN([ Index: shlib/Makefile.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/readline/shlib/Makefile.in,v retrieving revision 1.4 diff -c -r1.4 Makefile.in *** shlib/Makefile.in 8 Dec 2002 22:31:38 -0000 1.4 --- shlib/Makefile.in 26 Feb 2003 16:36:15 -0000 *************** *** 103,108 **** --- 103,115 ---- SHARED_HISTORY =3D libhistory.$(SHLIB_LIBVERSION) SHARED_LIBS =3D $(SHARED_READLINE) $(SHARED_HISTORY) =20=20 + HAVE_WCWIDTH =3D @HAVE_WCWIDTH@ +=20 + ifeq ($(HAVE_WCWIDTH), no) + WCWIDTH_SRC =3D $(srcdir)/support/wcwidth.c + WCWIDTH_OBJ =3D wcwidth.so + endif +=20 # The C code source files for this library. CSOURCES =3D $(topdir)/readline.c $(topdir)/funmap.c $(topdir)/keymaps.c \ $(topdir)/vi_mode.c $(topdir)/parens.c $(topdir)/rltty.c \ *************** *** 115,121 **** $(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 =20=20 # The header files for this library. HSOURCES =3D readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h= \ --- 122,128 ---- $(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 $(WCWIDTH_SRC) =20=20 # The header files for this library. HSOURCES =3D readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h= \ *************** *** 129,135 **** 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 =20=20 ########################################################################## =20=20 --- 136,142 ---- 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 $(WCWIDTH_OBJ) =20=20 ########################################################################## =20=20 *************** *** 152,157 **** --- 159,171 ---- $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so $(RM) $@ $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) x= malloc.so $(SHLIB_LIBS) +=20 + ifeq ($(HAVE_WCWIDTH), no) + $(WCWIDTH_OBJ): $(WCWIDTH_SRC) + $(RM) $@ + $(SHOBJ_CC) -c $(CCFLAGS) $(SHOBJ_FLAGS) -o wcwidth.o $(WCWIDTH_SRC) + $(MV) wcwidth.o $@ + endif =20=20 # Since tilde.c is shared between readline and bash, make sure we compile= =20 # it with the right flags when it's built as part of readline ------=_NextPart_000_0082_01C2DD8C.CA589C80--