Commit ccac5853 authored by Tom Coldrick's avatar Tom Coldrick
Browse files

Upstream libtool .la file removal

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.
parent 30f696f2
Loading
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -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 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;
      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_files}

  # Commands for stripping debugging information out of
  # installed binaries