Update lang/p5-signatures to version 0.11
[dports.git] / lang / php56 / Makefile.ext
1 COMMENT=        The ${PHP_MODNAME} shared extension for php
2
3 USE_PHP=        yes
4 USE_PHPEXT=     yes
5 PHP_MODNAME=    ${PKGNAMESUFFIX:S/-//}
6 PHP_DEFAULT=    5.6
7 IGNORE_WITH_PHP=52 53 54 55 5
8
9 EXTSUBDIR=      ${DISTNAME}/ext/${PHP_MODNAME}
10 WRKSRC=         ${WRKDIR}/${EXTSUBDIR}
11 PATCHDIR=       ${.CURDIR}/files
12 PLIST=          ${NONEXISTENT}
13
14 EXTRACT_AFTER_ARGS?=    ${EXTSUBDIR}
15
16 .if ${PHP_MODNAME} == "bcmath"
17 CONFIGURE_ARGS+=--enable-bcmath
18
19 PHP_HEADER_DIRS=libbcmath libbcmath/src
20 .endif
21
22 .if ${PHP_MODNAME} == "bz2"
23 CONFIGURE_ARGS+=--with-bz2=/usr
24 .endif
25
26 .if ${PHP_MODNAME} == "calendar"
27 CONFIGURE_ARGS+=--enable-calendar
28 .endif
29
30 .if ${PHP_MODNAME} == "ctype"
31 CONFIGURE_ARGS+=--enable-ctype
32 .endif
33
34 .if ${PHP_MODNAME} == "curl"
35 LIB_DEPENDS+=   libcurl.so:${PORTSDIR}/ftp/curl
36
37 CONFIGURE_ARGS+=--with-curl=${LOCALBASE}
38 .endif
39
40 .if ${PHP_MODNAME} == "dba"
41 CONFIGURE_ARGS+=--enable-dba
42
43 OPTIONS_DEFINE= CDB DB4 GDBM QDBM TOKYO INIFILE FLATFILE
44 OPTIONS_DEFAULT=CDB INIFILE FLATFILE
45
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
53
54 PHP_HEADER_DIRS=        libcdb libflatfile libinifile
55 .endif
56
57 .if ${PHP_MODNAME} == "dom"
58 CONFIGURE_ARGS+=--enable-dom \
59                 --with-libxml-dir=${LOCALBASE}
60
61 USE_GNOME=      libxml2
62 .endif
63
64 .if ${PHP_MODNAME} == "exif"
65 CONFIGURE_ARGS+=--enable-exif
66 .endif
67
68 .if ${PHP_MODNAME} == "fileinfo"
69 CONFIGURE_ARGS+=--enable-fileinfo \
70                 --with-pcre-dir=${LOCALBASE}
71
72 PHP_HEADER_DIRS=        libmagic
73 .endif
74
75 .if ${PHP_MODNAME} == "filter"
76 CONFIGURE_ARGS+=--enable-filter \
77                 --with-pcre-dir=${LOCALBASE}
78 .endif
79
80 .if ${PHP_MODNAME} == "ftp"
81 CONFIGURE_ARGS+=--enable-ftp \
82                 --with-openssl-dir=${OPENSSLBASE}
83
84 LDFLAGS+=       -L${OPENSSLLIB} -lcrypto -lssl
85 USE_OPENSSL=    yes
86 .endif
87
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
92
93 CONFIGURE_ARGS+=--with-gd \
94                 --with-freetype-dir=${LOCALBASE} \
95                 --with-jpeg-dir=${LOCALBASE} \
96                 --with-png-dir=${LOCALBASE} \
97                 --with-zlib-dir=/usr
98
99 OPTIONS_DEFINE= T1LIB TRUETYPE JIS X11 VPX
100 OPTIONS_DEFAULT=T1LIB TRUETYPE X11
101
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
107
108 PHP_HEADER_DIRS=libgd
109 .endif
110
111 .if ${PHP_MODNAME} == "gettext"
112 CONFIGURE_ARGS+=--with-gettext=${LOCALBASE}
113
114 USES+=          gettext
115 .endif
116
117 .if ${PHP_MODNAME} == "gmp"
118 LIB_DEPENDS+=   libgmp.so:${PORTSDIR}/math/gmp
119
120 CONFIGURE_ARGS+=--with-gmp=${LOCALBASE}
121 .endif
122
123 .if ${PHP_MODNAME} == "hash"
124 CONFIGURE_ARGS+=--enable-hash \
125                 --with-mhash
126 .endif
127
128 .if ${PHP_MODNAME} == "iconv"
129 CONFIGURE_ARGS+=--with-iconv=${LOCALBASE}
130
131 USES+=  iconv:translit
132 .endif
133
134 .if ${PHP_MODNAME} == "imap"
135 OPTIONS_DEFINE= PANDA
136 PANDA_DESC=     Uses the forked panda-cclient instead of the original cclient
137
138 CONFIGURE_ARGS+=--with-imap=${LOCALBASE} \
139                 --with-pcre-dir=${LOCALBASE} \
140                 --with-imap-ssl=${OPENSSLBASE}
141
142 LDFLAGS+=       -L${OPENSSLLIB} -lcrypto -lssl
143 USE_OPENSSL=    yes
144 .endif
145
146 .if ${PHP_MODNAME} == "interbase"
147 CONFIGURE_ARGS+=--with-interbase=${LOCALBASE}
148
149 USE_FIREBIRD=   yes
150 .endif
151
152 .if ${PHP_MODNAME} == "json"
153 CONFIGURE_ARGS+=--enable-json
154 .endif
155
156 .if ${PHP_MODNAME} == "ldap"
157 CONFIGURE_ARGS+=--with-ldap=${LOCALBASE}
158
159 USE_OPENLDAP=   yes
160
161 . ifdef(WANT_OPENLDAP_SASL)
162 CONFIGURE_ARGS+=--with-ldap-sasl=${LOCALBASE}
163 . endif
164 .endif
165
166 .if ${PHP_MODNAME} == "mbstring"
167
168 CONFIGURE_ARGS+=--enable-mbstring \
169                 --with-pcre-dir=${LOCALBASE}
170
171 OPTIONS_DEFINE= REGEX
172 OPTIONS_DEFAULT=REGEX
173
174 REGEX_DESC=     Enable multibyte regex support
175
176 PHP_HEADER_DIRS=libmbfl libmbfl/filters libmbfl/mbfl libmbfl/nls
177 .endif
178
179 .if ${PHP_MODNAME} == "mcrypt"
180 LIB_DEPENDS+=   libltdl.so:${PORTSDIR}/devel/libltdl \
181                 libmcrypt.so:${PORTSDIR}/security/libmcrypt
182
183 CONFIGURE_ARGS+=--with-mcrypt=${LOCALBASE}
184 .endif
185
186 .if ${PHP_MODNAME} == "mssql"
187 LIB_DEPENDS+=   libsybdb.so:${PORTSDIR}/databases/freetds
188
189 CONFIGURE_ARGS+=--with-mssql=${LOCALBASE}
190 .endif
191
192 .if ${PHP_MODNAME} == "mysql"
193 OPTIONS_DEFINE= MYSQLND
194 OPTIONS_DEFAULT=MYSQLND
195
196 MYSQLND_DESC=   Use MySQL Native Driver
197 .endif
198
199 .if ${PHP_MODNAME} == "mysqli"
200 OPTIONS_DEFINE= MYSQLND
201 OPTIONS_DEFAULT=MYSQLND
202
203 MYSQLND_DESC=   Use MySQL Native Driver
204 .endif
205
206 .if ${PHP_MODNAME} == "odbc"
207 LIB_DEPENDS+=   libodbc.so:${PORTSDIR}/databases/unixODBC
208
209 CONFIGURE_ARGS+=--enable-odbc \
210                 --with-unixODBC=${LOCALBASE}
211 .endif
212
213 .if ${PHP_MODNAME} == "openssl"
214 CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
215
216 LDFLAGS+=       -L${OPENSSLLIB} -lcrypto -lssl
217 USE_OPENSSL=    yes
218 .endif
219
220 .if ${PHP_MODNAME} == "opcache"
221 CONFIGURE_ARGS+=--enable-opcache
222 .endif
223
224 .if ${PHP_MODNAME} == "pcntl"
225 CONFIGURE_ARGS+=--enable-pcntl
226 .endif
227
228 .if ${PHP_MODNAME} == "pdo"
229 CONFIGURE_ARGS+=--enable-pdo
230 .endif
231
232 .if ${PHP_MODNAME} == "pdo_dblib"
233 CONFIGURE_ARGS+=--with-pdo-dblib=${LOCALBASE}
234
235 USE_PHP=        pdo
236 USE_PHP_BUILD=  yes
237
238 OPTIONS_DEFINE= MSSQL
239
240 MSSQL_DESC=     Enable Microsoft SQL Server support
241 .endif
242
243 .if ${PHP_MODNAME} == "pdo_firebird"
244 CONFIGURE_ARGS+=--with-pdo-firebird=${LOCALBASE}
245
246 USE_PHP=        pdo
247 USE_PHP_BUILD=  yes
248
249 USE_FIREBIRD=   yes
250 .endif
251
252 .if ${PHP_MODNAME} == "pdo_mysql"
253 OPTIONS_DEFINE= MYSQLND
254 OPTIONS_DEFAULT=MYSQLND
255
256 MYSQLND_DESC=   Use MySQL Native Driver
257
258 USE_PHP=        pdo
259 USE_PHP_BUILD=  yes
260 .endif
261
262 .if ${PHP_MODNAME} == "pdo_odbc"
263 LIB_DEPENDS+=   libodbc.so:${PORTSDIR}/databases/unixODBC
264 CONFIGURE_ARGS+=--with-pdo-odbc=unixODBC,${LOCALBASE}
265
266 USE_PHP=        pdo
267 USE_PHP_BUILD=  yes
268 .endif
269
270 .if ${PHP_MODNAME} == "pdo_pgsql"
271 USES+=          pgsql
272
273 CONFIGURE_ARGS+=--with-pdo-pgsql=${LOCALBASE}
274
275 USE_PHP=        pdo
276 USE_PHP_BUILD=  yes
277 .endif
278
279 .if ${PHP_MODNAME} == "pdo_sqlite"
280 USE_SQLITE=     yes
281 CONFIGURE_ARGS+=--with-pdo-sqlite=${LOCALBASE}
282
283 USE_PHP=        pdo
284 USE_PHP_BUILD=  yes
285 .endif
286
287 .if ${PHP_MODNAME} == "pgsql"
288 USES+=          pgsql
289
290 CONFIGURE_ARGS+=--with-pgsql=${LOCALBASE}
291 .endif
292
293 .if ${PHP_MODNAME} == "phar"
294 CONFIGURE_ARGS+=--enable-phar \
295                 --with-pcre-dir=${LOCALBASE}
296
297 USE_PHP=        hash
298 USE_PHP_BUILD=  yes
299 .endif
300
301 .if ${PHP_MODNAME} == "posix"
302 CONFIGURE_ARGS+=--enable-posix
303 .endif
304
305 .if ${PHP_MODNAME} == "pspell"
306 LIB_DEPENDS+=   libaspell.so:${PORTSDIR}/textproc/aspell
307
308 CONFIGURE_ARGS+=--with-pspell=${LOCALBASE}
309
310 # Ugly hack to load session before psell to avoid crashes
311 USE_PHP=        session
312 USE_PHP_BUILD=  yes
313 .endif
314
315 .if ${PHP_MODNAME} == "readline"
316 CONFIGURE_ARGS+=--with-readline=/usr
317 USES+=          readline
318 .endif
319
320 .if ${PHP_MODNAME} == "recode"
321 LIB_DEPENDS+=   librecode.so:${PORTSDIR}/converters/recode
322
323 CONFIGURE_ARGS+=--with-recode=${LOCALBASE}
324 .endif
325
326 .if ${PHP_MODNAME} == "session"
327 CONFIGURE_ARGS+=--enable-session
328 .endif
329
330 .if ${PHP_MODNAME} == "shmop"
331 CONFIGURE_ARGS+=--enable-shmop
332 .endif
333
334 .if ${PHP_MODNAME} == "simplexml"
335 CONFIGURE_ARGS+=--enable-simplexml \
336                 --with-pcre-dir=${LOCALBASE} \
337                 --with-libxml-dir=${LOCALBASE}
338
339 USES+=          pkgconfig
340 USE_GNOME=      libxml2
341 .endif
342
343 .if ${PHP_MODNAME} == "snmp"
344 CONFIGURE_ARGS+=--with-snmp=${LOCALBASE} \
345                 --with-openssl-dir=${OPENSSLBASE}
346
347 CONFIGURE_ENV+= ac_cv_buggy_snprint_value="no"
348
349 LIB_DEPENDS+=   libnetsnmp.so:${PORTSDIR}/net-mgmt/net-snmp
350 LDFLAGS+=       -L${OPENSSLLIB} -lcrypto -lssl
351 USE_OPENSSL=    yes
352 .endif
353
354 .if ${PHP_MODNAME} == "soap"
355 CONFIGURE_ARGS+=--enable-soap \
356                 --with-libxml-dir=${LOCALBASE}
357
358 USE_GNOME=      libxml2
359
360 USE_PHP=        session
361 USE_PHP_BUILD=  yes
362 .endif
363
364 .if ${PHP_MODNAME} == "sockets"
365 CONFIGURE_ARGS+=--enable-sockets
366 .endif
367
368 .if ${PHP_MODNAME} == "sqlite3"
369 USE_SQLITE=     yes
370 CONFIGURE_ARGS+=--with-sqlite3=${LOCALBASE}
371 .endif
372
373 .if ${PHP_MODNAME} == "sybase_ct"
374 LIB_DEPENDS+=   libct.so:${PORTSDIR}/databases/freetds
375
376 CONFIGURE_ARGS+=--with-sybase-ct=${LOCALBASE}
377 .endif
378
379 .if ${PHP_MODNAME} == "sysvmsg"
380 CONFIGURE_ARGS+=--enable-sysvmsg
381 .endif
382
383 .if ${PHP_MODNAME} == "sysvsem"
384 CONFIGURE_ARGS+=--enable-sysvsem
385 .endif
386
387 .if ${PHP_MODNAME} == "sysvshm"
388 CONFIGURE_ARGS+=--enable-sysvshm
389 .endif
390
391 .if ${PHP_MODNAME} == "tidy"
392 CONFIGURE_ARGS+=--with-tidy=${LOCALBASE}
393
394 LIB_DEPENDS+=   libtidy.so:${PORTSDIR}/www/tidy-lib
395 .endif
396
397 .if ${PHP_MODNAME} == "tokenizer"
398 CONFIGURE_ARGS+=--enable-tokenizer
399 .endif
400
401 .if ${PHP_MODNAME} == "wddx"
402 CONFIGURE_ARGS+=--enable-wddx \
403                 --with-libxml-dir=${LOCALBASE}
404
405 USE_GNOME=      libxml2
406
407 USE_PHP=        xml session
408 USE_PHP_BUILD=  yes
409 .endif
410
411 .if ${PHP_MODNAME} == "xml"
412 CONFIGURE_ARGS+=--enable-xml \
413                 --with-libxml-dir=${LOCALBASE}
414
415 USE_GNOME=      libxml2
416 .endif
417
418 .if ${PHP_MODNAME} == "xmlreader"
419 CONFIGURE_ARGS+=--enable-xmlreader \
420                 --with-libxml-dir=${LOCALBASE}
421
422 USE_GNOME=      libxml2
423
424 USE_PHP=        dom
425 USE_PHP_BUILD=  yes
426 .endif
427
428 .if ${PHP_MODNAME} == "xmlrpc"
429 CONFIGURE_ARGS+=--with-xmlrpc \
430                 --with-libxml-dir=${LOCALBASE} \
431                 --with-iconv-dir=${LOCALBASE}
432
433 USES+=          iconv:translit
434 USE_GNOME=      libxml2
435
436 PHP_HEADER_DIRS=libxmlrpc
437
438 USE_PHP=        xml
439 USE_PHP_BUILD=  yes
440 .endif
441
442 .if ${PHP_MODNAME} == "xmlwriter"
443 CONFIGURE_ARGS+=--enable-xmlwriter \
444                 --with-libxml-dir=${LOCALBASE}
445
446 USE_GNOME=      libxml2
447 .endif
448
449 .if ${PHP_MODNAME} == "xsl"
450 CONFIGURE_ARGS+=--with-xsl=${LOCALBASE}
451
452 USE_GNOME=      libxslt
453 USE_PHP=        dom xml
454 USE_PHP_BUILD=  yes
455 .endif
456
457 .if ${PHP_MODNAME} == "zip"
458 LIB_DEPENDS+=   libzip.so:${PORTSDIR}/archivers/libzip
459
460 CONFIGURE_ARGS+=--enable-zip \
461                 --with-zlib-dir=/usr \
462                 --with-pcre-dir=${LOCALBASE} \
463                 --with-libzip=${LOCALBASE}
464 .endif
465
466 .if ${PHP_MODNAME} == "zlib"
467 CONFIGURE_ARGS+=--with-zlib=/usr
468 .endif
469
470 .include <bsd.port.pre.mk>
471
472 .if ${PHP_MODNAME} == "dba"
473 .       if empty(PORT_OPTIONS:MCDB)
474 CONFIGURE_ARGS+=--without-cdb
475 .       endif
476 .       if ${PORT_OPTIONS:MDB4}
477 CONFIGURE_ARGS+=--with-db4=${LOCALBASE}
478
479 USE_BDB=                40+
480 WITH_BDB_HIGHEST=       yes
481 .       endif
482 .       if ${PORT_OPTIONS:MGDBM}
483 LIB_DEPENDS+=   libgdbm.so:${PORTSDIR}/databases/gdbm
484
485 CONFIGURE_ARGS+=--with-gdbm=${LOCALBASE}
486 .       endif
487 .       if ${PORT_OPTIONS:MQDBM}
488 LIB_DEPENDS+=   libqdbm.so:${PORTSDIR}/databases/qdbm
489
490 CONFIGURE_ARGS+=--with-qdbm=${LOCALBASE}
491 .       endif
492 .       if ${PORT_OPTIONS:MTOKYO}
493 LIB_DEPENDS+=   libtokyocabinet.so:${PORTSDIR}/databases/tokyocabinet
494
495 CONFIGURE_ARGS+=--with-tcadb=${LOCALBASE}
496 .       endif
497 .       if empty(PORT_OPTIONS:MINIFILE)
498 CONFIGURE_ARGS+=--disable-inifile
499 .       endif
500 .       if empty(PORT_OPTIONS:MFLATFILE)
501 CONFIGURE_ARGS+=--disable-flatfile
502 .       endif
503 .endif
504
505 .if ${PHP_MODNAME} == "gd"
506 .       if ${PORT_OPTIONS:MT1LIB}
507 LIB_DEPENDS+=   libt1.so:${PORTSDIR}/devel/t1lib
508
509 CONFIGURE_ARGS+=--with-t1lib=${LOCALBASE}
510 .       endif
511 .       if ${PORT_OPTIONS:MTRUETYPE}
512 CONFIGURE_ARGS+=--enable-gd-native-ttf
513 .       endif
514 .       if ${PORT_OPTIONS:MJIS}
515 CONFIGURE_ARGS+=--enable-gd-jis-conv
516 .       endif
517 .       if ${PORT_OPTIONS:MX11}
518 USE_XORG=       xpm
519
520 CONFIGURE_ARGS+=--with-xpm-dir=${LOCALBASE}
521 .       endif
522 .       if ${PORT_OPTIONS:MVPX}
523 LIB_DEPENDS+=   libvpx.so:${PORTSDIR}/multimedia/libvpx
524
525 CONFIGURE_ARGS+=--with-vpx-dir=${LOCALBASE}
526 .       endif
527 .endif
528
529 .if ${PHP_MODNAME} == "imap"
530 .       if ${PORT_OPTIONS:MPANDA}
531 LIB_DEPENDS+=   libc-client4.so.10:${PORTSDIR}/mail/panda-cclient
532 .       else
533 LIB_DEPENDS+=   libc-client4.so.9:${PORTSDIR}/mail/cclient
534 .       endif
535 .endif
536
537 .if ${PHP_MODNAME} == "mbstring"
538 .       if ${PORT_OPTIONS:MREGEX}
539 LIB_DEPENDS+=   libonig.so:${PORTSDIR}/devel/oniguruma4
540 CONFIGURE_ARGS+=--with-onig=${LOCALBASE}
541 .       else
542 CONFIGURE_ARGS+=--disable-mbregex
543 .       endif
544 .endif
545
546 .if ${PHP_MODNAME} == "mysql"
547 .       if ${PORT_OPTIONS:MMYSQLND}
548 CONFIGURE_ARGS+=--with-mysql=mysqlnd
549 .       else
550 CONFIGURE_ARGS+=--with-mysql=${LOCALBASE} \
551                 --with-zlib-dir=/usr
552
553 USE_MYSQL=      yes
554 .       endif
555 .endif
556
557 .if ${PHP_MODNAME} == "mysqli"
558 .       if ${PORT_OPTIONS:MMYSQLND}
559 CONFIGURE_ARGS+=--with-mysqli=mysqlnd
560 .       else
561 CONFIGURE_ARGS+=--with-mysqli=${LOCALBASE}/bin/mysql_config
562
563 USE_MYSQL=      yes
564 .       endif
565 .endif
566
567 .if ${PHP_MODNAME} == "openssl" || ${PHP_MODNAME} == "sqlite3"
568 post-extract:
569         @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
570 .endif
571
572 .if ${PHP_MODNAME} == "pdo_dblib"
573 .       if ${PORT_OPTIONS:MMSSQL}
574 LIB_DEPENDS+=   libsybdb.so:${PORTSDIR}/databases/freetds
575 .       else
576 LIB_DEPENDS+=   libct.so:${PORTSDIR}/databases/freetds
577 .       endif
578 .endif
579
580 .if ${PHP_MODNAME} == "pdo_mysql"
581 .       if ${PORT_OPTIONS:MMYSQLND}
582 CONFIGURE_ARGS+=--with-pdo-mysql=mysqlnd
583
584 USE_PHP+=       mysql
585 .       else
586 CONFIGURE_ARGS+=--with-pdo-mysql=${LOCALBASE} \
587                 --with-zlib-dir=/usr
588
589 USE_MYSQL=      yes
590 .       endif
591 .endif
592
593 .if ${PHP_MODNAME} == "xml"
594 post-extract:
595         @${MKDIR} ${WRKSRC}/ext/xml
596         @${CP} ${WRKSRC}/expat_compat.h ${WRKSRC}/ext/xml
597 .endif
598
599 .if ${PHP_MODNAME} == "zlib"
600 post-extract:
601         @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
602 .endif