-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generate libpng.pc, zlib.pc if needed #28906
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:3
The biggest question I here is how to find the full path to I don't quite know: I can link an executable with libz and analyse it with |
Commit: |
Author: Dima Pasechnik |
Branch: u/dimpase/packages/missingpcs |
comment:5
You can use a minimal pkgconfig file like below which doesn't require the full path to the library.
|
comment:6
well, a minimal pkgconfig like this would be just a bug in waiting to bite. I can think of one platform-independent way (well, it needs dladdr, which is non-POSIX, but BSD, something that is available on most Unices, certainly on Linux and MacOS) Write a C function that calls |
comment:8
Could someone please try if the following works on MacOS, and if yes, what's the output
|
comment:9
Replying to @dimpase:
|
comment:10
I suggest linking the executable |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:13
This branch is so far only for zlib.pc Any obvious things I missed? Naturally, I'd appreciate it tested on MacOS. For libpng.pc I'll probably refactor that, to make computing abstolute path to libpng/libz/libWhatever a macro. |
comment:15
this is a result - ugly as hell. I am not sure whether this should get in. |
comment:17
Replying to @dimpase:
Would it though? Why exactly do we require pkgconfig here at all? It's a convenience sure, but on systems that don't install .pc files for some libraries we can still get the required information another way... I mean, if autoconf could detect a system zlib in the first place, then I don't see why would need the absolute path to the SO file itself. All that should be needed to link against that library are whatever compiler/linker flags (e.g. |
comment:18
Replying to @embray:
I am thinking of a library trying to detect zlib by calling pkg-config rather than IMHO it's better not to install a pc file at all rather than install a rather bogus one. That's why I prefer how it's done on #28883.
|
comment:19
It's not necessarily "bogus". But I agree--I think what you did in #28883 is more in line with what I was trying to say here. |
comment:20
I don't see the difference in #28883 and a minimal .pc file as in #28906 comment:5 . They do the same thing. |
comment:21
Replying to @isuruf:
yes, but they do so by different means, and a pc file is much more likely to trip up someone. |
comment:22
I don't know if this ticket is still needed; but if it is, then it should be revised along the lines of #29082 -- do not write into SAGE_LOCAL at configure time; instead generate a rule in build/make/Makefile that generates the pc file there. |
comment:23
I don't recall right now all the details, why I thought it's needed. Anyhow, perhaps as a concept of how to generate *.pc files, e.g. for openblas. |
libpng.pc, gdlib.pc, zlib.pc
etcare needed in the calls of
pkgconfig.parse
insrc/module_list.py
some perfectly fine implementations of
zlib
etc. don't installzlib.pc
etc. (e.g. MacOS does not).Since #26286 this problem was sleeping, until we updated
pkgconfig
on #28883, which made it throw an error on absense ofzlib.pc
.This ticket provides generation of
zlib.pc
andlibpng.pc
, among with some fly-by refactoring.CC: @kiwifb @embray @isuruf @mkoeppe
Component: build: configure
Author: Dima Pasechnik
Branch/Commit: u/dimpase/packages/missingpcs @
ba7d963
Issue created by migration from https://trac.sagemath.org/ticket/28906
The text was updated successfully, but these errors were encountered: