|
1 | 1 | dnl Configure options
|
2 | 2 | dnl
|
3 | 3 |
|
| 4 | +PHP_ARG_WITH([external-uriparser], |
| 5 | + [for external/system liburiparser], |
| 6 | + [AS_HELP_STRING([--with-external-uriparser], |
| 7 | + [Use externalsystem liburiparser])], |
| 8 | + [no], |
| 9 | + [no]) |
| 10 | + |
4 | 11 | PHP_INSTALL_HEADERS([ext/uri], m4_normalize([
|
5 | 12 | php_lexbor.h
|
6 | 13 | php_uri.h
|
7 | 14 | php_uri_common.h
|
8 | 15 | ]))
|
9 | 16 |
|
| 17 | + |
10 | 18 | AC_DEFINE([URI_ENABLE_ANSI], [1], [Define to 1 for enabling ANSI support of uriparser.])
|
11 | 19 | AC_DEFINE([URI_NO_UNICODE], [1], [Define to 1 for disabling unicode support of uriparser.])
|
12 | 20 |
|
13 |
| -URIPARSER_DIR="uriparser" |
14 |
| -URIPARSER_SOURCES="$URIPARSER_DIR/src/UriCommon.c $URIPARSER_DIR/src/UriCompare.c $URIPARSER_DIR/src/UriEscape.c \ |
15 |
| -$URIPARSER_DIR/src/UriFile.c $URIPARSER_DIR/src/UriIp4.c $URIPARSER_DIR/src/UriIp4Base.c \ |
16 |
| -$URIPARSER_DIR/src/UriMemory.c $URIPARSER_DIR/src/UriNormalize.c $URIPARSER_DIR/src/UriNormalizeBase.c \ |
17 |
| -$URIPARSER_DIR/src/UriParse.c $URIPARSER_DIR/src/UriParseBase.c $URIPARSER_DIR/src/UriQuery.c \ |
18 |
| -$URIPARSER_DIR/src/UriRecompose.c $URIPARSER_DIR/src/UriResolve.c $URIPARSER_DIR/src/UriShorten.c" |
| 21 | +if test "$PHP_EXTERNAL_URIPARSER" = "no"; then |
| 22 | + URIPARSER_DIR="uriparser" |
| 23 | + URIPARSER_SOURCES="$URIPARSER_DIR/src/UriCommon.c $URIPARSER_DIR/src/UriCompare.c $URIPARSER_DIR/src/UriEscape.c \ |
| 24 | + $URIPARSER_DIR/src/UriFile.c $URIPARSER_DIR/src/UriIp4.c $URIPARSER_DIR/src/UriIp4Base.c \ |
| 25 | + $URIPARSER_DIR/src/UriMemory.c $URIPARSER_DIR/src/UriNormalize.c $URIPARSER_DIR/src/UriNormalizeBase.c \ |
| 26 | + $URIPARSER_DIR/src/UriParse.c $URIPARSER_DIR/src/UriParseBase.c $URIPARSER_DIR/src/UriQuery.c \ |
| 27 | + $URIPARSER_DIR/src/UriRecompose.c $URIPARSER_DIR/src/UriResolve.c $URIPARSER_DIR/src/UriShorten.c" |
| 28 | + URI_CFLAGS="-DURI_STATIC_BUILD" |
| 29 | +else |
| 30 | + PKG_CHECK_MODULES([LIBURIPARSER], [liburiparser >= 0.9.8]) |
| 31 | + PHP_EVAL_LIBLINE([$LIBURIPARSER_LIBS], [URI_SHARED_LIBADD]) |
| 32 | + PHP_EVAL_INCLINE([$LIBURIPARSER_CFLAGS]) |
| 33 | +fi |
19 | 34 |
|
20 |
| -PHP_NEW_EXTENSION(uri, [php_lexbor.c php_uri.c php_uri_common.c $URIPARSER_SOURCES], [no],,[-I$ext_srcdir/$URIPARSER_DIR/include -DURI_STATIC_BUILD -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1]) |
| 35 | +PHP_NEW_EXTENSION(uri, [php_lexbor.c php_uri.c php_uri_common.c $URIPARSER_SOURCES], [no],,[$URI_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1]) |
21 | 36 | PHP_ADD_EXTENSION_DEP(uri, lexbor)
|
22 |
| -PHP_ADD_BUILD_DIR($ext_builddir/$URIPARSER_DIR/src $ext_builddir/$URIPARSER_DIR/include) |
| 37 | + |
| 38 | +if test "$PHP_EXTERNAL_URIPARSER" = "no"; then |
| 39 | + PHP_ADD_BUILD_DIR($ext_builddir/$URIPARSER_DIR/src $ext_builddir/$URIPARSER_DIR/include) |
| 40 | + PHP_ADD_INCLUDE([$ext_srcdir/$URIPARSER_DIR/include]) |
| 41 | +fi |
0 commit comments