IF CONFIG_ZLIB
GROUP(!HAVE_ZLIB) zlib
{
  INCLUDE .
  EXPINCLUDE .
  SUBINCLUDE .

  DEFINE FASTEST
  DEFINE NO_ERRNO_H
  DEFINE(CONFIG_BUILDFIXED) BUILDFIXED
  DEFINE(CONFIG_BUILDFIXED) DYNAMIC_CRC_TABLE
  DEFINE(TARGET_WIN && !COREMAKE_STATIC) ZLIB_DLL

  SOURCE adler32.c
  SOURCE crc32.c
  SOURCE inffast.c
  SOURCE inflate.c
  SOURCE inftrees.c
  SOURCE uncompr.c
  SOURCE zutil.c
  //uses masm and not yasm SOURCE(COMPILER_MSVC && IX86) contrib/masmx86/inffas32.asm
  //uses masm and not yasm SOURCE(COMPILER_MSVC && IX86) contrib/masmx86/match686.asm
  //uses masm and not yasm SOURCE(COMPILER_MSVC && IX86_64) contrib/masmx64/gvmat64.asm
  //uses masm and not yasm SOURCE(COMPILER_MSVC && IX86_64) contrib/masmx64/inffas8664.c
  //uses masm and not yasm SOURCE(COMPILER_MSVC && IX86_64) contrib/masmx64/inffasx64.asm
  
  DEFINE(COMPILER_GCC && IX86 && !TARGET_OSX) ASMINF
  SOURCE(COMPILER_GCC && IX86 && !TARGET_OSX) contrib/inflate86/inffas86.c
  //SOURCE(COMPILER_GCC && IX86 && !TARGET_OSX) contrib/inflate86/inffast.S

  DEFINE(COMPILER_GCC && (IX86 || IX86_64) && !TARGET_OSX) ASMV
  SOURCE(COMPILER_GCC && IX86 && !TARGET_OSX) contrib/asm686/match.S
  //SOURCE(COMPILER_GCC && IX86_64 && !TARGET_OSX) contrib/gcc_gvmat64/gvmat64.S
  //SOURCE(COMPILER_GCC && IX86_64 && !TARGET_OSX) contrib/amd64/amd64-match.S
  
  HEADER crc32.h
  HEADER inffast.h
  HEADER inffixed.h
  HEADER inflate.h
  HEADER inftrees.h
  HEADER zconf.h
  HEADER zlib.h
  HEADER zutil.h
}

GROUP(!HAVE_ZLIB) zlib_adler32
{
  SUBINCLUDE .

  SOURCE adler32.c
  HEADER zconf.h
  HEADER zlib.h
  HEADER zutil.h
}

GROUP(!HAVE_ZLIB) zlib_deflate
{
  USE zlib

  SOURCE compress.c
  SOURCE deflate.c
  SOURCE trees.c

  HEADER deflate.h
  HEADER trees.h
}

DLL zlib1
{
  USE zlib

  SOURCE compress.c
  SOURCE deflate.c
  SOURCE gzclose.c
  SOURCE gzlib.c
  SOURCE gzread.c
  SOURCE gzwrite.c
  SOURCE infback.c
  SOURCE trees.c

  HEADER deflate.h
  HEADER gzguts.h
  HEADER trees.h
}
ENDIF
