Permalink
Browse files

Nanosecond resolution cvd_timer and gettimeofday() on POSIX systems.

Only tested on Linux.
  • Loading branch information...
1 parent 414f130 commit f9c07df6591d5c5d7f15433efd528a0ebde0a229 edrosten committed May 13, 2009
Showing with 149 additions and 15 deletions.
  1. +1 −1 Doxyfile
  2. +2 −2 Makefile.in
  3. +135 −11 configure
  4. +11 −1 configure.in
View
@@ -23,7 +23,7 @@ PROJECT_NAME = CVD
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 0.7
+PROJECT_NUMBER = 0.8
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
View
@@ -82,7 +82,7 @@ GZIP_ENV = --best
# CVD objects
#
-CVD_OBJS= cvd_src/cvd_timer.o \
+CVD_OBJS= \
cvd_src/diskbuffer2.o \
cvd_src/deinterlacebuffer.o \
cvd_src/exceptions.o \
@@ -253,7 +253,7 @@ distclean: clean
.deps:
rm -f .sourcefiles
- find . -name "*.cxx" -o -name "*.cc" -o -name "*.cpp" -o -name "*.c" -o -name "*.C" > .sourcefiles
+ find . -name "*.cxx" -o -name "*.cc" -o -name "*.cpp" -o -name "*.c" -o -name "*.C" | grep -v python > .sourcefiles
rm -f .deps
bash generate_dependencies.bash "-I. $(CPPFLAGS) $(CXXFLAGS)" > .deps
View
146 configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for CVD 0.7.
+# Generated by GNU Autoconf 2.61 for CVD 0.8.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='CVD'
PACKAGE_TARNAME='cvd'
-PACKAGE_VERSION='0.7'
-PACKAGE_STRING='CVD 0.7'
+PACKAGE_VERSION='0.8'
+PACKAGE_STRING='CVD 0.8'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -700,6 +700,7 @@ have_linux_2_6
have_o2buffer
osx_hacks
have_qtbuffer
+have_posix_rt
XMKMF
have_videodisplay
have_tr1_shared_ptr
@@ -1245,7 +1246,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures CVD 0.7 to adapt to many kinds of systems.
+\`configure' configures CVD 0.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1314,7 +1315,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of CVD 0.7:";;
+ short | recursive ) echo "Configuration of CVD 0.8:";;
esac
cat <<\_ACEOF
@@ -1361,6 +1362,7 @@ Optional Packages:
--without-o2buffer compile without sgi video (IRIX only)
--without-qtbuffer compile without quicktime buffer support (MacOSX only)
--with-linux=UNAME specify the output of uname -r
+ --without-posix_rt compile without POSIX-RT (better cvd_timer) support
--without-videodisplay compile without videodisplay support
--without-pthread compile without PThread support
--without-jpeg compile without JPEG support
@@ -1454,7 +1456,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-CVD configure 0.7
+CVD configure 0.8
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1470,7 +1472,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by CVD $as_me 0.7, which was
+It was created by CVD $as_me 0.8, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -7609,6 +7611,124 @@ _ACEOF
fi
+#Check for POSIX clock_getres
+
+# Check whether --with-posix_rt was given.
+if test "${with_posix_rt+set}" = set; then
+ withval=$with_posix_rt;
+fi
+
+
+
+ if test "$with_posix_rt" != no && test "$have_posix_rt" != yes
+ then
+ if test "$with_posix_rt" == ""
+ then
+ with_posix_rt=yes
+ fi
+
+ save_LIBS="$LIBS"
+ save_CXXFLAGS="$CXXFLAGS"
+ a=
+
+
+{ echo "$as_me:$LINENO: checking for clock_getres in -lrt" >&5
+echo $ECHO_N "checking for clock_getres in -lrt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_rt_clock_getres+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_getres ();
+int
+main ()
+{
+return clock_getres ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_rt_clock_getres=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_rt_clock_getres=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_getres" >&5
+echo "${ECHO_T}$ac_cv_lib_rt_clock_getres" >&6; }
+if test $ac_cv_lib_rt_clock_getres = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRT 1
+_ACEOF
+
+ LIBS="-lrt $LIBS"
+
+else
+ a=1
+fi
+
+
+
+ if test x$a == x
+ then
+ cat >>confdefs.h <<\_ACEOF
+#define CVD_HAVE_POSIX_RT 1
+_ACEOF
+
+ have_posix_rt=yes
+
+ options="$options posix_rt"
+
+ else
+ LIBS="$save_LIBS"
+ CXXFLAGS="$save_CXXFLAGS"
+ fi
+ fi
+
+ if test "$have_posix_rt" != yes
+ then
+ :
+
+ fi
+
+
################################################################################
#
#Check for optional libraries
@@ -12208,6 +12328,9 @@ cvd_src/Linux/v4lcontrol v4l2buffer linux_2_6 END
cvd_src/IRIX/O2buffer,cvd_src/IRIX/sgi-video o2buffer END
cvd_src/OSX/qtbuffer qtbuffer END
+cvd_src/posix/timer posix_rt
+cvd_src/cvd_timer END
+
#Libraries
cvd_src/synchronized,cvd_src/eventobject,cvd_src/thread pthread END
cvd_src/thread/runnable_batch tr1_shared_ptr pthread
@@ -12742,7 +12865,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by CVD $as_me 0.7, which was
+This file was extended by CVD $as_me 0.8, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12791,7 +12914,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-CVD config.status 0.7
+CVD config.status 0.8
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@@ -13047,6 +13170,7 @@ have_linux_2_6!$have_linux_2_6$ac_delim
have_o2buffer!$have_o2buffer$ac_delim
osx_hacks!$osx_hacks$ac_delim
have_qtbuffer!$have_qtbuffer$ac_delim
+have_posix_rt!$have_posix_rt$ac_delim
XMKMF!$XMKMF$ac_delim
have_videodisplay!$have_videodisplay$ac_delim
have_tr1_shared_ptr!$have_tr1_shared_ptr$ac_delim
@@ -13057,7 +13181,6 @@ have_png!$have_png$ac_delim
have_jpeg!$have_jpeg$ac_delim
have_tiff!$have_tiff$ac_delim
have_ffmpeg!$have_ffmpeg$ac_delim
-docs!$docs$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -13099,6 +13222,7 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
+docs!$docs$ac_delim
have_glob!$have_glob$ac_delim
have_memalign!$have_memalign$ac_delim
have_fast7!$have_fast7$ac_delim
@@ -13118,7 +13242,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
View
@@ -1,4 +1,4 @@
-AC_INIT(CVD,0.7)
+AC_INIT(CVD,0.8)
AC_COPYRIGHT(Copyright foo)
AC_CONFIG_HEADERS
@@ -567,6 +567,13 @@ then
])
fi
+#Check for POSIX clock_getres
+AC_ARG_WITH(posix_rt, [ --without-posix_rt compile without POSIX-RT (better cvd_timer) support])
+
+CHECK_FOR_OPTION(posix_rt, [
+ AC_CHECK_LIB(rt, clock_getres, [], [a=1])
+])
+
################################################################################
#
#Check for optional libraries
@@ -1008,6 +1015,9 @@ cvd_src/Linux/v4lcontrol v4l2buffer linux_2_6 END
cvd_src/IRIX/O2buffer,cvd_src/IRIX/sgi-video o2buffer END
cvd_src/OSX/qtbuffer qtbuffer END
+cvd_src/posix/timer posix_rt
+cvd_src/cvd_timer END
+
#Libraries
cvd_src/synchronized,cvd_src/eventobject,cvd_src/thread pthread END
cvd_src/thread/runnable_batch tr1_shared_ptr pthread

0 comments on commit f9c07df

Please sign in to comment.