autoconf/automake を使用して小さなプロジェクトを作成しました。
プロジェクトは、ネイティブ コンパイルとクロス コンパイルの両方を対象としています。
./configure --host=arm-none-eabi
これはうまくいきます。ただし、クロスコンパイラがインストールされていない場合、構成されたスクリプトはそれを無視し、インストールされているデフォルトのコンパイラを使用して喜んでコンパイルします。
./configure --host=arm-none-eabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-eabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make sets $(MAKE)... (cached) yes
checking for arm-none-eabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
ここでは arm-none-eabi-gcc が見つかりませんでした。ただし、ネイティブ gcc が検出され、ネイティブ コンパイラが引き続き使用されます。
--host=XXXX を使用してクロス コンパイルを要求し、そのためのコンパイラが見つからない場合、構成スクリプトを停止してエラーを発生させるには、configure.ac に何を入れることができますか?