changeset 14043:f913363318e0 stable

handle new names and locations of qhull include files (bug #33712) * src/DLD-FUNCTIONS/oct-qhull.h: New file. Handle details of which Qhull header files to include here. * src/DLD-FUNCTIONS/config-module.awk: Include oct-qhull.h in list of EXTRA_DIST files. * configure.ac: Check for qhull/libqhull.h, libqhull.h, qhull/qhull.h, and qhull.h instead of qhull/libqhull_a.h. * __delaunayn__.cc, __voronoi__.cc, convhulln.cc: Include oct-qhull.h instead of qhull/qhull_a.h. * acinclude.m4 (OCTAVE_CHECK_QHULL_VERSION, OCTAVE_CHECK_QHULL_OK): Look for various qhull header files.
author John W. Eaton <jwe@octave.org>
date Tue, 13 Dec 2011 16:53:22 -0500
parents 57e19c30b7d6
children c15ddadffbfb
files configure.ac m4/acinclude.m4 src/DLD-FUNCTIONS/__delaunayn__.cc src/DLD-FUNCTIONS/__voronoi__.cc src/DLD-FUNCTIONS/config-module.awk src/DLD-FUNCTIONS/convhulln.cc src/DLD-FUNCTIONS/oct-qhull.h
diffstat 7 files changed, 115 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Tue Dec 13 12:16:50 2011 -0500
+++ b/configure.ac	Tue Dec 13 16:53:22 2011 -0500
@@ -649,7 +649,7 @@
 
 OCTAVE_CHECK_LIBRARY(qhull, QHull,
   [Qhull library not found -- this will result in loss of functionality of some geometry functions.],
-  [qhull/qhull_a.h], [qh_qhull], [], [],
+  [qhull/libqhull.h libqhull.h qhull/qhull.h qhull.h], [qh_qhull], [], [],
   [warn_qhull=
    OCTAVE_CHECK_QHULL_VERSION
    OCTAVE_CHECK_QHULL_OK([TEXINFO_QHULL="@set HAVE_QHULL"
--- a/m4/acinclude.m4	Tue Dec 13 12:16:50 2011 -0500
+++ b/m4/acinclude.m4	Tue Dec 13 16:53:22 2011 -0500
@@ -936,7 +936,28 @@
   [AC_CACHE_CHECK([for qh_version in $QHULL_LIBS],
     octave_cv_lib_qhull_version,  [
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <qhull/qhull_a.h>
+#include <stdio.h>
+#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+# if defined (HAVE_QHULL_LIBQHULL_H)
+#  include <qhull/libqhull.h>
+# else
+#  include <qhull/qhull.h>
+# endif
+# include <qhull/qset.h>
+# include <qhull/geom.h>
+# include <qhull/poly.h>
+# include <qhull/io.h>
+#elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
+# if defined (HAVE_LIBQHULL_H)
+#  include <libqhull.h>
+# else
+#  include <qhull.h>
+# endif
+# include <qset.h>
+# include <geom.h>
+# include <poly.h>
+# include <io.h>
+#endif
 ]], [[
 const char *tmp = qh_version;
 ]])], [octave_cv_lib_qhull_version=yes], [octave_cv_lib_qhull_version=no])])
@@ -953,7 +974,27 @@
     octave_cv_lib_qhull_ok, [
       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-#include <qhull/qhull.h>
+#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+# if defined (HAVE_QHULL_LIBQHULL_H)
+#  include <qhull/libqhull.h>
+# else
+#  include <qhull/qhull.h>
+# endif
+# include <qhull/qset.h>
+# include <qhull/geom.h>
+# include <qhull/poly.h>
+# include <qhull/io.h>
+#elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
+# if defined (HAVE_LIBQHULL_H)
+#  include <libqhull.h>
+# else
+#  include <qhull.h>
+# endif
+# include <qset.h>
+# include <geom.h>
+# include <poly.h>
+# include <io.h>
+#endif
 #ifdef NEED_QHULL_VERSION
 char *qh_version = "version";
 #endif
--- a/src/DLD-FUNCTIONS/__delaunayn__.cc	Tue Dec 13 12:16:50 2011 -0500
+++ b/src/DLD-FUNCTIONS/__delaunayn__.cc	Tue Dec 13 16:53:22 2011 -0500
@@ -50,14 +50,11 @@
 #include "error.h"
 #include "oct-obj.h"
 
-#ifdef HAVE_QHULL
-extern "C" {
-#include <qhull/qhull_a.h>
-}
-
-#ifdef NEED_QHULL_VERSION
+#if defined (HAVE_QHULL)
+# include "oct-qhull.h"
+# if defined (NEED_QHULL_VERSION)
 char qh_version[] = "__delaunayn__.oct 2007-08-21";
-#endif
+# endif
 #endif
 
 DEFUN_DLD (__delaunayn__, args, ,
@@ -70,7 +67,7 @@
 {
   octave_value_list retval;
 
-#ifdef HAVE_QHULL
+#if defined (HAVE_QHULL)
 
   retval(0) = 0.0;
 
--- a/src/DLD-FUNCTIONS/__voronoi__.cc	Tue Dec 13 12:16:50 2011 -0500
+++ b/src/DLD-FUNCTIONS/__voronoi__.cc	Tue Dec 13 16:53:22 2011 -0500
@@ -45,14 +45,11 @@
 #include "error.h"
 #include "oct-obj.h"
 
-#ifdef HAVE_QHULL
-extern "C" {
-#include <qhull/qhull_a.h>
-}
-
-#ifdef NEED_QHULL_VERSION
+#if defined (HAVE_QHULL)
+# include "oct-qhull.h"
+# if defined (NEED_QHULL_VERSION)
 char qh_version[] = "__voronoi__.oct 2007-07-24";
-#endif
+# endif
 #endif
 
 DEFUN_DLD (__voronoi__, args, ,
@@ -67,7 +64,7 @@
 
   std::string caller = args(0).string_value ();
 
-#ifdef HAVE_QHULL
+#if defined (HAVE_QHULL)
 
   retval(0) = 0.0;
 
--- a/src/DLD-FUNCTIONS/config-module.awk	Tue Dec 13 12:16:50 2011 -0500
+++ b/src/DLD-FUNCTIONS/config-module.awk	Tue Dec 13 16:53:22 2011 -0500
@@ -7,7 +7,8 @@
   print "EXTRA_DIST += \\"
   print "  DLD-FUNCTIONS/config-module.sh \\"
   print "  DLD-FUNCTIONS/config-module.awk \\"
-  print "  DLD-FUNCTIONS/module-files"
+  print "  DLD-FUNCTIONS/module-files \\"
+  print "  DLD-FUNCTIONS/oct-qhull.h"
   print ""
 }
 /^#.*/ { next; }
--- a/src/DLD-FUNCTIONS/convhulln.cc	Tue Dec 13 12:16:50 2011 -0500
+++ b/src/DLD-FUNCTIONS/convhulln.cc	Tue Dec 13 16:53:22 2011 -0500
@@ -41,15 +41,12 @@
 #include "oct-obj.h"
 #include "parse.h"
 
-#ifdef HAVE_QHULL
-extern "C" {
-#include <qhull/qhull_a.h>
-}
-
-# ifdef NEED_QHULL_VERSION
+#if defined (HAVE_QHULL)
+# include "oct-qhull.h"
+# if defined (NEED_QHULL_VERSION)
 char qh_version[] = "convhulln.oct 2007-07-24";
 # endif
-#endif /* HAVE_QHULL */
+#endif
 
 DEFUN_DLD (convhulln, args, nargout,
   "-*- texinfo -*-\n\
@@ -85,7 +82,7 @@
 {
   octave_value_list retval;
 
-#ifdef HAVE_QHULL
+#if defined (HAVE_QHULL)
 
   int nargin = args.length ();
   if (nargin < 1 || nargin > 2)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/DLD-FUNCTIONS/oct-qhull.h	Tue Dec 13 16:53:22 2011 -0500
@@ -0,0 +1,54 @@
+/*
+
+Copyright (C) 2011 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if !defined (octave_oct_qhull_h)
+#define octave_oct_qhull_h 1
+
+#include <cstdio>
+
+extern "C" {
+
+#if defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H)
+# if defined (HAVE_QHULL_LIBQHULL_H)
+#  include <qhull/libqhull.h>
+# else
+#  include <qhull/qhull.h>
+# endif
+# include <qhull/qset.h>
+# include <qhull/geom.h>
+# include <qhull/poly.h>
+# include <qhull/io.h>
+#elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H)
+# if defined (HAVE_LIBQHULL_H)
+#  include <libqhull.h>
+# else
+#  include <qhull.h>
+# endif
+# include <qset.h>
+# include <geom.h>
+# include <poly.h>
+# include <io.h>
+#endif
+
+}
+
+#endif