We make chartables.h rather than pcre_chartables.c, and include in 
pcre_compile.c.  This makes the standard dependency mechanism work.

pcre_internal.h includes the relevant definitions that configure would
make.

In pcre.h, we don't want to make a DLL on Windows.

We do not define SUPPORT_UCP and so leave out the files it needs.

diff -u ./dftables.c ../../extra/pcre/dftables.c
--- ./dftables.c	2006-12-19 09:31:35.000000000 +0000
+++ ../../extra/pcre/dftables.c	2006-12-23 07:32:57.000000000 +0000
@@ -43,6 +43,7 @@
 locale. Now that pcre_maketables is a function visible to the outside world, we
 make use of its code from here in order to be consistent. */
 
+#include <config.h> /* to avoid trivial warnings from LFS */
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
@@ -52,6 +53,7 @@
 #define DFTABLES          /* pcre_maketables.c notices this */
 #include "pcre_maketables.c"
 
+#undef fprintf /* remapped on Windows */
 
 int main(int argc, char **argv)
 {
diff -u ./pcre.h ../../extra/pcre/pcre.h
--- ./pcre.h	2006-12-19 09:31:35.000000000 +0000
+++ ../../extra/pcre/pcre.h	2006-12-23 07:22:19.000000000 +0000
@@ -60,6 +60,7 @@
 /* Win32 uses DLL by default; it needs special stuff for exported functions
 when building PCRE. */
 
+/* Win32 uses DLL by default, but not for R
 #ifdef _WIN32
 #  ifdef PCRE_DEFINITION
 #    ifdef DLL_EXPORT
@@ -71,6 +72,7 @@
 #    endif
 #  endif
 #endif
+*/
 
 /* Otherwise, we use the standard "extern". */
 
diff -u ./pcre_compile.c ../../extra/pcre/pcre_compile.c
--- ./pcre_compile.c	2006-12-19 09:31:35.000000000 +0000
+++ ../../extra/pcre/pcre_compile.c	2006-12-23 07:14:51.000000000 +0000
@@ -5039,6 +5039,8 @@
                 with errorptr and erroroffset set
 */
 
+#include "chartables.h"
+
 PCRE_DATA_SCOPE pcre *
 pcre_compile(const char *pattern, int options, const char **errorptr,
   int *erroroffset, const unsigned char *tables)
diff -u ./pcre_internal.h ../../extra/pcre/pcre_internal.h
--- ./pcre_internal.h	2006-12-19 09:31:35.000000000 +0000
+++ ../../extra/pcre/pcre_internal.h	2006-12-23 07:12:13.000000000 +0000
@@ -69,7 +69,18 @@
 
 /* Get the definitions provided by running "configure" */
 
-#include "config.h"
+#include <config.h>
+#define HAVE_MEMMOVE 1
+#ifndef NEWLINE
+#define NEWLINE '\n'
+#define LINK_SIZE 2
+#define POSIX_MALLOC_THRESHOLD 10
+#define MATCH_LIMIT 10000000
+#define MAX_NAME_SIZE 32
+#define MAX_NAME_COUNT 10000
+#define MAX_DUPLENGTH 30000
+#define MATCH_LIMIT_RECURSION MATCH_LIMIT
+#endif
 
 /* Standard C headers plus the external interface definition. The only time
 setjmp and stdarg are used is when NO_RECURSE is set. */
