2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
11 CATEGORY:=Extra packages
16 MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
17 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
18 ifneq ($(PKG_VERSION),)
19 ifneq ($(PKG_RELEASE),)
20 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
22 VERSION:=$(PKG_VERSION)
25 VERSION:=$(PKG_RELEASE)
28 PKGFLAGS:=$(PKG_FLAGS)
32 ifneq ($(ARCH_PACKAGES),)
33 PKGARCH:=$(ARCH_PACKAGES)
49 Build/Patch:=$(Build/Patch/Default)
50 ifneq ($(strip $(PKG_UNPACK)),)
51 define Build/Prepare/Default
52 $(SH_FUNC) $(PKG_UNPACK)
57 CONFIGURE_PREFIX:=/usr
59 --target=$(GNU_TARGET_NAME) \
60 --host=$(GNU_TARGET_NAME) \
61 --build=$(GNU_HOST_NAME) \
64 --prefix=$(CONFIGURE_PREFIX) \
65 --exec-prefix=$(CONFIGURE_PREFIX) \
66 --bindir=$(CONFIGURE_PREFIX)/bin \
67 --sbindir=$(CONFIGURE_PREFIX)/sbin \
68 --libexecdir=$(CONFIGURE_PREFIX)/lib \
70 --datadir=$(CONFIGURE_PREFIX)/share \
71 --localstatedir=/var \
72 --mandir=$(CONFIGURE_PREFIX)/man \
73 --infodir=$(CONFIGURE_PREFIX)/info \
75 $(DISABLE_LARGEFILE) \
79 $(TARGET_CONFIGURE_OPTS) \
80 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
81 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
82 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
83 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
86 CONFIGURE_CMD = ./configure
88 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
90 define Build/Configure/Default
91 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
92 if [ -x $(CONFIGURE_CMD) ]; then \
93 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
94 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
105 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
106 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
107 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
110 $(TARGET_CONFIGURE_OPTS) \
111 CROSS="$(TARGET_CROSS)" \
114 MAKE_INSTALL_FLAGS = \
116 DESTDIR="$(PKG_INSTALL_DIR)"
120 define Build/Compile/Default
122 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
127 define Build/Install/Default
129 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
130 $(MAKE_INSTALL_FLAGS) \
131 $(if $(1), $(1), install);
134 define Build/Dist/Default
135 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
138 define Build/DistCheck/Default
139 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)