# ***************************************************************************
#     ZLIB_DIR.msvc      (!INCLUDE ed by "makefile-dllmod.msvc")
# --------------------------------------------------------------------------
# (c) Copyright Roger Bowler, 2005-2007
# --------------------------------------------------------------------------
# $Id: ZLIB_DIR.msvc 5407 2009-06-14 18:34:54Z fish $
#
#  Handles support for ZLIB compression
#
# ***************************************************************************

# ---------------------------------------------------------------------
# To enable ZLIB compression, first make sure you have the ZLIB dll
# installed on your system (downloadable from http://www.zlib.net),
# and then define an environment variable called "ZLIB_DIR" that
# specifies the full path to the directory where it is installed.
# (via the "Advanced" tab of the Control Panel 'System' applet).
#
# Note that the directory you specify should: a) hold the zlib1.dll
# itself, b) contain two sub-directories called 'include' and 'lib'
# where the 'zlib.h', zconf.h' and 'zdll.lib', etc, files reside.
#
# Note: if the path contains blanks, do NOT surround it with quotes!
# The makefile will do that if it needs to. Just define the variable
# with the path as-is. E.g.:
#
# ZLIB_DIR = E:\MyProjects\zlib and bzip2 dlls\zlib latest\zlib122-dll
# ZLIB_DIR = C:\winbuild\zlib\win32_32
# ---------------------------------------------------------------------

!IFNDEF ZLIB_DIR
# Undefined: use default value, if it exists.
# ZLIB_DIR defaults to winbuild\zlib relative to current directory
!IF "$(CPU)" == "i386" && EXIST(winbuild\zlib\win32_32)
# Avoid breaking existing builds, use win32_32 subdir if it exists
ZLIB_DIR = winbuild\zlib\win32_32
!ELSEIF "$(CPU)" == "i386" && EXIST(winbuild\zlib)
ZLIB_DIR = winbuild\zlib
!ELSEIF "$(CPU)" == "AMD64" && EXIST(winbuild\zlib\x64)
ZLIB_DIR = winbuild\zlib\x64
!ELSEIF "$(CPU)" == "IA64" && EXIST(winbuild\zlib\ia64)
ZLIB_DIR = winbuild\zlib\ia64
!ENDIF
!ELSE
# Defined: use explicit directory or subdirectory
# unless "NONE" is specified or it doesn't exist.
!IF "$(ZLIB_DIR)" == "NONE"
!UNDEF ZLIB_DIR
!ELSE
!IF "$(CPU)" == "i386"
!IF !EXIST($(ZLIB_DIR))
!UNDEF ZLIB_DIR
!ENDIF
!ELSEIF "$(CPU)" == "AMD64"
!IF EXIST($(ZLIB_DIR)\x64)
ZLIB_DIR = $(ZLIB_DIR)\x64
!ENDIF
!ELSEIF "$(CPU)" == "IA64"
!IF EXIST($(ZLIB_DIR)\ia64)
ZLIB_DIR = $(ZLIB_DIR)\ia64
!ENDIF
!ENDIF
!ENDIF
!ENDIF

!IFDEF ZLIB_DIR
!IF !EXIST("$(ZLIB_DIR)\include\zlib.h")
!ERROR ZLIB_DIR "$(ZLIB_DIR)\include\zlib.h" does not exist. Check ZLIB_DIR
!ELSEIF !EXIST("$(ZLIB_DIR)\lib\zdll.lib")
!ERROR ZLIB_DIR "$(ZLIB_DIR)\lib\zdll.lib" does not exist. Check ZLIB_DIR
!ELSEIF !EXIST("$(ZLIB_DIR)\zlib1.dll")
!ERROR ZLIB_DIR "$(ZLIB_DIR)\zlib1.dll" does not exist. Check ZLIB_DIR
!ENDIF
!MESSAGE ZLIB support will be included from "$(ZLIB_DIR)"
!ELSE
!MESSAGE ZLIB support will not be generated
!ENDIF
