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.
11 CATEGORY
:=Extra packages
15 MAINTAINER
:=OpenWrt Developers Team
<openwrt-devel@openwrt.org
>
16 SOURCE
:=$(patsubst $(TOPDIR
)/%,%,$(CURDIR
))
17 ifneq ($(PKG_VERSION
),)
18 ifneq ($(PKG_RELEASE
),)
19 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
21 VERSION
:=$(PKG_VERSION
)
24 VERSION
:=$(PKG_RELEASE
)
27 PKGFLAGS
:=$(PKG_FLAGS
)
31 ifneq ($(ARCH_PACKAGES
),)
32 PKGARCH
:=$(ARCH_PACKAGES
)
48 Build
/Patch
:=$(Build
/Patch
/Default
)
49 ifneq ($(strip $(PKG_UNPACK
)),)
50 define Build
/Prepare
/Default
51 $(SH_FUNC
) $(PKG_UNPACK
)
56 CONFIGURE_PREFIX
:=/usr
58 --target
=$(GNU_TARGET_NAME
) \
59 --host
=$(GNU_TARGET_NAME
) \
60 --build
=$(GNU_HOST_NAME
) \
63 --prefix=$(CONFIGURE_PREFIX
) \
64 --exec-prefix
=$(CONFIGURE_PREFIX
) \
65 --bindir=$(CONFIGURE_PREFIX
)/bin \
66 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
67 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
69 --datadir=$(CONFIGURE_PREFIX
)/share \
70 --localstatedir
=/var \
71 --mandir=$(CONFIGURE_PREFIX
)/man \
72 --infodir=$(CONFIGURE_PREFIX
)/info \
74 $(DISABLE_LARGEFILE
) \
78 $(TARGET_CONFIGURE_OPTS
) \
79 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
80 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
81 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
82 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
85 CONFIGURE_CMD
= .
/configure
87 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
89 define Build
/Configure
/Default
90 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
91 if
[ -x
$(CONFIGURE_CMD
) ]; then \
92 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
93 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
104 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
105 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
106 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
109 $(TARGET_CONFIGURE_OPTS
) \
110 CROSS
="$(TARGET_CROSS)" \
113 MAKE_INSTALL_FLAGS
= \
115 DESTDIR
="$(PKG_INSTALL_DIR)"
119 define Build
/Compile
/Default
121 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
126 define Build
/Install
/Default
128 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
129 $(MAKE_INSTALL_FLAGS
) \
130 $(if
$(1), $(1), install);
133 define Build
/Dist
/Default
134 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
137 define Build
/DistCheck
/Default
138 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)