From 22791af91ff9dccca374fc0e28ca22a77db5cfff Mon Sep 17 00:00:00 2001 From: s0600204 Date: Fri, 17 Aug 2018 19:47:19 +0000 Subject: [PATCH] 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. --- build/premake/extern_libs4.lua | 18 ++++++++++-------- build/premake/extern_libs5.lua | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/build/premake/extern_libs4.lua b/build/premake/extern_libs4.lua index ca83a6b492..fed12dafaf 100644 --- a/build/premake/extern_libs4.lua +++ b/build/premake/extern_libs4.lua @@ -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, }, diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua index 6807dc7e0a..362aa32bf8 100644 --- a/build/premake/extern_libs5.lua +++ b/build/premake/extern_libs5.lua @@ -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, },