Comments (10)
I tried to simulate this by putting libjpeg-turbo and ijg libraries in the same place, like:
$ ls -l ~/x2/lib/*
total 1200
lrwxrwxrwx. 1 ozkan ozkan 16 Mar 11 21:26 libjpeg.so -> libjpeg.so.9.6.0
lrwxrwxrwx. 1 ozkan ozkan 17 Mar 11 21:28 libjpeg.so.62 -> libjpeg.so.62.0.0
-rwxr-xr-x. 1 ozkan ozkan 291256 Dec 10 2013 libjpeg.so.62.0.0
lrwxrwxrwx. 1 ozkan ozkan 16 Mar 11 21:26 libjpeg.so.9 -> libjpeg.so.9.6.0
-rwxr-xr-x. 1 ozkan ozkan 929643 Mar 11 21:26 libjpeg.so.9.6.0
drwxrwxr-x. 2 ozkan ozkan 4096 Mar 11 21:26 pkgconfig
.. and then, configuring SDL_image like LDFLAGS=-L~/x2/lib ../configure --disable-stb-image
gives me -- dynamic libjpeg -> libjpeg.so.62
When both are present:
- Which one do the headers actually belong?
- Which one does configure pick for you? and ..
- which one do you really want?
from sdl_image.
Linking a project with -ljpeg
will select libjpeg.so
-> libjpeg.so.9.6.0
. So the headers (should) belong to 9.6.0.
CMake selects the correct library by following the symbolic links and then looking in the same directory for other files linking to libjpeg.so.9.6.0
, of which it selects libjpeg.so.9
.
libjpeg.so
-> libjpeg.so.9.6.0
-> libjpeg.so.9
.
from sdl_image.
- [To] Which one do the headers actually belong?
In my reproducer, libjpeg.so.8
.
- Which one does configure pick for you?
libjpeg.so.62
(I think because 62 is more than 8, even though actually it's a strange way of writing 6b and is semantically more like 6.2)
- which one do you really want?
Whichever one the headers and the libjpeg.so
symlink belong to, which in my case is libjpeg.so.8
.
from sdl_image.
That's a fundamental deficiency of find_lib
. Do we not have a way of following lib*.so
symlinks by common shell tools?
from sdl_image.
For my use-case, it would be enough to have a configure option or an AC_ARG_VAR
that lets me say "don't auto-detect, I'll tell you the right answer: it is libjpeg.so.8
".
from sdl_image.
For my use-case, it would be enough to have a configure option or an
AC_ARG_VAR
that lets me say "don't auto-detect, I'll tell you the right answer: it islibjpeg.so.8
".
That actually sounds like a good solution to me
from sdl_image.
Do we not have a way of following
lib*.so
symlinks by common shell tools?
Messing with readlink
result might help with this?
from sdl_image.
Messing with
readlink
result might help with this?
It might be better not to make this critical-path for SDL 2.8.x.
from sdl_image.
Let's go with your AC_ARG_WITH solution then (but we should make it for every lib-to-be-detected in there.) Do you have a patch?
from sdl_image.
#434 does this for libjpeg, by overloading --enable-jpg-shared
to take three classes of value:
- literal
no
: link libjpeg in the normal way (not using dlopen), as is done in e.g. Debian - literal
yes
: auto-detect what to dlopen - anything else: dlopen that SONAME
In practice, I think libjpeg is the only one of the libraries we link that has multiple competing implementations, and also the only one where the highest number is not necessarily the "best".
We could extend the same treatment to avif, jxl, png, tif relatively easily.
We cannot easily do the same thing for webp, because webp dlopens two libraries, not just one - so we'd have to invent a new --enable-webpdemux-shared=SONAME
or something. I'd prefer not to get into that for 2.x, and certainly not for 2.8.x.
For 3.x, Autotools has gone away completely, which is part of why I don't think it's necessarily worth investing a whole lot of effort in it.
from sdl_image.
Related Issues (20)
- Build libavif with encoding support on Windows HOT 33
- longjmp/setjmp clobbered warning in IMG_png.c HOT 24
- upgrading libjpeg to 9f HOT 1
- [Cmake] [SDL2] Backport SDL3IMAGE_STRICT option to SDL2_image HOT 3
- cmake build: SDL2IMAGE_DEPS_SHARED option doesn't work HOT 3
- libwebp simd code not properly built with Cmake build system HOT 10
- SEGMENTATION FAULT with IMG_Load_RW in SDL2 HOT 4
- Build fails on MSYS2 HOT 4
- Failure to build SDL3_image HOT 4
- [2.8.x] Double-free if IMG_SaveJPG_RW_jpeglib() fails and IMG_SaveJPG_RW_tinyjpeg() is tried HOT 4
- Failing to save a JPEG with libjpeg crashes when it uses an uninitialized jmp_buf HOT 1
- Factor out the parts of IMG_LoadJPG_RW where locals can be clobbered by setjmp()/longjmp()
- `SDL_RWops_renamed_SDL_IOStream` with latest SDL3 commit
- Create SDL3 stub library (.tbd) for use by the xcode projects of SDL satellite libraries
- CMake configure error on install with libavif with FetchContent on main (for SDL3) HOT 1
- Statically linking an executable with JPEG XL enabled breaks the build at link time HOT 2
- Build failed: too few arguments to function ‘SDL_CreateWindowAndRenderer’ HOT 1
- CI: macos ninja setup failure HOT 12
- jpeg-xl test have been failing on macos HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl_image.