From 3d91327bc353e674ff09921785fa35792a7e03c8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 11 Feb 2004 07:09:11 +0000 Subject: [PATCH] Fixed static linking on MacOS X (thanks Max!) --- configure.in | 12 ++++++++++++ sdl-config.in | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index faad1558d..422cef619 100644 --- a/configure.in +++ b/configure.in @@ -2592,6 +2592,17 @@ case "$ARCH" in ;; esac +case "$ARCH" in + macosx) + # Evil hack to allow static linking on Mac OS X + SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a" + ;; + *) + SDL_STATIC_LIBS="$SDL_LIBS" + ;; +esac + + STATIC_SYSTEM_LIBS="$SYSTEM_LIBS" dnl Output the video drivers we use @@ -2614,6 +2625,7 @@ AC_SUBST(SDL_EXTRALIBS) dnl Expand the cflags and libraries needed by apps using SDL AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) +AC_SUBST(SDL_STATIC_LIBS) AC_SUBST(SDL_RLD_FLAGS) dnl Expand the libraries needed for static and dynamic linking diff --git a/sdl-config.in b/sdl-config.in index 942d242df..132db863d 100644 --- a/sdl-config.in +++ b/sdl-config.in @@ -57,7 +57,7 @@ while test $# -gt 0; do @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) @ENABLE_STATIC_TRUE@ libdirs="-L@libdir@ @SDL_RLD_FLAGS@" -@ENABLE_STATIC_TRUE@ echo $libdirs @SDL_LIBS@ @STATIC_SYSTEM_LIBS@ +@ENABLE_STATIC_TRUE@ echo $libdirs @SDL_STATIC_LIBS@ @STATIC_SYSTEM_LIBS@ @ENABLE_STATIC_TRUE@ ;; *) echo "${usage}" 1>&2