1# ***************************************************************************
2#     BZIP2_DIR.msvc      (!INCLUDE ed by "makefile-dllmod.msvc")
3# --------------------------------------------------------------------------
4# (c) Copyright Roger Bowler, 2005-2007
5# --------------------------------------------------------------------------
6# $Id$
7#
8#  Handles support for BZIP2 compression
9#
10# ***************************************************************************
11
12# ---------------------------------------------------------------------
13# To enable BZIP2 compression, first make sure you have the libbz2.dll
14# installed on your system (from: http://sources.redhat.com/bzip2/),
15# and then define an environment variable called "BZIP2_DIR" that
16# specifies the full path to the directory where it is installed.
17# (via the "Advanced" tab of the Control Panel 'System' applet).
18#
19# Note that the directory you specify should contain the libbz2.dll as
20# well as the 'bzlib.h' header file and the 'libbz2.lib' link library.
21#
22# Note: if the path contains blanks, do NOT surround it with quotes!
23# The makefile will do that if it needs to. Just define the variable
24# with the path as-is. E.g.:
25#
26# BZIP2_DIR = E:\MyProjects\bzip2
27# ---------------------------------------------------------------------
28
29!IFNDEF BZIP2_DIR
30# Undefined: use default value, if it exists.
31# BZIP2_DIR defaults to winbuild\bzip2 relative to current directory
32!IF "$(CPU)" == "i386" && EXIST(winbuild\bzip2)
33BZIP2_DIR = winbuild\bzip2
34!ELSEIF "$(CPU)" == "AMD64" && EXIST(winbuild\bzip2\x64)
35BZIP2_DIR = winbuild\bzip2\x64
36!ELSEIF "$(CPU)" == "IA64" && EXIST(winbuild\bzip2\ia64)
37BZIP2_DIR = winbuild\bzip2\ia64
38!ENDIF
39!ELSE
40# Defined: use explicit directory or subdirectory
41# unless "NONE" is specified or it doesn't exist.
42!IF "$(BZIP2_DIR)" == "NONE"
43!UNDEF BZIP2_DIR
44!ELSE
45!IF "$(CPU)" == "i386"
46!IF !EXIST($(BZIP2_DIR))
47!UNDEF BZIP2_DIR
48!ENDIF
49!ELSEIF "$(CPU)" == "AMD64"
50!IF EXIST($(BZIP2_DIR)\x64)
51BZIP2_DIR = $(BZIP2_DIR)\x64
52!ENDIF
53!ELSEIF "$(CPU)" == "IA64"
54!IF EXIST($(BZIP2_DIR)\ia64)
55BZIP2_DIR = $(BZIP2_DIR)\ia64
56!ENDIF
57!ENDIF
58!ENDIF
59!ENDIF
60
61!IFDEF BZIP2_DIR
62!IF !EXIST("$(BZIP2_DIR)\bzlib.h")
63!ERROR BZIP2_DIR "$(BZIP2_DIR)\bzlib.h" does not exist. Check BZIP2_DIR
64!ELSEIF !EXIST("$(BZIP2_DIR)\libbz2.lib")
65!ERROR BZIP2_DIR "$(BZIP2_DIR)\libbz2.lib" does not exist. Check BZIP2_DIR
66!ELSEIF !EXIST("$(BZIP2_DIR)\libbz2.dll")
67!ERROR BZIP2_DIR "$(BZIP2_DIR)\libbz2.dll" does not exist. Check BZIP2_DIR
68!ENDIF
69!MESSAGE BZIP2 support will be included from "$(BZIP2_DIR)"
70!ELSE
71!MESSAGE BZIP2 support will not be generated
72!ENDIF
73