# HG changeset patch # User Jaroslav Hajek # Date 1233739100 -3600 # Node ID 9792c26bffc77c76beb6d568d5de2ea45d00cdca # Parent 73c4516fae102455ca2e6bc55e17fb36c07b75a8 configure: check whether qhull works diff -r 73c4516fae10 -r 9792c26bffc7 ChangeLog --- a/ChangeLog Wed Feb 04 00:47:53 2009 -0500 +++ b/ChangeLog Wed Feb 04 10:18:20 2009 +0100 @@ -1,3 +1,9 @@ +2009-02-03 Jaroslav Hajek + + * aclocal.m4 (AC_CHECK_QHULL_OK): New macro, based on suggestion by + Petr Mikulik . + * configure.in: Call it. + 2009-02-01 Thorsten Meyer * autogen.sh: Remove printing of cvs motd. diff -r 73c4516fae10 -r 9792c26bffc7 aclocal.m4 --- a/aclocal.m4 Wed Feb 04 00:47:53 2009 -0500 +++ b/aclocal.m4 Wed Feb 04 10:18:20 2009 +0100 @@ -955,6 +955,44 @@ fi ]) dnl +dnl Check whether QHull works (does not crash) +dnl +AC_DEFUN(AC_CHECK_QHULL_OK, +[AC_MSG_CHECKING([whether the qhull library works]) +AC_CACHE_VAL(octave_cv_lib_qhull_ok, +[ + save_LIBS="$LIBS" + LIBS="$LIBS -lqhull -lm" +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include + +#ifdef NEED_QHULL_VERSION +char *qh_version = "version"; +#endif +int main() +{ + int dim = 2, n = 4; + coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 }; + boolT ismalloc = 0; + + return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); +} +]])], + [octave_cv_lib_qhull_ok=yes], + [octave_cv_lib_qhull_ok=no], + [octave_cv_lib_qhull_ok=yes]) + LIBS="$save_LIBS" +]) +if test "$octave_cv_lib_qhull_ok" = "yes"; then + AC_MSG_RESULT(yes) + ifelse([$1], , , [$1]) +else + AC_MSG_RESULT(no) + ifelse([$2], , , [$2]) +fi +]) +dnl dnl Check for OpenGL. If found, define OPENGL_LIBS dnl dnl FIXME -- add tests for apple diff -r 73c4516fae10 -r 9792c26bffc7 configure.in --- a/configure.in Wed Feb 04 00:47:53 2009 -0500 +++ b/configure.in Wed Feb 04 10:18:20 2009 +0100 @@ -425,13 +425,20 @@ AC_CHECK_QHULL_VERSION(have_qhull=yes, have_qhull=no) AC_DEFINE(NEED_QHULL_VERSION, 1, [Define if the QHull library needs a wh_version variable defined.]) fi + if test "$have_qhull" = yes; then + AC_CHECK_QHULL_OK(have_qhull=yes, have_qhull=bad) + fi fi if test "$have_qhull" = yes; then AC_DEFINE(HAVE_QHULL, 1, [Define if the QHull library is used.]) QHULL_LIBS="-lqhull" TEXINFO_QHULL="@set HAVE_QHULL" else - warn_qhull="Qhull library not found --- This will result in loss of functionality of some geometry functions." + if test "$have_qhull" = bad; then + warn_qhull="Qhull library found, but seems not to work properly --- This will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing." + else + warn_qhull="Qhull library not found --- This will result in loss of functionality of some geometry functions." + fi AC_MSG_WARN($warn_qhull) fi