diff configure.in @ 5585:6dbb3f6d0054

[project @ 2005-12-15 01:40:58 by jwe]
author jwe
date Thu, 15 Dec 2005 01:45:37 +0000
parents 8b0b36c2dc0c
children 1ad66ea35fe5
line wrap: on
line diff
--- a/configure.in	Thu Dec 15 01:29:34 2005 +0000
+++ b/configure.in	Thu Dec 15 01:45:37 2005 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.493 $)
+AC_REVISION($Revision: 1.494 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -418,6 +418,37 @@
   ;;
 esac
 
+### Check for pcre/regex library.
+AC_SUBST(REGEX_LIBS)
+WITH_PCRE_CONFIG=no
+AC_CHECK_HEADER(pcre.h, WITH_PCRE=yes, WITH_PCRE=no)
+if test $WITH_PCRE = no ; then
+  AC_CHECK_PROG(WITH_PCRE_CONFIG, pcre-config, yes, no)
+  if test $WITH_PCRE_CONFIG = yes ; then
+    WITH_PCRE=yes
+  fi
+fi
+if test $WITH_PCRE = yes ; then
+  AC_CHECK_LIB(pcre, pcre_compile, WITH_PCRE=yes, WITH_PCRE=no)
+  if test $WITH_PCRE = yes ; then
+    AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.])
+    if test $WITH_PCRE_CONFIG = yes ; then
+      REGEX_LIBS=`pcre-config --cflags --libs`
+    else
+      REGEX_LIBS="-lpcre"
+    fi
+  fi
+fi
+AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [
+  AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)])
+if test $WITH_REGEX = yes ; then
+  AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.])
+  if test $HAVE_PCRE = no ; then
+    AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [
+      AC_CHECK_LIB(regex, regexec, REGEX_LIBS="-lregex")])
+  fi
+fi
+
 ### Check for ZLIB library.
 
 WITH_ZLIB=true