代码之家  ›  专栏  ›  技术社区  ›  John Bruselius Jensen

配置脚本和ldid

  •  2
  • John Bruselius Jensen  · 技术社区  · 12 年前

    由于以下原因,配置脚本的摘录失败 Killed: 9 错误,即iOS 5只能运行 签名的 应用程序。所以我需要找到一种方法 ldid -s 有些地方在这些测试中,唯一的问题是在哪里。

    任何人

    以失败

    checking build system compiler gcc... no
    checking build system compiler gcc -g -O2 ... no
    checking build system compiler cc... no
    checking build system compiler gcc... no
    checking build system compiler c89... no
    checking build system compiler c99... no
    configure: error: Cannot find a build system compiler
    

    和config.log

    onfigure:15586: gcc -c -g -O2  conftest.c >&5
    configure:15586: $? = 0
    configure:15586: result: yes
    configure:15586: checking sys/time.h presence
    configure:15586: gcc -E  conftest.c
    configure:15586: $? = 0
    configure:15586: result: yes
    configure:15586: checking for sys/time.h
    configure:15586: result: yes
    configure:15677: checking build system compiler gcc
    configure:15690: gcc conftest.c
    conftest.c: In function 'main':
    conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
    configure:15693: $? = 0
    ./configure: line 15675: 27218 Killed: 9               ./a.out
    ./configure: line 15695: ./b.out: No such file or directory
    ./configure: line 15695: ./a.exe: No such file or directory
    ./configure: line 15695: ./a_out.exe: No such file or directory
    ./configure: line 15695: ./conftest: No such file or directory
    configure:15700: result: no
    configure:15677: checking build system compiler gcc -g -O2
    configure:15690: gcc -g -O2  conftest.c
    conftest.c: In function 'main':
    conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
    configure:15693: $? = 0
    ./configure: line 15675: 27234 Killed: 9               ./a.out
    ./configure: line 15695: ./b.out: No such file or directory
    ./configure: line 15695: ./a.exe: No such file or directory
    ./configure: line 15695: ./a_out.exe: No such file or directory
    ./configure: line 15695: ./conftest: No such file or directory
    configure:15700: result: no
    

    最后是/配置脚本。。

    if test -n "$CC_FOR_BUILD"; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $CC_FOR_BUILD" >&5
        $as_echo_n "checking build system compiler $CC_FOR_BUILD... " >&6; }
        # remove anything that might look like compiler output to our "||" expression
        rm -f conftest* a.out b.out a.exe a_out.exe
        cat >conftest.c <<EOF
        int
        main ()
        {
          exit(0);
        }
        EOF
        gmp_compile="$CC_FOR_BUILD conftest.c"
        cc_for_build_works=no
        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
          (eval $gmp_compile) 2>&5
          ac_status=$?
          $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
          test $ac_status = 0; }; then
          if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
            cc_for_build_works=yes
          fi
        fi
        rm -f conftest* a.out b.out a.exe a_out.exe
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_for_build_works" >&5
        $as_echo "$cc_for_build_works" >&6; }
        if test "$cc_for_build_works" = yes; then
          :
        else
          as_fn_error $? "Specified CC_FOR_BUILD doesn't seem to work" "$LINENO" 5
        fi
    
        elif test -n "$HOST_CC"; then
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $HOST_CC" >&5
        $as_echo_n "checking build system compiler $HOST_CC... " >&6; }
        # remove anything that might look like compiler output to our "||" expression
        rm -f conftest* a.out b.out a.exe a_out.exe
        cat >conftest.c <<EOF
        int
        main ()
        {
          exit(0);
        }
    
    1 回复  |  直到 12 年前
        1
  •  1
  •   Nate    12 年前

    我不得不承认,除了最简单的shell脚本之外,我阅读任何东西的能力都很差,但基本上,在运行可执行文件之前,你需要对其进行伪代码签名 conftest 正确的因此,请尝试在此块中签名:

    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
      (eval $gmp_compile) 2>&5
      ac_status=$?
      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      test $ac_status = 0; }; then
    
      #begin added code
      ldid -S ./conftest
      #end added code
    
      if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
        cc_for_build_works=yes
      fi
    fi
    

    显然,您可能需要提供 ldid (例如。 /usr/bin/ldid )如果在现有的 PATH

    更新: 根据下面海报的评论, a.out 实际上是需要签名的可执行文件,而不是 一致性检验