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 ifeq ($(CONFIG_BUILD_NLS
),y
)
73 DISABLE_NLS
:=--disable-nls
76 CONFIGURE_PREFIX
:=/usr
78 --target
=$(GNU_TARGET_NAME
) \
79 --host
=$(GNU_TARGET_NAME
) \
80 --build
=$(GNU_HOST_NAME
) \
83 --prefix=$(CONFIGURE_PREFIX
) \
84 --exec-prefix
=$(CONFIGURE_PREFIX
) \
85 --bindir=$(CONFIGURE_PREFIX
)/bin \
86 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
87 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
89 --datadir=$(CONFIGURE_PREFIX
)/share \
90 --localstatedir
=/var \
91 --mandir=$(CONFIGURE_PREFIX
)/man \
92 --infodir=$(CONFIGURE_PREFIX
)/info \
94 $(DISABLE_LARGEFILE
) \
98 $(TARGET_CONFIGURE_OPTS
) \
99 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
100 CXXFLAGS
="$(TARGET_CXXFLAGS) $(EXTRA_CFLAGS)" \
101 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
102 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
105 CONFIGURE_CMD
= .
/configure
107 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; \
108 $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
--remove-destination \
111 define Build
/Configure
/Default
112 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
113 if
[ -x
$(CONFIGURE_CMD
) ]; then \
114 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
115 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
126 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
127 CXXFLAGS
="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
128 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
131 $(TARGET_CONFIGURE_OPTS
) \
132 CROSS
="$(TARGET_CROSS)" \
135 MAKE_INSTALL_FLAGS
= \
137 DESTDIR
="$(PKG_INSTALL_DIR)"
141 define Build
/Compile
/Default
143 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
148 define Build
/Install
/Default
150 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
151 $(MAKE_INSTALL_FLAGS
) \
152 $(if
$(1), $(1), install);
155 define Build
/Dist
/Default
156 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
159 define Build
/DistCheck
/Default
160 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)