r114924 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114923‎ | r114924 | r114925 >
Date:12:45, 16 April 2012
Author:hashar
Status:reverted
Tags:
Comment:
enhance librt detection

We explicitly requested to link against librt despite that library
not being always wanted or just unavailable on Mac OS X.

This patch introduce the new --without-librt which let you disable librt.
It also unconditionally disable such linking on the darwin platform.
Modified paths:
  • /trunk/php/luasandbox/config.m4 (modified) (history)

Diff [purge]

Index: trunk/php/luasandbox/config.m4
@@ -5,11 +5,15 @@
66
77 PHP_ARG_WITH(luasandbox, for luasandbox support,
88 [ --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)
913
1014 if test "$PHP_LUASANDBOX" != "no"; then
1115 dnl Include pkg-config macros definitions:
1216 m4_include([m4/pkg.m4])
13 -
 17+
1418 dnl ICU did not support pkg-config till recently; current WM version
1519 dnl probably does not support it as well
1620 m4_include([m4/ac_check_icu.m4])
@@ -25,6 +29,22 @@
2630
2731 AC_CHECK_ICU( [4.0] )
2832
 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+
2949 dnl LUA_LIBS and LUA_CFLAGS interprets them:
3050 PHP_EVAL_INCLINE($LUA_CFLAGS)
3151 PHP_EVAL_LIBLINE($LUA_LIBS, LUASANDBOX_SHARED_LIBADD)
@@ -32,7 +52,8 @@
3353 PHP_EVAL_INCLINE($ICU_CFLAGS)
3454 PHP_EVAL_LIBLINE($ICU_LIBS, LUASANDBOX_SHARED_LIBADD)
3555
36 - PHP_EVAL_LIBLINE("-lrt", LUASANDBOX_SHARED_LIBADD)
 56+ PHP_EVAL_INCLINE($RT_CFLAGS)
 57+ PHP_EVAL_LIBLINE($RT_LIBS, LUASANDBOX_SHARED_LIBADD)
3758
3859 PHP_SUBST(LUASANDBOX_SHARED_LIBADD)
3960 PHP_NEW_EXTENSION(luasandbox, alloc.c data_conversion.c library.c luasandbox.c timer.c ustring.c, $ext_shared)

Status & tagging log