kernel: bump 4.9 to 4.9.155
[openwrt/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 PKG_DEFAULT_DEPENDS = +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread
9
10 ifneq ($(PKG_NAME),toolchain)
11 PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
12 else
13 PKG_FIXUP_DEPENDS = $(2)
14 endif
15
16 define Package/Default
17 CONFIGFILE:=
18 SECTION:=opt
19 CATEGORY:=Extra packages
20 DEPENDS:=
21 MDEPENDS:=
22 CONFLICTS:=
23 PROVIDES:=
24 EXTRA_DEPENDS:=
25 MAINTAINER:=$(PKG_MAINTAINER)
26 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
27 ifneq ($(PKG_VERSION),)
28 ifneq ($(PKG_RELEASE),)
29 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
30 else
31 VERSION:=$(PKG_VERSION)
32 endif
33 else
34 VERSION:=$(PKG_RELEASE)
35 endif
36 ABI_VERSION:=
37 ifneq ($(PKG_FLAGS),)
38 PKGFLAGS:=$(PKG_FLAGS)
39 else
40 PKGFLAGS:=
41 endif
42 ifneq ($(ARCH_PACKAGES),)
43 PKGARCH:=$(ARCH_PACKAGES)
44 else
45 PKGARCH:=$(BOARD)
46 endif
47 DEFAULT:=
48 MENU:=
49 SUBMENU:=
50 SUBMENUDEP:=
51 TITLE:=
52 KCONFIG:=
53 BUILDONLY:=
54 HIDDEN:=
55 URL:=
56 VARIANT:=
57 DEFAULT_VARIANT:=
58 USERID:=
59 ALTERNATIVES:=
60 LICENSE:=$(PKG_LICENSE)
61 LICENSE_FILES:=$(PKG_LICENSE_FILES)
62 endef
63
64 Build/Patch:=$(Build/Patch/Default)
65 ifneq ($(strip $(PKG_UNPACK)),)
66 define Build/Prepare/Default
67 $(PKG_UNPACK)
68 [ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
69 $(Build/Patch)
70 endef
71 endif
72
73 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
74 ifeq ($(CONFIG_BUILD_NLS),y)
75 DISABLE_NLS:=
76 else
77 DISABLE_NLS:=--disable-nls
78 endif
79
80 CONFIGURE_PREFIX:=/usr
81 CONFIGURE_ARGS = \
82 --target=$(GNU_TARGET_NAME) \
83 --host=$(GNU_TARGET_NAME) \
84 --build=$(GNU_HOST_NAME) \
85 --program-prefix="" \
86 --program-suffix="" \
87 --prefix=$(CONFIGURE_PREFIX) \
88 --exec-prefix=$(CONFIGURE_PREFIX) \
89 --bindir=$(CONFIGURE_PREFIX)/bin \
90 --sbindir=$(CONFIGURE_PREFIX)/sbin \
91 --libexecdir=$(CONFIGURE_PREFIX)/lib \
92 --sysconfdir=/etc \
93 --datadir=$(CONFIGURE_PREFIX)/share \
94 --localstatedir=/var \
95 --mandir=$(CONFIGURE_PREFIX)/man \
96 --infodir=$(CONFIGURE_PREFIX)/info \
97 $(DISABLE_NLS) \
98 $(DISABLE_IPV6)
99
100 CONFIGURE_VARS = \
101 $(TARGET_CONFIGURE_OPTS) \
102 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
103 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \
104 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
105 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
106
107 CONFIGURE_PATH = .
108 CONFIGURE_CMD = ./configure
109
110 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
111 $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
112 $(SCRIPT_DIR)/$(2);
113
114 define Build/Configure/Default
115 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
116 if [ -x $(CONFIGURE_CMD) ]; then \
117 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
118 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
119 $(CONFIGURE_VARS) \
120 $(2) \
121 $(CONFIGURE_CMD) \
122 $(CONFIGURE_ARGS) \
123 $(1); \
124 fi; \
125 )
126 endef
127
128 MAKE_VARS = \
129 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
130 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
131 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
132
133 MAKE_FLAGS = \
134 $(TARGET_CONFIGURE_OPTS) \
135 CROSS="$(TARGET_CROSS)" \
136 ARCH="$(ARCH)"
137
138 MAKE_INSTALL_FLAGS = \
139 $(MAKE_FLAGS) \
140 DESTDIR="$(PKG_INSTALL_DIR)"
141
142 MAKE_PATH ?= .
143
144 define Build/Compile/Default
145 +$(MAKE_VARS) \
146 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
147 $(MAKE_FLAGS) \
148 $(1);
149 endef
150
151 define Build/Install/Default
152 $(MAKE_VARS) \
153 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
154 $(MAKE_INSTALL_FLAGS) \
155 $(if $(1), $(1), install);
156 endef
157
158 define Build/Dist/Default
159 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
160 endef
161
162 define Build/DistCheck/Default
163 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
164 endef