Skip to content
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

Drop pkg-config for static libs #68

Closed
ljbade opened this issue Feb 3, 2015 · 4 comments
Closed

Drop pkg-config for static libs #68

ljbade opened this issue Feb 3, 2015 · 4 comments

Comments

@ljbade
Copy link
Contributor

ljbade commented Feb 3, 2015

For all the statically linked libs we should stop using pkg-config becuase most libraries do not provide a valid .pc file for static linking.

See http://stackoverflow.com/questions/27586503/how-to-use-pkg-config-to-link-a-library-statically

Currently I am seeing link commnads with a mix of static and dynamic link flags for the same library. This is just asking for trouble, no to mention a missing symbol will result in a run-time error instead of a compile time error - I have hit this many times on Android.

@kkaefer Said pkg-config is needed for GLFW, so assuming they maintain a valid .pc we can leave that lib alone.

@springmeyer
Copy link
Contributor

I'm on board with reducing dependence on pkg-config wherever possible (#12). But GLFW is certainly a case we should keep pkg-config around for.

@kkaefer
Copy link
Contributor

kkaefer commented Feb 4, 2015

An example of a package that seems broken is curl and openssl:

'openssl_static_libs%': ['/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/openssl/1.0.1l/lib/libssl.a'],
'openssl_cflags%': ['-I/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/openssl/1.0.1l/include'],
'openssl_ldflags%': ['-L/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/openssl/1.0.1l/lib', '-lssl', '-lcrypto', '-ldl'],
'curl_static_libs%': ['/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/libcurl/7.40.0/lib/libcurl.a'],
'curl_cflags%': ['-DCURL_STATICLIB', '-I/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/libcurl/7.40.0/include'],
'curl_ldflags%': ['-L/Users/kkaefer/Code/gl/native/mason_packages/android-arm-v5-9/libcurl/7.40.0/lib', '-lcurl', '-lssl', '-lcrypto', '-lssl', '-lcrypto', '-lz'],

You'll see that the ldflags contain other libs as well, even though they should be folded into the static archives.

@springmeyer
Copy link
Contributor

springmeyer commented Nov 10, 2016

Closing. The motivation for this ticket was solved by using mason.cmake to avoid a runtime dependency on pkg-config after mapbox/mapbox-gl-native#5359

@kkaefer
Copy link
Contributor

kkaefer commented Nov 11, 2016

In particular, this is solved by including a mason.ini file in packages to avoid calling the original packages build system in #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants