1 COMMENT= The ${PHP_MODNAME} shared extension for php
5 PHP_MODNAME= ${PKGNAMESUFFIX:S/-//}
7 IGNORE_WITH_PHP=52 53 54 55 5
9 EXTSUBDIR= ${DISTNAME}/ext/${PHP_MODNAME}
10 WRKSRC= ${WRKDIR}/${EXTSUBDIR}
11 PATCHDIR= ${.CURDIR}/files
14 EXTRACT_AFTER_ARGS?= ${EXTSUBDIR}
16 .if ${PHP_MODNAME} == "bcmath"
17 CONFIGURE_ARGS+=--enable-bcmath
19 PHP_HEADER_DIRS=libbcmath libbcmath/src
22 .if ${PHP_MODNAME} == "bz2"
23 CONFIGURE_ARGS+=--with-bz2=/usr
26 .if ${PHP_MODNAME} == "calendar"
27 CONFIGURE_ARGS+=--enable-calendar
30 .if ${PHP_MODNAME} == "ctype"
31 CONFIGURE_ARGS+=--enable-ctype
34 .if ${PHP_MODNAME} == "curl"
35 LIB_DEPENDS+= libcurl.so:${PORTSDIR}/ftp/curl
37 CONFIGURE_ARGS+=--with-curl=${LOCALBASE}
40 .if ${PHP_MODNAME} == "dba"
41 CONFIGURE_ARGS+=--enable-dba
43 OPTIONS_DEFINE= CDB DB4 GDBM QDBM TOKYO INIFILE FLATFILE
44 OPTIONS_DEFAULT=CDB INIFILE FLATFILE
46 CDB_DESC= cdb database support
47 DB4_DESC= Berkeley DB4 support
48 GDBM_DESC= GDBM database support
49 QDBM_DESC= QDBM database support
50 TOKYO_DESC= Tokyo Cabinet database support
51 INIFILE_DESC= INI file support
52 FLATFILE_DESC= flatfile support
54 PHP_HEADER_DIRS= libcdb libflatfile libinifile
57 .if ${PHP_MODNAME} == "dom"
58 CONFIGURE_ARGS+=--enable-dom \
59 --with-libxml-dir=${LOCALBASE}
64 .if ${PHP_MODNAME} == "exif"
65 CONFIGURE_ARGS+=--enable-exif
68 .if ${PHP_MODNAME} == "fileinfo"
69 CONFIGURE_ARGS+=--enable-fileinfo \
70 --with-pcre-dir=${LOCALBASE}
72 PHP_HEADER_DIRS= libmagic
75 .if ${PHP_MODNAME} == "filter"
76 CONFIGURE_ARGS+=--enable-filter \
77 --with-pcre-dir=${LOCALBASE}
80 .if ${PHP_MODNAME} == "ftp"
81 CONFIGURE_ARGS+=--enable-ftp \
82 --with-openssl-dir=${OPENSSLBASE}
84 LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
88 .if ${PHP_MODNAME} == "gd"
89 LIB_DEPENDS= libfreetype.so:${PORTSDIR}/print/freetype2 \
90 libpng.so:${PORTSDIR}/graphics/png \
91 libjpeg.so:${PORTSDIR}/graphics/jpeg
93 CONFIGURE_ARGS+=--with-gd \
94 --with-freetype-dir=${LOCALBASE} \
95 --with-jpeg-dir=${LOCALBASE} \
96 --with-png-dir=${LOCALBASE} \
99 OPTIONS_DEFINE= T1LIB TRUETYPE JIS X11 VPX
100 OPTIONS_DEFAULT=T1LIB TRUETYPE X11
102 T1LIB_DESC= Include T1lib support
103 TRUETYPE_DESC= Enable TrueType string function
104 JIS_DESC= Enable JIS-mapped Japanese font support
105 X11_DESC= Enable XPM support
106 VPX_DESC= Enable VP8 codec support
108 PHP_HEADER_DIRS=libgd
111 .if ${PHP_MODNAME} == "gettext"
112 CONFIGURE_ARGS+=--with-gettext=${LOCALBASE}
117 .if ${PHP_MODNAME} == "gmp"
118 LIB_DEPENDS+= libgmp.so:${PORTSDIR}/math/gmp
120 CONFIGURE_ARGS+=--with-gmp=${LOCALBASE}
123 .if ${PHP_MODNAME} == "hash"
124 CONFIGURE_ARGS+=--enable-hash \
128 .if ${PHP_MODNAME} == "iconv"
129 CONFIGURE_ARGS+=--with-iconv=${LOCALBASE}
131 USES+= iconv:translit
134 .if ${PHP_MODNAME} == "imap"
135 OPTIONS_DEFINE= PANDA
136 PANDA_DESC= Uses the forked panda-cclient instead of the original cclient
138 CONFIGURE_ARGS+=--with-imap=${LOCALBASE} \
139 --with-pcre-dir=${LOCALBASE} \
140 --with-imap-ssl=${OPENSSLBASE}
142 LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
146 .if ${PHP_MODNAME} == "interbase"
147 CONFIGURE_ARGS+=--with-interbase=${LOCALBASE}
152 .if ${PHP_MODNAME} == "json"
153 CONFIGURE_ARGS+=--enable-json
156 .if ${PHP_MODNAME} == "ldap"
157 CONFIGURE_ARGS+=--with-ldap=${LOCALBASE}
161 . ifdef(WANT_OPENLDAP_SASL)
162 CONFIGURE_ARGS+=--with-ldap-sasl=${LOCALBASE}
166 .if ${PHP_MODNAME} == "mbstring"
168 CONFIGURE_ARGS+=--enable-mbstring \
169 --with-pcre-dir=${LOCALBASE}
171 OPTIONS_DEFINE= REGEX
172 OPTIONS_DEFAULT=REGEX
174 REGEX_DESC= Enable multibyte regex support
176 PHP_HEADER_DIRS=libmbfl libmbfl/filters libmbfl/mbfl libmbfl/nls
179 .if ${PHP_MODNAME} == "mcrypt"
180 LIB_DEPENDS+= libltdl.so:${PORTSDIR}/devel/libltdl \
181 libmcrypt.so:${PORTSDIR}/security/libmcrypt
183 CONFIGURE_ARGS+=--with-mcrypt=${LOCALBASE}
186 .if ${PHP_MODNAME} == "mssql"
187 LIB_DEPENDS+= libsybdb.so:${PORTSDIR}/databases/freetds
189 CONFIGURE_ARGS+=--with-mssql=${LOCALBASE}
192 .if ${PHP_MODNAME} == "mysql"
193 OPTIONS_DEFINE= MYSQLND
194 OPTIONS_DEFAULT=MYSQLND
196 MYSQLND_DESC= Use MySQL Native Driver
199 .if ${PHP_MODNAME} == "mysqli"
200 OPTIONS_DEFINE= MYSQLND
201 OPTIONS_DEFAULT=MYSQLND
203 MYSQLND_DESC= Use MySQL Native Driver
206 .if ${PHP_MODNAME} == "odbc"
207 LIB_DEPENDS+= libodbc.so:${PORTSDIR}/databases/unixODBC
209 CONFIGURE_ARGS+=--enable-odbc \
210 --with-unixODBC=${LOCALBASE}
213 .if ${PHP_MODNAME} == "openssl"
214 CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
216 LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
220 .if ${PHP_MODNAME} == "opcache"
221 CONFIGURE_ARGS+=--enable-opcache
224 .if ${PHP_MODNAME} == "pcntl"
225 CONFIGURE_ARGS+=--enable-pcntl
228 .if ${PHP_MODNAME} == "pdo"
229 CONFIGURE_ARGS+=--enable-pdo
232 .if ${PHP_MODNAME} == "pdo_dblib"
233 CONFIGURE_ARGS+=--with-pdo-dblib=${LOCALBASE}
238 OPTIONS_DEFINE= MSSQL
240 MSSQL_DESC= Enable Microsoft SQL Server support
243 .if ${PHP_MODNAME} == "pdo_firebird"
244 CONFIGURE_ARGS+=--with-pdo-firebird=${LOCALBASE}
252 .if ${PHP_MODNAME} == "pdo_mysql"
253 OPTIONS_DEFINE= MYSQLND
254 OPTIONS_DEFAULT=MYSQLND
256 MYSQLND_DESC= Use MySQL Native Driver
262 .if ${PHP_MODNAME} == "pdo_odbc"
263 LIB_DEPENDS+= libodbc.so:${PORTSDIR}/databases/unixODBC
264 CONFIGURE_ARGS+=--with-pdo-odbc=unixODBC,${LOCALBASE}
270 .if ${PHP_MODNAME} == "pdo_pgsql"
273 CONFIGURE_ARGS+=--with-pdo-pgsql=${LOCALBASE}
279 .if ${PHP_MODNAME} == "pdo_sqlite"
281 CONFIGURE_ARGS+=--with-pdo-sqlite=${LOCALBASE}
287 .if ${PHP_MODNAME} == "pgsql"
290 CONFIGURE_ARGS+=--with-pgsql=${LOCALBASE}
293 .if ${PHP_MODNAME} == "phar"
294 CONFIGURE_ARGS+=--enable-phar \
295 --with-pcre-dir=${LOCALBASE}
301 .if ${PHP_MODNAME} == "posix"
302 CONFIGURE_ARGS+=--enable-posix
305 .if ${PHP_MODNAME} == "pspell"
306 LIB_DEPENDS+= libaspell.so:${PORTSDIR}/textproc/aspell
308 CONFIGURE_ARGS+=--with-pspell=${LOCALBASE}
310 # Ugly hack to load session before psell to avoid crashes
315 .if ${PHP_MODNAME} == "readline"
316 CONFIGURE_ARGS+=--with-readline=/usr
320 .if ${PHP_MODNAME} == "recode"
321 LIB_DEPENDS+= librecode.so:${PORTSDIR}/converters/recode
323 CONFIGURE_ARGS+=--with-recode=${LOCALBASE}
326 .if ${PHP_MODNAME} == "session"
327 CONFIGURE_ARGS+=--enable-session
330 .if ${PHP_MODNAME} == "shmop"
331 CONFIGURE_ARGS+=--enable-shmop
334 .if ${PHP_MODNAME} == "simplexml"
335 CONFIGURE_ARGS+=--enable-simplexml \
336 --with-pcre-dir=${LOCALBASE} \
337 --with-libxml-dir=${LOCALBASE}
343 .if ${PHP_MODNAME} == "snmp"
344 CONFIGURE_ARGS+=--with-snmp=${LOCALBASE} \
345 --with-openssl-dir=${OPENSSLBASE}
347 CONFIGURE_ENV+= ac_cv_buggy_snprint_value="no"
349 LIB_DEPENDS+= libnetsnmp.so:${PORTSDIR}/net-mgmt/net-snmp
350 LDFLAGS+= -L${OPENSSLLIB} -lcrypto -lssl
354 .if ${PHP_MODNAME} == "soap"
355 CONFIGURE_ARGS+=--enable-soap \
356 --with-libxml-dir=${LOCALBASE}
364 .if ${PHP_MODNAME} == "sockets"
365 CONFIGURE_ARGS+=--enable-sockets
368 .if ${PHP_MODNAME} == "sqlite3"
370 CONFIGURE_ARGS+=--with-sqlite3=${LOCALBASE}
373 .if ${PHP_MODNAME} == "sybase_ct"
374 LIB_DEPENDS+= libct.so:${PORTSDIR}/databases/freetds
376 CONFIGURE_ARGS+=--with-sybase-ct=${LOCALBASE}
379 .if ${PHP_MODNAME} == "sysvmsg"
380 CONFIGURE_ARGS+=--enable-sysvmsg
383 .if ${PHP_MODNAME} == "sysvsem"
384 CONFIGURE_ARGS+=--enable-sysvsem
387 .if ${PHP_MODNAME} == "sysvshm"
388 CONFIGURE_ARGS+=--enable-sysvshm
391 .if ${PHP_MODNAME} == "tidy"
392 CONFIGURE_ARGS+=--with-tidy=${LOCALBASE}
394 LIB_DEPENDS+= libtidy.so:${PORTSDIR}/www/tidy-lib
397 .if ${PHP_MODNAME} == "tokenizer"
398 CONFIGURE_ARGS+=--enable-tokenizer
401 .if ${PHP_MODNAME} == "wddx"
402 CONFIGURE_ARGS+=--enable-wddx \
403 --with-libxml-dir=${LOCALBASE}
411 .if ${PHP_MODNAME} == "xml"
412 CONFIGURE_ARGS+=--enable-xml \
413 --with-libxml-dir=${LOCALBASE}
418 .if ${PHP_MODNAME} == "xmlreader"
419 CONFIGURE_ARGS+=--enable-xmlreader \
420 --with-libxml-dir=${LOCALBASE}
428 .if ${PHP_MODNAME} == "xmlrpc"
429 CONFIGURE_ARGS+=--with-xmlrpc \
430 --with-libxml-dir=${LOCALBASE} \
431 --with-iconv-dir=${LOCALBASE}
433 USES+= iconv:translit
436 PHP_HEADER_DIRS=libxmlrpc
442 .if ${PHP_MODNAME} == "xmlwriter"
443 CONFIGURE_ARGS+=--enable-xmlwriter \
444 --with-libxml-dir=${LOCALBASE}
449 .if ${PHP_MODNAME} == "xsl"
450 CONFIGURE_ARGS+=--with-xsl=${LOCALBASE}
457 .if ${PHP_MODNAME} == "zip"
458 LIB_DEPENDS+= libzip.so:${PORTSDIR}/archivers/libzip
460 CONFIGURE_ARGS+=--enable-zip \
461 --with-zlib-dir=/usr \
462 --with-pcre-dir=${LOCALBASE} \
463 --with-libzip=${LOCALBASE}
466 .if ${PHP_MODNAME} == "zlib"
467 CONFIGURE_ARGS+=--with-zlib=/usr
470 .include <bsd.port.pre.mk>
472 .if ${PHP_MODNAME} == "dba"
473 . if empty(PORT_OPTIONS:MCDB)
474 CONFIGURE_ARGS+=--without-cdb
476 . if ${PORT_OPTIONS:MDB4}
477 CONFIGURE_ARGS+=--with-db4=${LOCALBASE}
480 WITH_BDB_HIGHEST= yes
482 . if ${PORT_OPTIONS:MGDBM}
483 LIB_DEPENDS+= libgdbm.so:${PORTSDIR}/databases/gdbm
485 CONFIGURE_ARGS+=--with-gdbm=${LOCALBASE}
487 . if ${PORT_OPTIONS:MQDBM}
488 LIB_DEPENDS+= libqdbm.so:${PORTSDIR}/databases/qdbm
490 CONFIGURE_ARGS+=--with-qdbm=${LOCALBASE}
492 . if ${PORT_OPTIONS:MTOKYO}
493 LIB_DEPENDS+= libtokyocabinet.so:${PORTSDIR}/databases/tokyocabinet
495 CONFIGURE_ARGS+=--with-tcadb=${LOCALBASE}
497 . if empty(PORT_OPTIONS:MINIFILE)
498 CONFIGURE_ARGS+=--disable-inifile
500 . if empty(PORT_OPTIONS:MFLATFILE)
501 CONFIGURE_ARGS+=--disable-flatfile
505 .if ${PHP_MODNAME} == "gd"
506 . if ${PORT_OPTIONS:MT1LIB}
507 LIB_DEPENDS+= libt1.so:${PORTSDIR}/devel/t1lib
509 CONFIGURE_ARGS+=--with-t1lib=${LOCALBASE}
511 . if ${PORT_OPTIONS:MTRUETYPE}
512 CONFIGURE_ARGS+=--enable-gd-native-ttf
514 . if ${PORT_OPTIONS:MJIS}
515 CONFIGURE_ARGS+=--enable-gd-jis-conv
517 . if ${PORT_OPTIONS:MX11}
520 CONFIGURE_ARGS+=--with-xpm-dir=${LOCALBASE}
522 . if ${PORT_OPTIONS:MVPX}
523 LIB_DEPENDS+= libvpx.so:${PORTSDIR}/multimedia/libvpx
525 CONFIGURE_ARGS+=--with-vpx-dir=${LOCALBASE}
529 .if ${PHP_MODNAME} == "imap"
530 . if ${PORT_OPTIONS:MPANDA}
531 LIB_DEPENDS+= libc-client4.so.10:${PORTSDIR}/mail/panda-cclient
533 LIB_DEPENDS+= libc-client4.so.9:${PORTSDIR}/mail/cclient
537 .if ${PHP_MODNAME} == "mbstring"
538 . if ${PORT_OPTIONS:MREGEX}
539 LIB_DEPENDS+= libonig.so:${PORTSDIR}/devel/oniguruma4
540 CONFIGURE_ARGS+=--with-onig=${LOCALBASE}
542 CONFIGURE_ARGS+=--disable-mbregex
546 .if ${PHP_MODNAME} == "mysql"
547 . if ${PORT_OPTIONS:MMYSQLND}
548 CONFIGURE_ARGS+=--with-mysql=mysqlnd
550 CONFIGURE_ARGS+=--with-mysql=${LOCALBASE} \
557 .if ${PHP_MODNAME} == "mysqli"
558 . if ${PORT_OPTIONS:MMYSQLND}
559 CONFIGURE_ARGS+=--with-mysqli=mysqlnd
561 CONFIGURE_ARGS+=--with-mysqli=${LOCALBASE}/bin/mysql_config
567 .if ${PHP_MODNAME} == "openssl" || ${PHP_MODNAME} == "sqlite3"
569 @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
572 .if ${PHP_MODNAME} == "pdo_dblib"
573 . if ${PORT_OPTIONS:MMSSQL}
574 LIB_DEPENDS+= libsybdb.so:${PORTSDIR}/databases/freetds
576 LIB_DEPENDS+= libct.so:${PORTSDIR}/databases/freetds
580 .if ${PHP_MODNAME} == "pdo_mysql"
581 . if ${PORT_OPTIONS:MMYSQLND}
582 CONFIGURE_ARGS+=--with-pdo-mysql=mysqlnd
586 CONFIGURE_ARGS+=--with-pdo-mysql=${LOCALBASE} \
593 .if ${PHP_MODNAME} == "xml"
595 @${MKDIR} ${WRKSRC}/ext/xml
596 @${CP} ${WRKSRC}/expat_compat.h ${WRKSRC}/ext/xml
599 .if ${PHP_MODNAME} == "zlib"
601 @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4