| 45 | *步驟結束後目錄下會有以下檔案: hello.c hello Makefile |
| 46 | |
| 47 | |
| 48 | === 第二階段:使用autoconf產生安裝及設定檔 === |
| 49 | ==== Step1. 工具取得及安裝 ==== |
| 50 | 1. 工具取得 [ftp://ftp.ntu.edu.tw/gnu/autoconf/autoconf-2.68.tar.gz autoconf下載(v2.68)] |
| 51 | 2. 安裝(步驟略) |
| 52 | |
| 53 | ==== Step2. autoscan ==== |
| 54 | * 此一步驟為讓系統自動產生 configure.scan |
| 55 | * 將產生的configure.scan更名為configure.ac,以便日後自行修改configure時不會被覆寫掉 |
| 56 | * 將Makefile 更名為 Makefile.in 做為日後修改的樣板 |
| 57 | ==== Step3. autoconf ==== |
| 58 | * 產生configure的可執行檔 |
| 59 | * 執行configure |
| 60 | {{{ |
| 61 | checking for gcc... gcc |
| 62 | checking whether the C compiler works... yes |
| 63 | checking for C compiler default output file name... a.out |
| 64 | checking for suffix of executables... |
| 65 | checking whether we are cross compiling... no |
| 66 | checking for suffix of object files... o |
| 67 | checking whether we are using the GNU C compiler... yes |
| 68 | checking whether gcc accepts -g... yes |
| 69 | checking for gcc option to accept ISO C89... none needed |
| 70 | configure: creating ./config.status |
| 71 | config.status: creating Makefile |
| 72 | config.status: error: cannot find input file: `config.h.in' |
| 73 | }}} |
| 74 | * 錯誤訊息:因為無法找到header檔 |
| 75 | ==== Step4. autoheader ==== |
| 76 | * 執行 autoheader |
| 77 | * 產生header檔 |
| 78 | * 執行configure |
| 79 | {{{ |
| 80 | checking for gcc... gcc |
| 81 | checking whether the C compiler works... yes |
| 82 | checking for C compiler default output file name... a.out |
| 83 | checking for suffix of executables... |
| 84 | checking whether we are cross compiling... no |
| 85 | checking for suffix of object files... o |
| 86 | checking whether we are using the GNU C compiler... yes |
| 87 | checking whether gcc accepts -g... yes |
| 88 | checking for gcc option to accept ISO C89... none needed |
| 89 | configure: creating ./config.status |
| 90 | config.status: creating Makefile |
| 91 | config.status: creating config.h |
| 92 | }}} |
| 93 | |
| 94 | === 第三階段:修改Source Code === |