]> git.puffer.fish Git - matthieu/frr.git/commitdiff
build: add --disable-rpath option in configure
authorEmanuele Bovisio <emanuele.bovisio@eolo.it>
Thu, 22 Oct 2020 14:24:02 +0000 (16:24 +0200)
committerEmanuele Bovisio <emanuele.bovisio@eolo.it>
Fri, 23 Oct 2020 08:00:08 +0000 (10:00 +0200)
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>
configure.ac
doc/user/installation.rst

index 8e86ba87ff78190bcffdde39e7c9ba05c0268851..67290807c20296994925205fd762bbd8b6a792ab 100755 (executable)
@@ -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
 ------------------------------
index ee06578b7c6123ec2c23fe1365054761d1952778..5d5dfa5cc5de8ab76f1ffda3ecc6655cf268727e 100644 (file)
@@ -273,15 +273,15 @@ options from the list below.
    With this option, we provide a way to strip out these characters for APK dev
    package builds.
 
-..option:: --disable-version-build-config
+.. option:: --disable-version-build-config
 
    Remove the "configuerd with" field that has all of the build configuration
    arguments when reporting the version string in `show version` command.
 
-..option:: --with-pkg-extra-version=VER
+.. option:: --with-pkg-extra-version=VER
    Add extra version field, for packagers/distributions
 
-..option::  --with-pkg-git-version
+.. option::  --with-pkg-git-version
 
    Add git information to MOTD and build version string
 
@@ -355,6 +355,10 @@ options from the list below.
 
    Turn on the usage of PCRE Posix libs for regex functionality.
 
+.. option:: --enable-rpath
+
+   Set hardcoded rpaths in the executable [default=yes].
+
 You may specify any combination of the above options to the configure
 script. By default, the executables are placed in :file:`/usr/local/sbin`
 and the configuration files in :file:`/usr/local/etc`. The :file:`/usr/local/`