From 1144490ff727f942fcce2549c5f0277990635b9a Mon Sep 17 00:00:00 2001 From: def Date: Sat, 15 Jul 2017 16:26:05 +0200 Subject: [PATCH] Only use opusfile+opus+ogg from one source at the same time to prevent linking problems (fixes #793) --- bam.lua | 6 --- other/opus/ogg.lua | 93 ----------------------------------------- other/opus/opus.lua | 93 ----------------------------------------- other/opus/opusfile.lua | 7 +++- 4 files changed, 6 insertions(+), 193 deletions(-) delete mode 100644 other/opus/ogg.lua delete mode 100644 other/opus/opus.lua diff --git a/bam.lua b/bam.lua index 56039108a..bb3ae5b59 100644 --- a/bam.lua +++ b/bam.lua @@ -17,8 +17,6 @@ Import("other/sdl/sdl.lua") Import("other/freetype/freetype.lua") Import("other/curl/curl.lua") Import("other/opus/opusfile.lua") -Import("other/opus/opus.lua") -Import("other/opus/ogg.lua") Import("other/mysql/mysql.lua") --- Setup Config ------- @@ -32,8 +30,6 @@ config:Add(SDL.OptFind("sdl", true)) config:Add(FreeType.OptFind("freetype", true)) config:Add(Curl.OptFind("curl", true)) config:Add(Opusfile.OptFind("opusfile", true)) -config:Add(Opus.OptFind("opus", true)) -config:Add(Ogg.OptFind("ogg", true)) config:Add(Mysql.OptFind("mysql", false)) config:Add(OptString("websockets", false)) config:Finalize("config.lua") @@ -353,8 +349,6 @@ function build(settings) config.freetype:Apply(client_settings) config.curl:Apply(client_settings) config.opusfile:Apply(client_settings) - config.opus:Apply(client_settings) - config.ogg:Apply(client_settings) if family == "unix" and (platform == "macosx" or platform == "linux") then engine_settings.link.libs:Add("dl") diff --git a/other/opus/ogg.lua b/other/opus/ogg.lua deleted file mode 100644 index d4e01a38f..000000000 --- a/other/opus/ogg.lua +++ /dev/null @@ -1,93 +0,0 @@ -Ogg = { - basepath = PathDir(ModuleFilename()), - - OptFind = function (name, required) - local check = function(option, settings) - option.value = false - option.lib_path = nil - - if IsNegativeTerm(ScriptArgs[name .. ".use_pkgconfig"]) then - option.use_pkgconfig = false - elseif IsPositiveTerm(ScriptArgs[name .. ".use_pkgconfig"]) then - option.use_pkgconfig = true - end - - if family ~= "windows" and ExecuteSilent("pkg-config ogg") == 0 then - option.value = true - if option.use_pkgconfig == nil then - option.use_pkgconfig = true - end - end - - if option.use_pkgconfig == nil then - option.use_pkgconfig = false - end - - if platform == "win32" then - option.value = true - elseif platform == "win64" then - option.value = true - elseif platform == "macosx" and string.find(settings.config_name, "32") then - option.value = true - elseif platform == "macosx" and string.find(settings.config_name, "64") then - option.value = true - elseif platform == "linux" and arch == "ia32" then - option.value = true - elseif platform == "linux" and arch == "amd64" then - option.value = true - end - end - - local apply = function(option, settings) - if option.use_pkgconfig == true then - settings.cc.flags:Add("`pkg-config --cflags ogg`") - settings.link.flags:Add("`pkg-config --libs ogg`") - else - settings.cc.includes:Add(Ogg.basepath .. "/include") - settings.cc.includes:Add(Ogg.basepath .. "/include/ogg") - - if family ~= "windows" then - settings.link.libs:Add("ogg") - end - - if platform == "win32" then - client_settings.link.libpath:Add("other/opus/windows/lib32") - elseif platform == "win64" then - client_settings.link.libpath:Add("other/opus/windows/lib64") - elseif platform == "macosx" and string.find(settings.config_name, "32") then - client_settings.link.libpath:Add("other/opus/mac/lib32") - elseif platform == "macosx" and string.find(settings.config_name, "64") then - client_settings.link.libpath:Add("other/opus/mac/lib64") - elseif platform == "linux" then - client_settings.link.libpath:Add("other/opus/linux/lib64") - client_settings.link.libpath:Add("other/opus/linux/lib32") - end - end - end - - local save = function(option, output) - output:option(option, "value") - output:option(option, "use_pkgconfig") - end - - local display = function(option) - if option.value == true then - if option.use_pkgconfig == true then return "using pkg-config" end - return "using bundled libs" - else - if option.required then - return "not found (required)" - else - return "not found (optional)" - end - end - end - - local o = MakeOption(name, 0, check, save, display) - o.Apply = apply - o.include_path = nil - o.lib_path = nil - o.required = required - return o - end -} diff --git a/other/opus/opus.lua b/other/opus/opus.lua deleted file mode 100644 index f8a7e8dea..000000000 --- a/other/opus/opus.lua +++ /dev/null @@ -1,93 +0,0 @@ -Opus = { - basepath = PathDir(ModuleFilename()), - - OptFind = function (name, required) - local check = function(option, settings) - option.value = false - option.lib_path = nil - - if IsNegativeTerm(ScriptArgs[name .. ".use_pkgconfig"]) then - option.use_pkgconfig = false - elseif IsPositiveTerm(ScriptArgs[name .. ".use_pkgconfig"]) then - option.use_pkgconfig = true - end - - if family ~= "windows" and ExecuteSilent("pkg-config opus") == 0 then - option.value = true - if option.use_pkgconfig == nil then - option.use_pkgconfig = true - end - end - - if option.use_pkgconfig == nil then - option.use_pkgconfig = false - end - - if platform == "win32" then - option.value = true - elseif platform == "win64" then - option.value = true - elseif platform == "macosx" and string.find(settings.config_name, "32") then - option.value = true - elseif platform == "macosx" and string.find(settings.config_name, "64") then - option.value = true - elseif platform == "linux" and arch == "ia32" then - option.value = true - elseif platform == "linux" and arch == "amd64" then - option.value = true - end - end - - local apply = function(option, settings) - if option.use_pkgconfig == true then - settings.cc.flags:Add("`pkg-config --cflags opus`") - settings.link.flags:Add("`pkg-config --libs opus`") - else - settings.cc.includes:Add(Opus.basepath .. "/include") - settings.cc.includes:Add(Opus.basepath .. "/include/opus") - - if family ~= "windows" then - settings.link.libs:Add("opus") - end - - if platform == "win32" then - client_settings.link.libpath:Add("other/opus/windows/lib32") - elseif platform == "win64" then - client_settings.link.libpath:Add("other/opus/windows/lib64") - elseif platform == "macosx" and string.find(settings.config_name, "32") then - client_settings.link.libpath:Add("other/opus/mac/lib32") - elseif platform == "macosx" and string.find(settings.config_name, "64") then - client_settings.link.libpath:Add("other/opus/mac/lib64") - elseif platform == "linux" then - client_settings.link.libpath:Add("other/opus/linux/lib64") - client_settings.link.libpath:Add("other/opus/linux/lib32") - end - end - end - - local save = function(option, output) - output:option(option, "value") - output:option(option, "use_pkgconfig") - end - - local display = function(option) - if option.value == true then - if option.use_pkgconfig == true then return "using pkg-config" end - return "using bundled libs" - else - if option.required then - return "not found (required)" - else - return "not found (optional)" - end - end - end - - local o = MakeOption(name, 0, check, save, display) - o.Apply = apply - o.include_path = nil - o.lib_path = nil - o.required = required - return o - end -} diff --git a/other/opus/opusfile.lua b/other/opus/opusfile.lua index e294d5142..a73288e79 100644 --- a/other/opus/opusfile.lua +++ b/other/opus/opusfile.lua @@ -12,7 +12,7 @@ Opusfile = { option.use_pkgconfig = true end - if family ~= "windows" and ExecuteSilent("pkg-config opusfile") == 0 then + if family ~= "windows" and ExecuteSilent("pkg-config opusfile") == 0 and ExecuteSilent("pkg-config opus") == 0 and ExecuteSilent("pkg-config ogg") == 0 then option.value = true if option.use_pkgconfig == nil then option.use_pkgconfig = true @@ -41,9 +41,14 @@ Opusfile = { local apply = function(option, settings) if option.use_pkgconfig == true then settings.cc.flags:Add("`pkg-config --cflags opusfile`") + settings.cc.flags:Add("`pkg-config --cflags opus`") + settings.cc.flags:Add("`pkg-config --cflags ogg`") settings.link.flags:Add("`pkg-config --libs opusfile`") + settings.link.flags:Add("`pkg-config --libs opus`") + settings.link.flags:Add("`pkg-config --libs ogg`") else settings.cc.includes:Add(Opusfile.basepath .. "/include") + settings.cc.includes:Add(Opusfile.basepath .. "/include/ogg") settings.cc.includes:Add(Opusfile.basepath .. "/include/opus") if family ~= "windows" then