1 # $NetBSD: ext.mk,v 1.28 2012/06/16 02:47:51 taca Exp $
3 # PHP extension package framework, for both PECL and bundled PHP extensions.
5 # Just include this file, define MODNAME, define PKGREVISION if necessary,
6 # add dependencies, and add the appropriate --with-configure-arg, then include
9 .if
!defined
(PHPEXT_MK
)
13 _USER_VARS.phpext
= # none
14 _PKG_VARS.phpext
= MODNAME PECL_VERSION PKGMODNAME MODULESDIR \
16 _SYS_VARS.phpext
= DISTINFO_FILE PATCHDIR
18 .if defined
(PECL_VERSION
)
19 HOMEPAGE?
= http
://pecl.php.net
/package
/${MODNAME}
22 .
include "../../lang/php/phpversion.mk"
24 .
include "${PHPPKGSRCDIR}/Makefile.common"
26 PKGMODNAME?
= ${MODNAME
:S
/-/_
/}
27 PHPSETUPSUBDIR?
= #empty
28 MODULESDIR?
= ${WRKSRC}/modules
29 PLIST_SUBST
+= MODNAME
=${PKGMODNAME}
31 .if
!defined
(PECL_VERSION
)
33 PKGNAME?
= ${PHP_PKG_PREFIX}-${MODNAME}-${PHP_BASE_VERS}
34 EXTRACT_ELEMENTS?
= ${DISTNAME}/ext
/${PKGMODNAME}
35 WRKSRC?
= ${WRKDIR}/${EXTRACT_ELEMENTS}
36 DISTINFO_FILE
= ${.CURDIR
}/${PHPPKGSRCDIR}/distinfo
39 # WARINING: following fixed version number for PHP 5.3.x must not be bumped!
40 .if defined
(PECL_LEGACY_VERSION_SCHEME
) && ${PKG_PHP_VERSION} == "53"
41 PKGNAME?
= ${PHP_PKG_PREFIX}-${MODNAME}-5.3.9.
${PECL_VERSION}
43 PKGNAME?
= ${PHP_PKG_PREFIX}-${MODNAME}-${PECL_VERSION}
45 MASTER_SITES?
= http
://pecl.php.net
/get/
46 PECL_DISTNAME?
= ${MODNAME}-${PECL_VERSION}
47 DISTNAME
= ${PECL_DISTNAME}
48 DIST_SUBDIR?
= php-
${MODNAME}
52 PHPIZE?
= ${BUILDLINK_PREFIX.php
}/bin
/phpize
53 PHP_CONFIG?
= ${BUILDLINK_PREFIX.php
}/bin
/php-config
56 CONFIGURE_ARGS
+= --with-php-config
=${PHP_CONFIG}
58 USE_CONFIG_WRAPPER
= YES
63 # Ensure we export symbols in the linked shared object.
64 LDFLAGS
+= ${EXPORT_SYMBOLS_LDFLAGS}
65 MAKE_ENV
+= EXPORT_SYMBOLS_LDFLAGS
="${EXPORT_SYMBOLS_LDFLAGS}"
67 PLIST_SRC
+= ${.CURDIR
}/..
/..
/lang
/php
/PLIST.module
68 MESSAGE_SRC
= ${.CURDIR
}/..
/..
/lang
/php
/MESSAGE.module
69 MESSAGE_SUBST
+= MODNAME
=${PKGMODNAME}
70 MESSAGE_SUBST
+= PHP_EXTENSION_DIR
=${PHP_EXTENSION_DIR}
72 # Also include extension-specific message
73 .if exists
(${.CURDIR
}/MESSAGE
)
74 MESSAGE_SRC
+= ${.CURDIR
}/MESSAGE
77 .if
${OBJECT_FMT} == "SOM"
83 pre-configure
: phpize-module
86 @cookie
=${WRKDIR}/.phpize_module_done
; \
87 if
[ ! -f
$${cookie} ]; then \
88 cd
${WRKSRC}/${PHPSETUPSUBDIR} && \
90 AUTOCONF
=${TOOLS_DIR
:Q
}/bin
/autoconf \
91 AUTOHEADER
=${TOOLS_DIR
:Q
}/bin
/autoheader \
92 ACLOCAL
=${TOOLS_DIR
:Q
}/bin
/aclocal \
93 LIBTOOLIZE
=${LOCALBASE
:Q
}/bin
/libtoolize \
95 ${TOUCH} ${TOUCH_FLAGS} $${cookie}; \
98 do-install
: do-module-install
101 ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR}
102 ${INSTALL_LIB} ${MODULESDIR}/${PKGMODNAME}.
${SHLIB_SUFFIX} \
103 ${DESTDIR}${PREFIX}/${PHP_EXTENSION_DIR}
105 .if defined
(USE_PHP_EXT_PATCHES
)
106 PATCHDIR
= ${.CURDIR
}/${PHPPKGSRCDIR}/patches
108 ${_PKG_SILENT}${_PKG_DEBUG} \
110 for p in
`${EGREP} -l '^\+\+\+ ext/${MODNAME}/' ${PATCHDIR}/patch-*`;do\
111 ${SED} -e
's,^+++ ext/${MODNAME}/,+++ ,' $$p |
${PATCH} ${PATCH_ARGS}; \
115 .
include "${PHPPKGSRCDIR}/buildlink3.mk"