aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 16:19:41 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-20 16:20:42 +0000
commitc4455dd4491879bf64122e863ad4fd8ff9b6dfa5 (patch)
treecacc73e5ba81819ad9362a3f7d69468add2c64ba /configure.ac
parent1ea7c642bc74df0d42e0b214c1a13ce7cc7b97e8 (diff)
downloadpaludis-c4455dd4491879bf64122e863ad4fd8ff9b6dfa5.tar.gz
paludis-c4455dd4491879bf64122e863ad4fd8ff9b6dfa5.tar.xz
Use std::random
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac37
1 files changed, 37 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 74dcb8f17..469673127 100644
--- a/configure.ac
+++ b/configure.ac
@@ -783,6 +783,43 @@ int main(int, char **)
])
dnl }}}
+dnl {{{ std::random
+random_is_tr1=
+AC_MSG_CHECKING([for c++0x-compliant <random>])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#include <random>
+#include <ctime>
+int main(int, char **)
+{
+ std::mt19937 rand(std::time(0));
+ std::uniform_int_distribution<int> dist(0, 9);
+ return dist(rand);
+}
+])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for tr1-compliant <random>])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#include <random>
+#include <ctime>
+int main(int, char **)
+{
+ std::mt19937 rand(std::time(0));
+ std::uniform_int<int> dist(0, 9);
+ return dist(rand);
+}
+ ])],
+ [AC_MSG_RESULT([yes])
+ random_is_tr1=yes],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Your compiler does not support <random>])])
+ ])
+
+if test x$random_is_tr1 = xyes ; then
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_RANDOM_IS_TR1=1"
+fi
+dnl }}}
+
dnl {{{ c++0x default and deleted functions
AC_MSG_CHECKING([for c++0x default and deleted functions])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([