From 3e84d5696f436c13933ad12ca7bf747c5b671d12 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 24 Jun 2015 18:07:28 -0500 Subject: [PATCH] Add Spearmint portable SDL for Linux compile stuff --- Makefile | 6 ++++++ make-linux-portable.sh | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 make-linux-portable.sh diff --git a/Makefile b/Makefile index 4cf8f11c5b..ea578f8a08 100644 --- a/Makefile +++ b/Makefile @@ -418,6 +418,12 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) CLIENT_LIBS=$(SDL_LIBS) RENDERER_LIBS = $(SDL_LIBS) -lGL + ifeq ($(USE_PORTABLE_RPATH),1) + # $ is escaped using two, so this is litterly $ORIGIN + CLIENT_LIBS+=-Wl,-rpath,'$$ORIGIN/lib/$(ARCH)' + RENDERER_LIBS+=-Wl,-rpath,'$$ORIGIN/lib/$(ARCH)' + endif + ifeq ($(USE_OPENAL),1) ifneq ($(USE_OPENAL_DLOPEN),1) CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) diff --git a/make-linux-portable.sh b/make-linux-portable.sh new file mode 100755 index 0000000000..8440bd939c --- /dev/null +++ b/make-linux-portable.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Usage: $0 " + echo " arch can be x86 or x86_64" + exit 0 +fi + +ARCH=$1 +SDL_PREFIX=/home/zack/Local/SDL-2.0.3/build-$ARCH + +SDL_CFLAGS="`$SDL_PREFIX/bin/sdl2-config --cflags`" +SDL_LIBS="`$SDL_PREFIX/bin/sdl2-config --libs`" + +make ARCH=$ARCH USE_PORTABLE_RPATH=1 SDL_CFLAGS="$SDL_CFLAGS" SDL_LIBS="$SDL_LIBS" +