Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Consider adding pkg-config .pc files for included versions #2387
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.
This would be a huge improvement and very low effort.
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
==== BEGIN libpng.pc
==== BEGIN egl.pc
==== BEGIN zlib.pc
==== BEGIN sdl.pc
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.
Hi, and thanks for the nice work! I wanted to create a new issue about
I am not very familiar with CMake, but I guess creating