summaryrefslogtreecommitdiff
path: root/www/php4/Makefile.module
blob: 00ad9b7c4994d3e04de67b3d62143c7ae1e374b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# $NetBSD: Makefile.module,v 1.22 2003/02/03 23:53:24 jlam Exp $
#
# This Makefile is provided to ease creating PHP4 packages for the extension
# modules distributed in the PHP4 sources.
#
# Just include this file, define MODNAME, define PKGREVISION if necessary,
# add dependencies, and add the appropriate --with-configure-arg, then include
# bsd.pkg.mk.

.include "../../www/php4/Makefile.common"

PKGNAME?=		php-${MODNAME}-${PHP_BASE_VERS}
PKGREVISION?=		# empty

DEPENDS+=		php>=${PHP_BASE_VERS}:../../www/php4

AUTOMAKE_REQD?=		1.7
.include "../../mk/automake.mk"

PKGMODNAME?=		${MODNAME:S/-/_/}
MODULESDIR?=		${WRKSRC}/modules
PLIST_SUBST+=		MODNAME=${PKGMODNAME}

EXTRACT_ELEMENTS?=	${DISTNAME}/ext/${PKGMODNAME}
WRKSRC?=		${WRKDIR}/${EXTRACT_ELEMENTS}

PHPIZE?=		${BUILDLINK_PREFIX.php4}/bin/phpize
PHP_CONFIG?=		${BUILDLINK_PREFIX.php4}/bin/php-config

GNU_CONFIGURE=		YES
CONFIGURE_ARGS+=	--with-php-config=${PHP_CONFIG}

USE_CONFIG_WRAPPER=	YES
USE_LIBTOOL=		YES
LTCONFIG_OVERRIDE=	${WRKSRC}/ltconfig

# Ensure we export symbols in the linked shared object.
LDFLAGS+=		${EXPORT_SYMBOLS_LDFLAGS}
MAKE_ENV+=		EXPORT_SYMBOLS_LDFLAGS="${EXPORT_SYMBOLS_LDFLAGS}"

PLIST_SRC=		${.CURDIR}/../../www/php4/PLIST.module
MESSAGE_SRC=		${.CURDIR}/../../www/php4/MESSAGE.module
MESSAGE_SUBST+=		MODNAME=${PKGMODNAME}
MESSAGE_SUBST+=		PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}

pre-configure:	phpize-module

phpize-module:
	@cookie=${WRKDIR}/.phpize_module_done;				\
	if [ ! -f $${cookie} ]; then					\
		( cd ${WRKSRC} && ${SETENV} AUTOCONF=${AUTOCONF}	\
			AUTOHEADER=${AUTOHEADER} ACLOCAL=${ACLOCAL}	\
			LIBTOOLIZE=${LOCALBASE}/bin/libtoolize		\
			${PHPIZE} );					\
		${TOUCH} ${TOUCH_FLAGS} $${cookie};			\
	fi

do-install: do-module-install

do-module-install:
	${INSTALL_DATA_DIR} ${PREFIX}/${PHP_EXTENSION_DIR}
	${INSTALL_DATA} ${MODULESDIR}/${PKGMODNAME}.so \
		${PREFIX}/${PHP_EXTENSION_DIR}

.include "../../www/php4/buildlink2.mk"