LoginSignup
13
10

More than 5 years have passed since last update.

とってもシンプルなconfigure.ac

Posted at

configure.acは世の中にいくらでもあるけど、複雑なのが多いのでシンプルなサンプルをつくってみた。

使い方

$ autoconf     # configure.acと同じディレクトリで実行する。
               # マクロを展開して移植性の高いconfigureスクリプトを作り出してくれる。
$ ./configure

とってもシンプルなconfigure.ac

configure.ac
AC_INIT([test_package_name],[0.0.1])   # 初期化と、対象のパッケージのメタデータの設定。必須。

AC_SUBST([variable], value)            # configure時に@variable@をvariableの値で置換。
                                       # 今回はvariableが設定されていないので、
                                       # 第二引数のvalueに置換。

AC_CONFIG_FILES([output])              # configureの対象となるファイルを設定。

AC_OUTPUT                              # AC_CONFIG_FILESで設定したファイルを出力
                                       # 今回は'output.in'から'output'を生成

入力ファイル

output.in
@variable@

出力ファイル

output
value

めでたしめでたし。

13
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
10