Add cross-compilation support to configure script
If the environment variable TARGET_CC is set, configure uses the value
as target compiler for cross-compiling. For example:
TARGET_CC=x86_64-w64-mingw32-gcc ./configure
@@ -38,12 +38,17 @@ if [ -z "$CC" ]; then
fi
fi
+if [ -z "$TARGET_CC" ]; then
echo "Using C compiler '$CC'"
+ TARGET_CC="$CC"
+else
+ echo "Using target compiler '$TARGET_CC' and host compiler '$CC'"
+fi
command="$CC ../common/charmonizer.c -o charmonizer"
echo $command
$command || exit
echo Running charmonizer
-./charmonizer --cc=$CC --host=c --enable-c --enable-makefile "$@"
+./charmonizer --cc="$TARGET_CC" --host=c --enable-c --enable-makefile "$@"
