Re: [Patch] correctly configure wcwidth in readline

Daniel Jacobowitz
2003-02-26T16:54:59Z

On Wed, Feb 26, 2003 at 11:47:07AM -0500, Kris Warkentin wrote:
> 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?

Kris, from MAINTAINERS:

readline/ Master version: ftp://ftp.cwru.edu/pub/bash/
Elena Zannoni ezannoni@redhat.com
Host maintainers (host dependant parts)
(but get your changes into the master version)

Something like this needs to go through the maintainers of
bash/readline first.

Yes, normally you regenerate any generated files when checking in a
patch.

> + HAVE_WCWIDTH = @HAVE_WCWIDTH@
> +
> + ifeq ($(HAVE_WCWIDTH), no)
> + WCWIDTH_SRC = $(srcdir)/support/wcwidth.c
> + WCWIDTH_OBJ = wcwidth.o
> + endif
> +

Can't do that. It's a GNU-make-ism. You have to move more of the
logic to configure.

> +
> + ifeq ($(HAVE_WCWIDTH), no)
> + $(WCWIDTH_OBJ): $(WCWIDTH_SRC)
> + $(RM) $@
> + $(CC) $(CCFLAGS) -c $(WCWIDTH_SRC)
> + endif

That should probably be an unconditional rule, a la:
wcwidth.o: $(srcdir)/support/wcwidth.c
$(RM) $@
$(CC) $(CCFLAGS) -c $(srcdir)/support/wcwidth.c

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer