summaryrefslogtreecommitdiff
path: root/www/php4/Makefile
blob: 6765862db903b07870c53031bc2563ef16e1b621 (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
66
67
68
# $NetBSD: Makefile,v 1.81 2008/01/18 05:09:52 tnn Exp $

PKGNAME=		php-${PHP_BASE_VERS}
PKGREVISION=		1
CATEGORIES+=		lang
COMMENT=		HTML-embedded scripting language

PKG_DESTDIR_SUPPORT=	user-destdir

CONFLICTS+=		ap-php-4.0.3pl1

# PHP uses libtool inconsistently for CGI/CLI build; don't sanify for now
LIBTOOL_OVERRIDE=	# empty
USE_TOOLS+=		gmake lex

PKG_OPTIONS_REQUIRED_GROUPS+=	sapi
PKG_OPTIONS_GROUP.sapi=	cgi fastcgi
PKG_SUGGESTED_OPTIONS+=	cgi

.include "Makefile.php"

.if !empty(PKG_OPTIONS:Mcgi)
CONFIGURE_ARGS+=	--enable-discard-path
CONFIGURE_ARGS+=	--enable-force-cgi-redirect
.endif

.if !empty(PKG_OPTIONS:Mfastcgi)
CONFIGURE_ARGS+=	--enable-fastcgi
.endif

CGIDIR=			${PREFIX}/libexec/cgi-bin
EGDIR=			${PREFIX}/share/examples/php
MESSAGE_SUBST+=		CGIDIR=${CGIDIR:Q}

MAKE_ENV+=		INSTALL_ROOT=${DESTDIR}

# On NetBSD ELF platforms, we need to link libgcc.a whole-archive so that
# certain symbols from the C++ implementation (__get_eh_context, etc.)
# referenced by DSOs written in C++ will resolve correctly.  We need to
# prefix the linker flags "-whole-archive -lgcc -no-whole-archive" with
# "-Wl," to force all of the flags to be passed down to the linker through
# libtool without change.
#
.if ${OPSYS} == "NetBSD" && ${OBJECT_FMT} == "ELF"
MAKE_ENV+=		LINK_LIBGCC_LDFLAGS=${LINK_ALL_LIBGCC_HACK:Q}
.endif

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

CONF_FILES=	${EGDIR}/php.ini-recommended ${PKG_SYSCONFDIR}/php.ini
OWN_DIRS=	${PREFIX}/${PHP_EXTENSION_DIR}

post-install:
	${INSTALL_PROGRAM} ${WRKSRC}/sapi/cli/php \
		${DESTDIR:Q}${PREFIX:Q}/bin/php
	${INSTALL_DATA} ${WRKSRC}/sapi/cli/php.1 \
		${DESTDIR:Q}${PREFIX:Q}/${PKGMANDIR}/man1/php.1
	${INSTALL_DATA_DIR} ${DESTDIR:Q}${CGIDIR:Q}
	${INSTALL_PROGRAM} ${WRKSRC}/sapi/cgi/php ${DESTDIR:Q}${CGIDIR:Q}
	${INSTALL_DATA_DIR} ${DESTDIR:Q}${EGDIR:Q}
	cd ${WRKSRC}; ${INSTALL_DATA} php.ini-dist php.ini-recommended \
		${DESTDIR:Q}${EGDIR:Q}
	${INSTALL_DATA_DIR} ${DESTDIR:Q}${PREFIX:Q}/share/php
	${INSTALL_DATA} ${WRKSRC}/php.gif ${DESTDIR:Q}${PREFIX:Q}/share/php

.include "../../mk/bsd.pkg.mk"