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
)/%,%,${shell pwd
})
17 ifneq ($(PKG_VERSION
),)
18 ifneq ($(PKG_RELEASE
),)
19 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
21 VERSION
:=$(PKG_VERSION
)
24 VERSION
:=$(PKG_RELEASE
)
38 Build
/Patch
:=$(Build
/Patch
/Default
)
39 ifneq ($(strip $(PKG_UNPACK
)),)
40 define Build
/Prepare
/Default
46 export PKG_CONFIG_PATH
=$(STAGING_DIR
)/usr
/lib
/pkgconfig
:$(STAGING_DIR_HOST
)/usr
/lib
/pkgconfig
47 export PKG_CONFIG_LIBDIR
=$(STAGING_DIR
)/usr
/lib
/pkgconfig
49 CONFIGURE_PREFIX
:=/usr
51 --target
=$(GNU_TARGET_NAME
) \
52 --host
=$(GNU_TARGET_NAME
) \
53 --build
=$(GNU_HOST_NAME
) \
56 --prefix=$(CONFIGURE_PREFIX
) \
57 --exec-prefix
=$(CONFIGURE_PREFIX
) \
58 --bindir=$(CONFIGURE_PREFIX
)/bin \
59 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
60 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
62 --datadir=$(CONFIGURE_PREFIX
)/share \
63 --localstatedir
=/var \
64 --mandir=$(CONFIGURE_PREFIX
)/man \
65 --infodir=$(CONFIGURE_PREFIX
)/info \
69 $(TARGET_CONFIGURE_OPTS
) \
70 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
71 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
72 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
73 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
74 PKG_CONFIG_PATH
="$(PKG_CONFIG_PATH)" \
75 PKG_CONFIG_LIBDIR
="$(PKG_CONFIG_LIBDIR)"
78 CONFIGURE_CMD
= .
/configure
80 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
82 define Build
/Configure
/Default
83 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
84 if
[ -x
$(CONFIGURE_CMD
) ]; then \
85 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
86 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
97 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
98 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
99 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
102 $(TARGET_CONFIGURE_OPTS
) \
103 CROSS
="$(TARGET_CROSS)" \
106 MAKE_INSTALL_FLAGS
= \
108 DESTDIR
="$(PKG_INSTALL_DIR)"
112 define Build
/Compile
/Default
114 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
119 define Build
/Install
/Default
121 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
122 $(MAKE_INSTALL_FLAGS
) \