summaryrefslogtreecommitdiffstats
path: root/windows/hdf5build.BAT
diff options
context:
space:
mode:
Diffstat (limited to 'windows/hdf5build.BAT')
-rwxr-xr-xwindows/hdf5build.BAT102
1 files changed, 46 insertions, 56 deletions
diff --git a/windows/hdf5build.BAT b/windows/hdf5build.BAT
index e2a062c..9c9d84d 100755
--- a/windows/hdf5build.BAT
+++ b/windows/hdf5build.BAT
@@ -16,17 +16,16 @@ rem access to either file, you may request a copy from helphdfgroup.org.
rem File Name: hdf5build.bat
rem This batch file is used to build HDF5 Libraries and Tools.
rem This batch file takes the following options:
+rem . /vs8 Build HDF5 using Visual Studio 2005
rem . /vs9 Build HDF5 using Visual Studio 2008
rem . Note: Default is Visual Studio 2005
-rem . /fort Build HDF5 with Fortran libraries
-rem . /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
-rem . Note: Default is Intel Visual Fortran 9.1
+rem . /fort Build HDF5 with Fortran libraries
+rem . /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
+rem . /ivf91 Note: Default is Intel Visual Fortran 9.1
+rem . /nodebug Note: Default is to build debug and release versions
rem . /useenv Build HDF5 using compiler settings defined
rem . in the environment, rather than the IDE.
rem . /? Help information
-rem By Xuan Bai
-rem Created: Aug. 16, 2004
-rem Last Updated: Scott Wegner, 7/2/08
rem This batch file makes the following assumptions:
rem - The appropriate version of Visual Studio is installed and setup
@@ -47,6 +46,8 @@ pushd %~dp0
set nerrors=0
if "%1"=="/?" goto help
+set blddebug=debug
+set bldrelease=release
goto main
rem Print a help message
@@ -56,12 +57,14 @@ rem Print a help message
echo.
echo.Usage: %~nx0 [OPTION]
echo.
+ echo. /vs8 Build HDF5 using Visual Studio 2005
echo. /vs9 Build HDF5 using Visual Studio 2008
echo. Note: Default is Visual Studio 2005
echo. /fort Build HDF5 with Fortran libraries using the
echo. Intel Fortran version specified, or 9.1 by default
echo. /ivf101 Build HDF5 Fortran using Intel Visual Fortran 10.1
- echo. Note: Default is Intel Visual Fortran 9.1
+ echo. /ivf91 Note: Default is Intel Visual Fortran 9.1
+ echo. /nodebug Note: Default is to build debug and release versions
echo. /useenv Build HDF5 using compiler settings defined
echo. in the environment, rather than the IDE.
echo. /? Help information
@@ -73,24 +76,30 @@ rem Parse through the parameters sent to file, and set appropriate variables
:parse_params
for %%a in (%*) do (
- if "%%a"=="/vs7" (
- rem Visual Studio .NET 2003 not supported
- rem Set errorlevel 1 and send to help
- call :help
- exit /b 1
+ if "%%a"=="/vs8" (
+ rem Use Visual Studio 2005
+ set hdf5_vs2005=true
) else if "%%a"=="/vs9" (
- rem Use Visual Studio .NET 2003
+ rem Use Visual Studio 2008
set hdf5_vs2008=true
) else if "%%a"=="/fort" (
rem Enable Fortran
set hdf5_enablefortran=true
+ ) else if "%%a"=="/ivf91" (
+ rem Enable Fortran
+ set hdf5_ivf91=true
+
) else if "%%a"=="/ivf101" (
rem Enable Fortran
set hdf5_ivf101=true
+ ) else if "%%a"=="/nodebug" (
+ rem Enable Fortran
+ set blddebug=
+
) else if "%%a"=="/useenv" (
rem Pass /useenv flag to devenv
set hdf5_useenv=true
@@ -118,29 +127,14 @@ rem Setup our environment
echo.Setting up environment
- rem Sanity check-- make sure VS.NET isn't specified with Fortran or x64
- if defined hdf5_vnet (
- if defined hdf5_enablefortran (
- echo.Error: Building Fortran libraries with Visual Studio .NET is unsupported
- exit /b 1
- )
- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
- echo.Error: Building HDF5 on x64 with Visual Studio .NET is unsupported
- exit /b 1
- )
- )
- rem Make sure /vs7 and /vs9 weren't specified together
- if "%hdf5_vnet%%hdf5_vs2008%"=="truetrue" (
- echo.Error: /vs7 and /vs9 should not be specified together.
+ rem Make sure /vs8 and /vs9 weren't specified together
+ if "%hdf5_vs2005%%hdf5_vs2008%"=="truetrue" (
+ echo.Error: /vs8 and /vs9 should not be specified together.
exit /b 1
)
rem Figure out which solution file to use based on configuration
- if defined hdf5_vnet (
- echo.Using Visual Studio .NET 2003
- set hdf5_sln="%CD%\windows_vnet\proj\all\all.sln"
-
- ) else if defined hdf5_vs2008 (
+ if defined hdf5_vs2008 (
echo.Using Visual Studio 2008
if defined hdf5_enablefortran (
echo.Building Fortran projects enabled
@@ -176,17 +170,7 @@ rem Setup our environment
set ccflags=
- if defined hdf5_vnet (
- if defined vs71comntools (
- rem This sets the Visual Studio .NET path and environment variables
- call "%vs71comntools%\vsvars32.bat"
- ) else (
- echo.Error: Cannot setup Visual Studio .NET 2003 environment. Please
- echo.make sure VS71COMNTOOLS is defined in the environment.
- exit /b 1
- )
-
- ) else if defined hdf5_vs2008 (
+ if defined hdf5_vs2008 (
if not defined hdf5_enablefortran (
if defined vs90comntools (
rem This sets the Visual Studio 2005 path and environment variables
@@ -308,15 +292,18 @@ rem Build the HDF5 libraries. By default, C and C++ libraries are built.
echo.
rem Build both debug and release versions
- for %%a in (debug release) DO (
+ for %%a in (%blddebug% %bldrelease%) DO (
echo.Building %hdf5_platform% %%a libraries...
- rem Only add hdf5_platform if not using Visual Studio .NET, because it doesn't like the syntax
- if defined hdf5_vnet (
- devenv %hdf5_sln% %ccflags% /rebuild %%a
- ) else (
- devenv %hdf5_sln% %ccflags% /rebuild "%%a|%hdf5_platform%"
- )
- if !errorlevel! neq 0 exit /b
+ devenv %hdf5_sln% %ccflags% /rebuild "%%a|%hdf5_platform%"
+ if not errorlevel 0 (
+ set /a nerrors=!nerrors!+1
+ echo. Building %%a FAILED
+ exit /b 1
+ ) else if errorlevel 1 (
+ set /a nerrors=!nerrors!+1
+ echo. Building %%a FAILED
+ exit /b 1
+ )
)
exit /b
@@ -338,8 +325,8 @@ rem This is where the magic happens
:main
call :parse_params %*
- if %errorlevel% neq 0 (
- if !errorlevel! equ 1 (
+ if not errorlevel 0 (
+ if errorlevel 1 (
rem This isn't an error case-- this means /? was specified. Simply
rem quit.
goto end
@@ -352,7 +339,7 @@ rem This is where the magic happens
)
call :setup
- if %errorlevel% neq 0 (
+ if not errorlevel 0 (
echo.Error setting up build environment.
goto error
)
@@ -360,7 +347,7 @@ rem This is where the magic happens
rem Upgrade the project files if needed
if defined hdf5_vs2008 (
call :upgrade
- if !errorlevel! neq 0 (
+ if not errorlevel 0 (
echo.Error upgrading project files!
goto error
)
@@ -376,7 +363,10 @@ rem This is where the magic happens
call :all
- if %errorlevel% neq 0 (
+ if not errorlevel 0 (
+ echo.Error building HDF5 libraries!
+ goto error
+ ) else if errorlevel 1 (
echo.Error building HDF5 libraries!
goto error
)