* guile-2.0.pc misses a few dependency libraries @ 2012-01-28 11:20 Eli Zaretskii 2012-01-29 23:19 ` Ludovic Courtès 0 siblings, 1 reply; 6+ messages in thread From: Eli Zaretskii @ 2012-01-28 11:20 UTC (permalink / raw) To: guile-user When statically linking programs against libguile-2.0.a, I get unresolved externals. This is on MS-Windows, but I don't think this is related to the problem. I finally traced that to the contents of guile-2.0.pc file: Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 -lm However, libguile-2.0.la shows more dependency libraries: dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid -lmsvcp60 -lcrypt -lws2_32' As you see, quite a few libraries are missing from guile-2.0.pc, and also a several libraries need to appear more than once in the link command line. Why doesn't the Guile build process put all of the libraries in the .pc file? I could easily work around this by editing guile-2.0.pc manually, but isn't this supposed to happen automatically? Any help would be appreciated. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guile-2.0.pc misses a few dependency libraries 2012-01-28 11:20 guile-2.0.pc misses a few dependency libraries Eli Zaretskii @ 2012-01-29 23:19 ` Ludovic Courtès 2012-01-30 17:02 ` Mark H Weaver 2012-01-31 16:57 ` Eli Zaretskii 0 siblings, 2 replies; 6+ messages in thread From: Ludovic Courtès @ 2012-01-29 23:19 UTC (permalink / raw) To: guile-user [-- Attachment #1: Type: text/plain, Size: 1070 bytes --] Hi Eli, Eli Zaretskii <eliz@gnu.org> skribis: > When statically linking programs against libguile-2.0.a, I get > unresolved externals. This is on MS-Windows, but I don't think this > is related to the problem. > > I finally traced that to the contents of guile-2.0.pc file: > > Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc > Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 -lm > > However, libguile-2.0.la shows more dependency libraries: > > dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid -lmsvcp60 -lcrypt -lws2_32' > > As you see, quite a few libraries are missing from guile-2.0.pc, and > also a several libraries need to appear more than once in the link > command line. Commit 58f86505d658359508732c8f187bc37d010074d0 (see below) should solve most of that, but not all, since I don’t know where -lole32, and -lregex come from, for example. Can you try it and report back? Thanks! Ludo’. [-- Attachment #2: Type: text/x-patch, Size: 1189 bytes --] commit 58f86505d658359508732c8f187bc37d010074d0 (HEAD, refs/remotes/origin/stable-2.0, refs/heads/stable-2.0) Author: Ludovic Courtès <ludo@gnu.org> Date: Mon Jan 30 00:17:34 2012 +0100 Augment `Libs.private' with for non-GNU platforms. Reported by Eli Zaretskii <eliz@gnu.org>. * meta/guile-2.0.pc.in (Libs.private): Add all the optional libraries that may be pulled via Gnulib on non-GNU platforms. Modified meta/guile-2.0.pc.in diff --git a/meta/guile-2.0.pc.in b/meta/guile-2.0.pc.in index ecca778..1bda734 100644 --- a/meta/guile-2.0.pc.in +++ b/meta/guile-2.0.pc.in @@ -15,5 +15,8 @@ Name: GNU Guile Description: GNU's Ubiquitous Intelligent Language for Extension Version: @GUILE_VERSION@ Libs: -L${libdir} -lguile-@GUILE_EFFECTIVE_VERSION@ @BDW_GC_LIBS@ -Libs.private: @LIB_CLOCK_GETTIME@ @LIBGMP@ @LIBLTDL@ @LIBFFI_LIBS@ @GUILE_LIBS@ +Libs.private: @LIB_CLOCK_GETTIME@ @LIBGMP@ @LIBLTDL@ @LIBFFI_LIBS@ \ + @LIBUNISTRING@ @GUILE_LIBS@ @LIBICONV@ @LIBINTL@ @LIBSOCKET@ \ + @SERVENT_LIB@ @HOSTENT_LIB@ @GETADDRINFO_LIB@ @INET_NTOP_LIB@ \ + @INET_PTON_LIB@ Cflags: -I${pkgincludedir}/@GUILE_EFFECTIVE_VERSION@ @GUILE_CFLAGS@ @BDW_GC_CFLAGS@ ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: guile-2.0.pc misses a few dependency libraries 2012-01-29 23:19 ` Ludovic Courtès @ 2012-01-30 17:02 ` Mark H Weaver 2012-01-30 17:10 ` Ludovic Courtès 2012-01-31 16:57 ` Eli Zaretskii 1 sibling, 1 reply; 6+ messages in thread From: Mark H Weaver @ 2012-01-30 17:02 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user ludo@gnu.org (Ludovic Courtès) writes: > Eli Zaretskii <eliz@gnu.org> skribis: > >> When statically linking programs against libguile-2.0.a, I get >> unresolved externals. This is on MS-Windows, but I don't think this >> is related to the problem. >> >> I finally traced that to the contents of guile-2.0.pc file: >> >> Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc >> Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib >> d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 >> -lm >> >> However, libguile-2.0.la shows more dependency libraries: >> >> dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl >> -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid >> -lmsvcp60 -lcrypt -lws2_32' >> >> As you see, quite a few libraries are missing from guile-2.0.pc, and >> also a several libraries need to appear more than once in the link >> command line. > > Commit 58f86505d658359508732c8f187bc37d010074d0 (see below) should solve > most of that, but not all, since I don’t know where -lole32, and -lregex > come from, for example. It seems to me that adding a fixed list of indirect dependencies to guile-2.0.pc.in is the wrong approach, because the indirect dependencies may depend on the platform, as well as the specific versions/variants of any of the direct or indirect dependencies. How do other programs that use 'pkg-config' deal with this issue? Are they all broken in this way? If we really need the full list of indirect dependencies, maybe we should somehow extract it from the generated .la file? Thanks, Mark > commit 58f86505d658359508732c8f187bc37d010074d0 (HEAD, refs/remotes/origin/stable-2.0, refs/heads/stable-2.0) > Author: Ludovic Courtès <ludo@gnu.org> > Date: Mon Jan 30 00:17:34 2012 +0100 > > Augment `Libs.private' with for non-GNU platforms. > > Reported by Eli Zaretskii <eliz@gnu.org>. > > * meta/guile-2.0.pc.in (Libs.private): Add all the optional libraries > that may be pulled via Gnulib on non-GNU platforms. > > Modified meta/guile-2.0.pc.in > diff --git a/meta/guile-2.0.pc.in b/meta/guile-2.0.pc.in > index ecca778..1bda734 100644 > --- a/meta/guile-2.0.pc.in > +++ b/meta/guile-2.0.pc.in > @@ -15,5 +15,8 @@ Name: GNU Guile > Description: GNU's Ubiquitous Intelligent Language for Extension > Version: @GUILE_VERSION@ > Libs: -L${libdir} -lguile-@GUILE_EFFECTIVE_VERSION@ @BDW_GC_LIBS@ > -Libs.private: @LIB_CLOCK_GETTIME@ @LIBGMP@ @LIBLTDL@ @LIBFFI_LIBS@ @GUILE_LIBS@ > +Libs.private: @LIB_CLOCK_GETTIME@ @LIBGMP@ @LIBLTDL@ @LIBFFI_LIBS@ \ > + @LIBUNISTRING@ @GUILE_LIBS@ @LIBICONV@ @LIBINTL@ @LIBSOCKET@ \ > + @SERVENT_LIB@ @HOSTENT_LIB@ @GETADDRINFO_LIB@ @INET_NTOP_LIB@ \ > + @INET_PTON_LIB@ > Cflags: -I${pkgincludedir}/@GUILE_EFFECTIVE_VERSION@ @GUILE_CFLAGS@ @BDW_GC_CFLAGS@ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guile-2.0.pc misses a few dependency libraries 2012-01-30 17:02 ` Mark H Weaver @ 2012-01-30 17:10 ` Ludovic Courtès 0 siblings, 0 replies; 6+ messages in thread From: Ludovic Courtès @ 2012-01-30 17:10 UTC (permalink / raw) To: Mark H Weaver; +Cc: guile-user Hi, Mark H Weaver <mhw@netris.org> skribis: > ludo@gnu.org (Ludovic Courtès) writes: > >> Eli Zaretskii <eliz@gnu.org> skribis: >> >>> When statically linking programs against libguile-2.0.a, I get >>> unresolved externals. This is on MS-Windows, but I don't think this >>> is related to the problem. >>> >>> I finally traced that to the contents of guile-2.0.pc file: >>> >>> Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc >>> Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib >>> d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 >>> -lm >>> >>> However, libguile-2.0.la shows more dependency libraries: >>> >>> dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl >>> -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid >>> -lmsvcp60 -lcrypt -lws2_32' >>> >>> As you see, quite a few libraries are missing from guile-2.0.pc, and >>> also a several libraries need to appear more than once in the link >>> command line. >> >> Commit 58f86505d658359508732c8f187bc37d010074d0 (see below) should solve >> most of that, but not all, since I don’t know where -lole32, and -lregex >> come from, for example. > > It seems to me that adding a fixed list of indirect dependencies to > guile-2.0.pc.in is the wrong approach, because the indirect dependencies > may depend on the platform, as well as the specific versions/variants of > any of the direct or indirect dependencies. For the record, most of those added in 58f86505d658359508732c8f187bc37d010074d0 are empty on GNU systems, for instance. So it’s really an OS-dependent list. > How do other programs that use 'pkg-config' deal with this issue? > Are they all broken in this way? Yes, AFAIK. > If we really need the full list of indirect dependencies, maybe we > should somehow extract it from the generated .la file? That sounds right, but slightly nasty. Keep in mind that the only issue could be for users linking without Libtool, and in the even that ‘Libs.private’ is outdated compared to what the actual dependency list. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guile-2.0.pc misses a few dependency libraries 2012-01-29 23:19 ` Ludovic Courtès 2012-01-30 17:02 ` Mark H Weaver @ 2012-01-31 16:57 ` Eli Zaretskii 2012-01-31 17:56 ` Ludovic Courtès 1 sibling, 1 reply; 6+ messages in thread From: Eli Zaretskii @ 2012-01-31 16:57 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user > From: ludo@gnu.org (Ludovic Courtès) > Date: Mon, 30 Jan 2012 00:19:40 +0100 > > > I finally traced that to the contents of guile-2.0.pc file: > > > > Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc > > Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 -lm > > > > However, libguile-2.0.la shows more dependency libraries: > > > > dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid -lmsvcp60 -lcrypt -lws2_32' > > > > As you see, quite a few libraries are missing from guile-2.0.pc, and > > also a several libraries need to appear more than once in the link > > command line. > > Commit 58f86505d658359508732c8f187bc37d010074d0 (see below) should solve > most of that, but not all It solves all of them, thanks. > I don’t know where -lole32, and -lregex come from, for example. "-lregex" is needed by regex-posix.c (naturally ;-), since the default Windows libraries do not include regcomp, regexec, etc. There's a test in configure that first check the standard library link, then "-lregex" and "-lrx". However, @GUILE_LIBS@ already gets edited to include -lregex, so there's no problems here. "-lole32" (and a few others) come from libregex.la. However, the standard link command for the program I'm building (GNU Make, btw) already includes these libraries even without Guile, so using your modified guile-2.0.pc.in, I was able to link the program successfully with no unresolved externals. Btw, shouldn't guile-2.0-uninstalled.pc.in get the same changes? Thanks! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: guile-2.0.pc misses a few dependency libraries 2012-01-31 16:57 ` Eli Zaretskii @ 2012-01-31 17:56 ` Ludovic Courtès 0 siblings, 0 replies; 6+ messages in thread From: Ludovic Courtès @ 2012-01-31 17:56 UTC (permalink / raw) To: Eli Zaretskii; +Cc: guile-user Hi Eli, Eli Zaretskii <eliz@gnu.org> skribis: >> From: ludo@gnu.org (Ludovic Courtès) >> Date: Mon, 30 Jan 2012 00:19:40 +0100 >> >> > I finally traced that to the contents of guile-2.0.pc file: >> > >> > Libs: -L${libdir} -lguile-2.0 -Ld:/usr/lib -lgc >> > Libs.private: d:/usr/lib/libgmp.dll.a -Ld:/usr/lib d:/usr/lib/libltdl.dll.a -Ld:/usr/lib -lffi -lregex -lcrypt -lws2_32 -lm >> > >> > However, libguile-2.0.la shows more dependency libraries: >> > >> > dependency_libs=' -lgc -lffi -lunistring -liconv -lregex -lintl -liconv -lgmp -ltdl -lregex -lintl -lwsock32 -lole32 -luuid -lmsvcp60 -lcrypt -lws2_32' >> > >> > As you see, quite a few libraries are missing from guile-2.0.pc, and >> > also a several libraries need to appear more than once in the link >> > command line. >> >> Commit 58f86505d658359508732c8f187bc37d010074d0 (see below) should solve >> most of that, but not all > > It solves all of them, thanks. Even better than expected. :-) >> I don’t know where -lole32, and -lregex come from, for example. > > "-lregex" is needed by regex-posix.c (naturally ;-), since the default > Windows libraries do not include regcomp, regexec, etc. There's a > test in configure that first check the standard library link, then > "-lregex" and "-lrx". > > However, @GUILE_LIBS@ already gets edited to include -lregex, so > there's no problems here. > > "-lole32" (and a few others) come from libregex.la. However, the > standard link command for the program I'm building (GNU Make, btw) > already includes these libraries even without Guile, so using your > modified guile-2.0.pc.in, I was able to link the program successfully > with no unresolved externals. Great! > Btw, shouldn't guile-2.0-uninstalled.pc.in get the same changes? Yes, you’re right. Fixed in 7e9a301b7f3bcc811803305250b22d71a8b06155. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-31 17:56 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-01-28 11:20 guile-2.0.pc misses a few dependency libraries Eli Zaretskii 2012-01-29 23:19 ` Ludovic Courtès 2012-01-30 17:02 ` Mark H Weaver 2012-01-30 17:10 ` Ludovic Courtès 2012-01-31 16:57 ` Eli Zaretskii 2012-01-31 17:56 ` Ludovic Courtès
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).