changeset 14025:9867be070ee1

use pcre/pcre.h if it is present * configure.ac: Check for pcre/pcre.h. * liboctave/regexp.cc: Include either pcre.h or pcre/pcre.h depending on which is available.
author John W. Eaton <jwe@octave.org>
date Sun, 11 Dec 2011 22:35:13 -0500
parents fc9f204faea0
children 3781981be535
files configure.ac liboctave/regexp.cc
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sun Dec 11 22:19:57 2011 -0500
+++ b/configure.ac	Sun Dec 11 22:35:13 2011 -0500
@@ -662,12 +662,17 @@
 
 pcre_fail_msg="to build Octave, you must have the PCRE library and header files installed"
 
-## NB: no need to do separate check for pcre.h header -- checking
-## macros is good enough
+AC_CHECK_HEADERS([pcre.h pcre/pcre.h])
+
 AC_CACHE_CHECK([whether pcre.h defines the macros we need],
   [ac_cv_pcre_h_macros_present],
   [AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [
+#if defined (HAVE_PCRE_H)
 #include <pcre.h>
+#elif defined (HAVE_PCRE_PCRE_H)
+#include <pcre.h>
+#error "NO PCRE HEADER"
+#endif
 #if defined (PCRE_INFO_NAMECOUNT) \
   && defined (PCRE_INFO_NAMEENTRYSIZE) \
   && defined (PCRE_INFO_NAMETABLE)
--- a/liboctave/regexp.cc	Sun Dec 11 22:19:57 2011 -0500
+++ b/liboctave/regexp.cc	Sun Dec 11 22:35:13 2011 -0500
@@ -31,7 +31,11 @@
 #include <string>
 #include <vector>
 
+#if defined (HAVE_PCRE_H)
 #include <pcre.h>
+#elif defined (HAVE_PCRE_PCRE_H)
+#include <pcre/pcre.h>
+#endif
 
 #include "Matrix.h"
 #include "base-list.h"