diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 56c2510d7e..8983f1085d 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -272,10 +272,15 @@ LINK_PLUGIN_SYMBOLS = $(LINK_EMPTY_SYMBOLS) LINK_EXEC_EXPORT=-rdynamic LIB_PLATFORM_RPATH = -Wl,-rpath,$(1) -ifeq ($(strip @BINRELOC_CFLAGS@),) -LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@)) + +ifeq (@USE_RPATH@,1) + ifeq ($(strip @BINRELOC_CFLAGS@),) + LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,$(if $(subst intl,,$(1)),@FB_LIBDIR@,@FB_INTLDIR@)) + else + LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$ORIGIN/../$(1)') + endif else -LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$ORIGIN/../$(1)') + LIB_LINK_RPATH = endif LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl) LIB_LINK_SONAME= -Wl,-soname,$(1) diff --git a/configure.in b/configure.in index 3a487e08f7..dbb1eec616 100644 --- a/configure.in +++ b/configure.in @@ -494,6 +494,14 @@ if test "$RAW_DEVICES_FLG" = "Y"; then [Define this if databases on raw devices should be supported]) fi +AC_ARG_ENABLE(rpath, + [ --enable-rpath enable linking with RPATH (default)], + [], + [enable_rpath=yes]) +if test "x$enable_rpath" != "xno" || test "x$enable_rpath" = "x" ; then + AC_SUBST(USE_RPATH, 1) +fi + AC_ARG_WITH(editline, [ --with-editline support fancy command line editing], [case "$withval" in