Anatomy of nginx · automatic scripts (2) setting the initial variable script Auto/init

Source: Internet
Author: User

InconfigureRunningauto/optionsRun the scriptauto/initScript, the work is as follows.

1 MAKEFILE file name variable

By default:

  • objs/Makefile

The Code is as follows:

NGX_MAKEFILE=$NGX_OBJS/Makefile
2. source file name variable

By default:

  • objs/ngx_modules.c

The Code is as follows:

NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
3 header file name variables

By default:

  • objs/ngx_auto_headers.h
  • objs/ngx_auto_config.h

The Code is as follows:

NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.hNGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
4. automatically test the file name and configuration error file name variable

By default:

  • objs/autotest
  • objs/autoconf.err

The Code is as follows:

NGX_AUTOTEST=$NGX_OBJS/autotestNGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
5 stubs related variables

By default:

  • objs/autoconf.err
  • objs/Makefile

The Code is as follows:

# STUBsNGX_ERR=$NGX_OBJS/autoconf.errMAKEFILE=$NGX_OBJS/Makefile
6 PCH related variables

The Code is as follows:

NGX_PCH=NGX_USE_PCH=
7. Test "\ c" and "-n" in the environment"

Nginx supports multiple operating systems, such as Mac OS, Linux, and Solaris. Shell in different systems is slightly different. Thereforeauto/initThe script contains the following two variables:

  • ngx_n
  • ngx_c

The Code is as follows:

# check the echo‘s "-n" option and "\c" capabilityif echo "test\c" | grep c >/dev/null; then    if echo -n test | grep n >/dev/null; then        ngx_n=        ngx_c=    else        ngx_n=-n        ngx_c=    fielse    ngx_n=    ngx_c=‘\c‘fi
8. Create and write makefile

There are two other targets, default: Build and clean.rm -rf Makefile $NGX_OBJS.

# create Makefilecat << END > Makefiledefault:    buildclean:    rm -rf Makefile $NGX_OBJS

Anatomy of nginx · automatic scripts (2) setting the initial variable script Auto/init

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.