Update lang/p5-signatures to version 0.11
[dports.git] / lang / php5 / 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.4
7 IGNORE_WITH_PHP=52 53 55
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} == "pcntl"
221 CONFIGURE_ARGS+=--enable-pcntl
222 .endif
223
224 .if ${PHP_MODNAME} == "pdo"
225 CONFIGURE_ARGS+=--enable-pdo
226 .endif
227
228 .if ${PHP_MODNAME} == "pdo_dblib"
229 CONFIGURE_ARGS+=--with-pdo-dblib=${LOCALBASE}
230
231 USE_PHP=        pdo
232 USE_PHP_BUILD=  yes
233
234 OPTIONS_DEFINE= MSSQL
235
236 MSSQL_DESC=     Enable Microsoft SQL Server support
237 .endif
238
239 .if ${PHP_MODNAME} == "pdo_firebird"
240 CONFIGURE_ARGS+=--with-pdo-firebird=${LOCALBASE}
241
242 USE_PHP=        pdo
243 USE_PHP_BUILD=  yes
244
245 USE_FIREBIRD=   yes
246 .endif
247
248 .if ${PHP_MODNAME} == "pdo_mysql"
249 OPTIONS_DEFINE= MYSQLND
250 OPTIONS_DEFAULT=MYSQLND
251
252 MYSQLND_DESC=   Use MySQL Native Driver
253
254 USE_PHP=        pdo
255 USE_PHP_BUILD=  yes
256 .endif
257
258 .if ${PHP_MODNAME} == "pdo_odbc"
259 LIB_DEPENDS+=   libodbc.so:${PORTSDIR}/databases/unixODBC
260 CONFIGURE_ARGS+=--with-pdo-odbc=unixODBC,${LOCALBASE}
261
262 USE_PHP=        pdo
263 USE_PHP_BUILD=  yes
264 .endif
265
266 .if ${PHP_MODNAME} == "pdo_pgsql"
267 USES+=          pgsql
268
269 CONFIGURE_ARGS+=--with-pdo-pgsql=${LOCALBASE}
270
271 USE_PHP=        pdo
272 USE_PHP_BUILD=  yes
273 .endif
274
275 .if ${PHP_MODNAME} == "pdo_sqlite"
276 USE_SQLITE=     yes
277 CONFIGURE_ARGS+=--with-pdo-sqlite=${LOCALBASE}
278
279 USE_PHP=        pdo
280 USE_PHP_BUILD=  yes
281 .endif
282
283 .if ${PHP_MODNAME} == "pgsql"
284 USES+=          pgsql
285
286 CONFIGURE_ARGS+=--with-pgsql=${LOCALBASE}
287 .endif
288
289 .if ${PHP_MODNAME} == "pear"
290 CONFIGURE_ARGS+=--with-pear
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 CONFIGURE_ARGS+=--enable-zip \
459                 --with-zlib-dir=/usr \
460                 --with-pcre-dir=${LOCALBASE}
461 .endif
462
463 .if ${PHP_MODNAME} == "zlib"
464 CONFIGURE_ARGS+=--with-zlib=/usr
465 .endif
466
467 .include <bsd.port.pre.mk>
468
469 .if ${PHP_MODNAME} == "dba"
470 .       if empty(PORT_OPTIONS:MCDB)
471 CONFIGURE_ARGS+=--without-cdb
472 .       endif
473 .       if ${PORT_OPTIONS:MDB4}
474 CONFIGURE_ARGS+=--with-db4=${LOCALBASE}
475
476 USE_BDB=                40+
477 WITH_BDB_HIGHEST=       yes
478 .       endif
479 .       if ${PORT_OPTIONS:MGDBM}
480 LIB_DEPENDS+=   libgdbm.so:${PORTSDIR}/databases/gdbm
481
482 CONFIGURE_ARGS+=--with-gdbm=${LOCALBASE}
483 .       endif
484 .       if ${PORT_OPTIONS:MQDBM}
485 LIB_DEPENDS+=   libqdbm.so:${PORTSDIR}/databases/qdbm
486
487 CONFIGURE_ARGS+=--with-qdbm=${LOCALBASE}
488 .       endif
489 .       if ${PORT_OPTIONS:MTOKYO}
490 LIB_DEPENDS+=   libtokyocabinet.so:${PORTSDIR}/databases/tokyocabinet
491
492 CONFIGURE_ARGS+=--with-tcadb=${LOCALBASE}
493 .       endif
494 .       if empty(PORT_OPTIONS:MINIFILE)
495 CONFIGURE_ARGS+=--disable-inifile
496 .       endif
497 .       if empty(PORT_OPTIONS:MFLATFILE)
498 CONFIGURE_ARGS+=--disable-flatfile
499 .       endif
500 .endif
501
502 .if ${PHP_MODNAME} == "gd"
503 .       if ${PORT_OPTIONS:MT1LIB}
504 LIB_DEPENDS+=   libt1.so:${PORTSDIR}/devel/t1lib
505
506 CONFIGURE_ARGS+=--with-t1lib=${LOCALBASE}
507 .       endif
508 .       if ${PORT_OPTIONS:MTRUETYPE}
509 CONFIGURE_ARGS+=--enable-gd-native-ttf
510 .       endif
511 .       if ${PORT_OPTIONS:MJIS}
512 CONFIGURE_ARGS+=--enable-gd-jis-conv
513 .       endif
514 .       if ${PORT_OPTIONS:MX11}
515 USE_XORG=       xpm
516
517 CONFIGURE_ARGS+=--with-xpm-dir=${LOCALBASE}
518 .       endif
519 .       if ${PORT_OPTIONS:MVPX}
520 LIB_DEPENDS+=   libvpx.so:${PORTSDIR}/multimedia/libvpx
521
522 CONFIGURE_ARGS+=--with-vpx-dir=${LOCALBASE}
523 .       endif
524 .endif
525
526 .if ${PHP_MODNAME} == "imap"
527 .       if ${PORT_OPTIONS:MPANDA}
528 LIB_DEPENDS+=   libc-client4.so.10:${PORTSDIR}/mail/panda-cclient
529 .       else
530 LIB_DEPENDS+=   libc-client4.so.9:${PORTSDIR}/mail/cclient
531 .       endif
532 .endif
533
534 .if ${PHP_MODNAME} == "mbstring"
535 .       if ${PORT_OPTIONS:MREGEX}
536 LIB_DEPENDS+=   libonig.so:${PORTSDIR}/devel/oniguruma4
537 CONFIGURE_ARGS+=--with-onig=${LOCALBASE}
538 .       else
539 CONFIGURE_ARGS+=--disable-mbregex
540 .       endif
541 .endif
542
543 .if ${PHP_MODNAME} == "mysql"
544 .       if ${PORT_OPTIONS:MMYSQLND}
545 CONFIGURE_ARGS+=--with-mysql=mysqlnd
546 .       else
547 CONFIGURE_ARGS+=--with-mysql=${LOCALBASE} \
548                 --with-zlib-dir=/usr
549
550 USE_MYSQL=      yes
551 .       endif
552 .endif
553
554 .if ${PHP_MODNAME} == "mysqli"
555 .       if ${PORT_OPTIONS:MMYSQLND}
556 CONFIGURE_ARGS+=--with-mysqli=mysqlnd
557 .       else
558 CONFIGURE_ARGS+=--with-mysqli=${LOCALBASE}/bin/mysql_config
559
560 USE_MYSQL=      yes
561 .       endif
562 .endif
563
564 .if ${PHP_MODNAME} == "openssl" || ${PHP_MODNAME} == "sqlite3"
565 post-extract:
566         @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
567 .endif
568
569 .if ${PHP_MODNAME} == "pdo_dblib"
570 .       if ${PORT_OPTIONS:MMSSQL}
571 LIB_DEPENDS+=   libsybdb.so:${PORTSDIR}/databases/freetds
572 .       else
573 LIB_DEPENDS+=   libct.so:${PORTSDIR}/databases/freetds
574 .       endif
575 .endif
576
577 .if ${PHP_MODNAME} == "pdo_mysql"
578 .       if ${PORT_OPTIONS:MMYSQLND}
579 CONFIGURE_ARGS+=--with-pdo-mysql=mysqlnd
580
581 USE_PHP+=       mysql
582 .       else
583 CONFIGURE_ARGS+=--with-pdo-mysql=${LOCALBASE} \
584                 --with-zlib-dir=/usr
585
586 USE_MYSQL=      yes
587 .       endif
588 .endif
589
590 .if ${PHP_MODNAME} == "xml"
591 post-extract:
592         @${MKDIR} ${WRKSRC}/ext/xml
593         @${CP} ${WRKSRC}/expat_compat.h ${WRKSRC}/ext/xml
594 .endif
595
596 .if ${PHP_MODNAME} == "zlib"
597 post-extract:
598         @${MV} ${WRKSRC}/config0.m4 ${WRKSRC}/config.m4
599 .endif