⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 build.bat

📁 Boost provides free peer-reviewed portable C++ source libraries. We emphasize libraries that work
💻 BAT
📖 第 1 页 / 共 2 页
字号:
@ECHO OFFREM ~ Copyright 2002-2007 Rene Rivera.REM ~ Distributed under the Boost Software License, Version 1.0.REM ~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)setlocalgoto StartREM NOTE: The "setlocal & endlocal" construct is used to reset the errorlevel to 0.REM NOTE: The "set _error_=" construct is used to set the errorlevel to 1:Error_PrintREM Output an error message and set the errorlevel to indicate failure.setlocalECHO ###ECHO ### %1ECHO ###ECHO ### You can specify the toolset as the argument, i.e.:ECHO ###     .\build.bat msvcECHO ###ECHO ### Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin, intel-win32, metrowerks, mingw, msvc, vc7, vc8ECHO ###set _error_=endlocalgoto :eof:Test_PathREM Tests for the given file(executable) presence in the directories in the PATHREM environment variable. Additionaly sets FOUND_PATH to the path of theREM found file.setlocal & endlocalsetlocalset test=%~$PATH:1endlocalif not errorlevel 1 set FOUND_PATH=%~dp$PATH:1goto :eof:Test_OptionREM Tests wether the given string is in the form of an option: "--*"setlocal & endlocalsetlocalset test=%1set test=###%test%###set test=%test:"###=%set test=%test:###"=%set test=%test:###=%if not [-] == [%test:~1,1%] set _error_=endlocalgoto :eof:Call_If_Existsif EXIST %1 call %*goto :eof:Guess_ToolsetREM Try and guess the toolset to bootstrap the build with...REM Sets BOOST_JAM_TOOLSET to the first found toolset.REM May also set BOOST_JAM_TOOLSET_ROOT to theREM location of the found toolset.if "_%ProgramFiles%_" == "__" set ProgramFiles=C:\Program Filessetlocal & endlocalif NOT "_%VS90COMNTOOLS%_" == "__" (    set "BOOST_JAM_TOOLSET=vc9"    set "BOOST_JAM_TOOLSET_ROOT=%VS90COMNTOOLS%..\..\VC\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\VCVARSALL.BAT" (    set "BOOST_JAM_TOOLSET=vc9"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\"    goto :eof)setlocal & endlocalif NOT "_%VS80COMNTOOLS%_" == "__" (    set "BOOST_JAM_TOOLSET=vc8"    set "BOOST_JAM_TOOLSET_ROOT=%VS80COMNTOOLS%..\..\VC\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual Studio 8\VC\VCVARSALL.BAT" (    set "BOOST_JAM_TOOLSET=vc8"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio 8\VC\"    goto :eof)setlocal & endlocalif NOT "_%VS71COMNTOOLS%_" == "__" (    set "BOOST_JAM_TOOLSET=vc7"    set "BOOST_JAM_TOOLSET_ROOT=%VS71COMNTOOLS%\..\..\VC7\"    goto :eof)setlocal & endlocalif NOT "_%VCINSTALLDIR%_" == "__" (    REM %VCINSTALLDIR% is also set for VC9 (and probably VC8)    set "BOOST_JAM_TOOLSET=vc7"    set "BOOST_JAM_TOOLSET_ROOT=%VCINSTALLDIR%\VC7\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\bin\VCVARS32.BAT" (    set "BOOST_JAM_TOOLSET=vc7"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual Studio .NET\VC7\bin\VCVARS32.BAT" (    set "BOOST_JAM_TOOLSET=vc7"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio .NET\VC7\"    goto :eof)setlocal & endlocalif NOT "_%MSVCDir%_" == "__" (    set "BOOST_JAM_TOOLSET=msvc"    set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual Studio\VC98\bin\VCVARS32.BAT" (    set "BOOST_JAM_TOOLSET=msvc"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual Studio\VC98\"    goto :eof)setlocal & endlocalif EXIST "%ProgramFiles%\Microsoft Visual C++\VC98\bin\VCVARS32.BAT" (    set "BOOST_JAM_TOOLSET=msvc"    set "BOOST_JAM_TOOLSET_ROOT=%ProgramFiles%\Microsoft Visual C++\VC98\"    goto :eof)setlocal & endlocalcall :Test_Path cl.exeif not errorlevel 1 (    set "BOOST_JAM_TOOLSET=msvc"    set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"    goto :eof)setlocal & endlocalcall :Test_Path vcvars32.batif not errorlevel 1 (    set "BOOST_JAM_TOOLSET=msvc"    call "%FOUND_PATH%VCVARS32.BAT"    set "BOOST_JAM_TOOLSET_ROOT=%MSVCDir%\"    goto :eof)setlocal & endlocalif EXIST "C:\Borland\BCC55\Bin\bcc32.exe" (    set "BOOST_JAM_TOOLSET=borland"    set "BOOST_JAM_TOOLSET_ROOT=C:\Borland\BCC55\"    goto :eof)setlocal & endlocalcall :Test_Path bcc32.exeif not errorlevel 1 (    set "BOOST_JAM_TOOLSET=borland"    set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"    goto :eof)setlocal & endlocalcall :Test_Path icl.exeif not errorlevel 1 (    set "BOOST_JAM_TOOLSET=intel-win32"    set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\"    goto :eof)setlocal & endlocalif EXIST "C:\MinGW\bin\gcc.exe" (    set "BOOST_JAM_TOOLSET=mingw"    set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\"    goto :eof)setlocal & endlocalif NOT "_%CWFolder%_" == "__" (    set "BOOST_JAM_TOOLSET=metrowerks"    set "BOOST_JAM_TOOLSET_ROOT=%CWFolder%\"    goto :eof )setlocal & endlocalcall :Test_Path mwcc.exeif not errorlevel 1 (    set "BOOST_JAM_TOOLSET=metrowerks"    set "BOOST_JAM_TOOLSET_ROOT=%FOUND_PATH%..\..\"    goto :eof)setlocal & endlocalcall :Error_Print "Could not find a suitable toolset."goto :eof:Guess_YaccREM Tries to find bison or yacc in common places so we can build the grammar.setlocal & endlocalcall :Test_Path yacc.exeif not errorlevel 1 (    set "YACC=yacc -d"    goto :eof)setlocal & endlocalcall :Test_Path bison.exeif not errorlevel 1 (    set "YACC=bison -d --yacc"    goto :eof)setlocal & endlocalif EXIST "C:\Program Files\GnuWin32\bin\bison.exe" (    set "YACC=C:\Program Files\GnuWin32\bin\bison.exe" -d --yacc    goto :eof)setlocal & endlocalcall :Error_Print "Could not find Yacc to build the Jam grammar."goto :eof:Startset BOOST_JAM_TOOLSET=set BOOST_JAM_ARGS=REM If no arguments guess the toolset;REM or if first argument is an option guess the toolset;REM otherwise the argument is the toolset to use.if "_%1_" == "__" (    call :Guess_Toolset    if not errorlevel 1 goto Setup_Toolset) else (    call :Test_Option "%1"    if not errorlevel 1 (        call :Guess_Toolset        if not errorlevel 1 goto Setup_Toolset    ) else (        setlocal & endlocal        set "BOOST_JAM_TOOLSET=%1"        shift        goto Setup_Toolset    ))if errorlevel 1 goto Finish:Setup_ToolsetREM Setup the toolset command and options. This bit of codeREM needs to be flexible enough to handle both whenREM the toolset was guessed at and found, or when the toolsetREM was indicated in the command arguments.REM NOTE: The strange multiple "if ?? == _toolset_" tests are that wayREM because in BAT variables are subsituted only once during a singleREM command. A complete "if ... ( commands ) else ( commands )"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -