--- configure.ac 2012-11-02 22:48:22.684904181 +0800 +++ configure.ac 2012-11-02 22:48:41.337069767 +0800 @@ -55,6 +55,7 @@ m4_include([unix/config/ax_arg_enable.m4]) m4_include([unix/config/ax_arg_with.m4]) m4_include([unix/config/ax_boost_base.m4]) +m4_include([unix/config/ax_boost_system.m4]) m4_include([unix/config/ax_boost_thread.m4]) m4_include([unix/config/ax_test_compiler_flags.m4]) m4_include([unix/config/ax_check_lib.m4]) @@ -296,6 +297,14 @@ # Boost; required library # the following macro stops with error when boost is not found AX_BOOST_BASE([$required_libboost_version]) +AX_BOOST_SYSTEM +if test x"$ax_cv_boost_system" != x"yes"; then + AC_MSG_ERROR([cannot find a suitable boost system library]) +else + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" # append + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" # append + LIBS="$BOOST_SYSTEM_LIB $LIBS" +fi AX_BOOST_THREAD if test x"$ax_cv_boost_thread" != x"yes"; then AC_MSG_ERROR([cannot find a suitable boost thread library]) --- source/backend/scene/view.cpp 2012-02-05 21:53:55.000000000 +0100 +++ source/backend/scene/view.cpp 2012-11-01 03:50:30.000000000 +0100 @@ -1547,7 +1547,7 @@ } boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.sec += 3; // this will cause us to wait until the other threads are done. --- source/base/timer.cpp 2012-02-05 21:54:15.000000000 +0100 +++ source/base/timer.cpp 2012-11-01 03:50:19.000000000 +0100 @@ -117,7 +117,7 @@ POV_LONG TimerDefault::ElapsedRealTime() const { boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); + boost::xtime_get(&t, boost::TIME_UTC_); POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); POV_LONG st = (POV_LONG)(realTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(realTimeStart.nsec); return ((tt - st) / (POV_LONG)(1000000)); @@ -126,7 +126,7 @@ POV_LONG TimerDefault::ElapsedCPUTime() const { boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); + boost::xtime_get(&t, boost::TIME_UTC_); POV_LONG tt = (POV_LONG)(t.sec) * (POV_LONG)(1000000000) + (POV_LONG)(t.nsec); POV_LONG st = (POV_LONG)(cpuTimeStart.sec) * (POV_LONG)(1000000000) + (POV_LONG)(cpuTimeStart.nsec); return ((tt - st) / (POV_LONG)(1000000)); @@ -139,8 +139,8 @@ void TimerDefault::Reset() { - boost::xtime_get(&realTimeStart, boost::TIME_UTC); - boost::xtime_get(&cpuTimeStart, boost::TIME_UTC); + boost::xtime_get(&realTimeStart, boost::TIME_UTC_); + boost::xtime_get(&cpuTimeStart, boost::TIME_UTC_); } } @@ -155,7 +155,7 @@ void Delay(unsigned int msec) { boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); + boost::xtime_get(&t, boost::TIME_UTC_); POV_ULONG ns = (POV_ULONG)(t.sec) * (POV_ULONG)(1000000000) + (POV_ULONG)(t.nsec) + (POV_ULONG)(msec) * (POV_ULONG)(1000000); t.sec = (boost::xtime::xtime_sec_t)(ns / (POV_ULONG)(1000000000)); t.nsec = (boost::xtime::xtime_nsec_t)(ns % (POV_ULONG)(1000000000)); --- vfe/unix/platformbase.cpp 2012-02-05 21:54:25.000000000 +0100 +++ vfe/unix/platformbase.cpp 2012-11-01 03:50:42.000000000 +0100 @@ -126,7 +126,7 @@ #else // taken from source/base/timer.cpp boost::xtime t; - boost::xtime_get(&t, boost::TIME_UTC); + boost::xtime_get(&t, boost::TIME_UTC_); POV_ULONG ns = (POV_ULONG)(t.sec) * (POV_ULONG)(1000000000) + (POV_ULONG)(t.nsec) + (POV_ULONG)(msec) * (POV_ULONG)(1000000); t.sec = (boost::xtime::xtime_sec_t)(ns / (POV_ULONG)(1000000000)); t.nsec = (boost::xtime::xtime_nsec_t)(ns % (POV_ULONG)(1000000000)); --- vfe/vfepovms.cpp 2012-02-05 21:54:26.000000000 +0100 +++ vfe/vfepovms.cpp 2012-11-01 03:50:57.000000000 +0100 @@ -247,7 +247,7 @@ // TODO: have a shorter wait but loop, and check for system shutdown boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.nsec += 50000000 ; m_Event.timed_wait (lock, t); --- vfe/vfesession.cpp 2012-02-05 21:54:27.000000000 +0100 +++ vfe/vfesession.cpp 2012-11-01 03:51:09.000000000 +0100 @@ -967,7 +967,7 @@ if (WaitTime > 0) { boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.sec += WaitTime / 1000 ; t.nsec += (WaitTime % 1000) * 1000000 ; m_SessionEvent.timed_wait (lock, t); @@ -1034,7 +1034,7 @@ // we can't call pause directly since it will result in a thread context // error. pause must be called from the context of the worker thread. boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.sec += 3 ; m_RequestFlag = rqPauseRequest; if (m_RequestEvent.timed_wait(lock, t) == false) @@ -1057,7 +1057,7 @@ // we can't call resume directly since it will result in a thread context // error. it must be called from the context of the worker thread. boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.sec += 3 ; m_RequestFlag = rqResumeRequest; if (m_RequestEvent.timed_wait(lock, t) == false) @@ -1123,7 +1123,7 @@ m_LastError = vfeNoError; boost::xtime t; - boost::xtime_get (&t, boost::TIME_UTC); + boost::xtime_get (&t, boost::TIME_UTC_); t.sec += 3 ; #ifdef _DEBUG t.sec += 120; --- unix/config/ax_boost_system.m4 2012-11-02 19:56:45.213869458 +0800 +++ unix/config/ax_boost_system.m4 2012-11-02 22:35:55.858268002 +0800 @@ -0,0 +1,120 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_SYSTEM +# +# DESCRIPTION +# +# Test for System library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_SYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_SYSTEM +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Daniel Casimiro +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 15 + +AC_DEFUN([AX_BOOST_SYSTEM], +[ + AC_ARG_WITH([boost-system], + AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], + [use the System library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-system=boost_system-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_system_lib="" + else + want_boost="yes" + ax_boost_user_system_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_BUILD]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::System library is available, + ax_cv_boost_system, + [AC_LANG_PUSH([C++]) + CXXFLAGS_SAVE=$CXXFLAGS + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[boost::system::system_category]])], + ax_cv_boost_system=yes, ax_cv_boost_system=no) + CXXFLAGS=$CXXFLAGS_SAVE + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_system" = "xyes"; then + AC_SUBST(BOOST_CPPFLAGS) + + AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + + LDFLAGS_SAVE=$LDFLAGS + if test "x$ax_boost_user_system_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_system*.a* $BOOSTLIBDIR/libboost_system*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.\(so\|a\).*$;\1;' | tac` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + if test "x$link_system" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.\(dll\|a\).*$;\1;' | tac` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the library!) + fi + if test "x$link_system" = "xno"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +])