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
65 [ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
70 EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)
71 ifeq ($(CONFIG_BUILD_NLS),y)
74 DISABLE_NLS:=--disable-nls
77 CONFIGURE_PREFIX:=/usr
79 --target=$(GNU_TARGET_NAME) \
80 --host=$(GNU_TARGET_NAME) \
81 --build=$(GNU_HOST_NAME) \
84 --prefix=$(CONFIGURE_PREFIX) \
85 --exec-prefix=$(CONFIGURE_PREFIX) \
86 --bindir=$(CONFIGURE_PREFIX)/bin \
87 --sbindir=$(CONFIGURE_PREFIX)/sbin \
88 --libexecdir=$(CONFIGURE_PREFIX)/lib \
90 --datadir=$(CONFIGURE_PREFIX)/share \
91 --localstatedir=/var \
92 --mandir=$(CONFIGURE_PREFIX)/man \
93 --infodir=$(CONFIGURE_PREFIX)/info \
95 $(DISABLE_LARGEFILE) \
99 $(TARGET_CONFIGURE_OPTS) \
100 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
101 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \
102 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
103 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
106 CONFIGURE_CMD = ./configure
108 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
109 $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
112 define Build/Configure/Default
113 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
114 if [ -x $(CONFIGURE_CMD) ]; then \
115 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
116 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
127 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
128 CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
129 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
132 $(TARGET_CONFIGURE_OPTS) \
133 CROSS="$(TARGET_CROSS)" \
136 MAKE_INSTALL_FLAGS = \
138 DESTDIR="$(PKG_INSTALL_DIR)"
142 define Build/Compile/Default
144 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
149 define Build/Install/Default
151 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
152 $(MAKE_INSTALL_FLAGS) \
153 $(if $(1), $(1), install);
156 define Build/Dist/Default
157 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
160 define Build/DistCheck/Default
161 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)