Hi.

Jens Staal <[email protected]> wrote:

> There was a recent discussion about that it would be nice to have gawk on
> Plan9.
>
> The latest upstream version of gawk can now be built via 9front-ports. I
> think/hope I built/ported it correctly, but it would be nice with
> critique/feedback/testing.

Majorly cool! The first thing to check is that 'make check' passes.
Some tests depend on locales; those are OK if they fail, assuming you
don't have locale data for them. Others are only run if gawk was built
with the MPFR library, so those should be OK too if they're not run. If
there are failures in other tests, they should be investigated.

I assume you built from the released tarball? Version 4.1.3?

> I noticed in the Arch linux package that gawk comes with a couple of
> dynamic libraries and a header. Are those also interesting to include in
> the Plan9 package (then as static libraries ofcourse)?

Supplyinig them as static libraries would serve no purpose. Those
dynamic libraries are extensions (or plug-ins, if you will). Gawk
loads them vial dlopen() if requested to via an @load directive in
the source or the via the -l command line option.

I hope that dlopen works on Plan 9; if so it's necessary to build
the libraries in whatever way will work to support dlopen.

The extension facility is something we (the gawk developers) put a
lot of work into for the 4.1 release. I can supply pointers to doc
for anyone who is interested. Here's a simple example:

        $ gawk -lreaddir '{ print }' .
        2814749767529876/./d
        281474977052502/../d
        2814749767530561/.bashrc/f
        281474976885114/.bash_history/f
        14355223812503808/.bash_profile/f
        1407374884183439/.bzr.log/f
        281474976885116/.ex-sgml-rc/f
        281474976885117/.exrc/f
        ...

The readdir extension returns directory entries as records in an
easily-parsed format: '/' is the field separator and the fields are
the inode, the name, and an optional single-letter file type indicator.

The doc has more examples.

I hope this helps. Please feel to contact me off-list if you need
more info / help.

Thanks!

Arnold

Reply via email to