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;
23 $(patsubst %,rm -f %;,$(2)) \
25 if [ -x $(p)/autogen.sh ]; then \
26 $(p)/autogen.sh || true; \
27 elif [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
28 [ -f $(p)/aclocal.m4 ] && [ ! -f $(p)/acinclude.m4 ] && mv aclocal.m4 acinclude.m4; \
29 [ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
30 $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
31 -B $(STAGING_DIR_HOST)/share/aclocal \
32 $(patsubst %,-B %,$(5)) \
33 $(patsubst %,-I %,$(4)) $(4) || true; \
40 PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
41 PKG_AUTOMAKE_PATHS?=$(CONFIGURE_PATH)
42 PKG_REMOVE_FILES?=aclocal.m4
44 Hooks/InstallDev/Post += libtool_remove_files
46 define autoreconf_target
47 $(strip $(call autoreconf, \
48 $(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
49 $(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
50 $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal))
53 ifneq ($(filter libtool,$(PKG_FIXUP)),)
54 PKG_BUILD_DEPENDS += libtool
55 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
56 Hooks/Configure/Pre += autoreconf_target
60 ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
61 PKG_BUILD_DEPENDS += libtool
62 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
63 Hooks/Configure/Pre += autoreconf_target
67 ifneq ($(filter autoreconf,$(PKG_FIXUP)),)
68 ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
69 Hooks/Configure/Pre += autoreconf_target
74 HOST_FIXUP?=$(PKG_FIXUP)
75 HOST_LIBTOOL_PATHS?=$(if $(PKG_LIBTOOL_PATHS),$(PKG_LIBTOOL_PATHS),.)
76 HOST_AUTOMAKE_PATHS?=$(if $(PKG_AUTOMAKE_PATHS),$(PKG_AUTOMAKE_PATHS),.)
77 HOST_REMOVE_FILES?=$(PKG_REMOVE_FILES)
79 define autoreconf_host
80 $(strip $(call autoreconf, \
81 $(HOST_BUILD_DIR), $(HOST_REMOVE_FILES), \
82 $(HOST_AUTOMAKE_PATHS), $(HOST_LIBTOOL_PATHS)))
85 ifneq ($(filter libtool,$(HOST_FIXUP)),)
86 HOST_BUILD_DEPENDS += libtool
87 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
88 Hooks/HostConfigure/Pre += autoreconf_host
92 ifneq ($(filter libtool-ucxx,$(HOST_FIXUP)),)
93 HOST_BUILD_DEPENDS += libtool
94 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
95 Hooks/HostConfigure/Pre += autoreconf_host
99 ifneq ($(filter autoreconf,$(HOST_FIXUP)),)
100 ifeq ($(filter autoreconf,$(Hooks/HostConfigure/Pre)),)
101 Hooks/HostConfigure/Pre += autoreconf_host