Index: snovis/head/obuild/DOS/build_dll_snovis.bat
===================================================================
--- snovis/head/obuild/DOS/build_dll_snovis.bat	(revision 6)
+++ snovis/head/obuild/DOS/build_dll_snovis.bat	(revision 92)
@@ -88,5 +88,5 @@
 IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%"
 IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" (
-  cl.exe /nologo /DWIN32 /MD /O2 /W3  /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snovis_path%\obuild\cpp\obuild_platform.cpp"
+  cl.exe /nologo /DWIN32 /MD /O2 /W3  /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snovis_path%\obuild\cpp\obuild_platform.cpp" 1> NUL
   IF EXIST obuild_platform.obj DEL obuild_platform.obj
 )
@@ -98,17 +98,17 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET bhep_home=/Users/barrand/dev/exp/nemo/bhep/v1r4p1
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_1
+SET bhep_home=/Users/barrand/dev/exp/nemo/bhep/v1r4p2
+:end_if_platform_1
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_3
 SET bhep_platform=Darwin
-)
+:end_if_platform_3
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -118,17 +118,17 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET GeomUtils_home=/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/GeomUtils
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET GeomUtils_platform=Darwin-i386
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_5
+SET snova_home=/Users/barrand/dev/exp/nemo/snova/v2r0p0
+:end_if_platform_5
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_7
+SET snova_platform=Darwin
+:end_if_platform_7
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -138,7 +138,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET SNgeom2_home=/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/SNgeom2
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_9
+SET CLHEP_home=/usr/local/CLHEP/2.0.3.1
+:end_if_platform_9
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -148,37 +148,17 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET snova_home=/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/snova
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% UNIX`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET CLHEP_home=/usr/local/CLHEP/2.0.3.1
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% UNIX`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_home=/geant4/geant4.8.2
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_work=${Geant4_home}/Darwin
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_11
+SET Geant4_home=/usr/local/geant4/8.2
+:end_if_platform_11
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_12
+SET obuild_cxx_command=c++
+:end_if_platform_12
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -188,17 +168,39 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_work=${Geant4_home}/slc3_gcc323
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_system=Darwin-g++
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_13
+SET obuild_cxx_command=c++
+:end_if_platform_13
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% OSF1`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_14
+SET obuild_cxx_command=cxx
+:end_if_platform_14
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_15
+SET obuild_cxx_command=cl.exe
+:end_if_platform_15
+SET obuild_platform_result=
+IF "%obuild_cxx_command%" == ""  ECHO Variable obuild_cxx_command not defined.  && GOTO obuild_return
+
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_16
+SET obuild_cxx_optimize=-O
+:end_if_platform_16
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -208,7 +210,17 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_system=Linux-g++
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_17
+SET obuild_cxx_optimize=-O
+:end_if_platform_17
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% OSF1`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_18
+SET obuild_cxx_optimize=-O
+:end_if_platform_18
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -218,17 +230,18 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET Geant4_system=WIN32-VC
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_command=c++
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_19
+SET obuild_cxx_optimize=/O2
+:end_if_platform_19
+SET obuild_platform_result=
+
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_20
+SET obuild_cxx_debug=-g
+:end_if_platform_20
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -238,7 +251,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_command=c++
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_21
+SET obuild_cxx_debug=-g
+:end_if_platform_21
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -248,7 +261,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_command=cxx
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_22
+SET obuild_cxx_debug=-g
+:end_if_platform_22
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -258,20 +271,9 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_command=cl.exe
-)
-SET obuild_platform_result=
-IF "%obuild_cxx_command%" == ""  ECHO Variable obuild_cxx_command not defined.  && GOTO obuild_return
-
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_optimize=-O
-)
-SET obuild_platform_result=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_23
+SET obuild_cxx_debug=/ZI /Od
+:end_if_platform_23
+SET obuild_platform_result=
+
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
 cd "%obuild_snovis_path%\%obuild_dir_bin%"
@@ -280,17 +282,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_optimize=-O
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% OSF1`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_optimize=-O
-)
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_24
+SET obuild_cxx_options=-fPIC
+:end_if_platform_24
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -300,85 +292,27 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_optimize=/O2
-)
-SET obuild_platform_result=
-
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_debug=-g
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Linux`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_debug=-g
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% OSF1`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_debug=-g
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_debug=/ZI /Od
-)
-SET obuild_platform_result=
-
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Linux`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
-SET obuild_cxx_options=-fPIC
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_25
 SET obuild_cxx_options=/nologo /DWIN32 /MD /GX /GR /W3
-)
-SET obuild_platform_result=
-
-IF %obuild_debug% == yes (
+:end_if_platform_25
+SET obuild_platform_result=
+
+IF NOT %obuild_debug% == yes GOTO else_if_db_build_dll_snovis_sh_26
   SET obuild_cxx_debug_local=%obuild_cxx_debug%
-) ELSE (
+  GOTO end_if_db_build_dll_snovis_sh_26
+:else_if_db_build_dll_snovis_sh_26
   SET obuild_cxx_debug_local=
-)
-IF %obuild_optimize% == yes (
+:end_if_db_build_dll_snovis_sh_26
+
+IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_dll_snovis_sh_27
   SET obuild_cxx_optimize_local=%obuild_cxx_optimize%
-) ELSE (
+  GOTO end_if_opt_build_dll_snovis_sh_27
+:else_if_opt_build_dll_snovis_sh_27
   SET obuild_cxx_optimize_local=
-)
+:end_if_opt_build_dll_snovis_sh_27
+
 
 IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%"
 IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_find.exe" (
-  cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_find.exe" "%obuild_snovis_path%\obuild\cpp\obuild_find.cpp"
+  cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_find.exe" "%obuild_snovis_path%\obuild\cpp\obuild_find.cpp" 1> NUL
   IF EXIST obuild_find.obj DEL obuild_find.obj
 )
@@ -532,7 +466,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_37
 SET obuild_cxx_includes=%obuild_cxx_includes% -I/System/Library/Frameworks/OpenGL.framework/Headers
-)
+:end_if_platform_37
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -542,7 +476,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_38
 SET obuild_cxx_includes=%obuild_cxx_includes% -I${OBUILD_OPENGL_HOME}/include
-)
+:end_if_platform_38
 SET obuild_platform_result=
 
@@ -552,16 +486,19 @@
 @IF %obuild_verbose% == yes @ECHO ON 
 cd "%obuild_snovis_path%\%obuild_dir_bin%"
-%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Callbacks.obj  /Tp..\source\Callbacks.cxx
-@IF ERRORLEVEL 1 @GOTO obuild_return
+%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Callbacks.obj  /Tp"..\source\Callbacks.cxx" 1> cl_exe_error
+@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
+@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
 cd "%obuild_snovis_path%\obuild"
 
 cd "%obuild_snovis_path%\%obuild_dir_bin%"
-%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\InventorCallbacks.obj  /Tp..\source\InventorCallbacks.cxx
-@IF ERRORLEVEL 1 @GOTO obuild_return
+%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\InventorCallbacks.obj  /Tp"..\source\InventorCallbacks.cxx" 1> cl_exe_error
+@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
+@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
 cd "%obuild_snovis_path%\obuild"
 
 cd "%obuild_snovis_path%\%obuild_dir_bin%"
-%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Layouts.obj  /Tp..\source\Layouts.cxx
-@IF ERRORLEVEL 1 @GOTO obuild_return
+%obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Layouts.obj  /Tp"..\source\Layouts.cxx" 1> cl_exe_error
+@IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return
+@IF NOT ERRORLEVEL 1 @DEL cl_exe_error
 cd "%obuild_snovis_path%\obuild"
 
@@ -585,17 +522,17 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_53
 SET obuild_linked_libraries=%obuild_linked_libraries% -framework OpenGL -framework AGL
-)
-SET obuild_platform_result=
-FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
-cd "%obuild_snovis_path%\%obuild_dir_bin%"
-IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
-FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
-cd "%obuild_pwd_snovis_0%"
-SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+:end_if_platform_53
+SET obuild_platform_result=
+FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
+cd "%obuild_snovis_path%\%obuild_dir_bin%"
+IF NOT EXIST .\obuild_platform.exe  ECHO Program obuild_platform.exe not found.  && GOTO obuild_return
+FOR /F "usebackq" %%j IN (`.\obuild_platform.exe  %obuild_platform% Darwin`) DO SET obuild_platform_result=%%j
+cd "%obuild_pwd_snovis_0%"
+SET obuild_pwd_snovis_0=
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_54
 SET obuild_linked_libraries=%obuild_linked_libraries% -framework ApplicationServices
-)
+:end_if_platform_54
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -605,7 +542,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_55
 SET obuild_linked_libraries=%obuild_linked_libraries% -L/usr/lib -lGLU -lGL -lm
-)
+:end_if_platform_55
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -615,7 +552,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_56
 SET obuild_linked_libraries=%obuild_linked_libraries% glu32.lib opengl32.lib gdi32.lib user32.lib
-)
+:end_if_platform_56
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -625,7 +562,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_57
 SET obuild_linked_libraries=%obuild_linked_libraries% -L${OBUILD_OPENGL_HOME}/lib -lGLU -lGL -lm
-)
+:end_if_platform_57
 SET obuild_platform_result=
 FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d
@@ -635,7 +572,7 @@
 cd "%obuild_pwd_snovis_0%"
 SET obuild_pwd_snovis_0=
-IF %obuild_platform_result% == yes (
+IF NOT %obuild_platform_result% == yes GOTO end_if_platform_58
 SET obuild_linked_libraries=%obuild_linked_libraries% -lpthread
-)
+:end_if_platform_58
 SET obuild_platform_result=
 
@@ -652,10 +589,12 @@
 
 REM # Build the obuild_windef.exe utility program :
-cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snovis_path%\obuild\cpp\obuild_windef.c"
+cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snovis_path%\obuild\cpp\obuild_windef.c" 1> NUL
 IF EXIST obuild_windef.obj DEL obuild_windef.obj
 
 REM # Building the .def file :
 @IF %obuild_verbose% == yes @ECHO ON 
-dumpbin.exe /symbols /out:.\dll_snovis\tmp .\dll_snovis\snovis.arc
+dumpbin.exe /symbols /out:.\dll_snovis\tmp .\dll_snovis\snovis.arc 1> dumpbin_exe_error .\dll_snovis\snovis.arc
+@IF ERRORLEVEL 1 @TYPE dumpbin_exe_error && @GOTO obuild_return
+@IF NOT ERRORLEVEL 1 @DEL dumpbin_exe_error
 @IF %obuild_verbose% == yes @ECHO OFF 
 .\obuild_windef.exe snovis < .\dll_snovis\tmp > .\dll_snovis\snovis.def
@@ -663,5 +602,7 @@
 REM # It produces a .exp file.
 @IF %obuild_verbose% == yes @ECHO ON 
-lib.exe /nologo /machine:ix86 /out:.\dll_snovis\snovis.lib /def:.\dll_snovis\snovis.def
+lib.exe /nologo /machine:ix86 /out:.\dll_snovis\snovis.lib /def:.\dll_snovis\snovis.def 1> lib_exe_error
+@IF ERRORLEVEL 1 @TYPE lib_exe_error && @GOTO obuild_return
+@IF NOT ERRORLEVEL 1 @DEL lib_exe_error
 @IF %obuild_verbose% == yes @ECHO OFF 
 
