void-packages/srcpkgs/teeworlds/patches/zlib-cross.patch

33 lines
1.5 KiB
Diff

Bam doesn't respect cflags when searching for libs/includes like this, so
just assume we have zlib for the target (which we do) and link it. Other
libs use pkg-config, so there is no problem for those.
--- a/bam.lua
+++ b/bam.lua
@@ -10,7 +10,6 @@ config:Add(OptCCompiler("compiler"))
config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-protector -fstack-protector-all"))
config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.7 -isysroot /Developer/SDKs/MacOSX10.7.sdk"))
config:Add(OptTestCompileC("buildwithoutsseflag", "#include <immintrin.h>\nint main(){_mm_pause();return 0;}", ""))
-config:Add(OptLibrary("zlib", "zlib.h", false))
config:Add(SDL.OptFind("sdl", true))
config:Add(FreeType.OptFind("freetype", true))
config:Finalize("config.lua")
@@ -82,17 +81,8 @@ function GenerateCommonSettings(settings, conf, arch, compiler)
settings.cc.flags:Add("-Wall", "-fno-exceptions")
end
- -- Compile zlib if needed
local zlib = nil
- if config.zlib.value == 1 then
- settings.link.libs:Add("z")
- if config.zlib.include_path then
- settings.cc.includes:Add(config.zlib.include_path)
- end
- else
- settings.cc.includes:Add("src/engine/external/zlib")
- zlib = Compile(settings, Collect("src/engine/external/zlib/*.c"))
- end
+ settings.link.libs:Add("z")
local md5 = Compile(settings, Collect("src/engine/external/md5/*.c"))
local wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c"))