bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid gawkextlib as a separate shared library


From: Manuel Collado
Subject: Re: Avoid gawkextlib as a separate shared library
Date: Wed, 18 May 2022 09:39:48 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

El 17/05/2022 a las 14:01, Eli Zaretskii escribió:
Cc: bug-gawk@gnu.org
From: Manuel Collado <mcollado2011@gmail.com>
Date: Tue, 17 May 2022 10:32:16 +0200

And I vaguely remember another install issue on MinGw. The file
gawkextlib-0.dll need to be in the \bin directory to run
gawk+some-extension, and also need to be in \lib to build
some-extension. Otherwise make fails to locate gawkextlib as a shared
library at the link phase, and offer to link it statically.

That shouldn't happen.  The DLL should be installed in the bin/
directory and the import library libgawkextlib.dll.a should be in
lib/, where the linker will find it.  And that's exactly what happens
on my system, where "make install" did TRT with both of those files,
and linking gawk-mpfr therefore succeeds, both at link time and at run
time (when I run the test suite).

I think this works because gawkextlib uses libtool, and libtool
already knows how to install shared libraries on MS-Windows.

But in a previous message you wrote:

With MinGW, I get:

  checking for libintl.h... yes
  checking for inline... inline
  checking gawkextlib.h usability... no
  checking gawkextlib.h presence... no
  checking for gawkextlib.h... no
  configure: error: Cannot find gawkextlib.h.  Please use --with-gawkextlib to 
supply a location for your gawkextlib build.

And after I overcome that obstacle, I get this from "make":

  /bin/sh ./libtool  --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H  -I.  
-DLOCALEDIR='"d:/usr/share/locale"' -Id:/usr/include   -g -O2 -Wall -Wextra 
-Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wshadow -MT mpfr.lo -MD 
-MP -MF .deps/mpfr.Tpo -c -o mpfr.lo mpfr.c
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. 
-DLOCALEDIR=\"d:/usr/share/locale\" -Id:/usr/include -g -O2 -Wall -Wextra 
-Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wshadow -MT mpfr.lo -MD 
-MP -MF .deps/mpfr.Tpo -c mpfr.c  -DDLL_EXPORT -DPIC -o .libs/mpfr.o
  mv -f .deps/mpfr.Tpo .deps/mpfr.Plo
  /bin/sh ./libtool  --tag=CC    --mode=link gcc  -g -O2 -Wall -Wextra 
-Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wshadow  
-module -avoid-version -no-undefined  -o mpfr.la -rpath d:/usr/lib/gawk mpfr.lo 
-lmpfr -lgmp -lgawkextlib -Ld:/usr/lib -lintl -Ld:/usr/lib -liconv -Rd:/usr/lib
  libtool: warning: '/d/usr/lib/libgmp.la' seems to be moved

  *** Warning: linker path does not have real file for library -lgawkextlib.
  *** I have the capability to make that library automatically link in when
  *** you link to this library.  But I can only do this if you have a
  *** shared version of the library, which you do not appear to have
  *** because I did check the linker path looking for a file starting
  *** with libgawkextlib but no candidates were found. (...for file magic test)

  *** Warning: libtool could not satisfy all declared inter-library
  *** dependencies of module mpfr.  Therefore, libtool will create
  *** a static module, that should work as long as the dlopening
  *** application is linked with the -dlopen flag.
  libtool: link: ar cru .libs/mpfr.a .libs/mpfr.o
  libtool: link: ranlib .libs/mpfr.a
  libtool: link: ( cd ".libs" && rm -f "mpfr.la" && cp -pR "../mpfr.la" 
"mpfr.la" )
  make[2]: Leaving directory `/d/gnu/gawkextlib/gawk-mpfr-1.1.0'
  make[1]: Leaving directory `/d/gnu/gawkextlib/gawk-mpfr-1.1.0'

That sounds like trouble, right?

This is exactly what I saw. My workaround was to put another copy of libgawkextlib-0.dll in the same place of libgawkextlib.dll.a. And the problem disappeared.


FWIW, I don't see the issue on my system, having followed the regular
installation procedure.  But don't let that stop you from discussing.


How exactly you did to avoid the issue?

Regards.
--
Manuel Collado - http://mcollado.z15.es



reply via email to

[Prev in Thread] Current Thread [Next in Thread]