# HG changeset patch # User John W. Eaton # Date 1323660913 18000 # Node ID 9867be070ee1e439d7c0b678e15b9d8355ca404e # Parent fc9f204faea0b520a8ea9d455e4f5c865b1b09a0 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. diff -r fc9f204faea0 -r 9867be070ee1 configure.ac --- 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 +#elif defined (HAVE_PCRE_PCRE_H) +#include +#error "NO PCRE HEADER" +#endif #if defined (PCRE_INFO_NAMECOUNT) \ && defined (PCRE_INFO_NAMEENTRYSIZE) \ && defined (PCRE_INFO_NAMETABLE) diff -r fc9f204faea0 -r 9867be070ee1 liboctave/regexp.cc --- 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 #include +#if defined (HAVE_PCRE_H) #include +#elif defined (HAVE_PCRE_PCRE_H) +#include +#endif #include "Matrix.h" #include "base-list.h"