In my system (Slackware64-14.1)
gawk is installed in version 4.1.0. I'd like to install gawkextlib to have access to some of its features, namely
README file of
To use this library, you must first build the new version of gawk containing shared extension library support. Please use gawk 4.1 or later, or use this recipe to build from the git sources:
git clone git://git.savannah.gnu.org/gawk.git cd gawk
./bootstrap.sh ./configure --prefix=/tmp/newgawk make && make check && make install
After you build and install that in /tmp/newgawk, you can then build gawkextlib like so:
Using git: git clone git://git.code.sf.net/p/gawkextlib/code gawkextlib cd gawkextlib ./update-autotools
Or it may be easier from a tarball if you do not have current autotools installed: tar xf gawkextlib-.tar.gz cd gawkextlib-
Either way, the steps to build are the same: ./configure --with-gawk=/tmp/newgawk --prefix=/tmp/newgawk make && make check && make install
The process fails with:
/usr/bin/mkdir -p '/tmp/newgawk/lib/gawk' /bin/sh ../libtool
--mode=install ../build-aux/install-sh -c xml.la gd.la mpfr.la '/tmp/newgawk/lib/gawk' libtool: install: error: cannot install `xml.la' to a directory not ending in /usr/lib/gawk make: * [install-pkgextensionLTLIBRARIES] Error 1
This is not a big problem, as I'd really like
gawkextlib to integrate with existing
gawk residing in
/usr. So, when:
$ ./configure --prefix=/usr --with-gawk=/usr $ make && make test # make install
Everything installs fine.
# ls /usr/lib/libgawkextlib.* /usr/lib/libgawkextlib.la /usr/lib/libgawkextlib.so /usr/lib/libgawkextlib.so.0 /usr/lib/libgawkextlib.so.0.0.0
$ awk -l xml awk: fatal: can't open shared library `xml' for reading (No such file or directory)
gawk man page:
--load lib Load a shared library lib. This searches for the library using the AWKLIBPATH environment variable. If the initial search fails, another attempt will be made after appending the default shared library suffix for the platform. The library initialization routine is expected to be named dl_load().
After setting up
$ export AWKLIBPATH=/usr/lib $ echo $AWKLIBPATH /usr/lib $ awk -l xml awk: fatal: can't open shared library `xml' for reading (No such file or directory)
gawk can't find the shared library.
What am I missing here?