From 37db965cff36eade8a1322a1e6af906d693569f4 Mon Sep 17 00:00:00 2001 From: Jackson R <48877885+spi3ex@users.noreply.github.com> Date: Tue, 14 Feb 2023 13:05:41 +0530 Subject: [PATCH] This simulator was tested on ARM MacBook. Updating Simulator for macOS macOS requires genromfs and X11 Libraries to run Simulators. * Added instructions to install genromfs * Added instructions to install X11 Adding Xorg Server The linker was unable to identify the location of X11 libraries. removed -L/opt/X11/lib from ln 145 Updating Changes to streamline with other Hosts --- Documentation/guides/simulator.rst | 22 +++++++++++++++++++++- arch/sim/src/Makefile | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/guides/simulator.rst b/Documentation/guides/simulator.rst index 307d38d80f..de15685d16 100644 --- a/Documentation/guides/simulator.rst +++ b/Documentation/guides/simulator.rst @@ -13,7 +13,27 @@ having a piece of embedded hardware. This guide assumes you're on Linux. It works on Windows and Mac too— if you know how, submit a PR to improve this guide! -.. todo:: Add Mac and Windows instructions +.. todo:: Windows instructions + +Prerequisites For macOS +----------------------- + +We need ``genromfs`` to build simulators(NON GUI). + + .. code-block:: console + + $ git clone https://github.com/chexum/genromfs.git + $ cd genromfs + $ make + $ make install + Now Copy the built `genromfs` `exec` to /opt/local/bin + +For GUI Applications we need X11 Libraries, libx11 can also be built using Homebrew or by Installing XQuartz. + + .. code-block:: console + + $ sudo port install xorg-libX11 + $ sudo port install sudo port install xorg-server Compiling --------- diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index deb7d59dbe..e43dbd1e76 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -141,6 +141,9 @@ endif ifeq ($(CONFIG_SIM_X11FB),y) HOSTSRCS += sim_x11framebuffer.c +ifeq ($(CONFIG_HOST_MACOS),y) + STDLIBS += -L/opt/X11/lib +endif STDLIBS += -lX11 -lXext ifeq ($(CONFIG_SIM_TOUCHSCREEN),y) CSRCS += sim_touchscreen.c