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)
59 Build/Patch:=$(Build/Patch/Default)
60 ifneq ($(strip $(PKG_UNPACK)),)
61 define Build/Prepare/Default
67 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
68 DISABLE_NLS:=--disable-nls
70 CONFIGURE_PREFIX:=/usr
72 --target=$(GNU_TARGET_NAME) \
73 --host=$(GNU_TARGET_NAME) \
74 --build=$(GNU_HOST_NAME) \
77 --prefix=$(CONFIGURE_PREFIX) \
78 --exec-prefix=$(CONFIGURE_PREFIX) \
79 --bindir=$(CONFIGURE_PREFIX)/bin \
80 --sbindir=$(CONFIGURE_PREFIX)/sbin \
81 --libexecdir=$(CONFIGURE_PREFIX)/lib \
83 --datadir=$(CONFIGURE_PREFIX)/share \
84 --localstatedir=/var \
85 --mandir=$(CONFIGURE_PREFIX)/man \
86 --infodir=$(CONFIGURE_PREFIX)/info \
88 $(DISABLE_LARGEFILE) \
92 $(TARGET_CONFIGURE_OPTS) \
93 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
94 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
95 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
96 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
99 CONFIGURE_CMD = ./configure
101 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
102 $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
105 define Build/Configure/Default
106 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
107 if [ -x $(CONFIGURE_CMD) ]; then \
108 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
109 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
120 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
121 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
122 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
125 $(TARGET_CONFIGURE_OPTS) \
126 CROSS="$(TARGET_CROSS)" \
129 MAKE_INSTALL_FLAGS = \
131 DESTDIR="$(PKG_INSTALL_DIR)"
135 define Build/Compile/Default
137 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
142 define Build/Install/Default
144 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
145 $(MAKE_INSTALL_FLAGS) \
146 $(if $(1), $(1), install);
149 define Build/Dist/Default
150 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
153 define Build/DistCheck/Default
154 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)