libtool: convert to autotools infrastructure for host package
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 1 Nov 2009 22:40:02 +0000 (23:40 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 15 Dec 2009 18:57:34 +0000 (19:57 +0100)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libtool/libtool.mk

index 14d0835c24c4207a3988045129185ddfc83516c8..bbabbb03cfa8072a1b91e43a96f836da7db32e9f 100644 (file)
@@ -11,54 +11,17 @@ ifeq ($(BR2_ENABLE_DEBUG),y) # install-exec doesn't install aclocal stuff
 LIBTOOL_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
 endif
 
-$(eval $(call AUTOTARGETS,package,libtool))
-
-# libtool for the host
-LIBTOOL_HOST_DIR:=$(BUILD_DIR)/libtool-$(LIBTOOL_VERSION)-host
-
-# variables used by other packages
-LIBTOOL:=$(HOST_DIR)/usr/bin/libtool
-
-$(DL_DIR)/$(LIBTOOL_SOURCE):
-       $(call DOWNLOAD,$(LIBTOOL_SITE),$(LIBTOOL_SOURCE))
-
-$(STAMP_DIR)/host_libtool_unpacked: $(DL_DIR)/$(LIBTOOL_SOURCE)
-       mkdir -p $(LIBTOOL_HOST_DIR)
-       $(INFLATE$(suffix $(LIBTOOL_SOURCE))) $< | \
-               $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(LIBTOOL_HOST_DIR) $(TAR_OPTIONS) -
-       toolchain/patch-kernel.sh $(LIBTOOL_HOST_DIR) package/libtool/ \*.patch
-       touch $@
-
-$(STAMP_DIR)/host_libtool_configured: $(STAMP_DIR)/host_libtool_unpacked
-       (cd $(LIBTOOL_HOST_DIR); rm -rf config.cache; \
-               $(HOST_CONFIGURE_OPTS) \
-               CFLAGS="$(HOST_CFLAGS)" \
-               LDFLAGS="$(HOST_LDFLAGS)" \
-               ./configure $(QUIET) \
-               --prefix="$(HOST_DIR)/usr" \
-               --sysconfdir="$(HOST_DIR)/etc" \
-               --disable-static \
-       )
-       touch $@
-
-$(STAMP_DIR)/host_libtool_compiled: $(STAMP_DIR)/host_libtool_configured
-       $(MAKE) -C $(LIBTOOL_HOST_DIR)
-       touch $@
-
-$(STAMP_DIR)/host_libtool_installed: $(STAMP_DIR)/host_libtool_compiled
-       $(MAKE) -C $(LIBTOOL_HOST_DIR) install
+define HOST_LIBTOOL_CUSTOM_INSTALL
        install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/libtool.m4 \
                $(STAGING_DIR)/usr/share/aclocal/libtool.m4
        install -D -m 0644 $(HOST_DIR)/usr/share/aclocal/ltdl.m4 \
                $(STAGING_DIR)/usr/share/aclocal/ltdl.m4
-       touch $@
+endef
 
-host-libtool: $(STAMP_DIR)/host_libtool_installed
+HOST_LIBTOOL_POST_INSTALL_HOOKS += HOST_LIBTOOL_CUSTOM_INSTALL
 
-host-libtool-clean:
-       rm -f $(addprefix $(STAMP_DIR)/host_libtool_,unpacked configured compiled installed)
-       -$(MAKE) -C $(LIBTOOL_HOST_DIR) uninstall
-       -$(MAKE) -C $(LIBTOOL_HOST_DIR) clean
+$(eval $(call AUTOTARGETS,package,libtool))
+$(eval $(call AUTOTARGETS,package,libtool,host))
 
-host-libtool-dirclean:
-       rm -rf $(LIBTOOL_HOST_DIR)
+# variables used by other packages
+LIBTOOL:=$(HOST_DIR)/usr/bin/libtool