-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Consider adding pkg-config .pc files for included versions #2387
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
Comments
I actually don't know enough about pkg-config to follow this. But I would be ok with including files in emscripten that are useful for various build systems, like we have for cmake and scons, so long as we have a test in place to keep them from breaking. |
They're mostly dummy stubs, without them autoconf and configure will attempt (on for example cairo's build) to try and individual detect -llibpng, -lSDL, -lzlib, etc and fail. Here's the stubs I have, if you add these files to system/lib/pkgconfig directory pkg-config behaves properly without any intervention from the user, as you can see from the stubs it doesn't add anything to the compile, but gives configure/autoconf confidence that they exist and will just compile when needed. You can test this on cairo-1.12, if you download it and run emconfigure ./configure it will fail not finding the required (built in) libraries such as libpng, zlib, sdl, etc. If you have these .pc files in the system/lib/pkgconfig within your emscripten root the configure finishes fine (and more importantly cairo builds correctly and runs correctly). You can test if the files have been included with emconfigure pkg-config --list-all you should see a list of all the built-in packages for emscripten. There may be other stubs that could be added, but these are all the stubs I need. One thing, <emscripten path??> needs to be replaced with the installed path of emscripten's system root. I'm not sure how to automatically do this but could be part of the installation ?.. === BEGIN glesv2.pc Name: glesv2 Requires: ==== BEGIN libpng.pc Name: libpng Requires: ==== BEGIN egl.pc Name: egl Requires: ==== BEGIN zlib.pc Name: zlib Requires: ==== BEGIN sdl.pc Name: sdl Requires: |
E.g., the prefix= in all of the .pc files needs to be set to the path of emscripten/version/system |
Actually I just tested this and the prefix can be set to something completely ridiculous such as /usr/blah/blah, the included directory would be /usr/blah/blah/lib and not affect the build at all, but allow you to get past the configure checks quickly. pkg-config is very helpful for libraries and if emscripten ever plans to support shared libraries it will be very helpful in managing dependencies and installing user-compiled libraries. Hypothetically installed .BC files could be used as "shared libraries" then pulled in for the final build with everything managed through pkg-config and existing package management tools. |
Sounds good to me. Again, I don't understand autotools at all. But a pull request with this stuff + tests would be welcome. |
trevorlinton: do you plan to work on this? I just ran into similar issues with my autotools project with PKG_CHECK_MODULES failing on SDL for emscripten builds. It would definitely be helpful for all projects relying on pkg-config. |
@sronsee, i'm not - if you'd like to take a swing at it i'm sure the community would appreciate it! |
@trevorlinton, @kripken : now working on this. |
@trevorlinton, @kripken: created #2486 |
Hi, and thanks for the nice work! I wanted to create a new issue about Emscripten provides I am not very familiar with CMake, but I guess creating |
I confirm it would be nice to have when your project's configure.ac uses PKG_CHECK_MODULES :) |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
I believe this can be merged with #8650 |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Still worth pursuing I think |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
bump |
I manually need to recreate these for each upgrade of emscripten, it would be helpful to have them included by default. It helps (VASTLY HELPS) configure scripts to complete without errors and configure accurately.
(and any other included libraries with emscripten's build).
This would be a huge improvement and very low effort.
The text was updated successfully, but these errors were encountered: