diff -up R-3.0.2/configure.ac.system-tre R-3.0.2/configure.ac --- R-3.0.2/configure.ac.system-tre 2014-02-04 18:14:04.233778538 -0500 +++ R-3.0.2/configure.ac 2014-02-04 18:14:52.635733566 -0500 @@ -420,6 +420,10 @@ AC_ARG_WITH([system-pcre], [AS_HELP_STRING([--with-system-pcre],[use system PCRE library (if available) @<:@no@:>@])], [R_ARG_USE_SYSTEM(pcre)], [use_system_pcre=no]) +AC_ARG_WITH([system-tre], +[AS_HELP_STRING([--with-system-tre],[use system tre library (if available) @<:@no@:>@])], +[R_ARG_USE_SYSTEM(tre)], +[use_system_tre=no]) AC_ARG_WITH([system-xz], [AS_HELP_STRING([--with-system-xz],[use system xz (lzma) library (if available) @<:@yes@:>@])], [R_ARG_USE_SYSTEM(xz)], @@ -2221,6 +2225,9 @@ R_LZMA ## PCRE headers and libraries. R_PCRE +## tre headers and libraries. +R_TRE + ## POSIX times. R_SYS_POSIX_LEAPSECONDS diff -up R-3.0.2/m4/R.m4.system-tre R-3.0.2/m4/R.m4 --- R-3.0.2/m4/R.m4.system-tre 2014-02-04 18:15:08.196719109 -0500 +++ R-3.0.2/m4/R.m4 2014-02-04 18:27:32.854028384 -0500 @@ -3150,6 +3150,26 @@ fi AM_CONDITIONAL(BUILD_BZLIB, [test "x${have_bzlib}" = xno]) ])# R_BZLIB +## R_TRE +## ------- +## Try finding tre library and headers. +## We check that both are installed, +AC_DEFUN([R_TRE], +[if test "x${use_system_tre}" = xyes; then + AC_CHECK_LIB(tre, tre_regncompb, [have_tre=yes], [have_tre=no]) + if test "${have_tre}" = yes; then + AC_CHECK_HEADERS(tre/tre.h, [have_tre=yes], [have_tre=no]) + fi +if test "x${have_tre}" = xyes; then + AC_DEFINE(HAVE_TRE, 1, [Define if your system has tre.]) + LIBS="-ltre ${LIBS}" +fi +else + have_tre="no" +fi +AM_CONDITIONAL(BUILD_TRE, [test x${have_tre} != xyes]) +])# R_TRE + ## R_LZMA ## ------- ## Try finding liblzma library and headers. diff -up R-3.0.2/src/extra/Makefile.in.system-tre R-3.0.2/src/extra/Makefile.in --- R-3.0.2/src/extra/Makefile.in.system-tre 2014-02-04 18:31:50.263790068 -0500 +++ R-3.0.2/src/extra/Makefile.in 2014-02-04 18:32:11.792770146 -0500 @@ -22,7 +22,7 @@ LIBPCRE =@BUILD_PCRE_TRUE@ make.pcre LIBZ =@BUILD_ZLIB_TRUE@ make.zlib LIBXDR =@BUILD_XDR_TRUE@ make.xdr LIBINTL =@BUILD_LIBINTL_TRUE@ make.intl -LIBTRE = make.tre +LIBTRE =@BUILD_TRE_TRUE@ make.tre LIBXZ =@BUILD_XZ_TRUE@ make.xz EXTRAS = $(RBLAS) $(LIBBZ2) $(LIBPCRE) $(LIBZ) $(LIBXDR) $(LIBINTL) $(LIBTRE) $(LIBXZ) diff -up R-3.0.2/src/extra/tre/Makefile.in.system-tre R-3.0.2/src/extra/tre/Makefile.in --- R-3.0.2/src/extra/tre/Makefile.in.system-tre 2014-02-04 18:29:54.812896929 -0500 +++ R-3.0.2/src/extra/tre/Makefile.in 2014-02-04 18:31:15.046822660 -0500 @@ -33,7 +33,7 @@ libtre_a_SOURCES = $(SOURCES) libtre_a_OBJECTS = $(OBJECTS) -all: R +all: @BUILD_TRE_TRUE@ R Makefile: $(srcdir)/Makefile.in \ $(top_builddir)/config.status \ @@ -44,9 +44,9 @@ Makedeps: Makefile $(DEPENDS) @cat $(DEPENDS) >> Makefile @touch $@ -R: Makefile - @$(MAKE) Makedeps - @$(MAKE) $(noinst_LIBRARIES) +R: Makefile @BUILD_TRE_TRUE@ + @BUILD_TRE_TRUE@ @$(MAKE) Makedeps + @BUILD_TRE_TRUE@ @$(MAKE) $(noinst_LIBRARIES) libtre.a: $(libtre_a_OBJECTS) rm -f $@ diff -up R-3.0.2/src/main/Makefile.in.system-tre R-3.0.2/src/main/Makefile.in --- R-3.0.2/src/main/Makefile.in.system-tre 2014-02-04 18:28:02.924000533 -0500 +++ R-3.0.2/src/main/Makefile.in 2014-02-04 18:29:06.677941495 -0500 @@ -69,7 +69,7 @@ DISTFILES = Makefile.in Makefile.win \ ZLIB_CPPFLAGS = @BUILD_ZLIB_TRUE@ -I$(top_srcdir)/src/extra/zlib BZLIB_CPPFLAGS = @BUILD_BZLIB_TRUE@ -I$(top_srcdir)/src/extra/bzip2 PCRE_CPPFLAGS = @BUILD_PCRE_TRUE@ -I$(top_srcdir)/src/extra/pcre -TRE_CPPFLAGS = -I$(top_srcdir)/src/extra +TRE_CPPFLAGS = @BUILD_TRE_TRUE@ -I$(top_srcdir)/src/extra XDR_CPPFLAGS = @BUILD_XDR_TRUE@ -I$(top_srcdir)/src/extra/xdr @BUILD_XDR_FALSE@XDR_CPPFLAGS = @TIRPC_CPPFLAGS@ XZ_CPPFLAGS = @BUILD_XZ_TRUE@ -I$(top_srcdir)/src/extra/xz/api @@ -84,7 +84,7 @@ ALL_CPPFLAGS = $(ZLIB_CPPFLAGS) $(BZLIB_ R_ZLIBS = @BUILD_ZLIB_TRUE@ ../extra/zlib/libz.a R_BZLIBS = @BUILD_BZLIB_TRUE@ ../extra/bzip2/libbz2.a R_PCRE = @BUILD_PCRE_TRUE@ ../extra/pcre/libpcre.a -R_TRE = ../extra/tre/libtre.a +R_TRE = @BUILD_TRE_TRUE@ ../extra/tre/libtre.a R_XDR = @BUILD_XDR_TRUE@ ../extra/xdr/libxdr.a R_XZ = @BUILD_XZ_TRUE@ ../extra/xz/liblzma.a R_LIBINTL = @BUILD_LIBINTL_TRUE@ ../extra/intl/libintl.a