****************************************************************

							OVAL Interpreter

          Build Instructions - Xerces-C and Xalan-C on Windows

			Copyright (c) 2002-2010, The MITRE Corporation

****************************************************************

The MITRE Corporation developed the OVAL Interpreter to 
demonstrate the usability of the OVAL Language. The source for
the OVAL Interpreter is freely available for reference use. This
document describes the steps you need to build the OVAL 
Interpreter.

For information about using the OVAL Interpreter refer to the README.txt
file included with the OVAL Interpreter, or the OVAL Web site.

      OVAL Interpreter:
      http://oval.mitre.org/language/download/interpreter/index.html

BY USING THE OVAL INTERPRETER, YOU SIGNIFY YOUR ACCEPTANCE OF THE
TERMS AND CONDITIONS OF USE.  IF YOU DO NOT AGREE TO THESE TERMS,
DO NOT USE THE OVAL INTERPRETER.  SEE THE TERMS.TXT FILE INCLUDED
WITH THE OVAL INTERPRETER, OR http://oval.mitre.org/oval/about/bsd_license.html.

-- CONTENTS --

  I     OVERVIEW
  II    INSTRUCTIONS FOR BUILDING THE XERCES-C LIBRARY ON WINDOWS
  III   INSTRUCTIONS FOR BUILDING THE XALAN-C LIBRARY ON WINDOWS

-- I -- OVERVIEW --
	
	Due to changes in the OVAL Language schema for Version 5.8, we were forced
	to upgrade to version 2.8 of the Xerces-C library.  However, in upgrading
	to Xerces-C 2.8, we encounted trouble in building the Xalan-C library for
	for Windows such that it would work with the OVAL Interpreter. As a result,
	we have provided these instructions.  These instructions were tested on
	Microsoft Visual Studio 2008 while creating the Release builds of the
	libraries on the Win32 platform.
  
-- II -- INSTRUCTIONS FOR BUILDING THE XERCES-C LIBRARY ON WINDOWS --

	1. Download the source distribution of Xerces-C 2.8 at
	   http://xerces.apache.org/xerces-c/download.cgi.

	2. Extract the source distribution. The location where the source
	   distribution is extracted (e.g. "C:\lib\xerces-c-src_2_8_0")
	   will be known as XERCESCROOT.
   
	3. Add an environment variable for XERCESCROOT.  Instructions on how
	   to add environment variables in Windows can be found at
	   http://support.microsoft.com/kb/310519.
   
	3. Open $(XERCESCROOT)\Projects\Win32\VC8\xerces-all\xerces-all.sln.
	   Allow Visual Studio to convert the projects if necessary.

	4. Select all of the projects under the project named "all" in the
	   Solution Explorer window and right click the selected projects and
	   click Properties.
	   
	5. Then select Build->Configuration Manager and select the appropriate
	   Active solution configuration and Active solution platform. In either
	   case, make sure that the Active solution configuration and Active
	   configuration platform settings chosen here are also used when
	   building the xalan-c library.

	5. Click OK.
   
	6. While all projects under the project "all" are still selected, right
	   click the selected projects and click Properties.

	7. Next, navigate to Configuration Properties->C/C++->Language and
	   set the property "Set wchar_t as Built-in Type" to "No (/Zc:wchar_t-)".
   
	8. Click apply and then click OK.

	9. Build the projects by clicking Build->Build Solution.

-- III -- INSTRUCTIONS FOR BUILDING THE XALAN-C LIBRARY ON WINDOWS --

	1. Download the source distribution of Xalan-C 1.10 at
	   http://xml.apache.org/xalan-c/download.html.

	2. Extract the source distribution. The location of the subdirectory
	   "c", where the source distribution is extracted
	   (e.g. "C:\lib\xml-xalan\c"), will be known as XALANCROOT.
   
	3. Add an environment variable for XALANCROOT. Instructions on how to add
	   environment variables in Windows can be found at
	   http://support.microsoft.com/kb/310519.
   
	4. Open $(XALANCROOT)\Projects\Win32\VC7.1\Xalan.sln. Allow Visual Studio
	   to convert the projects if necessary.

	5. Edit $(XALANCROOT)\Projects\Win32\VC7.1\Utils\MsgCreator\MsgCreator.mak with
	   the following changes: 

		a. Modify the XERCESLIBRELEASE or XERCESLIBDEBUG libpath
		   (depending on which library you are building) to use the path to the
		   Xerces-C libraries (e.g. change 
		   XERCESLIBRELEASE=$(XERCESLIB) /libpath:"$(XERCESCROOT)\Build\Win32\VC7.1\Release"
		   to XERCESLIBRELEASE=$(XERCESLIB) /libpath:"$(XERCESCROOT)\Build\Win32\VC8\Release")

		b. In the section for the release being built, edit the CPP_PROJ variable to update
		   obsolete, non-existent, and missing parameters.
		   
			- /GX becomes /EHsc (this has to do with exception handling).
			- Remove /YX.
			- /ML becomes /MD (has to do with which C runtime to link to.  Xerces-C used /MD).
			- Add /I <path_to_windows_sdk_include_directory> 
			  (e.g. "/I"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include"")
			  if windows.h cannot be found.
			- Add /Zc:wchar_t-.
	
		c. In the section for the release being built, edit the LINK32_FLAGS variable, which 
		   contains the linker commandline to add parameters.
		   
			- Add /LIBPATH:<path_to_windows_sdk_lib_directory> 
			  (e.g. "/LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib"") if kernel.lib
			  cannot be found.
		  
	6. Edit $(XALANCROOT)\Projects\Win32\VC7.1\Utils\Localization\BuildMessages.mak with the
	   following changes:

		a. Modify XERCESCPATH to use VC8 instead of VC7.1 for the appropriate release.

	7. In $(XALANCROOT)\Projects\Win32\VC7.1\Utils\XalanMsgLib\XalanMsgLib.mak:

		a. Repeat steps 5 a. through c. for this file. 

	8. Select all projects, except for "Localization", in the Solution Explorer window and right
	   click the selected projects and click Properties.

	9. Then select Build->Configuration Manager and select the appropriate Active solution configuration
	   and Active solution platform as used while building the Xerces-C libraries.
   
	10. Next, navigate to Configuration Properties->C/C++->Language and set the property "Set wchar_t
	    as Built-in Type" to "No (/Zc:wchar_t-)".
   
	11. Click Apply and then click OK.
   
	11. Navigate to Tools->Options->Projects and Solutions->VC++ Directories and add the necessary include
	    and library paths to the project.
	
		a. Add the include paths
			
			-$(XERCESCROOT)\src
			-$(XALANCROOT)\src
			-$(XALANCROOT)\Build\Win32\VC7.1\Release\Nls\Include
			
		b. Add the library paths

			-$(XERCESCROOT)\Build\Win32\VC8\Release
			-$(XALANCROOT)\Build\Win32\VC7.1\Release

	12. Navigate to Project->Properties->Configuration Properties->Linker->Input and add the following
	    libraries to "Additional Dependencies".

		a. xerces-c_2.lib
		b. xerces-depdom_2.lib
		c. XalanMessages_1_10.lib

	13. Build the "Localization" project.
	
	14. Build the "AllInOne" project.  Please note that you will see many warnings during this build
	    regarding deprecated and unsafe function calls. These warnings can be ignored.
	
	15. The libraries needed by OVALDI (xerces-c_2.lib, Xalan-C_1.lib, and XalanMessages_1_10.lib)
	    will be available in $(XERCESCROOT)\Build\Win32\VC8\Release and $(XALANCROOT)\Build\Win32\VC7.1\Release.