summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Coldrick <thomas.coldrick@codethink.co.uk>2018-08-28 14:54:36 +0100
committerThomas Coldrick <thomas.coldrick@codethink.co.uk>2018-08-28 14:54:36 +0100
commit20ade7a22eb1a293d71df3e6f4dc69c127382da3 (patch)
treeb6a805ad22e1b11f6ac7b4431c19fa3ed0b1bcd4
parent6a5a8e7a9942c83581d3cb44e6509f773ca136f9 (diff)
downloadbuildstream-coldtom/autotools-libtool.tar.gz
Upstream libtool .la file removalcoldtom/autotools-libtool
In freedesktop-sdk we add a script to our project.conf to remove libtool .la files from autotools projects after install, this seems like a sensible default, so we're attempting to send it upstream.
-rw-r--r--buildstream/plugins/elements/autotools.yaml36
1 files changed, 36 insertions, 0 deletions
diff --git a/buildstream/plugins/elements/autotools.yaml b/buildstream/plugins/elements/autotools.yaml
index 021d3815c..7adafd472 100644
--- a/buildstream/plugins/elements/autotools.yaml
+++ b/buildstream/plugins/elements/autotools.yaml
@@ -50,6 +50,40 @@ variables:
#
# notparallel: True
+
+ # Automatically remove libtool archive files
+ #
+ # Set remove-libtool-modules to "true" to remove .la files for
+ # modules intended to be opened with lt_dlopen()
+ #
+ # Set remove-libtool-libraries to "true" to remove .la files for
+ # libraries
+ #
+ # Value must be "true" or "false"
+ remove-libtool-modules: "false"
+ remove-libtool-libraries: "false"
+
+ delete-libtool-archives: |
+ if %{remove-libtool-modules} || %{remove-libtool-libraries}; then
+ find "%{install-root}" -name "*.la" -print0 | while read -d '' -r file; do
+ if grep '^shouldnotlink=yes$' "${file}" &>/dev/null; then
+ if %{remove-libtool-modules}; then
+ echo "Removing ${file}."
+ rm "${file}"
+ else
+ echo "Not removing ${file}."
+ fi
+ else
+ if %{remove-libtool-libraries}; then
+ echo "Removing ${file}."
+ rm "${file}"
+ else
+ echo "Not removing ${file}."
+ fi
+ fi
+ done
+ fi
+
config:
# Commands for configuring the software
@@ -72,6 +106,8 @@ config:
install-commands:
- |
%{make-install}
+ - |
+ %{delete-libtool-archives}
# Commands for stripping debugging information out of
# installed binaries