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: Eli Zaretskii
Subject: Re: Avoid gawkextlib as a separate shared library
Date: Wed, 18 May 2022 14:43:28 +0300

> Cc: aschorr@telemetry-investments.com, bug-gawk@gnu.org
> From: Manuel Collado <mcollado2011@gmail.com>
> Date: Wed, 18 May 2022 09:39:48 +0200
> 
> > 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.

The above is unrelated to the issue at hand: it happened because
initially I had no gawkextlib installed _at_all_, and I tried to
overcome the error message shown by the configure script by copying
just the gawkextlib.h header from the Git repository to the system
include directory (because I didn't realize some other library needs
to be installed for gawk-mpfr to build correctly, I though it was just
a missing header file).

Once I've built and installed gawkextlib, per Andy's subsequent and
more detailed instructions, that problem never happened, because "make
install" in the gawkextlib tree installed the DLL, the import library
and the header file correctly.

Why you saw this problem after building and installing gawkextlib, I
cannot imagine.

> My workaround was to put another copy of libgawkextlib-0.dll in the
> same place of libgawkextlib.dll.a. And the problem disappeared.

That shouldn't be needed, and is also incorrect: the DLL should only
be in the $prefix/bin directory.

> > 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?

I did nothing special, I just said "make install".



reply via email to

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