Package: acr
Version: 2.2.2-1
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs
Control: affects -1 + src:tudu
tudu fails to cross build from source, because it fails to detect a
working cross compiler. It uses acr and that happens to roughly work in
this way:
* Consider the environment variable CXX.
* When it is unset, default it to "c++".
* When cross compiling, try <triplet>-$CXX.
* Fall back to $CXX (i.e. c++).
Now Debian has /usr/bin/c++, but no /usr/bin/<triplet>-c++. That might
be considered a bug, but even if that were to change, acr would be
incompatible with older versions of Debian. I propose adding another
fallback. If <triplet>-$CXX is not to be found, I suggest additionally
checking <triplet>-g++ as that's also what autoconf does. Once doing so,
tudu cross builds successfully. I'm attaching a patch for your
convenience.
Helmut
--- acr-2.2.2.orig/src/acr-sh
+++ acr-2.2.2/src/acr-sh
@@ -929,7 +929,10 @@
ochof \"checking for c++ compiler... \"
if [ \"${S}{CROSSBUILD}\" = 1 ]; then
(command -v ${S}{HOST}-${S}{CXX} 2>&1 >/dev/null)
-if [ \"${S}?\" = 0 ]; then CXX=\"${S}{HOST}-${S}{CXX}\"; fi
+if [ \"${S}?\" = 0 ]; then CXX=\"${S}{HOST}-${S}{CXX}\"; else
+(command -v ${S}{HOST}-g++ 2>&1 >/dev/null)
+if [ \"${S}?\" = 0 ]; then CXX=\"${S}{HOST}-g++\"; fi
+fi
fi
echo \"#include <iostream>\" > test.cxx
echo \"int main(){ std::cout << 1; return 0;}\" >> test.cxx