autoconfに似たプロジェクトを繰り返すことを不可能にします。

autoconfに似たプロジェクトを繰り返すことを不可能にします。

私はARMv7チップ上で動作するLinuxシステムを構築しましたが、完全に実行されていますが、基本的なビルドに問題があります。

最初はx86-64システムでクロスコンパイルしてブートストラップを実行しましたが、今は基本的にすべてを再構築してテストなどを実行する必要があると思います。

私が経験している問題は、autoconfプロジェクトが実行する特定のタスクを実行するプロジェクトに影響します。 gmakeやm4などのいくつかのコンポーネントでこの問題が発生しましたが、ここではgmakeに焦点を当てます(影響を受ける他のプロジェクトもまったく同じように動作します)。 Python、nginx、uwsgi、perlなどは問題なく構築されています。

私がすることの基本的な順序は次のとおりです。

$ tar xjf ~/download/make-4.2.1.tar.bz2
$ cd make-4.2.1
$ ./configure

これまでは、すべてがうまく機能しています。クロスコンパイラで構築した基本コンパイラを探し、クロス構築ツール(sed、gawkなど)もすべて探します。問題は、「make」を実行するとすぐにエラーが発生することです。

$ make
make  all-recursive
make[1]: Entering directory '/home/jan/tmp/make-4.2.1'
Making all in glob
make[1]: *** [Makefile:798: all-recursive] Error 1
make[1]: Leaving directory '/home/jan/tmp/make-4.2.1'
make: *** [Makefile:534: all] Error 2

ご覧のとおり、本質的に何もしません。 globサブディレクトリに移動すると主張しますが、決してそこに到達しません。

走る

$ make --trace

..生産する:

Makefile:573: update target 'config.h' due to: stamp-h1
test -f config.h || rm -f stamp-h1
test -f config.h || make  stamp-h1
Makefile:534: update target 'all' due to: config.h
make  all-recursive
make[1]: Entering directory '/home/jan/tmp/make-4.2.1'
Makefile:798: target 'all-recursive' does not exist
fail=; \
if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if { if test -z '1'; then false; elif test -n 'armv7l-unknown-linux-gnueabihf'; then true; elif test -n '4.2.1' && test -n '/home/jan/tmp/make-4.2.1'; then true; else false; fi; }; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \ ]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs ]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in *=*|--*) continue;; -*I) strip_trailopt 'I'; skip_next=yes;; -*I?*) strip_trailopt 'I';; -*O) strip_trailopt 'O'; skip_next=yes;; -*O?*) strip_trailopt 'O';; -*l) strip_trailopt 'l'; skip_next=yes;; -*l?*) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in *$target_option*) has_opt=yes; break;; esac; done; test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='glob config po doc w32' ;; \
  *) list='glob config po doc ' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
Making all in glob
make[1]: *** [Makefile:798: all-recursive] Error 1
make[1]: Leaving directory '/home/jan/tmp/make-4.2.1'
make: *** [Makefile:534: all] Error 2

どこで失敗するのかわかりますが、その理由を理解していません。下部の近くにセクションがあります。

(CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target)

私がそれを次のように変更した場合:

(printf "hello\n" && CDPATH="${ZSH_VERSION+.}:" && printf "world\n" && cd $subdir && make $local_target)

..そしてライン全体を再実行し、次のように出力します。

Making all in glob
hello
exit

つまり、CDPATH=... 部分から抜け出さないようで混乱します。少なくとも1つの他のプロジェクトを詳細に確認しましたが、同じロジックが失敗します。

すべてのコンポーネントは新しいものです(最新の安定版でない場合は、1つまたは2つのバージョンが遅いバージョン(GCC 7.2.0、gmake 4.2.1、bash 4.4など))。私はglibcを使っていますが、私はByboxシステムですが、いくつかのツールがcoreutilsツールに置き換えられました。そして、前述したように、私はbash(SHELLが/ bin / bashに設定されている)を使用しています。

私は解決策を見つけるために多くを検索しました。私が見つけた唯一のヒントは、私の問題と漠然と同様の問題でした。解決策はautoreconfを実行することです。確かに試してみましたが、違いはありませんでした。

ビルドが失敗する原因は何ですか?

ベストアンサー1

これはbashクロスビルドによるものであることがわかった。幸いなことに、この問題はARMプラットフォーム自体でローカルにbashをビルドすることには影響しませんでしたので、ローカルビルドをビルドし、すべてのテストを実行し、新しいbashバイナリをインストールして再起動すると問題がなくなりました。

おすすめ記事