+dnl REMEMBER TO CHANGE WITH A NEW TRE RELEASE!
+tre_version="0.7.4"
+AC_MSG_RESULT(extracting TRE regex library)
+cur_dir=`pwd`
+cd tools
+dnl remove old tre directory to force a recompile...
+rm -rf tre-$tre_version
+if test "x$ac_cv_path_GUNZIP" = "x" ; then
+ tar xfz tre.tar.gz
+else
+ cp tre.tar.gz tre.tar.gz.bak
+ gunzip -f tre.tar.gz
+ cp tre.tar.gz.bak tre.tar.gz
+ tar xf tre.tar
+fi
+AC_MSG_RESULT(configuring TRE regex library)
+cd tre-$tre_version
+./configure --disable-agrep --disable-shared --disable-system-abi --disable-wchar --disable-multibyte --prefix=$prefix || exit 1
+AC_MSG_RESULT(compiling TRE regex library)
+$ac_cv_prog_MAKER || exit 1
+AC_MSG_RESULT(installing TRE regex library)
+$ac_cv_prog_MAKER install || exit 1
+TREINCDIR="$prefix/include"
+AC_SUBST(TREINCDIR)
+if test "x$ac_cv_path_PKGCONFIG" = "x" ; then
+ TRELIBS="-L$prefix/lib -ltre"
+else
+ TRELIBS=`$ac_cv_path_PKGCONFIG --libs tre.pc`
+fi
+AC_SUBST(TRELIBS)
+cd $cur_dir
+