[systemd-commits] Makefile.am

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Jan 7 10:48:35 PST 2013


 Makefile.am |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit ca25fde748dba7ee74e24dff2db6aff1d9faea00
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Jan 7 13:25:15 2013 -0500

    build-sys: remove .la files after installation
    
    Define KEEP_LA_FILES to keep them.
    
    The hook is repeated because both install-exec-hook and
    install-data-hook can install libraries and with parallel make
    it's not possible to predict which one will run first.
    
    http://lists.freedesktop.org/archives/systemd-devel/2013-January/008016.html
    tl;dr: Libtool .la files are not very useful for linking linux
    libraries.

diff --git a/Makefile.am b/Makefile.am
index 7048cb5..c1bb5a7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -174,6 +174,7 @@ define move-to-rootlibdir
 		so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
 		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
 		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
+		{ test -n "$(KEEP_LA_FILES)" || rm -f $(DESTDIR)$(libdir)/$${libname/%.so/.la}; } && \
 		mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
 	fi
 endef
@@ -4064,11 +4065,23 @@ if HAVE_KMOD
 		$(LN_S) ../systemd-modules-load.service systemd-modules-load.service )
 endif
 
+# This hook is defined as a rule to make sure that it runs last.
+define remove-la-hook
+	test -z "$(lib_LTLIBRARIES)" || \
+		rm -f $(addprefix $(DESTDIR)$(libdir)/, $(lib_LTLIBRARIES))
+	test -z "$(pamlib_LTLIBRARIES)" || \
+		rm -f $(addprefix $(DESTDIR)$(pamlibdir)/, $(pamlib_LTLIBRARIES))
+	test -z "$(pkgpyexec_LTLIBRARIES)" || \
+		rm -f $(addprefix $(DESTDIR)$(pkgpyexecdir)/, $(pkgpyexec_LTLIBRARIES))
+endef
+
 install-exec-hook: $(INSTALL_EXEC_HOOKS)
+	$(remove-la-hook$(KEEP_LA_FILES))
 
 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
 
 install-data-hook: systemd-install-data-hook $(INSTALL_DATA_HOOKS)
+	$(remove-la-hook$(KEEP_LA_FILES))
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 



More information about the systemd-commits mailing list