Bug 522126, part 3: Use POSIX-clock TimeStamp/TimeDuration implementation if configure.in says it's supported. r=luser

This commit is contained in:
Chris Jones 2010-01-07 11:21:33 -06:00
Родитель e5a816f1aa
Коммит f3372c628f
5 изменённых файлов: 36 добавлений и 1 удалений

Просмотреть файл

@ -655,3 +655,6 @@ MOZ_SPLASHSCREEN = @MOZ_SPLASHSCREEN@
MOZ_THEME_FASTSTRIPE = @MOZ_THEME_FASTSTRIPE@
MOZ_OFFICIAL_BRANDING = @MOZ_OFFICIAL_BRANDING@
HAVE_CLOCK_MONOTONIC = @HAVE_CLOCK_MONOTONIC@
REALTIME_LIBS = @REALTIME_LIBS@

Просмотреть файл

@ -3600,6 +3600,25 @@ AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat6
AC_CHECK_FUNCS(flockfile getpagesize)
AC_CHECK_FUNCS(localtime_r strtok_r)
dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -lrt"
AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt,
ac_cv_have_clock_monotonic,
[AC_TRY_LINK([#include <time.h>],
[ struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); ],
ac_cv_have_clock_monotonic=yes,
ac_cv_have_clock_monotonic=no)])
LDFLAGS=$_SAVE_LDFLAGS
if test "$ac_cv_have_clock_monotonic" = "yes"; then
HAVE_CLOCK_MONOTONIC=1
REALTIME_LIBS=-lrt
AC_DEFINE(HAVE_CLOCK_MONOTONIC)
AC_SUBST(HAVE_CLOCK_MONOTONIC)
AC_SUBST(REALTIME_LIBS)
fi
dnl check for wcrtomb/mbrtowc
dnl =======================================================================
if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then

Просмотреть файл

@ -391,3 +391,7 @@ ifeq ($(OS_ARCH),Linux)
EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
endif
endif
ifdef HAVE_CLOCK_MONOTONIC
EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
endif

Просмотреть файл

@ -175,6 +175,10 @@ EXTRA_DSO_LDOPTS += $(LIBHILDONMIME_LIBS)
endif
endif
ifdef HAVE_CLOCK_MONOTONIC
EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
endif
ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 uuid version)
ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))

Просмотреть файл

@ -50,7 +50,6 @@ MOZILLA_INTERNAL_API = 1
CPPSRCS = \
TimeStamp.cpp \
nsArray.cpp \
nsAtomTable.cpp \
nsAtomService.cpp \
@ -77,6 +76,12 @@ CPPSRCS = \
nsVariant.cpp \
$(NULL)
ifdef HAVE_CLOCK_MONOTONIC
CPPSRCS += TimeStamp_posix.cpp
else
CPPSRCS += TimeStamp.cpp
endif
EXPORTS_NAMESPACES = mozilla
EXPORTS_mozilla = \