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.
8 PKG_DEFAULT_DEPENDS = +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread
10 ifneq ($(PKG_NAME),toolchain)
11 PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),$(PKG_DEFAULT_DEPENDS) $(filter-out $(PKG_DEFAULT_DEPENDS),$(2)))
13 PKG_FIXUP_DEPENDS = $(2)
16 define Package/Default
19 CATEGORY:=Extra packages
24 MAINTAINER:=$(PKG_MAINTAINER)
25 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
26 ifneq ($(PKG_VERSION),)
27 ifneq ($(PKG_RELEASE),)
28 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
30 VERSION:=$(PKG_VERSION)
33 VERSION:=$(PKG_RELEASE)
37 PKGFLAGS:=$(PKG_FLAGS)
41 ifneq ($(ARCH_PACKAGES),)
42 PKGARCH:=$(ARCH_PACKAGES)
58 Build/Patch:=$(Build/Patch/Default)
59 ifneq ($(strip $(PKG_UNPACK)),)
60 define Build/Prepare/Default
66 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
67 DISABLE_NLS:=--disable-nls
69 CONFIGURE_PREFIX:=/usr
71 --target=$(GNU_TARGET_NAME) \
72 --host=$(GNU_TARGET_NAME) \
73 --build=$(GNU_HOST_NAME) \
76 --prefix=$(CONFIGURE_PREFIX) \
77 --exec-prefix=$(CONFIGURE_PREFIX) \
78 --bindir=$(CONFIGURE_PREFIX)/bin \
79 --sbindir=$(CONFIGURE_PREFIX)/sbin \
80 --libexecdir=$(CONFIGURE_PREFIX)/lib \
82 --datadir=$(CONFIGURE_PREFIX)/share \
83 --localstatedir=/var \
84 --mandir=$(CONFIGURE_PREFIX)/man \
85 --infodir=$(CONFIGURE_PREFIX)/info \
87 $(DISABLE_LARGEFILE) \
91 $(TARGET_CONFIGURE_OPTS) \
92 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
93 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
94 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
95 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
98 CONFIGURE_CMD = ./configure
100 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
102 define Build/Configure/Default
103 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
104 if [ -x $(CONFIGURE_CMD) ]; then \
105 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
106 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
117 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
118 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
119 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
122 $(TARGET_CONFIGURE_OPTS) \
123 CROSS="$(TARGET_CROSS)" \
126 MAKE_INSTALL_FLAGS = \
128 DESTDIR="$(PKG_INSTALL_DIR)"
132 define Build/Compile/Default
134 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
139 define Build/Install/Default
141 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
142 $(MAKE_INSTALL_FLAGS) \
143 $(if $(1), $(1), install);
146 define Build/Dist/Default
147 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
150 define Build/DistCheck/Default
151 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)