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

[SDL2] Use pre-built avif/libjxl libraries in autotools configuration #484

Closed
madebr opened this issue Dec 6, 2024 · 6 comments
Closed

Comments

@madebr
Copy link
Contributor

madebr commented Dec 6, 2024

The autotools detects libavif/libjx using pkg-config and custom build tests here:

SDL_image/configure.ac

Lines 310 to 320 in 251cdd8

PKG_CHECK_MODULES([LIBAVIF], [libavif >= 0.9.3], [dnl
have_avif_hdr=yes
have_avif_lib=yes
have_avif_pc=yes
], [dnl
save_LIBS="$LIBS"
LIBS="-lavif"
AC_LANG_PUSH([C])
AC_MSG_CHECKING([for libavif >= 0.9.3])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <avif/avif.h>

Is it possible to re-use the pre-built win32 binaries in VisualC/external?

Configuring with LIBAVIF_CFLAGS=/path/to/SDL2_image/VisualC/external/include LIBAVIF_LDFLAGS= does still fail the libavif tests.

@sezero

@slouken
Copy link
Collaborator

slouken commented Dec 6, 2024

FYI, this is a blocker for an SDL_image release, so we should resolve this.

@madebr
Copy link
Contributor Author

madebr commented Dec 6, 2024

Creating import libraries, and configuring with 'LIBAVIF_CFLAGS=-I/home/maarten/projects/SDL_image/VisualC/external/include' 'LIBAVIF_LDFLAGS=-L/home/maarten/projects/SDL_image/VisualC/external/optional/x86' also does not work

avif-implibs.tar.gz

I created the implibs using:

x86_64-w64-mingw32-dlltool --input-def libavif-16.def --output-lib libavif.dll.a
i686-w64-mingw32-dlltool --input-def libavif-16.def --output-lib libavif.dll.a

@madebr
Copy link
Contributor Author

madebr commented Dec 7, 2024

I think I got it working with:

        "LDFLAGS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBAVIF_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBAVIF_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBWEBPDEMUX_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBWEBPDEMUX_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBWEBP_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBWEBP_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"

@sezero
Copy link
Contributor

sezero commented Dec 7, 2024

I think I got it working with:

        "LDFLAGS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBAVIF_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBAVIF_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBWEBPDEMUX_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBWEBPDEMUX_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"
        "LIBWEBP_CFLAGS=-I/src/SDL_image/VisualC/external/include"
        "LIBWEBP_LIBS=-L/src/SDL_image/VisualC/external/optional/x86"

Yes, that should work I think

FYI, this is a blocker for an SDL_image release, so we should resolve this.

Why is this a blocker? Are the sdl2 branch releases going to be made through CI artifacts?

@sezero
Copy link
Contributor

sezero commented Dec 7, 2024

FYI, this is a blocker for an SDL_image release, so we should resolve this.

P.S.: The actual blocker is #450 (tests failing against libjxl >= 0.10.0), which I think we should ask libjxl guys for help

@madebr
Copy link
Contributor Author

madebr commented Dec 7, 2024

Yes, that should work I think

It works! Proven by ci :)

FYI, this is a blocker for an SDL_image release, so we should resolve this.

Why is this a blocker? Are the sdl2 branch releases going to be made through CI artifacts?

Yes, I've backported the scripts from the main branch, now using autotools.

It was a blocker because without it, the mingw binaries would be built without avif/webp/tiff support.

@madebr madebr closed this as completed Dec 7, 2024
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