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 +SSP_SUPPORT:libssp +USE_GLIBC:librt +USE_GLIBC: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
25 MAINTAINER:=$(PKG_MAINTAINER)
26 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
27 ifneq ($(PKG_VERSION),)
28 ifneq ($(PKG_RELEASE),)
29 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
31 VERSION:=$(PKG_VERSION)
34 VERSION:=$(PKG_RELEASE)
38 PKGFLAGS:=$(PKG_FLAGS)
42 ifneq ($(ARCH_PACKAGES),)
43 PKGARCH:=$(ARCH_PACKAGES)
61 Build/Patch:=$(Build/Patch/Default)
62 ifneq ($(strip $(PKG_UNPACK)),)
63 define Build/Prepare/Default
69 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
70 DISABLE_NLS:=--disable-nls
72 CONFIGURE_PREFIX:=/usr
74 --target=$(GNU_TARGET_NAME) \
75 --host=$(GNU_TARGET_NAME) \
76 --build=$(GNU_HOST_NAME) \
79 --prefix=$(CONFIGURE_PREFIX) \
80 --exec-prefix=$(CONFIGURE_PREFIX) \
81 --bindir=$(CONFIGURE_PREFIX)/bin \
82 --sbindir=$(CONFIGURE_PREFIX)/sbin \
83 --libexecdir=$(CONFIGURE_PREFIX)/lib \
85 --datadir=$(CONFIGURE_PREFIX)/share \
86 --localstatedir=/var \
87 --mandir=$(CONFIGURE_PREFIX)/man \
88 --infodir=$(CONFIGURE_PREFIX)/info \
90 $(DISABLE_LARGEFILE) \
94 $(TARGET_CONFIGURE_OPTS) \
95 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
96 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
97 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
98 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
101 CONFIGURE_CMD = ./configure
103 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
104 $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
107 define Build/Configure/Default
108 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
109 if [ -x $(CONFIGURE_CMD) ]; then \
110 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
111 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
122 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
123 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
124 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
127 $(TARGET_CONFIGURE_OPTS) \
128 CROSS="$(TARGET_CROSS)" \
131 MAKE_INSTALL_FLAGS = \
133 DESTDIR="$(PKG_INSTALL_DIR)"
137 define Build/Compile/Default
139 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
144 define Build/Install/Default
146 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
147 $(MAKE_INSTALL_FLAGS) \
148 $(if $(1), $(1), install);
151 define Build/Dist/Default
152 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
155 define Build/DistCheck/Default
156 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)