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)
36 PKGFLAGS:=$(PKG_FLAGS)
40 ifneq ($(ARCH_PACKAGES),)
41 PKGARCH:=$(ARCH_PACKAGES)
57 Build/Patch:=$(Build/Patch/Default)
58 ifneq ($(strip $(PKG_UNPACK)),)
59 define Build/Prepare/Default
65 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
67 CONFIGURE_PREFIX:=/usr
69 --target=$(GNU_TARGET_NAME) \
70 --host=$(GNU_TARGET_NAME) \
71 --build=$(GNU_HOST_NAME) \
74 --prefix=$(CONFIGURE_PREFIX) \
75 --exec-prefix=$(CONFIGURE_PREFIX) \
76 --bindir=$(CONFIGURE_PREFIX)/bin \
77 --sbindir=$(CONFIGURE_PREFIX)/sbin \
78 --libexecdir=$(CONFIGURE_PREFIX)/lib \
80 --datadir=$(CONFIGURE_PREFIX)/share \
81 --localstatedir=/var \
82 --mandir=$(CONFIGURE_PREFIX)/man \
83 --infodir=$(CONFIGURE_PREFIX)/info \
85 $(DISABLE_LARGEFILE) \
89 $(TARGET_CONFIGURE_OPTS) \
90 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
91 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
92 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
93 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
96 CONFIGURE_CMD = ./configure
98 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
100 define Build/Configure/Default
101 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
102 if [ -x $(CONFIGURE_CMD) ]; then \
103 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
104 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
115 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
116 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
117 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
120 $(TARGET_CONFIGURE_OPTS) \
121 CROSS="$(TARGET_CROSS)" \
124 MAKE_INSTALL_FLAGS = \
126 DESTDIR="$(PKG_INSTALL_DIR)"
130 define Build/Compile/Default
132 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
137 define Build/Install/Default
139 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
140 $(MAKE_INSTALL_FLAGS) \
141 $(if $(1), $(1), install);
144 define Build/Dist/Default
145 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
148 define Build/DistCheck/Default
149 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)