Skip to content

Commit

Permalink
Add Spearmint portable SDL for Linux compile stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Jun 24, 2015
1 parent add8b18 commit 3e84d56
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions make-linux-portable.sh
@@ -0,0 +1,16 @@
#!/bin/sh

if [ -z "$1" ]; then
echo "Usage: $0 <arch>"
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"

0 comments on commit 3e84d56

Please sign in to comment.