1. Add a new compiler and linker to the Auto/make script:
#LINK = $LINK #原25行附近注释掉原链接器
cxx=g++ #新增C + + compiler
Cxxflags=-std=c++0x-wall #新增C + + compile option, enable c++11
link=g++ #新增C + + linker
2. Near 340 rows, Red Bottom bold is the modified part
# The Stream sources
If [$STREAM = YES]; Then
If Test-n "$NGX _pch", then
ngx_cc= "\$ (cc) $ngx _compile_opt \$ (CFLAGS) $ngx _use_pch \$ (all_incs)"
ngx_cxx= "\$ (cxx) $ngx _compile_opt \$ (cxxflags) $ngx _use_pch \$ (all_incs)"
Else
ngx_cc= "\$ (cc) $ngx _compile_opt \$ (CFLAGS) \$ (core_incs) \$ (stream_incs)"
" Span style= "background-color: #ff0000" >ngx_cxx= "\$ (cxx) $ngx _compile_opt \$ (cxxflags) \$ (core_incs) \$ (stream_incs)"
Fi
For NGX_SRC in $STREAM _srcs
Do
Ngx_src= ' echo $ngx _src | SED-E "s/\//$ngx _regex_dirsep/g"
Ngx_obj= ' echo $ngx _src \
| Sed-e "s#^\ (. *\.\) cpp\\$# $ngx _objs_dir\1$ngx_objext#g" \
-e "s#^\ (. *\.\) cc\\$# $ngx _objs_dir\1$ngx_objext#g" \
-e "s#^\ (. *\.\) c\\$# $ngx _objs_dir\1$ngx_objext#g" \
-e "s#^\ (. *\.\) s\\$# $ngx _objs_dir\1$ngx_objext#g" '
ext= ' echo ${ngx_src} | cut-d.-f 2 '
ngx_gcc= $ngx _CC
If [$ext = "cpp"]; Then
ngx_gcc= $ngx _cxx
Fi
Cat << END >> $NGX _makefile
$ngx _obj:\$ (core_deps) \$ (stream_deps) $ngx _cont$ngx_src
$ngx _gcc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$ngx_aux
END
Nginx Configuration supports C + +