2 # Copyright (C) 2007-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2))
10 # delete *.la-files from staging_dir - we can not yet remove respective lines within all package
11 # Makefiles, since backfire still uses libtool v1.5.x which (may) require those files
12 define libtool_remove_files
13 find $(1) -name '*.la' | $(XARGS) rm -f;
18 AUTOM4TE=$(STAGING_DIR_HOST)/bin/autom4te \
19 AUTOCONF=$(STAGING_DIR_HOST)/bin/autoconf \
20 AUTOMAKE=$(STAGING_DIR_HOST)/bin/automake \
21 ACLOCAL=$(STAGING_DIR_HOST)/bin/aclocal \
22 AUTOHEADER=$(STAGING_DIR_HOST)/bin/autoheader \
23 LIBTOOLIZE=$(STAGING_DIR_HOST)/bin/libtoolize \
24 M4=$(STAGING_DIR_HOST)/bin/m4
33 $(patsubst %,rm -f %;,$(2)) \
35 if [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
36 [ -f $(p)/aclocal.m4 ] && [ ! -f $(p)/acinclude.m4 ] && mv aclocal.m4 acinclude.m4; \
37 [ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
38 touch NEWS AUTHORS COPYING ChangeLog; \
39 $(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
40 -B $(STAGING_DIR_HOST)/share/aclocal \
41 $(patsubst %,-B %,$(5)) \
42 $(patsubst %,-I %,$(4)) -I m4 $(4) || true; \
49 PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
50 PKG_AUTOMAKE_PATHS?=$(CONFIGURE_PATH)
51 PKG_REMOVE_FILES?=aclocal.m4
53 Hooks/InstallDev/Post += libtool_remove_files
55 define autoreconf_target
56 $(strip $(call autoreconf, \
57 $(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
58 $(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
59 $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal))
62 ifneq ($(filter libtool,$(PKG_FIXUP)),)
63 PKG_BUILD_DEPENDS += libtool
64 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
65 Hooks/Configure/Pre += autoreconf_target
69 ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
70 PKG_BUILD_DEPENDS += libtool
71 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
72 Hooks/Configure/Pre += autoreconf_target
76 ifneq ($(filter autoreconf,$(PKG_FIXUP)),)
77 ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
78 Hooks/Configure/Pre += autoreconf_target
83 HOST_FIXUP?=$(PKG_FIXUP)
84 HOST_LIBTOOL_PATHS?=$(if $(PKG_LIBTOOL_PATHS),$(PKG_LIBTOOL_PATHS),.)
85 HOST_AUTOMAKE_PATHS?=$(if $(PKG_AUTOMAKE_PATHS),$(PKG_AUTOMAKE_PATHS),.)
86 HOST_REMOVE_FILES?=$(PKG_REMOVE_FILES)
88 define autoreconf_host
89 $(strip $(call autoreconf, \
90 $(HOST_BUILD_DIR), $(HOST_REMOVE_FILES), \
91 $(HOST_AUTOMAKE_PATHS), $(HOST_LIBTOOL_PATHS)))
94 ifneq ($(filter libtool,$(HOST_FIXUP)),)
95 HOST_BUILD_DEPENDS += libtool
96 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
97 Hooks/HostConfigure/Pre += autoreconf_host
101 ifneq ($(filter libtool-ucxx,$(HOST_FIXUP)),)
102 HOST_BUILD_DEPENDS += libtool
103 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
104 Hooks/HostConfigure/Pre += autoreconf_host
108 ifneq ($(filter autoreconf,$(HOST_FIXUP)),)
109 ifeq ($(filter autoreconf,$(Hooks/HostConfigure/Pre)),)
110 Hooks/HostConfigure/Pre += autoreconf_host