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

When linking with library flags generated by pkg-config, the -ljpeg flag is duplicated #153

Closed
georgestagg opened this issue Dec 13, 2023 · 1 comment

Comments

@georgestagg
Copy link

georgestagg commented Dec 13, 2023

See discussion in #152 for more context. The short version is that duplicated link flags fails when building for webR/Wasm with Emscripten.


In the package's configure script, pkg-config is used to find libjpeg,

PKG_CONFIG_NAME="freetype2 libpng libtiff-4 libjpeg"

but later, the -ljpeg flag is also manually appended,

ragg/configure

Lines 37 to 39 in 792c1e1

echo "Found pkg-config cflags and libs!"
PKG_CFLAGS=${PKGCONFIG_CFLAGS}
PKG_LIBS="${PKGCONFIG_LIBS} -ljpeg"

If we are relying on pkg-config and the existence of jpeg.pc, can we remove the additional -ljpeg?

Alternatively, should fa87a16 be reverted? The argument for that is that older versions of libjpeg did not install a jpeg.pc for pkg-config to use.

I don't particularly mind which of the two solutions we land on.

@georgestagg georgestagg changed the title When linking with library flags generated by pkg-confg, the -ljpeg flag is duplicated When linking with library flags generated by pkg-config, the -ljpeg flag is duplicated Dec 13, 2023
@jeroen
Copy link
Member

jeroen commented Dec 13, 2023

As I am listed as the official author of this particular script, I'll use my executive powers here :)

I checked a few old linux distros and all of them install the libjpeg-turbo drop-in replacement instead of the original libjpeg implementation when you install libjpeg-dev or libjpeg-devel . The libjpeg-turbo library has always included a proper libjpeg.pc, so therefore requiring this is probably fine these days (otherwise we would have heard about it by now).

@jeroen jeroen closed this as completed in a62becc Dec 13, 2023
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

2 participants