日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

對話 UNIX,第 12 部分: 自己動手完成項(xiàng)目( 三 )


集中精力感受源代碼
下一個步驟是探查系統(tǒng)并配置該軟件,以便進(jìn)行正確地構(gòu)建 。(您可以將這個步驟想象為裁剪一件衣服:這件衣服大小基本合適,但是需要進(jìn)行一定的修改以使其更加時尚 。)您需要進(jìn)行自定義工作,并為使用 ./configure 本地腳本進(jìn)行編譯做好準(zhǔn)備 。在命令行提示處,鍵入:$ ./configure
這個配置腳本進(jìn)行了幾項(xiàng)測試,以證明您的系統(tǒng)是合格的 。例如,在一臺 Apple MacBook 計(jì)算機(jī)上(其中運(yùn)行著 FreeBSD?UNIX 的一個變種)運(yùn)行 ./configure,將產(chǎn)生以下結(jié)果(請參見清單 2):
清單 2. 在 Mac OS X 上運(yùn)行 ./configure 的結(jié)果
checking build system type... i386-apple-darwin8.9.1
checking host system type... i386-apple-darwin8.9.1
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by gcc... /usr/bin/ld
...
這里,./configure 可以確定編譯和主機(jī)系統(tǒng)的類型(如果您采用交叉編譯的話,它可能不同),證實(shí)是否已經(jīng)安裝了 GNU C 編譯器(GCC),并找到其余構(gòu)建過程可能需要使用的實(shí)用工具的路徑 。您可以瀏覽一下其余的輸出,但是您將看到一個較長的診斷信息列表,該列表從成功構(gòu)造 SQLite 的角度分析了您的系統(tǒng)的特點(diǎn) 。
注意: ./configure 命令可能 會失敗,特別是在無法找到一個先決條件的情況下(比如一個系統(tǒng)庫或者關(guān)鍵的系統(tǒng)實(shí)用工具) 。
瀏覽 ./configure 的輸出,尋找其中不正常之處,如命令的專用或者本地版本,它可能并不適合于構(gòu)建通用的應(yīng)用程序,如 SQLite 。作為一個示例,如果您的系統(tǒng)管理員安裝了 GCC 的 alpha 版本,并且 configure 工具首選使用該版本,那么您可以選擇手動地改寫這個選擇 。要查看您可以改寫的選項(xiàng)的列表(該列表通常很長),可以鍵入 ./configure --help,如清單 3 中所示:
清單 3. 用于 ./configure 腳本的通用選項(xiàng)
$ ./configure --help
...
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'.
For better control, use the options below.
Fine tuning of the installation DirectorIEs:
 --bindir=DIRuser executables [EPREFIX/bin]
 --sbindir=DIR system admin executables [EPREFIX/sbin]
 --libexecdir=DIRprogram executables [EPREFIX/libexec]
...
./configure --help 的輸出中包括配置系統(tǒng)使用的通用選項(xiàng),以及僅與您正在構(gòu)建的軟件相關(guān)的特定選項(xiàng) 。要查看后者(較短)的列表,可以鍵入 ./configure --help=short(請參見清單 4):
清單 4. 要構(gòu)建的軟件包所特定的選項(xiàng)
$ ./configure --help=short
Optional Features:
 --disable-FEATUREdo not include FEATURE (same as --enable-FEATURE=no)
 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
 --enable-shared[=PKGS] build shared librarIEs [default=yes]
 --enable-static[=PKGS] build static libraries [default=yes]
 --enable-fast-install[=PKGS]
 optimize for fast installation [default=yes]
 --disable-libtool-lock avoid locking (might break parallel builds)

推薦閱讀