以編譯bluez中的configure為模版,并補充了些選項
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables 指定環境變量(e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
配置選項Configuration: - h, --help display this help and exit ./configure出問題的第一反應 --help=short display options specific to this package 隻顯示正在運作的目前腳本選項 --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking...' messages 不顯示腳本工作期間輸出的“checking ...”消息 -C, --config-cache alias for `-- cache-file=config.cache' 這個檔案會很有用 --cache-file=FILE cache test results in FILE [disabled] 在FILE檔案中緩存測試結果(預設禁用)
-n, --no-create do not create output files 不輸出結果 --srcdir=DIR find the sources in DIR [configure dir or `..'] 指定源代碼所在目錄DIR
安裝目錄Installation directories: -- prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX]
By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'.
--enable-layout=LAYOUT 使用名為LAYOUT的布局配置所有源代碼和編譯腳本。這樣就允許你在安裝時分别指定不同檔案的安裝位置。config.layout檔案中包含了預設布局的示例,你可以根據它建立你自己的布局。這個檔案中的不同布局使用<Layout FOO>...</Layout>段進行分組,其中的FOO就是布局名。預設的布局是Apache 。
For better control, use the options below. 安裝目錄微調 Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] 使用者可執行目錄DIR 。用于存放對網站管理者很有幫助的htpasswd, dbmmanage之類的支援程式。 --sbindir=DIR system admin executables [EPREFIX/sbin] 有超級使用者執行的程式 --libexecdir=DIR program executables [EPREFIX/libexec] 指定可執行支援檔案的安裝位置。與二進制檔案相反,這些檔案從來 不直接由使用者執行,但是可以被上面提到的二進制檔案所執行 --sysconfdir=DIR read-only single-machine data [PREFIX/etc] /etc配置檔案目錄 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] 可寫的單一機器資料目錄DIR --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] Web伺服器隻讀的體系無關資料目錄DIR --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/bluez] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR]
程式名稱Program names: --program-prefix=PREFIX prepend PREFIX to installed program names 字首 --program-suffix=SUFFIX append SUFFIX to installed program names 字尾 --program-transform-name=PROGRAM run sed PROGRAM on installed program names 這裡的PROGRAM是一個sed腳本.當一個程式被安裝時,他的名字将經過`sed -e PROGRAM'來産生安裝的名字
系統類型System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET類型的系統,預設使用host的值
特性選項Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 一些軟體包可以選擇這個選項來提供為大型選項的編譯時配置,例如使用Kerberos認證系統或者一個實驗性的編譯器最優配置.如果預設是提供這些特性,這裡'FEATURE'是特性的名字 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-static[=PKGS] build static libraries [default=no] 編譯為靜态庫 --enable-shared[=PKGS] build shared libraries [default=yes] 編譯為動态庫 --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-optimization disable code optimization --disable-fortify disable compile time buffer checks --disable-pie disable position independent executables flag --disable-network disable network plugin --enable-sap enable sap plugin --disable-serial disable serial plugin --disable-input disable input plugin --disable-audio disable audio plugin 編譯的時候有些功能我們 用不到就不用編譯了使用--disable- 禁用 --disable-service disable service plugin --enable-health enable health plugin --enable-pnat enable pnat plugin --enable-gatt-example enable GATT example plugin --enable-gstreamer enable GStreamer support --enable-alsa enable ALSA support --enable-usb enable USB support --enable-tracer install Tracing daemon --enable-tools install Bluetooth utilities --enable-bccmd install BCCMD interface utility --enable-pcmcia install PCMCIA serial script --enable-hid2hci install HID mode switching utility --enable-dfutool install DFU firmware upgrade utility --enable-hidd install HID daemon --enable-pand install PAN daemon --enable-dund install DUN daemon --enable-cups install CUPS backend support --enable-test install test programs --enable-datafiles install Bluetooth configuration and data files --enable-debug enable compiling with debugging information 啟用調試日志 --enable-maemo6 compile with maemo6 plugin --enable-dbusoob compile with D-Bus OOB plugin --enable-hal Use HAL to determine adapter class --enable-capng enable capabilities support
特殊程式包選項Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-ouifile=PATH Path to the oui.txt file [auto] --with-sap=DRIVER select SAP driver --with-telephony=DRIVER select telephony driver --with-systemdunitdir=DIR path to systemd system service directory
環境變量Some influential environment variables: PKG_CONFIG path to pkg-config utility 找不到庫的時候要設定這個 例如:export PKG_CONFIG_LIBDIR=/usr/local/newbt/lib/pkgconfig/ CC C compiler command C編譯器指令 CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config 與dbus有關的頭檔案 DBUS_LIBS linker flags for DBUS, overriding pkg-config 與dbus有關的庫 GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config ALSA_LIBS linker flags for ALSA, overriding pkg-config GSTREAMER_CFLAGS C compiler flags for GSTREAMER, overriding pkg-config GSTREAMER_LIBS linker flags for GSTREAMER, overriding pkg-config USB_CFLAGS C compiler flags for USB, overriding pkg-config USB_LIBS linker flags for USB, overriding pkg-config UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config UDEV_LIBS linker flags for UDEV, overriding pkg-config SNDFILE_CFLAGS C compiler flags for SNDFILE, overriding pkg-config SNDFILE_LIBS linker flags for SNDFILE, overriding pkg-config CAPNG_CFLAGS C compiler flags for CAPNG, overriding pkg-config CAPNG_LIBS linker flags for CAPNG, overriding pkg-config
Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations.
補充: 子產品選項 有兩種使用子產品的方法:一是靜态連接配接進核心,二是作為DSO子產品動态加載;如果編譯中包含任何DSO子產品,則mod_so會被自動包含進核心。如果希望核心能夠裝載DSO,但不實際編譯任何DSO子產品,則需明确指定"--enable-so=static"。
一般文法 一般情況下你可以使用如下文法啟用或者禁用某個子產品:
--disable-MODULE 禁用MODULE子產品(僅用于基本子產品) --enable-MODULE=shared 将MODULE編譯為DSO(可用于所有子產品) --enable-MODULE=static 将MODULE靜态連接配接進核心(僅用于擴充和實驗子產品) --enable-mods-shared=MODULE-LIST 将MODULE-LIST中的所有子產品都編譯成DSO(可用于所有子產品) --enable-modules=MODULE-LIST 将MODULE-LIST靜态連接配接進核心(可用于所有子產品)
上述 MODULE-LIST 可以是: (1)用引号界定并且用空格分隔的子產品名清單
--enable-mods-shared='headers rewrite dav'
(2)"most"(大多數子產品[遇見錯誤子產品時忽略該子產品而不中斷配置過程]) (3)"all"(所有子產品[遇見錯誤子產品時中斷配置過程并報錯])
--enable-mods-shared=most
注意 configure将忽略MODULE和MODULE-LIST中的拼寫錯誤,注意仔細拼寫。用于MODULE和MODULE-LIST中的名稱是"mod_NAME"中去掉"mod_"并将剩餘部分中的下劃線"_"替換為連字元"-"以後的結果,比如"mod_log_config"子產品應當表示為"log-config"。