Use pkg-config instead of sdl2-config

Resolves build issue on Arch Linux (and Arch-derivatives)

(Also forms part of a fix for Slackware-current builds)


Accepted By: echotangoecho (Arch)
Confirmed as functional by: Imarok (Ubuntu 16.04, gcc5.4), wes-fole-dog
(Parabola)
Refs: #5157
Fixes: #5152
Differential Revision: https://code.wildfiregames.com/D1582
This was SVN commit r21865.
This commit is contained in:
s0600204 2018-08-17 19:47:19 +00:00
parent ecce63628c
commit 22791af91f
2 changed files with 20 additions and 16 deletions

View File

@ -584,13 +584,14 @@ extern_lib_defs = {
if os.is("windows") then
includedirs { libraries_dir .. "sdl2/include/SDL" }
elseif not _OPTIONS["android"] then
-- Support SDL2_CONFIG for overriding the default PATH-based sdl2-config
-- Support SDL2_CONFIG for overriding the default (pkg-config sdl2)
-- i.e. on OSX where it gets set in update-workspaces.sh
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
if sdl_config_path then
pkgconfig_cflags(nil, sdl_config_path.." --cflags")
else
pkgconfig_cflags("sdl2")
end
pkgconfig_cflags(nil, sdl_config_path.." --cflags")
end
end,
link_settings = function()
@ -598,10 +599,11 @@ extern_lib_defs = {
add_default_lib_paths("sdl2")
elseif not _OPTIONS["android"] then
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
if sdl_config_path then
pkgconfig_libs(nil, sdl_config_path.." --libs")
else
pkgconfig_libs("sdl2")
end
pkgconfig_libs(nil, sdl_config_path.." --libs")
end
end,
},

View File

@ -540,13 +540,14 @@ extern_lib_defs = {
if os.istarget("windows") then
includedirs { libraries_dir .. "sdl2/include/SDL" }
elseif not _OPTIONS["android"] then
-- Support SDL2_CONFIG for overriding the default PATH-based sdl2-config
-- Support SDL2_CONFIG for overriding the default (pkg-config sdl2)
-- i.e. on OSX where it gets set in update-workspaces.sh
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
if sdl_config_path then
pkgconfig.add_includes(nil, sdl_config_path.." --cflags")
else
pkgconfig.add_includes("sdl2")
end
pkgconfig.add_includes(nil, sdl_config_path.." --cflags")
end
end,
link_settings = function()
@ -554,10 +555,11 @@ extern_lib_defs = {
add_default_lib_paths("sdl2")
elseif not _OPTIONS["android"] then
sdl_config_path = os.getenv("SDL2_CONFIG")
if not sdl_config_path then
sdl_config_path = "sdl2-config"
if sdl_config_path then
pkgconfig.add_links(nil, sdl_config_path.." --libs")
else
pkgconfig.add_links("sdl2")
end
pkgconfig.add_links(nil, sdl_config_path.." --libs")
end
end,
},