From 409b9c86d93bb42aa73851a48e26c5ef13062acf Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 21 Aug 2010 11:04:04 +0200 Subject: [PATCH] Speed up removal of auxiliary linker output files for ltlibraries. * lib/am/ltlib.am (clean-%DIR%LTLIBRARIES): Rewrite using just one `rm' invocation. Report by Bob Friesenhahn. Signed-off-by: Ralf Wildenhues --- ChangeLog | 5 +++++ lib/am/ltlib.am | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98011dcfb..6e2c275bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-08-21 Ralf Wildenhues + Speed up removal of auxiliary linker output files for ltlibraries. + * lib/am/ltlib.am (clean-%DIR%LTLIBRARIES): Rewrite using just + one `rm' invocation. + Report by Bob Friesenhahn. + Improve robustness of mdate-sh script. * lib/mdate-sh: Sanitize zsh behavior on startup, to ensure $ls_command is word-split properly upon invocation. diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am index 29aa00ce7..55e53e176 100644 --- a/lib/am/ltlib.am +++ b/lib/am/ltlib.am @@ -104,9 +104,11 @@ clean-%DIR%LTLIBRARIES: ## `so_locations' files are created by some linkers (IRIX, OSF) when ## building a shared object. Libtool places these files in the ## directory where the shared object is created. - @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(%DIR%_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } -- 2.47.2