mirror of https://github.com/encounter/SDL.git
Use --enable-new-dtags to set RUNPATH rather than RPATH so that LD_LIBRARY_PATH is not overridden by the application.
This commit is contained in:
parent
73680ab374
commit
dc5f05bb99
|
@ -958,6 +958,12 @@ elseif(UNIX AND NOT APPLE)
|
||||||
set(SDL_RLD_FLAGS "")
|
set(SDL_RLD_FLAGS "")
|
||||||
if(BSDI OR FREEBSD OR LINUX OR NETBSD)
|
if(BSDI OR FREEBSD OR LINUX OR NETBSD)
|
||||||
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
|
set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--enable-new-dtags")
|
||||||
|
check_c_compiler_flag("" HAVE_ENABLE_NEW_DTAGS)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
|
if(HAVE_ENABLE_NEW_DTAGS)
|
||||||
|
list(APPEND SDL_RLD_FLAGS "-Wl,--enable-new-dtags")
|
||||||
|
endif()
|
||||||
elseif(SOLARIS)
|
elseif(SOLARIS)
|
||||||
set(SDL_RLD_FLAGS "-R\${libdir}")
|
set(SDL_RLD_FLAGS "-R\${libdir}")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -23763,6 +23763,36 @@ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\
|
||||||
if test "x$enable_rpath" = "xyes"; then
|
if test "x$enable_rpath" = "xyes"; then
|
||||||
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
|
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
|
||||||
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
|
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker option --enable-new-dtags" >&5
|
||||||
|
$as_echo_n "checking for linker option --enable-new-dtags... " >&6; }
|
||||||
|
have_enable_new_dtags=no
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
|
||||||
|
have_enable_new_dtags=yes
|
||||||
|
SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_enable_new_dtags" >&5
|
||||||
|
$as_echo "$have_enable_new_dtags" >&6; }
|
||||||
fi
|
fi
|
||||||
if test $ARCH = solaris; then
|
if test $ARCH = solaris; then
|
||||||
SDL_RLD_FLAGS="-R\${libdir}"
|
SDL_RLD_FLAGS="-R\${libdir}"
|
||||||
|
|
13
configure.in
13
configure.in
|
@ -3516,6 +3516,19 @@ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.
|
||||||
if test "x$enable_rpath" = "xyes"; then
|
if test "x$enable_rpath" = "xyes"; then
|
||||||
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
|
if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then
|
||||||
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
|
SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for linker option --enable-new-dtags)
|
||||||
|
have_enable_new_dtags=no
|
||||||
|
save_LDFLAGS="$LDFLAGS"
|
||||||
|
LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
||||||
|
AC_TRY_LINK([
|
||||||
|
],[
|
||||||
|
],[
|
||||||
|
have_enable_new_dtags=yes
|
||||||
|
SDL_RLD_FLAGS="$SDL_RLD_FLAGS -Wl,--enable-new-dtags"
|
||||||
|
])
|
||||||
|
LDFLAGS="$save_LDFLAGS"
|
||||||
|
AC_MSG_RESULT($have_enable_new_dtags)
|
||||||
fi
|
fi
|
||||||
if test $ARCH = solaris; then
|
if test $ARCH = solaris; then
|
||||||
SDL_RLD_FLAGS="-R\${libdir}"
|
SDL_RLD_FLAGS="-R\${libdir}"
|
||||||
|
|
Loading…
Reference in New Issue