We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4399

Summary: Please make sdl2-config optional to install
Product: SDL Reporter: Hugh McMaster <hugh.mcmaster>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: hugh.mcmaster
Version: 2.0.8   
Hardware: All   
OS: Linux   
Attachments: Disable installation of sdl2-config by default
Make installation of sdl2-config optional

Description Hugh McMaster 2018-11-24 11:25:50 UTC
Hi,

sdl2-config causes problems when cross-compiling, as it doesn't support multi-arch systems, such as those used by Debian and Ubuntu. (Debian uses /usr/lib/<gnu-triplet> paths to store development files for different architectures.)

pkg-config is much better at supporting cross-compiling. Plus, pkg-config is comfortably available on all systems these days.

Can you please deprecate sdl2-config? Or, at least, make it optional to install via a configure flag?

If you need a patch for this, I can generate one for you.

Thank you
Comment 1 Hugh McMaster 2019-03-28 10:56:11 UTC
Created attachment 3715 [details]
Disable installation of sdl2-config by default

The attached patch disables the installaiton of sdl2-config by default.

Packagers wishing to ship sdl2-config should pass --enable-sdl2-config to configure.
Comment 2 Sam Lantinga 2019-04-02 12:35:03 UTC
I'd much rather improve sdl2-config so that it works correctly with multi-arch systems. It's still used by a bunch of projects and SDL examples, so I don't want to remove it by default.

A patch to prefer PKG_CONFIG over sdl2-config in sdl.m4 would be fine as well, if that takes care of the problem you're trying to solve.
Comment 3 Hugh McMaster 2019-04-03 12:28:38 UTC
(In reply to Sam Lantinga from comment #2)
> I'd much rather improve sdl2-config so that it works correctly with
> multi-arch systems. It's still used by a bunch of projects and SDL examples,
> so I don't want to remove it by default.

To be honest, I'm not sure sdl2-config can ever be multi-arch co-installable, as @libdir@ will always cause a file conflict on Debian-based systems.

Removing the libdir paths would fix this, but such a change is probably unwanted.

> A patch to prefer PKG_CONFIG over sdl2-config in sdl.m4 would be fine as
> well, if that takes care of the problem you're trying to solve.

Would you support a patch that installs sdl2-config by default, but allows the user to prevent its installation by passing --disable-sdl2-config (or --enable-sdl2-config=no) to configure?

I'm also happy to look at patching sdl.m4 as well.
Comment 4 Hugh McMaster 2019-04-08 10:54:49 UTC
Created attachment 3738 [details]
Make installation of sdl2-config optional

Hi Sam,

I've altered the patch so users can disable the installation of sdl2-config if desired.

sdl2-config is installed by default if no flag is passed to configure.
Comment 5 Hugh McMaster 2019-04-08 10:55:23 UTC
sdl.m4 already prefers pkg-config over sdl2-config, so there is no need to patch that macro file.
Comment 6 Sam Lantinga 2019-04-23 14:43:25 UTC
Looks good, thanks!
https://hg.libsdl.org/SDL/rev/8ed803255020