3. How to run configure and make / 如何執行 configure 與 make
A package constructed using Autoconf will come with a `configure' script. A user who wants to build and install the package must run this script in order to prepare their source tree in order to build it on their particular system. The actual build process is performed using the make program.
一個使用 Autoconf 建構的套件會含有一個 `configure' 指令稿,想要建置與安裝套件的使用者必須先執行這個指令稿,以針對使用者的系統調整所取得的原始碼樹。實際的建置程序,則是利用 make 程式來執行。
The `configure' script tests system features. For example, it might test whether the C library defines the time_t data type for use by the time() C library function. The `configure' script then makes the results of those tests available to the program while it is being built.
`configure' 指令稿會測試系統所支援的功能,舉例來說,他可能會測試 C 函式庫是不是定義了由 time() 這個 C 函式庫使用的 time_t 資料型別。完成測試後 `configure' 指令稿會把結果包裝成建置時期可以存取的型式,以供建置時使用。
This chapter explains how to invoke a `configure' script from the perspective of a user -- someone who just wants to take your package and compile it on their system with a minimum of fuss. It is because Autoconf works as well as it does that it is usually possible to build a package on any kind of machine with a simple configure; make
command line. The topics covered in this chapter include how to invoke configure, the files that configure generates and the most useful `Makefile' targets -- actions that you want make to perform -- that will be available when compiling the package (see section 4. Introducing `Makefile's).
在這章,我們會從使用者 -- 也就是想在他自己的系統上取得你的套件並編譯,但不希望碰上大麻煩的那個人 -- 的角度來解釋怎麼執行 `configure' 指令稿。拜 Autoconf 的精良實作,我們通常可以在任何機器上執行簡單的 configure; make
指令來進行套件的建置。我們會在這章討論怎麼執行 configure,哪些檔案會被 configure 產生,以及一些在編譯套件時很有用的 `Makefile' 建置目標 -- 也就是你想要 make 進行的動作 (請參閱 4. 簡介 `Makefile')。