SDL icon indicating copy to clipboard operation
SDL copied to clipboard

On Windows, sdl2-config should be written in something other than bash

Open SDLBugzilla opened this issue 4 years ago • 3 comments

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: don't know Reported for operating system, platform: Windows (All), All

Comments on the original bug report:

On 2020-01-18 01:03:50 +0000, Michael J. Walsh wrote:

I'd like to propose that in the Windows version of SDL, sdl2-config should be written in natively supported script system, like a batch file or Windows Script Host script.

I appreciate bash can work on Windows in wsl, cygwin, msys2 and probably others, but it's still not universally available.

On 2020-01-18 01:06:44 +0000, Michael J. Walsh wrote:

Created attachment 4169 link script to invoke cscript.exe

I'm attaching two documents:

sdl2-config.bat - a link script to invoke cscript.exe, and

sdl2-config.script - a javascript which imitates it's bash namesake. The only difference is that it assumes the prefix is the script's parent folder so if the script is in:

C:\Users\Shared\Downloads\SDL-ver2\bin

the prefix is set as

C:\Users\Shared\Downloads\SDL-ver2

On 2020-01-18 01:08:23 +0000, Michael J. Walsh wrote:

Created attachment 4170 a javascript which imitates it's bash namesake

SDLBugzilla avatar Feb 11 '21 01:02 SDLBugzilla

I think a better way to solve this would be to deprecate sdl2-config (#6140) , and recommend locating SDL via either pkg-config or CMake.

smcv avatar Aug 26 '22 09:08 smcv

Does pkg-config work in mingw Windows installations?

slouken avatar Aug 26 '22 16:08 slouken

Does pkg-config work in mingw Windows installations?

It should, but there are lots of environments that can be referred to as "mingw", because mingw is a cross-compilation target rather than a programming environment. Which one do people use?

In MSYS2 (mingw-w64) you can install it with pacman (example instructions), or use pkgconf instead (same instructions, but with pkgconf instead of pkg-config).

In Cygwin, it looks like the package named pkg-config available through Cygwin's setup.exe is actually just pkgconf in disguise anyway.

In Linux distributions that offer a mingw cross-compiler (usually mingw-w64), there should be a suitable architecture-prefixed pkg-config available (e.g. in Debian the mingw-w64-tools package is responsible for setting this up), or worst-case you can set some environment variables.

MSYS 1 or the old mingw32 I'm not sure, but they seem to be fairly dead anyway. GNOME has some old binaries in https://download.gnome.org/binaries/win32/dependencies/ if people are sufficiently desperate.

smcv avatar Aug 26 '22 17:08 smcv

sdl2-config has been deprecated and sdl3-config has never seen the day light. So I suppose it is safe to close this issue.

The only downside of using .pc files is you can't simply move install prefixes because it embeds absolute paths.

Unless we use pcfiledir, as suggested here: https://github.com/openssl/openssl/issues/13080

madebr avatar Jan 15 '23 10:01 madebr