zoukankan      html  css  js  c++  java
  • Nginx 配置支持C++

    1.在auto/make脚本里添加新的编译器和链接器:

    #LINK = $LINK                         #原25行附近注释掉原链接器
    CXX=g++                                #新增C++编译器
    CXXFLAGS=-std=c++0x -Wall    #新增C++编译选项,启用C++11
    LINK=g++                               #新增C++链接器

    2.来到340行附近,红底粗体为修改部分

    # 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)"
    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

  • 相关阅读:
    成员变量和局部变量
    成员变量和局部变量
    对象和类
    数组
    Scanner--控制台输入
    Java运算符
    Java数据类型
    TextView控件
    Android控件
    注释
  • 原文地址:https://www.cnblogs.com/yufengs/p/6015362.html
Copyright © 2011-2022 走看看