#!/bin/bash # Simple ARM64 cross-compilation script for pure C version if [ "$1" == "arm64" ] || [ "$1" == "aarch64" ]; then echo "Cross-compiling C framebuffer demo for ARM64..." # Check if cross-compiler is available if ! command -v aarch64-linux-gnu-gcc &> /dev/null; then echo "Error: ARM64 cross-compiler not found!" echo "Install with: sudo apt-get install gcc-aarch64-linux-gnu" exit 1 fi # Cross-compile pure C version (no dependencies) aarch64-linux-gnu-gcc -o framebuffer_demo framebuffer_simple.c -static if [ $? -eq 0 ]; then echo "Cross-compilation successful!" echo "Binary compiled for ARM64 (aarch64)" echo "Transfer to R36 Ultra and run with: sudo ./framebuffer_demo" file framebuffer_demo else echo "Cross-compilation failed!" exit 1 fi else echo "Compiling C framebuffer demo (native)..." gcc -o framebuffer_demo framebuffer_simple.c if [ $? -eq 0 ]; then echo "Compilation successful!" echo "Run with: sudo ./framebuffer_demo" file framebuffer_demo else echo "Compilation failed!" exit 1 fi fi