From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnold@skeeve.com Message-Id: <201507071227.t67CRtlQ005463@freefriends.org> Date: Tue, 7 Jul 2015 06:27:55 -0600 To: 9fans@9fans.net References: In-Reply-To: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Gawk in 9front-ports Topicbox-Message-UUID: 5d81347e-ead9-11e9-9d60-3106f5b1d025 Hi. Jens Staal 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