blob: 5847d456f51c89c941065e04344f86ce0a2f4469 [file] [log] [blame]
Stanley Cheung5adb71f2016-02-13 00:03:02 -08001%YAML 1.2
2--- |
3 PHP_ARG_ENABLE(grpc, whether to enable grpc support,
4 [ --enable-grpc Enable grpc support])
5
6 if test "$PHP_GRPC" != "no"; then
7 dnl Write more examples of tests here...
8
9 dnl # --with-grpc -> add include path
10 PHP_ADD_INCLUDE(../../grpc/include)
11 PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc)
12 PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include)
13
Stanley Cheungbf74d692016-02-23 22:39:25 -080014 LIBS="-lpthread $LIBS"
15
16 GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD"
Stanley Cheung5adb71f2016-02-13 00:03:02 -080017 PHP_ADD_LIBRARY(pthread)
18
Stanley Cheungbf74d692016-02-23 22:39:25 -080019 PHP_ADD_LIBRARY(dl,,GRPC_SHARED_LIBADD)
20 PHP_ADD_LIBRARY(dl)
21
22 case $host in
23 *darwin*) ;;
24 *)
25 PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
26 PHP_ADD_LIBRARY(rt)
27 ;;
28 esac
29
Stanley Cheung5adb71f2016-02-13 00:03:02 -080030 PHP_NEW_EXTENSION(grpc,
31 % for source in php_config_m4.src:
32 ${source} ${"\\"}
33 % endfor
34 % for lib in libs:
35 % if lib.name in php_config_m4.get('deps', []):
36 % for source in lib.src:
37 ${source} ${"\\"}
38 % endfor
39 % endif
40 % endfor
Stanley Cheung5ade2d42016-02-25 13:44:05 -080041 , $ext_shared, , -Wall -Werror ${"\\"}
42 -Wno-parentheses-equality -Wno-unused-value -std=c11 ${"\\"}
Stanley Cheung5adb71f2016-02-13 00:03:02 -080043 -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN ${"\\"}
44 -D_HAS_EXCEPTIONS=0 -DNOMINMAX)
Stanley Cheung80db5be2016-02-24 21:35:56 -080045
46 PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)
47 <%
48 dirs = {}
49 for lib in libs:
50 if lib.name in php_config_m4.get('deps', []):
51 for source in lib.src:
52 dirs[source[:source.rfind('/')]] = 1
53 dirs = dirs.keys()
54 dirs.sort()
55 %>
56 % for dir in dirs:
57 PHP_ADD_BUILD_DIR($ext_builddir/${dir})
58 % endfor
Stanley Cheung5adb71f2016-02-13 00:03:02 -080059 fi