globally define IPv6 support or not in OpenWrt, just like for largefiles, ipv6 disabl...
[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)/%,%,$(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 PKGARCH:=$(ARCH)
27 PRIORITY:=optional
28 DEFAULT:=
29 MENU:=
30 SUBMENU:=
31 SUBMENUDEP:=
32 TITLE:=
33 KCONFIG:=
34 BUILDONLY:=
35 URL:=
36 endef
37
38 Build/Patch:=$(Build/Patch/Default)
39 ifneq ($(strip $(PKG_UNPACK)),)
40 define Build/Prepare/Default
41 $(PKG_UNPACK)
42 $(Build/Patch)
43 endef
44 endif
45
46 CONFIGURE_PREFIX:=/usr
47 CONFIGURE_ARGS = \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=$(CONFIGURE_PREFIX) \
54 --exec-prefix=$(CONFIGURE_PREFIX) \
55 --bindir=$(CONFIGURE_PREFIX)/bin \
56 --sbindir=$(CONFIGURE_PREFIX)/sbin \
57 --libexecdir=$(CONFIGURE_PREFIX)/lib \
58 --sysconfdir=/etc \
59 --datadir=$(CONFIGURE_PREFIX)/share \
60 --localstatedir=/var \
61 --mandir=$(CONFIGURE_PREFIX)/man \
62 --infodir=$(CONFIGURE_PREFIX)/info \
63 $(DISABLE_NLS) \
64 $(DISABLE_LARGEFILE) \
65 $(DISABLE_IPV6)
66
67 CONFIGURE_VARS = \
68 $(TARGET_CONFIGURE_OPTS) \
69 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
70 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
71 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
72 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
73
74 CONFIGURE_PATH = .
75 CONFIGURE_CMD = ./configure
76
77 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
78
79 define Build/Configure/Default
80 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
81 if [ -x $(CONFIGURE_CMD) ]; then \
82 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
83 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
84 $(CONFIGURE_VARS) \
85 $(2) \
86 $(CONFIGURE_CMD) \
87 $(CONFIGURE_ARGS) \
88 $(1); \
89 fi; \
90 )
91 endef
92
93 MAKE_VARS = \
94 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
95 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
96 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
97
98 MAKE_FLAGS = \
99 $(TARGET_CONFIGURE_OPTS) \
100 CROSS="$(TARGET_CROSS)" \
101 ARCH="$(ARCH)"
102
103 MAKE_INSTALL_FLAGS = \
104 $(MAKE_FLAGS) \
105 DESTDIR="$(PKG_INSTALL_DIR)"
106
107 MAKE_PATH = .
108
109 define Build/Compile/Default
110 $(MAKE_VARS) \
111 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
112 $(MAKE_FLAGS) \
113 $(1);
114 endef
115
116 define Build/Install/Default
117 $(MAKE_VARS) \
118 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
119 $(MAKE_INSTALL_FLAGS) \
120 $(1) install;
121 endef
122
123 define Build/Dist/Default
124 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
125 endef
126
127 define Build/DistCheck/Default
128 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
129 endef