Index: trunk/php/luasandbox/config.m4 |
— | — | @@ -5,11 +5,15 @@ |
6 | 6 | |
7 | 7 | PHP_ARG_WITH(luasandbox, for luasandbox support, |
8 | 8 | [ --with-luasandbox Include luasandbox support]) |
| 9 | +dnl RT is not available on Mac OS X so we need an easy way to |
| 10 | +dnl disable librt. |
| 11 | +PHP_ARG_WITH(librt, [whether to include librt], |
| 12 | +[ --without-librt Do not attempt to use librt, forced on Mac OS X], yes, no) |
9 | 13 | |
10 | 14 | if test "$PHP_LUASANDBOX" != "no"; then |
11 | 15 | dnl Include pkg-config macros definitions: |
12 | 16 | m4_include([m4/pkg.m4]) |
13 | | - |
| 17 | + |
14 | 18 | dnl ICU did not support pkg-config till recently; current WM version |
15 | 19 | dnl probably does not support it as well |
16 | 20 | m4_include([m4/ac_check_icu.m4]) |
— | — | @@ -25,6 +29,22 @@ |
26 | 30 | |
27 | 31 | AC_CHECK_ICU( [4.0] ) |
28 | 32 | |
| 33 | + AC_MSG_CHECKING([whether to use librt]) |
| 34 | + dnl librt does not exist on Mac OS X |
| 35 | + case "$host_alias" in |
| 36 | + *darwin*) |
| 37 | + AC_MSG_RESULT([no, not available on Mac OS X]) |
| 38 | + PHP_LIBRT="no" |
| 39 | + ;; |
| 40 | + *) |
| 41 | + AC_MSG_RESULT($PHP_LIBRT) |
| 42 | + ;; |
| 43 | + esac |
| 44 | + |
| 45 | + if test "$PHP_LIBRT" != "no"; then |
| 46 | + PKG_CHECK_MODULES([RT], [rt]) |
| 47 | + fi |
| 48 | + |
29 | 49 | dnl LUA_LIBS and LUA_CFLAGS interprets them: |
30 | 50 | PHP_EVAL_INCLINE($LUA_CFLAGS) |
31 | 51 | PHP_EVAL_LIBLINE($LUA_LIBS, LUASANDBOX_SHARED_LIBADD) |
— | — | @@ -32,7 +52,8 @@ |
33 | 53 | PHP_EVAL_INCLINE($ICU_CFLAGS) |
34 | 54 | PHP_EVAL_LIBLINE($ICU_LIBS, LUASANDBOX_SHARED_LIBADD) |
35 | 55 | |
36 | | - PHP_EVAL_LIBLINE("-lrt", LUASANDBOX_SHARED_LIBADD) |
| 56 | + PHP_EVAL_INCLINE($RT_CFLAGS) |
| 57 | + PHP_EVAL_LIBLINE($RT_LIBS, LUASANDBOX_SHARED_LIBADD) |
37 | 58 | |
38 | 59 | PHP_SUBST(LUASANDBOX_SHARED_LIBADD) |
39 | 60 | PHP_NEW_EXTENSION(luasandbox, alloc.c data_conversion.c library.c luasandbox.c timer.c ustring.c, $ext_shared) |