dynamically enable/disable kernel config options for kmod packages based on build...
[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 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)/%,%,${shell pwd})
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 PKGARCH:=$(ARCH)
27 PRIORITY:=optional
28 DEFAULT:=
29 MENU:=
30 SUBMENU:=
31 SUBMENUDEP:=
32 TITLE:=
33 DESCRIPTION:=
34 KCONFIG:=
35 endef
36
37 Build/Patch:=$(Build/Patch/Default)
38 ifneq ($(strip $(PKG_UNPACK)),)
39 define Build/Prepare/Default
40 $(PKG_UNPACK)
41 $(Build/Patch)
42 endef
43 endif
44
45 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
46 TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
47
48 CONFIGURE_ARGS = \
49 --target=$(GNU_TARGET_NAME) \
50 --host=$(GNU_TARGET_NAME) \
51 --build=$(GNU_HOST_NAME) \
52 --program-prefix="" \
53 --program-suffix="" \
54 --prefix=/usr \
55 --exec-prefix=/usr \
56 --bindir=/usr/bin \
57 --sbindir=/usr/sbin \
58 --libexecdir=/usr/lib \
59 --sysconfdir=/etc \
60 --datadir=/usr/share \
61 --localstatedir=/var \
62 --mandir=/usr/man \
63 --infodir=/usr/info \
64 $(DISABLE_NLS)
65
66 CONFIGURE_VARS = \
67 $(TARGET_CONFIGURE_OPTS) \
68 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
69 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
70 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
71 LDFLAGS="$(TARGET_LDFLAGS)" \
72 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
73 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
74
75 CONFIGURE_PATH = .
76 CONFIGURE_CMD = ./configure
77
78 define Build/Configure/Default
79 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
80 if [ -x $(CONFIGURE_CMD) ]; then \
81 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/$(3)/ && \
82 $(CONFIGURE_VARS) \
83 $(2) \
84 $(CONFIGURE_CMD) \
85 $(CONFIGURE_ARGS) \
86 $(1); \
87 fi; \
88 )
89 endef
90
91 MAKE_VARS = \
92 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
93 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
94 LDFLAGS="$(EXTRA_LDFLAGS) "
95
96 MAKE_FLAGS = \
97 $(TARGET_CONFIGURE_OPTS) \
98 CROSS="$(TARGET_CROSS)" \
99 ARCH="$(ARCH)"
100
101 MAKE_PATH = .
102
103 define Build/Compile/Default
104 $(MAKE_VARS) \
105 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
106 $(MAKE_FLAGS) \
107 $(1);
108 endef
109
110