source: branches/backfire/include/autotools.mk @ 26590

Last change on this file since 26590 was 26590, checked in by jow, 6 years ago

[backfire] merge r26589

  • Property copyright set to Copyright (C) 2007-2008 Openwrt.org
  • Property licence set to GPLv2
  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1#
2# Copyright (C) 2007-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8autoconf_bool = $(patsubst %,$(if $($(1)),--enable,--disable)-%,$(2))
9
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
12define libtool_remove_files
13        find $(1) -name '*.la' | $(XARGS) rm -f;
14endef
15
16
17AM_TOOL_PATHS:= \
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        LIBTOOL=$(STAGING_DIR_HOST)/bin/libtool \
25        M4=$(STAGING_DIR_HOST)/bin/m4 \
26        AUTOPOINT=true
27
28# 1: build dir
29# 2: remove files
30# 3: automake paths
31# 4: libtool paths
32# 5: extra m4 dirs
33define autoreconf
34        (cd $(1); \
35                $(patsubst %,rm -f %;,$(2)) \
36                $(foreach p,$(3), \
37                        if [ -f $(p)/configure.ac ] || [ -f $(p)/configure.in ]; then \
38                                [ -d $(p)/autom4te.cache ] && rm -rf autom4te.cache; \
39                                touch NEWS AUTHORS COPYING ChangeLog; \
40                                $(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
41                                        $(if $(word 2,$(3)),--no-recursive) \
42                                        -B $(STAGING_DIR_HOST)/share/aclocal \
43                                        $(patsubst %,-I %,$(5)) \
44                                        $(patsubst %,-I %,$(4)) $(4) || true; \
45                                [ -e $(p)/config.rpath ] || \
46                                                ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath;
47                        fi; \
48                ) \
49        );
50endef
51
52
53PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
54PKG_AUTOMAKE_PATHS?=$(CONFIGURE_PATH)
55PKG_MACRO_PATHS?=m4
56PKG_REMOVE_FILES?=aclocal.m4
57
58Hooks/InstallDev/Post += libtool_remove_files
59
60define autoreconf_target
61  $(strip $(call autoreconf, \
62    $(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
63    $(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
64    $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
65endef
66
67ifneq ($(filter libtool,$(PKG_FIXUP)),)
68  PKG_BUILD_DEPENDS += libtool libintl libiconv
69 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
70  Hooks/Configure/Pre += autoreconf_target
71 endif
72endif
73
74ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
75  PKG_BUILD_DEPENDS += libtool libintl libiconv
76 ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
77  Hooks/Configure/Pre += autoreconf_target
78 endif
79endif
80
81ifneq ($(filter autoreconf,$(PKG_FIXUP)),)
82  ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
83    Hooks/Configure/Pre += autoreconf_target
84  endif
85endif
86
87
88HOST_FIXUP?=$(PKG_FIXUP)
89HOST_LIBTOOL_PATHS?=$(if $(PKG_LIBTOOL_PATHS),$(PKG_LIBTOOL_PATHS),.)
90HOST_AUTOMAKE_PATHS?=$(if $(PKG_AUTOMAKE_PATHS),$(PKG_AUTOMAKE_PATHS),.)
91HOST_MACRO_PATHS?=$(if $(PKG_MACRO_PATHS),$(PKG_MACRO_PATHS),m4)
92HOST_REMOVE_FILES?=$(PKG_REMOVE_FILES)
93
94define autoreconf_host
95  $(strip $(call autoreconf, \
96    $(HOST_BUILD_DIR), $(HOST_REMOVE_FILES), \
97    $(HOST_AUTOMAKE_PATHS), $(HOST_LIBTOOL_PATHS), \
98    $(HOST_MACRO_PATHS)))
99endef
100
101ifneq ($(filter libtool,$(HOST_FIXUP)),)
102 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
103  Hooks/HostConfigure/Pre += autoreconf_host
104 endif
105endif
106
107ifneq ($(filter libtool-ucxx,$(HOST_FIXUP)),)
108 ifeq ($(filter no-autoreconf,$(HOST_FIXUP)),)
109  Hooks/HostConfigure/Pre += autoreconf_host
110 endif
111endif
112
113ifneq ($(filter autoreconf,$(HOST_FIXUP)),)
114  ifeq ($(filter autoreconf,$(Hooks/HostConfigure/Pre)),)
115    Hooks/HostConfigure/Pre += autoreconf_host
116  endif
117endif
Note: See TracBrowser for help on using the repository browser.