Anatomy of nginx automatic scripts (6) compiler name variable script Auto/CC/Name

Source: Internet
Author: User
Review variable CC

Initially inauto/optionsInitialized in the script:

CC=${CC:-gcc}
1 C compiler feature

The compiler for Windows is calledMSVCOther platforms are collectively calledC Compiler.

1.1 obtain compiler Parameters

This script is not complex.NGX_PLATFORMVariable to determine whether it iswin32(The variable is inauto/options). If yes, then:

ngx_feature="C compiler"ngx_feature_name=ngx_feature_run=yesngx_feature_incs=ngx_feature_path=ngx_feature_libs=ngx_feature_test=. auto/feature

Where,ngx_featureVariable isC compilerAnd initialize other feature-related variables before referencing them.auto/featureScript.

1.2 exit if the compiler cannot be found.

ngx_foundIndicates whether the compiler exists and determinesngx_foundIf the variable isno(The variable is inauto/featureIn the script), then:

echoecho $0: error: C compiler $CC is not foundechoexit 1

That is, if the compiler does not exist, exit the automatic script.

2. Set the name 2.1 msvc based on different Compilers
if `$NGX_WINE $CC -v 2>&1     | grep ‘^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16‘     >/dev/null 2>&1`; then    NGX_CC_NAME=msvc10    echo " + using Microsoft Visual C++ 10 compiler"else if `$NGX_WINE $CC -v 2>&1     | grep ‘^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14‘     >/dev/null 2>&1`; then    NGX_CC_NAME=msvc8    echo " + using Microsoft Visual C++ 8 compiler"else if `$NGX_WINE $CC -v 2>&1     | grep ‘^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13‘     >/dev/null 2>&1`; then    NGX_CC_NAME=msvc7    echo " + using Microsoft Visual C++ 7 compiler"else    NGX_CC_NAME=msvc    echo " + using Microsoft Visual C++ compiler"fififi
2.2 owc
elseif [ "$CC" = wcl386 ]; then    NGX_CC_NAME=owc    echo " + using Open Watcom C compiler"
2.3 BCC
elseif [ "$CC" = bcc32 ]; then    NGX_CC_NAME=bcc    echo " + using Borland C++ compiler"
2.4 gcc
elseif `$CC -v 2>&1 | grep ‘gcc version‘ >/dev/null 2>&1`; then    NGX_CC_NAME=gcc    echo " + using GNU C compiler"
2.5 ICC
elseif `$CC -V 2>&1 | grep ‘^Intel(R) C‘ >/dev/null 2>&1`; then    NGX_CC_NAME=icc    echo " + using Intel C++ compiler"
2.6 sunc
elseif `$CC -V 2>&1 | grep ‘Sun C‘ >/dev/null 2>&1`; then    NGX_CC_NAME=sunc    echo " + using Sun C compiler"
2.7 ccc
elseif `$CC -V 2>&1 | grep ‘^Compaq C‘ >/dev/null 2>&1`; then    NGX_CC_NAME=ccc    echo " + using Compaq C compiler"
2.8 ACC
elseif `$CC -V 2>&1 | grep ‘^aCC: ‘ >/dev/null 2>&1`; then    NGX_CC_NAME=acc    echo " + using HP aC++ compiler"
2.9 unknown
else    NGX_CC_NAME=unknown

Anatomy of nginx automatic scripts (6) compiler name variable script Auto/CC/Name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.