diff options
author | Scott Wegner <swegner@hdfgroup.org> | 2008-05-14 14:46:44 (GMT) |
---|---|---|
committer | Scott Wegner <swegner@hdfgroup.org> | 2008-05-14 14:46:44 (GMT) |
commit | 86790dab743b1ed55f106001185c70e1e77f40be (patch) | |
tree | b67d8bde273a12f78f0292df607fd658cf25296f /windows/hdf5build.BAT | |
parent | ec4ae5213b66274287844b2e05340f342c7c3231 (diff) | |
download | hdf5-86790dab743b1ed55f106001185c70e1e77f40be.zip hdf5-86790dab743b1ed55f106001185c70e1e77f40be.tar.gz hdf5-86790dab743b1ed55f106001185c70e1e77f40be.tar.bz2 |
[svn-r14993] Purpose: Add support for building 64-bit Windows binaries from command line
Description:
We can dynamically detect the host architecture using the PROCESSOR_ARCHITECTURE variable. This allows us to setup our build paths accordingly and build 64-bit Windows binaries from the command line. This allows us to run autotests on 64-bit Windows as well.
Tested:
VS2005 on WinXP x64
VS2005 on WinXP x86
Diffstat (limited to 'windows/hdf5build.BAT')
-rwxr-xr-x | windows/hdf5build.BAT | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/windows/hdf5build.BAT b/windows/hdf5build.BAT index f361e23..c620e80 100755 --- a/windows/hdf5build.BAT +++ b/windows/hdf5build.BAT @@ -22,7 +22,7 @@ rem . in the environment, rather than the IDE. rem . /? Help information
rem By Xuan Bai
rem Created: Aug. 16, 2004
-rem Last Updated: July 13, 2007
+rem Last Updated: May 13, 2008
rem This batch file makes the following assumptions:
rem - The appropriate version of Visual Studio is installed and setup
@@ -33,6 +33,8 @@ rem - szip and zlib DLLs are already placed in an accessible directory rem - hdf5_ext_szip or hdf5_ext_zlib have been set accordingly
rem - if building with the /useenv option, szip and zlib paths have been added
rem to %include% and %libpath% as necessary.
+rem - The target platform architecture is specified in the environment
+rem variable PROCESSOR_ARCHITECTURE
rem By default, only C and C++ libraries are built.
@@ -40,6 +42,7 @@ setlocal enabledelayedexpansion pushd %~dp0
set nerrors=0
+if "%1"=="/?" goto help
goto main
rem Print a help message
@@ -101,6 +104,17 @@ rem Setup our environment )
+ rem Make sure PROCESSOR_ARCHITECURE is set to either x86 or AMD64
+ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
+ set hdf5_platform=Win32
+ ) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
+ set hdf5_platform=x64
+ ) else (
+ echo.Error: Environment variable PROCESSOR_ARCHITECTURE should contain
+ echo.either x86 or AMD64
+ exit /b 1
+ )
+
rem Setup Visual Studio environment. By default, use the Visual Studio
rem 2005 environment.
@@ -112,7 +126,12 @@ rem Setup our environment if not defined hdf5_enablefortran (
if defined vs80comntools (
rem This sets the Visual Studio path and environment variables
- call "%vs80comntools%\vsvars32.bat"
+ if %hdf5_platform%==Win32 (
+ call "%vs80comntools%\..\..\VC\vcvarsall.bat" x86
+ ) else (
+ call "%vs80comntools%\..\..\VC\vcvarsall.bat" x86_amd64
+ )
+
) else (
echo.Error: Cannot setup Visual Studio 2005 environment. Please
echo.make sure VS80COMNTOOLS is defined in the environment.
@@ -126,8 +145,11 @@ rem Setup our environment rem This sets the Intel Fortran 9.1 environment, as well as
rem setting the appropriate Visual Studio environment
- rem Assume 32-bit environment
- call "%ifort_compiler91%\IA32\Bin\ifortvars.bat"
+ if %hdf5_platform%==Win32 (
+ call "%ifort_compiler91%\IA32\Bin\ifortvars.bat"
+ ) else (
+ call "%ifort_compiler91%\em64t\Bin\ifortvars.bat"
+ )
) else (
echo.Error: Cannot setup Intel Fortran 9.1 environment. Please
echo.make sure IFORT_COMPILER91 is defined in the environment.
@@ -157,8 +179,8 @@ rem Build the HDF5 libraries. By default, C and C++ libraries are built. rem Build both debug and release versions
for %%a in (debug release) DO (
- echo.Building %%a libraries...
- devenv %hdf5_sln% %ccflags% /rebuild %%a
+ echo.Building %hdf5_platform% %%a libraries...
+ devenv %hdf5_sln% %ccflags% /rebuild "%%a|%hdf5_platform%"
if !errorlevel! neq 0 exit /b
)
|