On 03/28/11 19:08, Stuart Henderson wrote: > On 2011/03/10 21:22, Nigel Taylor wrote: >>> "translit(`+,-12345', `+--1-5', `<;>a-c-a') >>> >>> This fails to give the correct reasult on OpenBSD a-c-a expected to be >>> equivalent to abcba, -a on the end is treated as -a." Back to back ranges >>> not >>> implemented yet. >>> >>> I think the info m4 examples should be in the regression tests. All but the >>> back >>> to back range worked (-g only gnu), with the updated version attached, I >>> have >>> fixed that as below, result from test m4 vs gm4 as per m4 info. > > > So the translit fix is in, here's the chunk of the diff with > the fix and test for back-to-back ranges. > > I haven't got autoconf-2.67 working yet though, testing with > lighttpd I'm getting 'configure:13699: error: possibly undefined > macro: AS_MESSAGE_LOG_FDdnl'. > > Index: usr.bin/m4/eval.c > =================================================================== > RCS file: /cvs/src/usr.bin/m4/eval.c,v > retrieving revision 1.69 > diff -u -p -r1.69 eval.c > --- usr.bin/m4/eval.c 24 Mar 2011 11:23:08 -0000 1.69 > +++ usr.bin/m4/eval.c 28 Mar 2011 18:02:28 -0000 > @@ -975,7 +975,7 @@ handledash(char *buffer, char *end, cons > unsigned char i; > if ((unsigned char)src[0] <= (unsigned char)src[2]) { > for (i = (unsigned char)src[0]; > - i <= (unsigned char)src[2]; i++) { > + i < (unsigned char)src[2]; i++) { > *p++ = i; > if (p == end) { > *p = '\0'; > @@ -984,7 +984,7 @@ handledash(char *buffer, char *end, cons > } > } else { > for (i = (unsigned char)src[0]; > - i >= (unsigned char)src[2]; i--) { > + i > (unsigned char)src[2]; i--) { > *p++ = i; > if (p == end) { > *p = '\0'; > @@ -992,7 +992,36 @@ handledash(char *buffer, char *end, cons > } > } > } > - src += 3; > + src += 2; > + /* check for back to back range */ > + if (src[1] == '-' && src[2]) { > + if ((unsigned char)src[0] <= (unsigned > char)src[2]) { > + for (i = (unsigned char)src[0]; > + i <= (unsigned char)src[2]; i++) { > + *p++ = i; > + if (p == end) { > + *p = '\0'; > + return buffer; > + } > + } > + } else { > + for (i = (unsigned char)src[0]; > + i >= (unsigned char)src[2]; i--) { > + *p++ = i; > + if (p == end) { > + *p = '\0'; > + return buffer; > + } > + } > + } > + src += 3; > + } else { > + *p++ = *src++; > + if (p == end) { > + *p = '\0'; > + return buffer; > + } > + } > } else > *p++ = *src++; > if (p == end) > Index: regress/usr.bin/m4/gnutranslit2.out > =================================================================== > RCS file: /cvs/src/regress/usr.bin/m4/gnutranslit2.out,v > retrieving revision 1.1 > diff -u -p -r1.1 gnutranslit2.out > --- regress/usr.bin/m4/gnutranslit2.out 24 Mar 2011 11:28:19 -0000 > 1.1 > +++ regress/usr.bin/m4/gnutranslit2.out 28 Mar 2011 18:02:28 -0000 > @@ -4,3 +4,5 @@ ABCDEFGHIJ > ABCDEFGHIJ > ABC-0980-ZYX > ABC-0980-ZYX > +<;>abcba > +bgced > Index: regress/usr.bin/m4/translit2.m4 > =================================================================== > RCS file: /cvs/src/regress/usr.bin/m4/translit2.m4,v > retrieving revision 1.1 > diff -u -p -r1.1 translit2.m4 > --- regress/usr.bin/m4/translit2.m4 24 Mar 2011 11:28:19 -0000 1.1 > +++ regress/usr.bin/m4/translit2.m4 28 Mar 2011 18:02:28 -0000 > @@ -6,3 +6,5 @@ translit(`0123456789', `0123456789', `AB > translit(`0123456789', `[0-9]', `[A-J]') > translit(`abc-0980-zyx', `abcdefghijklmnopqrstuvwxyz', > `ABCDEFGHIJKLMNOPQRSTUVWXYZ') > translit(`abc-0980-zyx', `[a-z]', `[A-Z]') > +translit(`+,-12345', `+--1-5', `<;>a-c-a') > +translit(`abcdef', `aabdef', `bcged') > Index: regress/usr.bin/m4/translit2.out > =================================================================== > RCS file: /cvs/src/regress/usr.bin/m4/translit2.out,v > retrieving revision 1.1 > diff -u -p -r1.1 translit2.out > --- regress/usr.bin/m4/translit2.out 24 Mar 2011 11:28:19 -0000 1.1 > +++ regress/usr.bin/m4/translit2.out 28 Mar 2011 18:02:28 -0000 > @@ -4,3 +4,5 @@ ABCDEFGHIJ > A12345678J > ABC-0980-ZYX > Abc-0980-Zyx > +<,;a234c > +bgced > > Hi,
Found these, http://old.nabble.com/-sr--107447--error%3A-possibly-undefined-macro%3A-AS_MESSAGE_LOG_FDdnl-td29339483.html http://comments.gmane.org/gmane.mail.imap.dovecot/51768 This one http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/13133/focus=13153 Says fixed in autoconf 2.68 to work with older pkg-config. >From 2.68 release notes this might be this is the problem.. ** AC_MSG_ERROR (and AS_ERROR) can once again be followed immediately by `dnl'. Regression introduced in 2.66. Tried lighttpd with autoconfig 2.68 and that builds. I don't think this is an issue with m4. When tried with GNU m4 fails to build with same error message. I looked at devel/metaauto, I can't get to pkg-config.freedesktop.org, url changed to http://pkgconfig.freedesktop.org/releases/ MASTER_SITES is wrong in Makefile, v0.21 16 Aug 2006 latest is v0.25 28 May 2010. The fix for pkg-config is in GIT only. Regards Nigel Taylor