Rubyの設定スクリプトが実行ファイルとヘッダファイルを検出しないのはなぜですか?

Rubyの設定スクリプトが実行ファイルとヘッダファイルを検出しないのはなぜですか?

私はRubyをコンパイルしようとしていますが、これを行うときに何が起こるのかを本当に理解しようとしています。Makefiles以前に使用して作成したことがありますが、ファイルではないため、意図autoconfconfigure.inに得られた結果かもしれません。

$ git clone https://github.com/ruby/ruby.git
...
$ cd ruby
$ git clean -fdx
$ autoconf 
$ ./configure
...
checking for dot... no
checking for doxygen... no
checking for pkg-config... no
...
checking direct.h usability... no
checking direct.h presence... no
checking for direct.h... no
...
checking for daemon... (cached) no

ただし、少なくともすべてがインストールされています。

$ dot -V
dot - graphviz version 2.26.3 (20100126.1600)
$ doxygen --version
1.7.4
$ pkg-config --version
0.26
$ sudo updatedb
$ locate /direct.h
/usr/src/linux-headers-3.0.0-16-generic/include/config/pci/direct.h
/usr/src/linux-headers-3.0.0-17-generic/include/config/pci/direct.h
$ daemon --version
daemon-0.6.4

問題ごとに原因が異なる可能性があることを知っていますが、スクリプトがなぜこれを検出しないのですかconfigure

最新のパッチが適用されたUbuntu 11.10を実行しています。

$ uname -a
Linux username 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

別のホストを試しました。からconfig.log

configure:6408: checking for dot
configure:6424: found /usr/bin/dot
configure:6438: result: no
configure:6445: checking for doxygen
configure:6461: found /usr/bin/doxygen
configure:6475: result: no
configure:6483: checking for pkg-config
configure:6504: found /usr/bin/pkg-config
configure:6530: result: no

何?見つけましたが、まだ行っていませんか?

configure:11880: checking direct.h usability
configure:11880: gcc -c  -O3 -ggdb    conftest.c >&5
conftest.c:135:20: fatal error: direct.h: No such file or directory
compilation terminated.
configure:11880: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
...
| #endif
| #include <direct.h>
configure:11880: result: no
configure:11880: checking direct.h presence
configure:11880: gcc -E  conftest.c
conftest.c:102:20: fatal error: direct.h: No such file or directory
compilation terminated.
configure:11880: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| /* end confdefs.h.  */
| #include <direct.h>
configure:11880: result: no
configure:11880: checking for direct.h
configure:11880: result: no

ファンキーなテストスクリプト - 一種のデフォルトパスにあるべきですか?

configure:15175: checking for daemon
configure:15175: result: no

これは実行可能ファイルをチェックするのではなく、使用されたC関数をチェックすることがわかりました。AC_CHECK_FUNCS

ベストアンサー1

私はルビーについて知ることはほとんどありません。しかし、私はビルドシステムについてかなりの量を知っています。私はここに提案をするために最善を尽くしますRubyビルドシステムで実際のバグを見つけました。

これが私の推論です。

  1. 私はあなたが指定したgitリポジトリを使って、まったく異なるシステム(Cygwin / Windows 7を含む)であなたと同じ結果を得ました。ストック Ruby 1.9 ソースコード

  2. 実際に道で発見したのでfound: /usr/bin/dotあなたのものを見ることができます。configure.logこれは生成されたスクリプトで簡単に確認できます。特に、シェルのデバッグ出力を取得するconfigureために最初の行を変更する場合は特にそうです。#!/bin/sh -x

    + test -z /bin
    + for ac_exec_ext in ''\'''\''' '$ac_executable_extensions'
    + test -f /bin/dot
    + test -x /bin/dot
    + ac_cv_prog_DOT=
    + printf '%s\n' 'configure:6424: found /bin/dot'
    + break 2
    + IFS='     
    
  3. これが表示されるのは、result: no上記のコードスニペットに示すように、空の文字列ac_cv_prog_DOTに設定され、構成の次の行がその欠落値を反映しているためです。

    + DOT=
    + test -n ''
    + printf '%s\n' 'configure:6438: result: no'
    + printf '%s\n' no
    no
    
  4. configure.in空の文字列に設定する理由は、空の文字列が行371で指定されているためです(これが問題の中心です)。

    AC_CHECK_PROG(DOT, dot)
    AC_CHECK_PROG(DOXYGEN, doxygen)
    

    私はこれがAC_CHECK_PROGマクロの間違った呼び出しだと思います。GNU Autoconf ドキュメント撮影枚数指定サム2つ以外の必須パラメータ:

    ― Macro: AC_CHECK_PROG (variable, prog-to-check-for, value-if-found, [value-if-not-found], [path = ‘$PATH’], [reject])
    
    Check whether program prog-to-check-for exists in path. If it
    is found, set variable to value-if-found, otherwise to
    value-if-not-found, if given. Always pass over reject (an
    absolute file name) even if it is the first found in the search
    path; in that case, set variable using the absolute file name
    of the prog-to-check-for found that is not reject. If variable
    was already set, do nothing. Calls AC_SUBST for variable. The
    result of this test can be overridden by setting the variable
    variable or the cache variable ac_cv_prog_variable.
    

    デフォルトはありません。これを維持するということは、実際に「ポイントが見つかった場合は、DOTを空の文字列に設定する」ことを意味します。

  5. 私はこのエラーが発生する理由は、行の元の定義が2 AC_CHECK_TOOLつの引数だけを必要とする別のマクロを使用したためだと思います。

    ~から 2010年11月11日にsvn.ruby-lang.orgで確認済み

    AC_CHECK_TOOLはAC_CHECK_PROGになります。

  6. これはしばらく中断された可能性があり、一部のChangeLogコメントは次のようなDOXYGEN問題があることを示しているようです。

    Fri Mar 26 19:55:41 2010  Akinori MUSHA  <[email protected]>
    
        * Makefile.in (DOXYGEN): Define a missing variable DOXYGEN.  Build
          has been failing when doxygen(1) is found by configure but the
          variable is not defined by the system and make(1) does not allow
          an empty command. ("@$(DOXYGEN)" was the cause)
    

結局私が間違っている可能性があります。しかし、configureツールが見つかり、対応するMakefile変数を空の文字列に設定するように指示されたと確信しています。

この分析について他の人の考えを聞きたいです。

おすすめ記事