diff configure.ac @ 2168:caaf4b1a8487 trunk

[svn] - allow user to choose a regex library between gnu (default), oniguruma, pcre (experimental); oniguruma and pcre support utf-8 encoding
author giacomo
date Mon, 18 Dec 2006 13:11:23 -0800
parents 33f768ab6418
children 1db6ecbedb27
line wrap: on
line diff
--- a/configure.ac	Mon Dec 18 11:59:00 2006 -0800
+++ b/configure.ac	Mon Dec 18 13:11:23 2006 -0800
@@ -189,6 +189,46 @@
 AC_SUBST(CHARDET_LIBS)
 AC_SUBST(SUBDIR_GUESS)
 
+dnl regex support (gnu/oniguruma/pcre)
+dnl ========================
+REGEX_LIBS=
+REGEX_CFLAGS=
+AC_ARG_WITH(regexlib,
+[
+  --with-regexlib[[=gnu/oniguruma/pcre]]   use the chosen regex library (default: gnu)
+],
+[case "${withval}" in
+  gnu)
+    AC_DEFINE(USE_REGEX_GNU,[1],[If this macro is defined, use GNU regex library.])
+    ;;
+  pcre)
+    PKG_CHECK_MODULES(LIBPCRE, [libpcre >= 6.7],
+        [
+          AC_DEFINE(USE_REGEX_PCRE,[1],[If this macro is defined, use PCRE regex library.])
+          REGEX_LIBS="-lpcreposix $LIBPCRE_LIBS"
+          REGEX_CFLAGS=$LIBPCRE_CFLAGS
+        ],
+        [AC_MSG_ERROR([Cannot find PCRE])]
+    )
+    ;;
+  oniguruma)
+    AC_CHECK_LIB( onig , onig_new ,
+        [
+          AC_DEFINE(USE_REGEX_ONIGURUMA,[1],[If this macro is defined, use Oniguruma regex library.])
+          REGEX_LIBS=['-lonig']
+        ],
+        [AC_MSG_ERROR([Cannot find Oniguruma])]
+    )
+    ;;
+  *)
+    AC_DEFINE(USE_REGEX_GNU,[1],[If this macro is defined, use GNU regex library.])
+    ;;
+esac],AC_DEFINE(USE_REGEX_GNU,[1],[If this macro is defined, use GNU regex library.]))
+
+AC_SUBST(REGEX_LIBS)
+AC_SUBST(REGEX_CFLAGS)
+
+
 dnl GConf support
 
 AC_ARG_ENABLE( gconf,