metadata: fix handling of multiple build dependencies with different conditions
[openwrt.git] / include / package-defaults.mk
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define Package/Default
9 CONFIGFILE:=
10 SECTION:=opt
11 CATEGORY:=Extra packages
12 DEPENDS:=
13 PROVIDES:=
14 EXTRA_DEPENDS:=
15 MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
16 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
17 ifneq ($(PKG_VERSION),)
18 ifneq ($(PKG_RELEASE),)
19 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
20 else
21 VERSION:=$(PKG_VERSION)
22 endif
23 else
24 VERSION:=$(PKG_RELEASE)
25 endif
26 ifneq ($(PKG_FLAGS),)
27 PKGFLAGS:=$(PKG_FLAGS)
28 else
29 PKGFLAGS:=
30 endif
31 ifneq ($(ARCH_PACKAGES),)
32 PKGARCH:=$(ARCH_PACKAGES)
33 else
34 PKGARCH:=$(BOARD)
35 endif
36 PRIORITY:=optional
37 DEFAULT:=
38 MENU:=
39 SUBMENU:=
40 SUBMENUDEP:=
41 TITLE:=
42 KCONFIG:=
43 BUILDONLY:=
44 URL:=
45 VARIANT:=
46 endef
47
48 Build/Patch:=$(Build/Patch/Default)
49 ifneq ($(strip $(PKG_UNPACK)),)
50 define Build/Prepare/Default
51 $(SH_FUNC) $(PKG_UNPACK)
52 $(Build/Patch)
53 endef
54 endif
55
56 CONFIGURE_PREFIX:=/usr
57 CONFIGURE_ARGS = \
58 --target=$(GNU_TARGET_NAME) \
59 --host=$(GNU_TARGET_NAME) \
60 --build=$(GNU_HOST_NAME) \
61 --program-prefix="" \
62 --program-suffix="" \
63 --prefix=$(CONFIGURE_PREFIX) \
64 --exec-prefix=$(CONFIGURE_PREFIX) \
65 --bindir=$(CONFIGURE_PREFIX)/bin \
66 --sbindir=$(CONFIGURE_PREFIX)/sbin \
67 --libexecdir=$(CONFIGURE_PREFIX)/lib \
68 --sysconfdir=/etc \
69 --datadir=$(CONFIGURE_PREFIX)/share \
70 --localstatedir=/var \
71 --mandir=$(CONFIGURE_PREFIX)/man \
72 --infodir=$(CONFIGURE_PREFIX)/info \
73 $(DISABLE_NLS) \
74 $(DISABLE_LARGEFILE) \
75 $(DISABLE_IPV6)
76
77 CONFIGURE_VARS = \
78 $(TARGET_CONFIGURE_OPTS) \
79 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
80 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
81 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
82 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
83
84 CONFIGURE_PATH = .
85 CONFIGURE_CMD = ./configure
86
87 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
88
89 define Build/Configure/Default
90 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
91 if [ -x $(CONFIGURE_CMD) ]; then \
92 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
93 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
94 $(CONFIGURE_VARS) \
95 $(2) \
96 $(CONFIGURE_CMD) \
97 $(CONFIGURE_ARGS) \
98 $(1); \
99 fi; \
100 )
101 endef
102
103 MAKE_VARS = \
104 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
105 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
106 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
107
108 MAKE_FLAGS = \
109 $(TARGET_CONFIGURE_OPTS) \
110 CROSS="$(TARGET_CROSS)" \
111 ARCH="$(ARCH)"
112
113 MAKE_INSTALL_FLAGS = \
114 $(MAKE_FLAGS) \
115 DESTDIR="$(PKG_INSTALL_DIR)"
116
117 MAKE_PATH = .
118
119 define Build/Compile/Default
120 $(MAKE_VARS) \
121 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
122 $(MAKE_FLAGS) \
123 $(1);
124 endef
125
126 define Build/Install/Default
127 $(MAKE_VARS) \
128 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
129 $(MAKE_INSTALL_FLAGS) \
130 $(if $(1), $(1), install);
131 endef
132
133 define Build/Dist/Default
134 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
135 endef
136
137 define Build/DistCheck/Default
138 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
139 endef
This page took 0.047459 seconds and 5 git commands to generate.