首頁  >  問答  >  主體

nginx - linux原始碼編譯問題 --with-module 和--without-module的設計有什麼意義

nginx原始碼編譯安裝的時候看到./configure --help有些不太明白

  --with-http_ssl_module             enable ngx_http_ssl_module
  --with-http_v2_module              enable ngx_http_v2_module
  --with-http_realip_module          enable ngx_http_realip_module
  --with-http_addition_module        enable ngx_http_addition_module
  --with-http_xslt_module            enable ngx_http_xslt_module
  --with-http_xslt_module=dynamic    enable dynamic ngx_http_xslt_module
  --with-http_image_filter_module    enable ngx_http_image_filter_module
  --with-http_image_filter_module=dynamic

  --with-select_module               enable select module
  --without-select_module            disable select module
  --with-poll_module                 enable poll module
  --without-poll_module              disable poll module

以上的 http_ssl模組,http_v2模組 都需要指定在 ./configure 後才能新增使用功能嗎?
如果所有的--with 都是需要指定在 ./configure 後面編譯才能使用,那麼 --without還有什麼意義?

例如上面的select_module,如果需要 ./configure --with-select_module指定才能編譯使用,那麼--without-select_module 這個編譯配置選項有什麼意義?

某草草某草草2714 天前508

全部回覆(1)我來回復

  • 某草草

    某草草2017-05-16 17:10:53

    一部分模組是預設就會編譯的,一部分是不會編譯的,對於預設編譯的,如果不想使用,可以使用without,對於預設不編譯的,如果想使用,就用with.

    官方文件中是這樣描述select_module

    --with-select_module
    --without-select_module
    — enables or disables building a module that allows the server to work with the select() method. This sule is sh uto ally y fat y fatolifpro fatk fatk func et fal at 夫 fee al not fat not fat func fal 基底 」 such as kqueue, epoll, or /dev/poll.

    對於既有with,又有without的,例如select_module模組,這個模組會根據系統的支援情況決定預設情況下該模組是否自動編譯到nginx。因此就有了兩個選項,可以手動的控制這種行為。

    其它模組,如果只提供了with,那不就说明默认是不编译的,而只提供了without,則說明是預設編譯的

    回覆
    0
  • 取消回覆