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
16 MAINTAINER
:=OpenWrt Developers Team
<openwrt-devel@openwrt.org
>
17 SOURCE
:=$(patsubst $(TOPDIR
)/%,%,$(CURDIR
))
18 ifneq ($(PKG_VERSION
),)
19 ifneq ($(PKG_RELEASE
),)
20 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
22 VERSION
:=$(PKG_VERSION
)
25 VERSION
:=$(PKG_RELEASE
)
28 PKGFLAGS
:=$(PKG_FLAGS
)
32 ifneq ($(ARCH_PACKAGES
),)
33 PKGARCH
:=$(ARCH_PACKAGES
)
50 Build
/Patch
:=$(Build
/Patch
/Default
)
51 ifneq ($(strip $(PKG_UNPACK
)),)
52 define Build
/Prepare
/Default
53 $(SH_FUNC
) $(PKG_UNPACK
)
58 CONFIGURE_PREFIX
:=/usr
60 --target
=$(GNU_TARGET_NAME
) \
61 --host
=$(GNU_TARGET_NAME
) \
62 --build
=$(GNU_HOST_NAME
) \
65 --prefix=$(CONFIGURE_PREFIX
) \
66 --exec-prefix
=$(CONFIGURE_PREFIX
) \
67 --bindir=$(CONFIGURE_PREFIX
)/bin \
68 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
69 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
71 --datadir=$(CONFIGURE_PREFIX
)/share \
72 --localstatedir
=/var \
73 --mandir=$(CONFIGURE_PREFIX
)/man \
74 --infodir=$(CONFIGURE_PREFIX
)/info \
76 $(DISABLE_LARGEFILE
) \
80 $(TARGET_CONFIGURE_OPTS
) \
81 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
82 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
83 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
84 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
87 CONFIGURE_CMD
= .
/configure
89 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
91 define Build
/Configure
/Default
92 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
93 if
[ -x
$(CONFIGURE_CMD
) ]; then \
94 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
95 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
106 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
107 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
108 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
111 $(TARGET_CONFIGURE_OPTS
) \
112 CROSS
="$(TARGET_CROSS)" \
115 MAKE_INSTALL_FLAGS
= \
117 DESTDIR
="$(PKG_INSTALL_DIR)"
121 define Build
/Compile
/Default
123 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
128 define Build
/Install
/Default
130 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
131 $(MAKE_INSTALL_FLAGS
) \
132 $(if
$(1), $(1), install);
135 define Build
/Dist
/Default
136 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
139 define Build
/DistCheck
/Default
140 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)