summaryrefslogtreecommitdiffstats
path: root/src/m4/ev++.m4
diff options
context:
space:
mode:
authorErik Andersson <erik@packy.se>2016-11-22 23:56:43 +0100
committerErik Andersson <erik@packy.se>2016-11-22 23:56:43 +0100
commit41954fffc10bfd230f857f57c6871b412d5f2e91 (patch)
tree010bcf28f294a58b4a22b7276cf615758648bcbe /src/m4/ev++.m4
parented374a8dbcdaaf273964293d2805bdd61b148022 (diff)
downloadocelot-master.zip
ocelot-master.tar.gz
ocelot-master.tar.bz2
Ocelot v1.0HEADv1.0master
Diffstat (limited to 'src/m4/ev++.m4')
-rw-r--r--src/m4/ev++.m459
1 files changed, 44 insertions, 15 deletions
diff --git a/src/m4/ev++.m4 b/src/m4/ev++.m4
index 573f9da..c81ea09 100644
--- a/src/m4/ev++.m4
+++ b/src/m4/ev++.m4
@@ -47,12 +47,17 @@ AC_DEFUN([EV_DEVEL],
if test -z "$ac_cv_ev_lib"
then
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([Didn't find the libev library dir in '$EV_lib_check'])
fi
case "$ac_cv_ev_lib" in
- /* ) ;;
- * ) AC_MSG_ERROR([The libev library directory ($ac_cv_ev_lib) must be an absolute path.]) ;;
+ /* )
+ ;;
+ * )
+ AC_MSG_RESULT([])
+ AC_MSG_ERROR([The libev library directory ($ac_cv_ev_lib) must be an absolute path.])
+ ;;
esac
])
AC_SUBST([EV_LIB_DIR],[$ac_cv_ev_lib])
@@ -73,12 +78,17 @@ AC_DEFUN([EV_DEVEL],
if test -z "$ac_cv_ev_inc"
then
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([Didn't find the libev header dir in '$EV_inc_check'])
fi
case "$ac_cv_ev_inc" in
- /* ) ;;
- * ) AC_MSG_ERROR([The libev header directory ($ac_cv_ev_inc) must be an absolute path.]) ;;
+ /* )
+ ;;
+ * )
+ AC_MSG_RESULT([])
+ AC_MSG_ERROR([The libev header directory ($ac_cv_ev_inc) must be an absolute path.])
+ ;;
esac
])
AC_SUBST([EV_INC_DIR],[$ac_cv_ev_inc])
@@ -87,20 +97,39 @@ AC_DEFUN([EV_DEVEL],
dnl Now check that the above checks resulted in -I and -L flags that
dnl let us build actual programs against libev.
dnl
- LDFLAGS_SAVED="$LDFLAGS"
- CPPFLAGS_SAVED="$CPPFLAGS"
case "$ac_cv_ev_lib" in
- /usr/lib) ;;
- *) LDFLAGS="$LDFLAGS -L${ac_cv_ev_lib}" ;;
+ /usr/lib)
+ ;;
+ *)
+ LDFLAGS="$LDFLAGS -L${ac_cv_ev_lib}"
+ ;;
esac
CPPFLAGS="$CPPFLAGS -I${ac_cv_ev_inc}"
AC_MSG_CHECKING([that we can build libev programs])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([#include <ev++.h>],
- [ev::io i])],
- AC_MSG_RESULT([yes]),
- AC_MSG_ERROR([no]))
- LDFLAGS="$LDFLAGS_SAVED"
- CPPFLAGS="$CPPFLAGS_SAVED"
+ AC_EGREP_CPP(
+ [bad_gcc_libev_ver],
+ [
+#include <ev.h>
+#if __GNUC__ && (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 9) && EV_VERSION_MAJOR == 4 && EV_VERSION_MINOR == 18
+ bad_gcc_libev_ver
+#endif
+ ],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([GCC versions prior to 4.9 cannot compile libev 4.18])],
+ [],
+ )
+
+ LIBS="-lev $LIBS"
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <ev++.h>],
+ [ev::io i])
+ ],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_FAILURE([Cannot build libev programs])]
+ )
+ AC_LANG_POP([C++])
]) dnl End EV_DEVEL