REM Don't copy this script to a different directory, it must be in REM cipres\cipres-build-scripts\build-for-windows. It expects to REM find buildConfig.bat above the cipres directory. REM @ echo on call %~dp0\..\..\..\buildConfig.bat REM should detect this (mth just put this variable in place of hard coding VC7) set VCNUM=VC7 setlocal set X_ORIG_DIR=%CD% set SCRIPT_DIR=%~dp0 set X_DISABLE_CXX=0 set X_DISABLE_HELP=0 set X_DISABLE_JAVA=0 set X_DISABLE_PYTHON=0 set X_DISABLE_TOOLS=0 set X_DISABLE_PACKAGE_DATA=0 set X_ENABLE_TEST=0 set X_ONLY_TEST=0 set X_ONLY_SERVICES=0 :ProcessArguments IF "%1" == "" goto Continue if "%1" == "--disable-cxx-lib" set X_DISABLE_CXX=1 if "%1" == "--disable-help" set X_DISABLE_HELP=1 if "%1" == "--disable-java-lib" set X_DISABLE_JAVA=1 if "%1" == "--disable-package-data" set X_DISABLE_PACKAGE_DATA=1 if "%1" == "--disable-python-lib" set X_DISABLE_PYTHON=1 if "%1" == "--disable-tools-lib" set X_DISABLE_TOOLS=1 if "%1" == "--enable-test" set X_ENABLE_TEST=1 if "%1" == "--only-test" set X_ONLY_TEST=1 if "%1" == "--only-services" set X_ONLY_SERVICES=1 shift goto ProcessArguments :Continue REM xcopy args: /Y=overwrite silently, /I=silently assume dest is dir if src is a dir or multiple files, REM /S=copy whole subtree REM xcopy creates directories along dest path as needed. REM if "%X_ONLY_TEST%" == "1" set X_ENABLE_TEST=1 if "%X_ONLY_TEST%" == "1" goto Test if "%X_ONLY_SERVICES%" == "1" goto Install_Java if "%X_DISABLE_TOOLS%" == "1" goto Install_package_data :Install_omniORB_Runtime xcopy /I /Y "%OMNIORB_TOP%\bin\x86_win32\*.dll" "%CIPRES_INSTALL%\bin" :Install_omniORBpy_Runtime xcopy /I /Y /S "%OMNIORB_PY_TOP%\lib\python\*" "%CIPRES_INSTALL%\lib\python\site-packages" xcopy /I /Y /S "%OMNIORB_PY_TOP%\lib\x86_win32\*" "%CIPRES_INSTALL%\lib\python\site-packages" :Install_msvc_Runtime xcopy /I /Y "%MSVCP_DLL%" "%CIPRES_INSTALL%\bin" xcopy /I /Y "%MSVCR_DLL%" "%CIPRES_INSTALL%\bin" :Install_package_data if "%X_DISABLE_PACKAGE_DATA%" == "1" goto Install_Java REM copy the whole help directory tree if "%X_DISABLE_HELP%" == "1" goto Install_rest_of_package_data xcopy /I /Y /S "%CIPRES_TOP%\package_data\help\*" "%CIPRES_INSTALL%\share\cipres\help" :Install_rest_of_package_data REM copy the xml directory tree xcopy /I /Y /S "%CIPRES_TOP%\package_data\xml\*" "%CIPRES_INSTALL%\share\cipres\xml" REM copy the whole resources directory tree xcopy /I /Y /S "%CIPRES_TOP%\package_data\resources\*" "%CIPRES_INSTALL%\share\cipres\resources" REM now make some changes in the resources tree: REM Everywhere we find a registry_win.xml file, copy it to registry.xml in the same directory. REM for /R "%CIPRES_INSTALL%\share\cipres\resources" %%i in (registry_win.xml) do call :replaceReg "%%i" registry_win.xml registry.xml REM Remove @variable@ references from *.properties.in to create .properties files. REM On autoconf builds the @variables@ would be replaced by configure but on windows we just want to replace REM them with "" so that the properties on the lhs will be unset. python "%SCRIPT_DIR%\..\removeQuoted.py" "%CIPRES_TOP%\package_data\resources\install.properties.in" "%CIPRES_INSTALL%\share\cipres\resources\install.properties" -DPACKAGE_VERSION=%PACKAGE_VERSION% python "%SCRIPT_DIR%\..\removeQuoted.py" "%CIPRES_TOP%\package_data\resources\system.properties.in" "%CIPRES_INSTALL%\share\cipres\resources\system.properties" :Install_Java REM install java first so that we can use the service installer for other services if "%X_DISABLE_JAVA%" == "1" goto Install_Cxx if "%X_ONLY_SERVICES%" == "1" goto Install_Java_Services call "%ANT%" install -buildfile "%CIPRES_TOP%\framework\java\cipres-idl-jar\build.xml" if errorlevel 1 goto Error call "%ANT%" install -buildfile "%CIPRES_TOP%\framework\java\cipres-library-jar\build.xml" if errorlevel 1 goto Error call "%ANT%" install -buildfile "%CIPRES_TOP%\cipres-examples\cipresapp\build.xml" if errorlevel 1 goto Error xcopy /I /Y "%CIPRES_TOP%\framework\etc\*.bat" "%CIPRES_INSTALL%\bin" if errorlevel 1 goto Error xcopy /I /Y "%CIPRES_TOP%\cipres-examples\cipresapp\etc\*.bat" "%CIPRES_INSTALL%\bin" if errorlevel 1 goto Error :Install_Java_Services call "%ANT%" install -buildfile "%CIPRES_TOP%\phyloservices\recidcm3\build.xml" if errorlevel 1 goto Error call "%ANT%" install -buildfile "%CIPRES_TOP%\phyloservices\clustal-wrap\build.xml" if errorlevel 1 goto Error :Install_Cxx if "%X_DISABLE_CXX%" == "1" goto Install_Python if "%X_ONLY_SERVICES%" == "1" goto Install_Cxx_Services SET X_DIR=%CIPRES_TOP%\framework\C++\build\%VCNUM% REM - copy release and debug libcipres libraries xcopy /I /Y "%X_DIR%\cipres*.lib" "%CIPRES_INSTALL%\lib\cipres" if errorlevel 1 goto Error REM - copy libcipres "public" header files xcopy /I /Y /S "%CIPRES_TOP%\framework\C++\CipresIDL\*.h*" "%CIPRES_INSTALL%\include\cipres\CipresIDL" if errorlevel 1 goto Error xcopy /I /Y /S "%CIPRES_TOP%\framework\C++\CipresIDL\*.h*" "%CIPRES_INSTALL%\include\cipres\CipresIDL" if errorlevel 1 goto Error xcopy /I /Y /S "%CIPRES_TOP%\framework\C++\CipresCommlib\*.h*" "%CIPRES_INSTALL%\include\cipres\CipresCommlib" if errorlevel 1 goto Error copy /Y "%X_DIR%\config.h" "%CIPRES_INSTALL%\include\cipres" if errorlevel 1 goto Error copy /Y "%CIPRES_TOP%\config\cipres_config.h" "%CIPRES_INSTALL%\include\cipres" if errorlevel 1 goto Error REM - copy phycas and ncl library libraries. I think this one lib is equivalent to the REM - two libs we build on *.nix platforms: ciphycas = libncl and libphycas. set X_DIR="%CIPRES_TOP%\phyloservices\phycas\cipres_services\%VCNUM%\libciphycas" copy /Y "%X_DIR%\ciphycas.lib" "%CIPRES_INSTALL%\lib\cipres" if errorlevel 1 goto Error copy /Y "%X_DIR%\ciphycasd.lib" "%CIPRES_INSTALL%\lib\cipres" if errorlevel 1 goto Error :Install_Cxx_Services REM - now using the service installer (via ant) to install phycas and dcm set X_DIR="%CIPRES_TOP%\phyloservices\phycas\cipres_services\%VCNUM%" set X_ARCHIVE="%CIPRES_TOP%\phyloservices\phycas\cipres_services\org.cipres.PhycasReadNexus" copy /Y "%X_DIR%\read_nexus\Release\read_nexus_server.exe" "%X_ARCHIVE%" if errorlevel 1 goto Error call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%X_ARCHIVE%" -Dreinstall.service if errorlevel 1 goto Error set X_ARCHIVE="%CIPRES_TOP%\phyloservices\phycas\cipres_services\org.cipres.PhycasSCMTreeMerge" copy /Y "%X_DIR%\tree_merge\Release\tree_merge_server.exe" "%X_ARCHIVE%" if errorlevel 1 goto Error call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%X_ARCHIVE%" -Dreinstall.service if errorlevel 1 goto Error set X_DIR="%CIPRES_TOP%\phyloservices\dcm3\build\%VCNUM%" set X_ARCHIVE="%CIPRES_TOP%\phyloservices\dcm3\dcm3\org.cipres.dcm3" copy /Y "%X_DIR%\Release\cipres_dcm3.exe" "%X_ARCHIVE%" if errorlevel 1 goto Error call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%X_ARCHIVE%" -Dreinstall.service if errorlevel 1 goto Error :Install_Python if "%X_DISABLE_PYTHON%" == "1" goto Exit if "%X_ONLY_SERVICES%" == "1" goto Install_Python_Services set PYTHONPATH=%ORB_PYTHONPATH% set PATH=%OMNIORB_PY_TOP%\bin\x86_win32;%OMNIORB_TOP%\bin\x86_win32;%PATH% set PIPRES_DIR=%CIPRES_TOP%\framework\python cd "%PIPRES_DIR%" python setup.py install --prefix="%CIPRES_INSTALL%" --install-purelib="%CIPRES_INSTALL%\lib\python\site-packages" ^ --install-platlib="%CIPRES_INSTALL%\lib\python\site-packages" if errorlevel 1 goto Error cd "%X_ORIG_DIR%" :Install_Python_Services call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%CIPRES_TOP%\phyloservices\paup-wrap\org.cipres.paup-wrap" -Dstage.service.only -Dreinstall.service if errorlevel 1 goto Error call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%CIPRES_TOP%\phyloservices\random-refine\org.cipres.random-refine" -Dreinstall.service if errorlevel 1 goto Error call "%CIPRES_INSTALL%\bin\install_service.bat" -Darchive.path="%CIPRES_TOP%\phyloservices\strict-consensus-merge\org.cipres.pipresSCM" -Dreinstall.service if errorlevel 1 goto Error :Test if "%X_ENABLE_TEST%" == "0" goto Exit call "%ANT%" install-check -buildfile "%CIPRES_TOP%\cipres-examples\cipresapp\build.xml" if errorlevel 1 goto Error goto Exit :Error echo InstallCipres had an error. exit /B 1 :Exit cd "%X_ORIG_DIR%" exit /B 0 :replaceReg set dir=%~dp1 set src=%dir%\%2 if not exist "%src%" goto :eof set dest=%dir%\%3 copy /Y %src% %dest% goto :eof