summaryrefslogtreecommitdiff
path: root/ltconfig
diff options
context:
space:
mode:
Diffstat (limited to 'ltconfig')
-rwxr-xr-xltconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/ltconfig b/ltconfig
index 5c6366c9890..a5011a81c19 100755
--- a/ltconfig
+++ b/ltconfig
@@ -3009,6 +3009,16 @@ hardcode_action=$hardcode_action
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
+# Check if debuild is being run by the current shell. If it is then,
+# the DEB_BUILD_ARCH variable should be of non-zero length, indicating
+# that we are in the middle of a Debian package build (assuming the
+# user isn't doing anything strange with environment variables).
+if test -n "`dpkg-architecture -qDEB_BUILD_ARCH`" && ps | grep debuild | grep -v grep > /dev/null; then
+ # Debian policy mandates that rpaths should not be encoded into a binary
+ # so it is overridden.
+ hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ "
+fi
+
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator=$hardcode_libdir_separator