libsdl-org / SDL_image

Image decoding for many popular formats for Simple Directmedia Layer.
zlib License
513 stars 174 forks source link

Autotools: Allow selecting a specific libjpeg SONAME #434

Closed smcv closed 4 months ago

smcv commented 4 months ago

It is possible to have multiple dynamic shared libraries for libjpeg, for example in the Steam Runtime 1 'scout' SDK, which has development headers and a runtime library for libjpeg-turbo (installed as libjpeg.so.8), but also has the runtime library for IJG libjpeg 6b (installed as libjpeg.so.62). Allow an invocation like

./configure --enable-jpg-shared=libjpeg.so.8 ...

to force the use of a specific SONAME.

Resolves: https://github.com/libsdl-org/SDL_image/issues/433

sezero commented 4 months ago

Can we please expand this to cover other --enable-XXX-shared ?

smcv commented 4 months ago

See https://github.com/libsdl-org/SDL_image/issues/433#issuecomment-1989302519 for notes on why this is the way it is.

smcv commented 4 months ago

Can we please expand this to cover other --enable-XXX-shared ?

For avif, jxl, png and tif: yes if you want, but I'm not really convinced it's worth it just for symmetry. As far as I know, all of these libraries only have one implementation, which is numbered in a straightforward integer sequence (no 62 meaning 6.2).

For webp: not trivially, we'd have to add a second option, and I'd prefer not to get into that for a stable-branch bug-fix, particularly when Autotools is on its way out (present in 2.x but deleted from 3.x).

sezero commented 4 months ago

@slouken ?

smcv commented 4 months ago

For avif, jxl, png and tif: yes if you want, but I'm not really convinced it's worth it just for symmetry.

I added a commit to give these libraries the same treatment, which you can take or not take as you prefer. I'd personally suggest not cherry-picking this one to 2.8.x.

slouken commented 4 months ago

Merged and the JPEG library fix is merged to release-2.8.x.