libtool-patches
[Top][All Lists]
Advanced

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

HEAD: Fix "make install"


From: Ralf Wildenhues
Subject: HEAD: Fix "make install"
Date: Fri, 26 Aug 2005 12:02:32 +0200
User-agent: Mutt/1.4.1i

OK, here's the long-awaited proposal for a fixed "make install" for CVS
HEAD.  I won't commit it until I've tested it on several architectures,
but I'll post it for you to read and complain if necessary.

Notes:
- it uses $(INSTALL_DATA) and $(INSTALL_SCRIPT), but only the former is
  mentioned in the Automake manual.  Both have existed for ages, however.
- moved away from trying to get Automake rules to do all.  I believe
  this would be possible, but we'd either have to specify dependencies
  between undocumented targets, or rely on order-of-prerequisite
  execution in `make' and disallow parallel install, or move around the
  source tree even more.  The solution below should not care about
  either of these issues.
- `make uninstall' does not actually remove any directories.  I believe
  this is according to standards.
- I put NORMAL_INSTALL before the rule.  Dunno if that is 100% correct,
  because the copying of the file into the aclocal directory might be
  regarded as post-installation commands; this would break our time
  stamp order.  However, Automake-generated aclocal_DATA targets don't
  do this either, so I don't think it's worth bothering at all.
- I'm a bit unsure whether cleaning pkgdatadir before install is even
  allowed: the user could have pre-created a directory structure with
  permissions according to her needs.  Should I omit that rm -rf?

What do you think?

Cheers,
Ralf

        * Makefile.am: Install libltdl data files in correct order.
        Use pre-defined programs for installation; use NORMAL_INSTALL
        and NORMAL_UNINSTALL.  Really fix ownership and timestamp
        problems.  Fix typo in uninstallation of aclocal files.
        Reported by Peter Breitenlohner <address@hidden> and
        Charles Wilson <address@hidden>.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/Makefile.am,v
retrieving revision 1.157
diff -u -r1.157 Makefile.am
--- Makefile.am 23 Aug 2005 01:49:36 -0000      1.157
+++ Makefile.am 25 Aug 2005 20:28:24 -0000
@@ -373,9 +374,9 @@
                  libltdl/README \
                  libltdl/Makefile.am \
                  libltdl/Makefile.in \
+                 libltdl/configure.ac \
                  libltdl/aclocal.m4 \
                  libltdl/config-h.in \
-                 libltdl/configure.ac \
                  libltdl/configure \
                  libltdl/argz_.h \
                  libltdl/argz.c \
@@ -390,31 +391,37 @@
                  $(libltdl_libltdl_la_SOURCES)
 
 install-data-local: libltdl/Makefile.in
+       @$(NORMAL_INSTALL)
 ## Don't install over the top of an old pkgdatadir
        -rm -rf $(DESTDIR)$(pkgdatadir)
 ## To avoid spurious reconfiguration when the user installs these files
-## with libtoolize, we have to preserve their timestamps carefully:
-       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
-       ( cd $(srcdir) && $(AMTAR) chf - $(ltdldatafiles); ) \
-         | ( umask 0 && cd $(DESTDIR)$(pkgdatadir) && $(AMTAR) xf -; )
-## And similarly copy the config auxilliary files into the master tree
-       ( cd $(srcdir)/libltdl && $(AMTAR) chf - $(auxfiles); ) \
-         | ( umask 0 && cd $(DESTDIR)$(pkgdatadir) && $(AMTAR) xf -; )
-       @for f in : $(auxexefiles); do \
-         test "X$$f" = X: && continue; \
-         echo "chmod +x '$(DESTDIR)$(pkgdatadir)/$$f'"; \
-         chmod +x "$(DESTDIR)$(pkgdatadir)/$$f"; \
-       done
-## Put a copy of the libtool m4 macros in the aclocal dir
+## with libtoolize, we have to install them in the correct order:
+## First, put a copy of the libtool m4 macros in the aclocal dir
        $(mkinstalldirs) $(DESTDIR)$(aclocaldir)
-       @for p in $(aclocalfiles); do \
+       @cd $(srcdir)/$(m4dir) && \
+       list='$(aclocalfiles)'; for p in $$list; do \
          f=`echo "$$p" | sed 's|^.*/||'`; \
-         aclocalfiles="$$aclocalfiles $$f"; \
+         echo " $(INSTALL_DATA) '$$f' '$(DESTDIR)$(aclocaldir)/$$f'"; \
+         $(INSTALL_DATA) "$$f" "$(DESTDIR)$(aclocaldir)/$$f"; \
        done; \
-       ( cd $(srcdir)/$(m4dir) && $(AMTAR) chf - $$aclocalfiles; ) \
-         | ( umask 0 && cd $(DESTDIR)$(aclocaldir) && $(AMTAR) xf -; )
-       chown -R root $(DESTDIR)$(pkgdatadir) && \
-       chgrp -R root $(DESTDIR)$(pkgdatadir) || :
+## install the helper scripts
+       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/config
+       @cd $(srcdir)/libltdl && \
+       list='$(auxfiles)' && for p in $$list; do \
+         echo " $(INSTALL_SCRIPT) '$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
+         $(INSTALL_SCRIPT) "$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
+       done
+## install the libltdl files
+       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl
+       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl/libltdl
+       $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl/loaders
+       @cd $(srcdir) && \
+       list='$(ltdldatafiles)' && for p in $$list; do \
+         echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
+         $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
+       done
+       -chmod a+x $(DESTDIR)$(pkgdatadir)/libltdl/configure
 
 
 ## ------------- ##
@@ -422,22 +429,16 @@
 ## ------------- ##
 
 uninstall-hook:
-       @for f in $(ltdldatafiles); do \
-         echo " rm -rf '$(DESTDIR)$(ltdldatadir)/$$f'"; \
-         rm -f "$(DESTDIR)$(ltdldatadir)/$$f"; \
+       @$(NORMAL_UNINSTALL)
+       @list='$(ltdldatafiles) $(auxfiles)'; for f in $$list; do \
+         echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+         rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
        done
        @for p in $(aclocalfiles); do \
          f=`echo "$$p" | sed 's|^.*/||'`; \
-         echo " rm -rf '$(DESTDIR)$(aclocaldir)/$$f'"; \
+         echo " rm -f '$(DESTDIR)$(aclocaldir)/$$f'"; \
          rm -f "$(DESTDIR)$(aclocaldir)/$$f"; \
        done
-## Uninstall files from install-data-local rule above:
-       @for f in $(ltdldatafiles) $(auxfiles); do \
-         test -f $(DESTDIR)$(pkgdatadir)/$$f || continue; \
-         echo "rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
-         rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
-       done
-
 
 dist-hook:
 ## Ship README.alpha only in alpha release, but renamed to README




reply via email to

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