view src/of-communications-1-fixes.patch @ 4020:46c6ddb14417

of-communications: add patch to compile wih dev octave (Bug #45856) * src/of-communications-1-fixes.patch: new file * src/of-communications.mk: call autoconfigure * dist-files.mk: add of-communications-1-fixes.patch
author John Donoghue
date Fri, 04 Sep 2015 10:06:02 -0400
parents
children b5a28d770997
line wrap: on
line source

# HG changeset patch
# User John Donoghue
# Date 1441300743 14400
#      Thu Sep 03 13:19:03 2015 -0400
# Node ID eeb20b3c6074e8932e40b14c9f99985340ceeca5
# Parent  dedf92d61d33525da3f71a635979c447defb438a
Check for ls-oct-ascii.h, ls-oct-text.h (Bug #45856)

src/configure.ac: check for ls-oct-ascii.h, ls-oct-text.h and set HAVE_XXXX variables accordingly.

src/ov-galois.cc: include either ls-oct-ascii.h, ls-oct-text.h dependong on HAVE_XXXX variables

diff -r dedf92d61d33 -r eeb20b3c6074 src/configure.ac
--- a/src/configure.ac	Sat Apr 04 12:20:33 2015 -0400
+++ b/src/configure.ac	Thu Sep 03 13:19:03 2015 -0400
@@ -99,5 +99,21 @@
   PKG_CPPFLAGS="$PKG_CPPFLAGS -DHAVE_OCTAVE_BASE_VALUE_PRINT_CONST=1"
 fi
 
+comm_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
+AC_LANG_PUSH(C++)
+AC_CHECK_HEADER([octave/ls-oct-ascii.h], [PKG_CPPFLAGS="$PKG_CPPFLAGS -DHAVE_OCTAVE_ASCII_H=1"], [], 
+[
+#include <octave/config.h>
+#incude <octave/ov.h>
+])
+AC_CHECK_HEADER([octave/ls-oct-text.h], [PKG_CPPFLAGS="$PKG_CPPFLAGS -DHAVE_OCTAVE_TEXT_H=1"], [], 
+[
+#include <octave/config.h>
+#include <octave/ov.h>
+])
+AC_LANG_POP(C++)
+CXXFLAGS=$comm_save_CXXFLAGS
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff -r dedf92d61d33 -r eeb20b3c6074 src/ov-galois.cc
--- a/src/ov-galois.cc	Sat Apr 04 12:20:33 2015 -0400
+++ b/src/ov-galois.cc	Thu Sep 03 13:19:03 2015 -0400
@@ -30,7 +30,12 @@
 #include <octave/ov.h>
 #include <octave/pr-output.h>
 
-#include <octave/ls-oct-ascii.h>
+
+#if defined(HAVE_OCTAVE_TEXT_H)
+#  include <octave/ls-oct-text.h>
+#else
+#  include <octave/ls-oct-ascii.h>
+#endif
 
 #include "galois.h"
 #include "ov-galois.h"