automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, master, updated. Release-1-


From: Ralf Wildenhues
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. Release-1-10-177-g4295fe3
Date: Sun, 07 Sep 2008 09:08:48 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=4295fe33eb23fb9440ee6a7404ec064067266372

The branch, master has been updated
       via  4295fe33eb23fb9440ee6a7404ec064067266372 (commit)
      from  8c9f415b59a95d76c0addba84101adbc3080f214 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4295fe33eb23fb9440ee6a7404ec064067266372
Author: Ralf Wildenhues <address@hidden>
Date:   Sun Sep 7 10:56:19 2008 +0200

    Multi-file install for PROGRAMS.
    
    * lib/am/progs.am (install-%DIR%PROGRAMS): Allow to install
    several programs with one install invocation, when not using
    libtool; employs some trickery to cater for nobase_, $(EXEEXT),
    create needed directories, libtool, while only forking a
    constant number of times in the fast path; uses awk and sed also
    in the default path.
    (%DIR%PROGRAMS_INSTALL) [!BASE]: No need to use install-sh any
    more.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |   10 +++++++++
 lib/am/progs.am |   60 ++++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ede8960..3f9f743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2008-09-07  Ralf Wildenhues  <address@hidden>
 
+       Multi-file install for PROGRAMS.
+       * lib/am/progs.am (install-%DIR%PROGRAMS): Allow to install
+       several programs with one install invocation, when not using
+       libtool; employs some trickery to cater for nobase_, $(EXEEXT),
+       create needed directories, libtool, while only forking a
+       constant number of times in the fast path; uses awk and sed also
+       in the default path.
+       (%DIR%PROGRAMS_INSTALL) [!BASE]: No need to use install-sh any
+       more.
+
        Enhance cleaning of programs in libtool mode.
        * lib/am/progs.am (clean-%DIR%PROGRAMS) [?LIBTOOL?]: Fork less
        often, avoid removing programs twice if $(EXEEXT) is empty.
diff --git a/lib/am/progs.am b/lib/am/progs.am
index 24fd10f..2a7778c 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -21,37 +21,61 @@
 
 if %?INSTALL%
 am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-%DIR%PROGRAMS_INSTALL = %BASE?$(INSTALL_PROGRAM):$(install_sh_PROGRAM)%
+%DIR%PROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 .PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
        @$(NORMAL_INSTALL)
        test -z "$(%NDIR%dir)" || $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)"
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
-       @list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
+       @list='$(%DIR%_PROGRAMS)'; \
+       for p in $$list; do echo "$$p $$p"; done | \
 ## On Cygwin with libtool test won't see `foo.exe' but instead `foo'.
 ## So we check for both.
-         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do \
          if test -f $$p \
 ?LIBTOOL?           || test -f $$p1 \
-         ; then \
-## Compute basename of source file.  Unless this is a nobase_ target, we
-## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.yo',
-## not '$(DESTDIR)$(%NDIR%dir)/python/foo.yo'.
-## However in all cases $(transform) applies only to the basename,
-## so we have to strip the directory part.
-           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-## Prepend the directory part if nobase_ is used.
-?!BASE?            f=`echo "$$p1" | sed 's|[^/]*$$||'`"$$f"; \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+## We now have a list of sourcefile pairs, separated by newline.
+## Turn that into "sourcefile source_base target_dir xformed_target_base",
+## with newlines being turned into spaces in a second step.
+       sed -e 'p;s,.*/,,;n;h' \
+?BASE?     -e 's|.*|.|' \
+?!BASE?            -e 's|[^/]*$$||; s|^$$|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
 ## Note that we explicitly set the libtool mode.  This avoids any
 ## lossage if the install program doesn't have a name that libtool
 ## expects.
-?LIBTOOL?         echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) '$$p' 
'$(DESTDIR)$(%NDIR%dir)/$$f'"; \
-?LIBTOOL?         $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) "$$p" 
"$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
-?!LIBTOOL?        echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) '$$p' 
'$(DESTDIR)$(%NDIR%dir)/$$f'"; \
-?!LIBTOOL?        $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) "$$p" 
"$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
-         else :; fi; \
-       done
+?LIBTOOL?      while read p pbase dir f; do \
+?LIBTOOL??!BASE?         if test "$$dir" != .; then f=$$dir/$$f; \
+?LIBTOOL??!BASE?           echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+?LIBTOOL??!BASE?           $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit 
$$?; \
+?LIBTOOL??!BASE?         else :; fi; \
+?LIBTOOL?        echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) '$$p' 
'$(DESTDIR)$(%NDIR%dir)/$$f'"; \
+?LIBTOOL?        $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) --mode=install $(%DIR%PROGRAMS_INSTALL) "$$p" 
"$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
+?LIBTOOL?      done
+## The following awk script turns that into one line containing directories
+## and then lines of `target_name_or_directory sources...'.
+?!LIBTOOL?     $(AWK) 'BEGIN { files["."] = ""; dirs["."] = "" } { \
+?!LIBTOOL?       if ($$2 == $$4) tgt = $$3; else tgt = $$3 "/" $$4; \
+?!LIBTOOL?       files[tgt] = files[tgt] " " $$1; dirs[$$3] = 1 } \
+?!LIBTOOL?       END { d=""; for (dir in dirs) d = d " " dir; print d; \
+?!LIBTOOL?             for (dir in files) print dir, files[dir] }' | { \
+?!LIBTOOL?     read dirs; \
+?!LIBTOOL??!BASE?      for dir in $$dirs; do test . = $$dir || { \
+?!LIBTOOL??!BASE?        echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
+?!LIBTOOL??!BASE?        $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit 
$$?; \
+?!LIBTOOL??!BASE?      }; done; \
+?!LIBTOOL?     while read dir files; do \
+?!LIBTOOL?       if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+?!LIBTOOL?       test -z "$$files" || { \
+?!LIBTOOL?         echo " $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) 
$$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
+?!LIBTOOL?         $(INSTALL_PROGRAM_ENV) $(%DIR%PROGRAMS_INSTALL) $$files 
"$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
+?!LIBTOOL?       }; \
+?!LIBTOOL?     done; }
 endif %?INSTALL%
 
 


hooks/post-receive
--
GNU Automake




reply via email to

[Prev in Thread] Current Thread [Next in Thread]