From: Dimitry Golubovsky <golubovsky@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] Plan9 awk vs. GNU awk
Date: Fri, 23 Oct 2009 22:20:33 -0400 [thread overview]
Message-ID: <bcba51a0910231920l5671994ck5b41f2b971604676@mail.gmail.com> (raw)
Hi,
Working through the autoconf stuff I came across another issue: Plan9
awk does not seem to recognize a regexp that GNU awk does. This
results in config.status not properly creating config.h file based on
the configure's findings. The regexp in the test program was extracted
from config.status. Can anybody see anything wrong with this regexp?
The test program named `rxtest' (long regexp should match a #define or
#undef statement, if matched the whole line is printed):
#!/bin/sh
# (or /bin/rc for Plan9)
awk '
/^[\t ]*#[\t ]*(define|undef)[\t
]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t
(]|$)/ {
line = $ 0
print line }
'
The source file (config.h.in), top portion of it:
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* platform-specific defines */
#include "platform.h"
/* Define to 1 if you want to use the primitives which let you examine Hugs
bytecodes (requires INTERNAL_PRIMS). */
#undef BYTECODE_PRIMS
/* Define to 1 to use a Char encoding determined by the locale. */
#undef CHAR_ENCODING_LOCALE
/* Define to 1 to use the UTF-8 Char encoding. */
#undef CHAR_ENCODING_UTF8
/* Define to 1 if you want to perform runtime tag-checks as an internal
consistency check. This makes Hugs run very slowly - but is very effective
at detecting and locating subtle bugs. */
#undef CHECK_TAGS
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define to 1 if debugging generated bytecodes or the bytecode interpreter.
*/
#undef DEBUG_CODE
Result under Linux (top portion):
$ cat src/config.h.in | rxtest | head
#undef BYTECODE_PRIMS
#undef CHAR_ENCODING_LOCALE
#undef CHAR_ENCODING_UTF8
#undef CHECK_TAGS
#undef CRAY_STACKSEG_END
#undef C_ALLOCA
#undef DEBUG_CODE
that is, all lines matched.
awk used was:
awk --version
GNU Awk 3.1.6
Copyright (C) 1989, 1991-2007 Free Software Foundation.
Result under Plan9:
term% cat src/config.h.in | rxtest
term%
Nothing: Plan9 awk does not match this regexp and source file's lines.
Not sure which version Plan9 awk is, the binary is dated:
term% ls -l /bin/awk
total 1000
-rwxr-xr-x 1 dima users 327504 Feb 4 2009 /bin/awk
/sys/src/cmd/awk/main.c contains:
char *version = "version 19990602";
Thanks.
--
Dimitry Golubovsky
Anywhere on the Web
next reply other threads:[~2009-10-24 2:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-24 2:20 Dimitry Golubovsky [this message]
2009-10-24 2:45 ` michael block
2009-10-24 17:32 ` Russ Cox
2009-10-24 18:34 ` Anthony Sorace
[not found] <<3df301650910231945n522c4592ib25cef16e9830202@mail.gmail.com>
2009-10-27 17:42 ` erik quanstrom
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=bcba51a0910231920l5671994ck5b41f2b971604676@mail.gmail.com \
--to=golubovsky@gmail.com \
--cc=9fans@9fans.net \
/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;
as well as URLs for NNTP newsgroup(s).