summaryrefslogtreecommitdiff
path: root/package/autoconf/autoconf.mk
blob: e2761c75f1674e81b6dc1b1e6640743bc42f1c11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#############################################################
#
# autoconf
#
#############################################################
AUTOCONF_VERSION = 2.64
AUTOCONF_SOURCE = autoconf-$(AUTOCONF_VERSION).tar.bz2
AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf

ifeq ($(BR2_ENABLE_DEBUG),y) # install-exec doesn't install aclocal stuff
AUTOCONF_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
endif

AUTOCONF_CONF_ENV = EMACS="no"

AUTOCONF_DEPENDENCIES = microperl

$(eval $(call AUTOTARGETS,package,autoconf))

# autoconf for the host
AUTOCONF_HOST_DIR:=$(BUILD_DIR)/autoconf-$(AUTOCONF_VERSION)-host

# variables used by other packages
AUTOCONF:=$(HOST_DIR)/usr/bin/autoconf
AUTORECONF=$(HOST_CONFIGURE_OPTS) ACLOCAL="$(ACLOCAL)" $(HOST_DIR)/usr/bin/autoreconf -v -f -i -I "$(ACLOCAL_DIR)"

$(DL_DIR)/$(AUTOCONF_SOURCE):
	$(call DOWNLOAD,$(AUTOCONF_SITE),$(AUTOCONF_SOURCE))

$(STAMP_DIR)/host_autoconf_unpacked: $(DL_DIR)/$(AUTOCONF_SOURCE)
	mkdir -p $(AUTOCONF_HOST_DIR)
	$(INFLATE$(suffix $(AUTOCONF_SOURCE))) $< | \
		$(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(AUTOCONF_HOST_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(AUTOCONF_HOST_DIR) package/autoconf/ \*.patch
	touch $@

$(STAMP_DIR)/host_autoconf_configured: $(STAMP_DIR)/host_autoconf_unpacked $(STAMP_DIR)/host_m4_installed  $(STAMP_DIR)/host_libtool_installed
	(cd $(AUTOCONF_HOST_DIR); rm -rf config.cache; \
		$(HOST_CONFIGURE_OPTS) \
		CFLAGS="$(HOST_CFLAGS)" \
		LDFLAGS="$(HOST_LDFLAGS)" \
		./configure \
		--prefix="$(HOST_DIR)/usr" \
		--sysconfdir="$(HOST_DIR)/etc" \
		--disable-static \
	)
	touch $@

$(STAMP_DIR)/host_autoconf_compiled: $(STAMP_DIR)/host_autoconf_configured
	$(MAKE) -C $(AUTOCONF_HOST_DIR)
	touch $@

$(STAMP_DIR)/host_autoconf_installed: $(STAMP_DIR)/host_autoconf_compiled
	$(MAKE) -C $(AUTOCONF_HOST_DIR) install
	touch $@

host-autoconf: $(STAMP_DIR)/host_autoconf_installed

host-autoconf-clean:
	rm -f $(addprefix $(STAMP_DIR)/host_autoconf_,unpacked configured compiled installed)
	-$(MAKE) -C $(AUTOCONF_HOST_DIR) uninstall
	-$(MAKE) -C $(AUTOCONF_HOST_DIR) clean

host-autoconf-dirclean:
	rm -rf $(AUTOCONF_HOST_DIR)