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. 완전히 다른 시스템(심지어 Cygwin/Windows 7)에서도 사용자가 지정한 git repo와재고 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.in371행에 빈 문자열을 지정했기 때문입니다(이것이 문제의 핵심입니다).

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

    나는 이것이 AC_CHECK_PROG 매크로의 버그 있는 호출이라고 생각합니다.GNU Autoconf 문서테이크 지정두 개가 아닌 필수 인수:

    ― 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. 나는 이 실수가 발생한 이유가 해당 줄의 원래 정의가 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 변수를 빈 문자열로 설정하라는 지시를 받았습니다.

다른 사람들은 이 분석에 대해 어떻게 생각하는지 듣고 싶습니다.

관련 정보