#!/bin/bash
# Install cross-compiler toolchain for CubeCactusOS development on macOS
echo "================================"
echo "CubeCactusOS Toolchain Installer"
echo "================================"
echo ""
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "✗ Homebrew not found. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "✓ Homebrew is installed"
fi
echo ""
echo "Installing cross-compiler toolchain..."
echo "This may take 10-20 minutes..."
echo ""
# Install i386-elf-gcc cross-compiler
brew tap nativeos/i386-elf-toolchain
brew install i386-elf-binutils i386-elf-gcc
# Install other required tools
brew install qemu xorriso grub --HEAD
echo ""
echo "================================"
echo "Installation Complete!"
echo "================================"
echo ""
echo "Installed tools:"
which i386-elf-gcc
which i386-elf-as
which i386-elf-ld
which qemu-system-i386
which grub-mkrescue
echo ""
echo "You can now build CubeCactusOS:"
echo " make -f Makefile.os os-image"
echo ""