summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2013-03-12 09:37:20 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2013-03-12 09:37:20 +0000
commitaa4d4b4ec0b8019ff9ebd5bba6c86c23990f42f2 (patch)
treea5c2ffc871656b11022335fefd78a137a6b34ea8
parent45bef435932417006bb1b45f706cd55ec7c6b349 (diff)
downloadmpfr-aa4d4b4ec0b8019ff9ebd5bba6c86c23990f42f2.tar.gz
(merged changeset 8443-8445 from the trunk)
Tuning: reverted changeset r8444 and applied patch by Patrick PĂ©lissier for GMP 5.1.0 to link against librt conditionally. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8479 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--configure.ac12
-rw-r--r--tune/Makefile.am6
2 files changed, 15 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 2908de2cd..53b502954 100644
--- a/configure.ac
+++ b/configure.ac
@@ -320,6 +320,18 @@ AC_C_CONST
AC_C_VOLATILE
MPFR_CONFIGS
+# (From GMP 5.1)
+# clock_gettime is in librt on *-*-osf5.1 and on glibc, so att -lrt to
+# TUNE_LIBS if needed. On linux (tested on x86_32, 2.6.26),
+# clock_getres reports ns accuracy, while in a quick test on osf
+# clock_getres said only 1 millisecond.
+old_LIBS="$LIBS"
+AC_SEARCH_LIBS(clock_gettime, rt, [
+ AC_DEFINE([HAVE_CLOCK_GETTIME],1,[Define to 1 if you have the `clock_gettime' function])])
+TUNE_LIBS="$LIBS"
+LIBS="$old_LIBS"
+AC_SUBST(TUNE_LIBS)
+
dnl
dnl Setup GMP detection
dnl
diff --git a/tune/Makefile.am b/tune/Makefile.am
index 50f4d37b3..f33045698 100644
--- a/tune/Makefile.am
+++ b/tune/Makefile.am
@@ -12,15 +12,15 @@
EXTRA_PROGRAMS = tuneup speed bidimensional_sample
tuneup_SOURCES = tuneup.c
-tuneup_LDADD = -lspeed $(top_builddir)/src/libmpfr.la
+tuneup_LDADD = -lspeed $(top_builddir)/src/libmpfr.la $(TUNE_LIBS)
tuneup_LDFLAGS = -static
speed_SOURCES = speed.c
-speed_LDADD = -lspeed $(top_builddir)/src/libmpfr.la
+speed_LDADD = -lspeed $(top_builddir)/src/libmpfr.la $(TUNE_LIBS)
speed_LDFLAGS = -static
bidimensional_sample_SOURCES = bidimensional_sample.c
-bidimensional_sample_LDADD = -lspeed $(top_builddir)/src/libmpfr.la
+bidimensional_sample_LDADD = -lspeed $(top_builddir)/src/libmpfr.la $(TUNE_LIBS)
bidimensional_sample_LDFLAGS = -static
INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src