serenity/Ports/epsilon/patches/0001-Add-serenity-toolchain-information-and-makefile-file.patch
sdomi 4db8a0b964 Toolchain: Fix default library paths when building with clang
When building with the GNU toolchain, /usr/local/lib and
/usr/local/include are among the default search paths for the compiler
and linker. It seems that this is not the case for Clang/LLVM, and thus
some packages fail to build, while others silently drop optional deps.

This commit adds those paths back, fixing multiple packages at once.
Additionally, it removes legacy -I/-L includes in various Ports which
are no longer needed.

Co-Authored-By: Nico Weber <thakis@chromium.org>
2024-08-04 11:09:53 -04:00

82 lines
2.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Joachim Le Fournis <joachimlf@pm.me>
Date: Tue, 13 Jul 2021 21:17:44 +0200
Subject: [PATCH] Add serenity toolchain information and makefile files
---
build/platform.simulator.serenity.mak | 6 ++++
build/toolchain.x86_64-pc-serenity.mak | 1 +
ion/src/simulator/serenity/Makefile | 43 ++++++++++++++++++++++++++
3 files changed, 50 insertions(+)
create mode 100644 build/platform.simulator.serenity.mak
create mode 100644 build/toolchain.x86_64-pc-serenity.mak
create mode 100644 ion/src/simulator/serenity/Makefile
diff --git a/build/platform.simulator.serenity.mak b/build/platform.simulator.serenity.mak
new file mode 100644
index 0000000000000000000000000000000000000000..0ac83c0bb06554bfa3077b9c2b67516291018e3b
--- /dev/null
+++ b/build/platform.simulator.serenity.mak
@@ -0,0 +1,6 @@
+TOOLCHAIN = x86_64-pc-serenity
+EXE = elf
+
+EPSILON_TELEMETRY ?= 0
+
+SHOULD_USE_DYNAMIC_SDL = 1
diff --git a/build/toolchain.x86_64-pc-serenity.mak b/build/toolchain.x86_64-pc-serenity.mak
new file mode 100644
index 0000000000000000000000000000000000000000..bb49f4ed4dcec21891f94ec9c3c9f602d6f4cbcf
--- /dev/null
+++ b/build/toolchain.x86_64-pc-serenity.mak
@@ -0,0 +1 @@
+TOOLCHAIN_PREFIX = x86_64-pc-serenity
diff --git a/ion/src/simulator/serenity/Makefile b/ion/src/simulator/serenity/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..5d4bb131983ba85c79042cfa790b94e400158705
--- /dev/null
+++ b/ion/src/simulator/serenity/Makefile
@@ -0,0 +1,43 @@
+ION_SIMULATOR_FILES = 1
+
+
+ion_src += $(addprefix ion/src/simulator/linux/, \
+ assets.s \
+ platform_files.cpp \
+ platform_images.cpp \
+ platform_language.cpp \
+)
+
+SFLAGS += -I$(SERENITY_INSTALL_ROOT)/usr/local/include/SDL2 -I$(SERENITY_INSTALL_ROOT)/usr/local/include
+LDFLAGS += -lpng -lz -ljpeg -lSDL2
+
+ion_src += $(addprefix ion/src/simulator/shared/, \
+ dummy/haptics_enabled.cpp \
+ dummy/keyboard_callback.cpp \
+ dummy/window_callback.cpp \
+ actions.cpp \
+ clipboard_helper.cpp \
+ haptics.cpp \
+ journal.cpp \
+ state_file.cpp \
+)
+
+ion_src += ion/src/shared/collect_registers.cpp
+
+ifeq ($(EPSILON_TELEMETRY),1)
+ion_src += ion/src/simulator/shared/dummy/telemetry_init.cpp
+ion_src += ion/src/shared/telemetry_console.cpp
+endif
+
+$(eval $(call rule_for, \
+ INCBIN, \
+ ion/src/simulator/linux/assets.s ion/src/simulator/linux/platform_images.h, \
+ $(ion_simulator_assets_paths), \
+ $$(PYTHON) ion/src/simulator/linux/incbin.py $(ion_simulator_assets) -o $$@, \
+ global \
+))
+
+$(call object_for,ion/src/simulator/linux/platform_images.cpp): $(BUILD_DIR)/ion/src/simulator/linux/platform_images.h
+
+# The header is refered to as <ion/src/simulator/linux/platform_images.h> so make sure it's findable this way
+$(call object_for,ion/src/simulator/linux/platform_images.cpp): SFLAGS += -I$(BUILD_DIR)