summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEmanuele Bovisio <emanuele.bovisio@eolo.it>2020-10-22 16:24:02 +0200
committerEmanuele Bovisio <emanuele.bovisio@eolo.it>2020-10-23 10:00:08 +0200
commit7134d0e9b273db4e6fa60e40a9773154e70514fd (patch)
tree97df3db29e81e5ba914c6ad53fb272c8024e7ce9 /configure.ac
parent84de5a245a3eb17619588a535b9f408ce802a8c9 (diff)
build: add --disable-rpath option in configure
Add an option to remove RPATH entry from binary files. Useful for cross-compilation, otherwise libtool hardcodes the building path. Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8e86ba87ff..67290807c2 100755
--- a/configure.ac
+++ b/configure.ac
@@ -451,6 +451,11 @@ fi
AC_SUBST([AC_LDFLAGS])
AM_CONDITIONAL([STATIC_BIN], [test "$enable_static_bin" = "yes"])
+AC_ARG_ENABLE([rpath],
+ [AS_HELP_STRING([--enable-rpath], [set hardcoded rpaths in the executable @<:@default=yes@:>@])],
+ [],
+ [enable_rpath=yes])
+
dnl $AR and $RANLIB are set by LT_INIT above
AC_MSG_CHECKING([whether $AR supports D option])
if $AR crD conftest.a >/dev/null 2>/dev/null; then
@@ -2499,6 +2504,14 @@ AS_IF([test "$with_pkg_git_version" = "yes"], [
## It's already in CVS until texinfo 4.7 is more common.
AC_OUTPUT
+if test "$enable_rpath" = "yes" ; then
+ true
+else
+ # See https://old-en.opensuse.org/openSUSE:Packaging_Guidelines#Removing_Rpath
+ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+fi
+
echo "
FRRouting configuration
------------------------------