diff --git a/.gitignore b/.gitignore index cb150b79e4ed051719d1fb0afad5aeb475f8e693..12fe9851164bd01ab1eb5ac74032cfc2e2be0b7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Bazel bazel-* +WORKSPACE # Temporary files *.pyc diff --git a/WORKSPACE b/WORKSPACE.in similarity index 100% rename from WORKSPACE rename to WORKSPACE.in diff --git a/apollo.sh b/apollo.sh index 561dd985aabb31b8589d33ab0e97b78db5722370..490a955668392d879a74c60854972051506e56cb 100755 --- a/apollo.sh +++ b/apollo.sh @@ -63,7 +63,13 @@ function apollo_check_system_config() { function check_machine_arch() { # the machine type, currently support x86_64, aarch64 MACHINE_ARCH=$(uname -m) - if [ "${MACHINE_ARCH}" != "x86_64" ] && [ "${MACHINE_ARCH}" != "aarch64" ]; then + + # Generate WORKSPACE file based on marchine architecture + if [ "$MACHINE_ARCH" == 'x86_64' ]; then + sed "s/MACHINE_ARCH/x86_64/g" WORKSPACE.in > WORKSPACE + elif [ "$MACHINE_ARCH" == 'aarch64' ]; then + sed "s/MACHINE_ARCH/aarch64/g" WORKSPACE.in > WORKSPACE + else fail "Unknown machine architecture $MACHINE_ARCH" exit 1 fi