This will help landing AOT support, avoiding turning tc-build.sh and tc-package.sh into a spaghetti mess. Fixes #898