No meu sistema (Slackware64-14.1) gawk
está instalado na versão 4.1.0. Gostaria de instalar o gawkextlib para ter acesso a alguns de seus recursos, ou seja, xml
.
Do arquivo README
de gawkextlib-0.4.9
:
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
O processo falha com:
/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[2]: *
[install-pkgextensionLTLIBRARIES] Error 1
Este não é um grande problema, pois gostaria que gawkextlib
se integrasse ao gawk
existente em /usr
. Então, quando:
$ ./configure --prefix=/usr --with-gawk=/usr
$ make && make test
# make install
Tudo é instalado bem.
# ls /usr/lib/libgawkextlib.*
/usr/lib/libgawkextlib.la /usr/lib/libgawkextlib.so /usr/lib/libgawkextlib.so.0 /usr/lib/libgawkextlib.so.0.0.0
mas
$ awk -l xml
awk: fatal: can't open shared library 'xml' for reading (No such file or directory)
Da página de manual gawk
:
-l
--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().
Depois de configurar AWKLIBPATH
:
$ 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)
awk
aka gawk
não consegue encontrar a biblioteca compartilhada.
O que estou perdendo aqui?