# ***************************************************************************
#     PCRE_DIR.msvc      (!INCLUDE ed by "makefile-dllmod.msvc")
# --------------------------------------------------------------------------
# (c) Copyright Roger Bowler, 2005-2007
# --------------------------------------------------------------------------
# $Id: PCRE_DIR.msvc 5407 2009-06-14 18:34:54Z fish $
#
#  Handles support for PCRE (Perl Compatible Regular Expressions),
#  for MSVC, needed by HAO (Hercules Automatic Operator) facility
#
# ***************************************************************************

# ---------------------------------------------------------------------
# To enable PCRE (Perl-Compatible Regular Expressions) support, first
# download 'Binaries'  and 'Developer files' packages from the GNUWin32
# PCRE website at: http://gnuwin32.sourceforge.net/packages/pcre.htm.
# Then create a permanent directory somewhere called whatever you want
# with a 'bin', 'lib' and 'include' subdirectory, and then define an
# environment variable called "PCRE_DIR" pointing to that directory.
# Finally, make sure the below names of the include (header), lib and
# DLL names are correct, making whatever adjustments may be necessary.
# ---------------------------------------------------------------------

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

!IFDEF PCRE_DIR
PCRE_INCNAME  = pcreposix.h
PCRE_LIBNAME1 = pcre.lib
PCRE_LIBNAME2 = pcreposix.lib
PCRE_DLLNAME1 = pcre3.dll
PCRE_DLLNAME2 = pcreposix3.dll
PCRE_INCDIR   = $(PCRE_DIR)\include
PCRE_INCPATH  = $(PCRE_DIR)\include\$(PCRE_INCNAME)
PCRE_LIBPATH1 = $(PCRE_DIR)\lib\$(PCRE_LIBNAME1)
PCRE_LIBPATH2 = $(PCRE_DIR)\lib\$(PCRE_LIBNAME2)
PCRE_DLLPATH1 = $(PCRE_DIR)\bin\$(PCRE_DLLNAME1)
PCRE_DLLPATH2 = $(PCRE_DIR)\bin\$(PCRE_DLLNAME2)
!IF !EXIST("$(PCRE_INCPATH)")
!ERROR PCRE_DIR "$(PCRE_INCPATH)" does not exist. Check PCRE_DIR
!ELSEIF !EXIST("$(PCRE_LIBPATH1)")
!ERROR PCRE_DIR "$(PCRE_LIBPATH1)" does not exist. Check PCRE_DIR
!ELSEIF !EXIST("$(PCRE_LIBPATH2)")
!ERROR PCRE_DIR "$(PCRE_LIBPATH2)" does not exist. Check PCRE_DIR
!ELSEIF !EXIST("$(PCRE_DLLPATH1)")
!ERROR PCRE_DIR "$(PCRE_DLLPATH1)" does not exist. Check PCRE_DIR
!ELSEIF !EXIST("$(PCRE_DLLPATH2)")
!ERROR PCRE_DIR "$(PCRE_DLLPATH2)" does not exist. Check PCRE_DIR
!ENDIF
!MESSAGE PCRE support will be included from "$(PCRE_DIR)" 
!ELSE
!MESSAGE PCRE support will not be generated
!ENDIF
