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
)
26 ifneq ($(ARCH_PACKAGES
),)
27 PKGARCH
:=$(ARCH_PACKAGES
)
43 Build
/Patch
:=$(Build
/Patch
/Default
)
44 ifneq ($(strip $(PKG_UNPACK
)),)
45 define Build
/Prepare
/Default
46 $(SH_FUNC
) $(PKG_UNPACK
)
51 CONFIGURE_PREFIX
:=/usr
53 --target
=$(GNU_TARGET_NAME
) \
54 --host
=$(GNU_TARGET_NAME
) \
55 --build
=$(GNU_HOST_NAME
) \
58 --prefix=$(CONFIGURE_PREFIX
) \
59 --exec-prefix
=$(CONFIGURE_PREFIX
) \
60 --bindir=$(CONFIGURE_PREFIX
)/bin \
61 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
62 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
64 --datadir=$(CONFIGURE_PREFIX
)/share \
65 --localstatedir
=/var \
66 --mandir=$(CONFIGURE_PREFIX
)/man \
67 --infodir=$(CONFIGURE_PREFIX
)/info \
69 $(DISABLE_LARGEFILE
) \
73 $(TARGET_CONFIGURE_OPTS
) \
74 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
75 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
76 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
77 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
80 CONFIGURE_CMD
= .
/configure
82 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
84 define Build
/Configure
/Default
85 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
86 if
[ -x
$(CONFIGURE_CMD
) ]; then \
87 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
88 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
99 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
100 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
101 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
104 $(TARGET_CONFIGURE_OPTS
) \
105 CROSS
="$(TARGET_CROSS)" \
108 MAKE_INSTALL_FLAGS
= \
110 DESTDIR
="$(PKG_INSTALL_DIR)"
114 define Build
/Compile
/Default
116 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
121 define Build
/Install
/Default
123 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
124 $(MAKE_INSTALL_FLAGS
) \
125 $(if
$(1), $(1), install);
128 define Build
/Dist
/Default
129 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
132 define Build
/DistCheck
/Default
133 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)