diff --git a/configure.in b/configure.in
index 368fb36..d55290a 100644
--- a/configure.in
+++ b/configure.in
@@ -179,18 +179,6 @@ AC_CHECK_LIB(Xrender, XRenderFindFormat,
 	[AC_SUBST(RENDER_LIBS, "")],
 	[-lXext])
 
-dnl Check for working pcre
-AC_CHECK_HEADER(pcre.h,[], AC_MSG_ERROR([Header files for PCRE were not found]))
-AC_CHECK_LIB(pcre,pcre_compile2,[], AC_MSG_ERROR([The PCRE library is missing or too old]))
-AC_MSG_CHECKING([for UTF-8 support in pcre])
-if (pcretest -C 2>&1) | grep -i "^ *UTF-8 support" >/dev/null; then
-    AC_MSG_RESULT(yes)
-    LIBS="$LIBS -lpcre"
-    EXTRA_LIBS="$EXTRA_LIBS -lpcre"
-else
-    AC_MSG_ERROR([The installed PCRE library is not configured for UTF-8 support.])
-fi
-
 dnl *****************************
 AC_MSG_CHECKING([for Win32 platform])
 with_win32=no
@@ -399,6 +387,13 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <glib/gstdio.h>]], [[(void)g_access("
                [AC_DEFINE(HAVE_G_ACCESS, 1, [Define if g_access is available as macro or function])
                 AC_MSG_RESULT(yes)],
                [AC_MSG_RESULT(no)])
+AC_MSG_CHECKING([for G_REGEX_ERROR_STRAY_BACKSLASH])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <glib/gregex.h>]], [[GRegexError error=G_REGEX_ERROR_STRAY_BACKSLASH;]])],
+               [AC_DEFINE(HAVE_G_REGEX_ERROR_STRA_BACKSLASH, 1, [Define if g_access is available as macro or function])
+	        glib_has_G_REGEX_ERROR_STRA_BACKSLASH=yes
+                AC_MSG_RESULT(yes)],
+               [AC_MSG_RESULT(no)
+	        glib_has_G_REGEX_ERROR_STRA_BACKSLASH=no])
 if test "x$goffice_with_gtk" = "xtrue" ; then
   AC_CHECK_FUNCS(gtk_dialog_get_response_for_widget)
   AC_CHECK_FUNCS(gtk_widget_set_tooltip_text gtk_tool_item_set_tooltip_text,
@@ -411,6 +406,20 @@ if test $gtk_disable_deprecated = yes; then
   CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
 fi
 
+if test "x$glib_has_G_REGEX_ERROR_STRA_BACKSLASH" = "xno"; then
+  dnl Check for working pcre
+  AC_CHECK_HEADER(pcre.h,[], AC_MSG_ERROR([Header files for PCRE were not found]))
+  AC_CHECK_LIB(pcre,pcre_compile2,[], AC_MSG_ERROR([The PCRE library is missing or too old]))
+  AC_MSG_CHECKING([for UTF-8 support in pcre])
+  if (pcretest -C 2>&1) | grep -i "^ *UTF-8 support" >/dev/null; then
+      AC_MSG_RESULT(yes)
+      LIBS="$LIBS -lpcre"
+      EXTRA_LIBS="$EXTRA_LIBS -lpcre"
+  else
+      AC_MSG_ERROR([The installed PCRE library is not configured for UTF-8 support.])
+  fi
+fi
+
 
 AC_DEFUN([GOFFICE_CHECK_FUNC],
 [AC_CHECK_FUNC([$1],
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index e186d14..3dd6bbe 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -52,8 +52,6 @@ IGNORE_HFILES=	\
 		libfoocanvas.h				\
 		foo-canvas-i18n.h			\
 		foo-canvas-marshal.h			\
-		pcre.h					\
-		pcre_internal.h				\
 		ucp.h
 	
 HTML_IMAGES=
diff --git a/goffice/utils/regutf8.c b/goffice/utils/regutf8.c
index 70dbcac..3dcfdd4 100644
--- a/goffice/utils/regutf8.c
+++ b/goffice/utils/regutf8.c
@@ -7,7 +7,9 @@
 
 #include <goffice/goffice-config.h>
 #include "regutf8.h"
+#ifndef HAVE_G_REGEX_ERROR_STRA_BACKSLASH
 #include <pcre.h>
+#endif
 #include "go-glib-extras.h"
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
@@ -18,152 +20,246 @@
 void
 go_regfree (GORegexp *gor)
 {
-  if (gor->ppcre) {
-    pcre_free (gor->ppcre);
-    gor->ppcre = NULL;
-  }
+	if (gor->ppcre) {
+#ifdef HAVE_G_REGEX_ERROR_STRA_BACKSLASH
+		g_regex_unref (gor->ppcre);
+#else
+		pcre_free (gor->ppcre);
+#endif
+		gor->ppcre = NULL;
+	}
 }
 
 size_t
 go_regerror (int errcode, const GORegexp *gor, char *dst, size_t dstsize)
 {
-  const char *err;
-  size_t errlen;
-
-  switch (errcode) {
-  case REG_NOERROR: err = "?"; break;
-  case REG_NOMATCH: err = _("Pattern not found."); break;
-  default:
-  case REG_BADPAT: err = _("Invalid pattern."); break;
-  case REG_ECOLLATE: err = _("Invalid collating element."); break;
-  case REG_ECTYPE: err = _("Invalid character class name."); break;
-  case REG_EESCAPE: err = _("Trailing backslash."); break;
-  case REG_ESUBREG: err = _("Invalid back reference."); break;
-  case REG_EBRACK: err = _("Unmatched left bracket."); break;
-  case REG_EPAREN: err = _("Parenthesis imbalance."); break;
-  case REG_EBRACE: err = _("Unmatched \\{."); break;
-  case REG_BADBR: err = _("Invalid contents of \\{\\}."); break;
-  case REG_ERANGE: err = _("Invalid range end."); break;
-  case REG_ESPACE: err = _("Out of memory."); break;
-  case REG_BADRPT: err = _("Invalid repetition operator."); break;
-  case REG_EEND: err = _("Premature end of pattern."); break;
-  case REG_ESIZE: err = _("Pattern is too big."); break;
-  case REG_ERPAREN: err = _("Unmatched ) or \\)"); break;
-  };
-
-  errlen = strlen (err);
-  if (dstsize > 0) {
-    size_t copylen = MIN (errlen, dstsize - 1);
-    memcpy (dst, err, copylen);
-    dst[copylen] = 0;
-  }
-
-  return errlen;
+	const char *err;
+	size_t errlen;
+
+	switch (errcode) {
+	case REG_NOERROR: err = "?"; break;
+	case REG_NOMATCH: err = _("Pattern not found."); break;
+	default:
+	case REG_BADPAT: err = _("Invalid pattern."); break;
+	case REG_ECOLLATE: err = _("Invalid collating element."); break;
+	case REG_ECTYPE: err = _("Invalid character class name."); break;
+	case REG_EESCAPE: err = _("Trailing backslash."); break;
+	case REG_ESUBREG: err = _("Invalid back reference."); break;
+	case REG_EBRACK: err = _("Unmatched left bracket."); break;
+	case REG_EPAREN: err = _("Parenthesis imbalance."); break;
+	case REG_EBRACE: err = _("Unmatched \\{."); break;
+	case REG_BADBR: err = _("Invalid contents of \\{\\}."); break;
+	case REG_ERANGE: err = _("Invalid range end."); break;
+	case REG_ESPACE: err = _("Out of memory."); break;
+	case REG_BADRPT: err = _("Invalid repetition operator."); break;
+	case REG_EEND: err = _("Premature end of pattern."); break;
+	case REG_ESIZE: err = _("Pattern is too big."); break;
+	case REG_ERPAREN: err = _("Unmatched ) or \\)"); break;
+	};
+
+	errlen = strlen (err);
+	if (dstsize > 0) {
+		size_t copylen = MIN (errlen, dstsize - 1);
+		memcpy (dst, err, copylen);
+		dst[copylen] = 0;
+	}
+
+	return errlen;
 }
 
 int
 go_regcomp (GORegexp *gor, const char *pat , int cflags)
 {
-  const char *errorptr;
-  int errorofs, errorcode;
-  pcre *r;
-  int coptions =
-    PCRE_UTF8 |
-    PCRE_NO_UTF8_CHECK |
-    ((cflags & REG_ICASE) ? PCRE_CASELESS : 0) |
-    ((cflags & REG_NEWLINE) ? PCRE_MULTILINE : 0);
-
-  if (&pcre_compile2 == NULL)
-    g_error ("libgoffice has been dynamically linked against a libpcre\n"
-	     "that lacks the pcre_compile2 function.  This indicates a\n"
-	     "distribution dependency problem.  Please report this at\n"
-	     "bugzilla.gnome.org and for you distribution.");
-
-  gor->ppcre = r = pcre_compile2 (pat, coptions,
-				  &errorcode, &errorptr, &errorofs,
-				  NULL);
-
-  if (r == NULL) {
-    switch (errorcode) {
-    case 1: case 2: case 3: case 37: return REG_EESCAPE;
-    case 4: case 5: return REG_EBRACE;
-    case 6: return REG_EBRACK;
-    case 7: case 30: return REG_ECTYPE;
-    case 8: return REG_ERANGE;
-    case 9: case 10: return REG_BADRPT;
-    case 14: case 18: case 22: return REG_EPAREN;
-    case 15: return REG_ESUBREG;
-    case 19: case 20: return REG_ESIZE;
-    case 21: return REG_ESPACE;
-    default: return REG_BADPAT;
-    }
-  } else {
-    gor->re_nsub = pcre_info (r, NULL, NULL);
-    gor->nosub = (cflags & REG_NOSUB) != 0;
-    return 0;
-  }
+#ifdef HAVE_G_REGEX_ERROR_STRA_BACKSLASH
+	GError *error = NULL;
+	GRegex *r;
+	int coptions =
+		((cflags & REG_ICASE) ? G_REGEX_CASELESS : 0) |
+		((cflags & REG_NEWLINE) ? G_REGEX_MULTILINE : 0);
+
+	gor->ppcre = r = g_regex_new (pat, coptions, 0, &error);
+
+	if (r == NULL) {
+		/* 10, 19, 22 and 37 are not handled by GRegex. */
+		switch (error->code) {
+		case G_REGEX_ERROR_STRAY_BACKSLASH:
+		case G_REGEX_ERROR_MISSING_CONTROL_CHAR:
+		case G_REGEX_ERROR_UNRECOGNIZED_ESCAPE:
+		/* case 37: */
+			return REG_EESCAPE;
+		case G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER:
+		case G_REGEX_ERROR_QUANTIFIER_TOO_BIG:
+			return REG_EBRACE;
+		case G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS:
+			return REG_EBRACK;
+		case G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS:
+		case G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME:
+			return REG_ECTYPE;
+		case G_REGEX_ERROR_RANGE_OUT_OF_ORDER:
+			return REG_ERANGE;
+		case G_REGEX_ERROR_NOTHING_TO_REPEAT:
+		/* case 10: */
+			return REG_BADRPT;
+		case G_REGEX_ERROR_UNMATCHED_PARENTHESIS:
+		case G_REGEX_ERROR_UNTERMINATED_COMMENT:
+		/* case 22: */
+			return REG_EPAREN;
+		case G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE:
+			return REG_ESUBREG;
+		case G_REGEX_ERROR_EXPRESSION_TOO_LARGE:
+		/* case 19: */
+			return REG_ESIZE;
+		case G_REGEX_ERROR_MEMORY_ERROR:
+			return REG_ESPACE;
+		default:
+			return REG_BADPAT;
+		}
+	} else {
+		gor->re_nsub = g_regex_get_capture_count (r);
+		gor->nosub = (cflags & REG_NOSUB) != 0;
+		return 0;
+	}
+#else
+	const char *errorptr;
+	int errorofs, errorcode;
+	pcre *r;
+	int coptions =
+		PCRE_UTF8 |
+		PCRE_NO_UTF8_CHECK |
+		((cflags & REG_ICASE) ? PCRE_CASELESS : 0) |
+		((cflags & REG_NEWLINE) ? PCRE_MULTILINE : 0);
+
+	if (&pcre_compile2 == NULL) {
+		g_error ("libgoffice has been dynamically linked against a libpcre\n"
+				"that lacks the pcre_compile2 function.  This indicates a\n"
+				"distribution dependency problem.  Please report this at\n"
+				"bugzilla.gnome.org and for you distribution.");
+	}
+
+	gor->ppcre = r = pcre_compile2 (pat, coptions,
+			&errorcode, &errorptr, &errorofs,
+			NULL);
+
+	if (r == NULL) {
+		switch (errorcode) {
+		case 1: case 2: case 3: case 37: return REG_EESCAPE;
+		case 4: case 5: return REG_EBRACE;
+		case 6: return REG_EBRACK;
+		case 7: case 30: return REG_ECTYPE;
+		case 8: return REG_ERANGE;
+		case 9: case 10: return REG_BADRPT;
+		case 14: case 18: case 22: return REG_EPAREN;
+		case 15: return REG_ESUBREG;
+		case 19: case 20: return REG_ESIZE;
+		case 21: return REG_ESPACE;
+		default: return REG_BADPAT;
+		}
+	} else {
+		gor->re_nsub = pcre_info (r, NULL, NULL);
+		gor->nosub = (cflags & REG_NOSUB) != 0;
+		return 0;
+	}
+#endif
+	return 0;
 }
 
 int
 go_regexec (const GORegexp *gor, const char *txt,
 	    size_t nmatch, GORegmatch *pmatch, int eflags)
 {
-  size_t txtlen = strlen (txt);
-  int eoptions =
-    ((eflags & REG_NOTBOL) ? PCRE_NOTBOL : 0) |
-    ((eflags & REG_NOTEOL) ? PCRE_NOTEOL : 0);
-  int res;
-  int *offsets, *allocated;
-  int offsetcount;
-
-  /* We need to totally ignore nmatch and pmatch in this case.  */
-  if (gor->nosub)
-    nmatch = 0;
-
-  if (nmatch > 0) {
-    /* Paranoia.  */
-    if (nmatch >= G_MAXINT / sizeof (int) / 3)
-      return REG_ESPACE;
-
-    offsetcount = nmatch * 3;
-    offsets = allocated = g_try_new (int, offsetcount);
-    if (!offsets)
-      return REG_ESPACE;
-  } else {
-    offsets = allocated = NULL;
-    offsetcount = 0;
-  }
-
-  res = pcre_exec (gor->ppcre, NULL, txt, txtlen, 0, eoptions,
-		   offsets, offsetcount);
-  if (res >= 0) {
-    int i;
-
-    if (res == 0) res = nmatch;
-
-    for (i = 0; i < res; i++) {
-      pmatch[i].rm_so = offsets[i * 2];
-      pmatch[i].rm_eo = offsets[i * 2 + 1];
-    }
-    for (; i < (int)nmatch; i++) {
-      pmatch[i].rm_so = -1;
-      pmatch[i].rm_eo = -1;
-    }
-    g_free (allocated);
-    return REG_NOERROR;
-  }
-
-  g_free (allocated);
-  switch (res) {
-  case PCRE_ERROR_NOMATCH:
-    return REG_NOMATCH;
-  case PCRE_ERROR_BADUTF8:
-  case PCRE_ERROR_BADUTF8_OFFSET:
-    /* POSIX doesn't seem to foresee this kind of error.  */
-    return REG_BADPAT;
-  default:
-    return REG_ESPACE;
-  }
+#ifdef HAVE_G_REGEX_ERROR_STRA_BACKSLASH
+	int eoptions =
+		((eflags & REG_NOTBOL) ? G_REGEX_MATCH_NOTBOL : 0) |
+		((eflags & REG_NOTEOL) ? G_REGEX_MATCH_NOTEOL : 0);
+	unsigned int i = 0;
+	gboolean matched;
+	GMatchInfo *match_info;
+
+	/* We need to totally ignore nmatch and pmatch in this case.  */
+	if (gor->nosub)
+		nmatch = 0;
+
+	/* Paranoia.  */
+	if (nmatch >= G_MAXINT / sizeof (int) / 3)
+		return REG_ESPACE;
+
+	matched = g_regex_match (gor->ppcre, txt, eoptions, &match_info);
+	if (!matched)
+		return REG_NOMATCH;
+
+	while (g_match_info_matches (match_info)) {
+		gint start_pos, end_pos;
+
+		g_match_info_fetch_pos (match_info, i,
+					&start_pos, &end_pos);
+		pmatch[i].rm_so = start_pos;
+		pmatch[i].rm_eo = end_pos;
+		g_match_info_next (match_info, NULL);
+		i++;
+	}
+	g_match_info_free (match_info);
+
+	for (; i < nmatch; i++) {
+		pmatch[i].rm_so = -1;
+		pmatch[i].rm_eo = -1;
+	}
+	return REG_NOERROR;
+#else
+	size_t txtlen = strlen (txt);
+	int eoptions =
+		((eflags & REG_NOTBOL) ? PCRE_NOTBOL : 0) |
+		((eflags & REG_NOTEOL) ? PCRE_NOTEOL : 0);
+	int res;
+	int *offsets, *allocated;
+	int offsetcount;
+	if (gor->nosub)
+		nmatch = 0;
+
+	if (nmatch > 0) {
+		/* Paranoia.  */
+		if (nmatch >= G_MAXINT / sizeof (int) / 3)
+			return REG_ESPACE;
+
+		offsetcount = nmatch * 3;
+		offsets = allocated = g_try_new (int, offsetcount);
+		if (!offsets)
+			return REG_ESPACE;
+	} else {
+		offsets = allocated = NULL;
+		offsetcount = 0;
+	}
+
+	res = pcre_exec (gor->ppcre, NULL, txt, txtlen, 0, eoptions,
+			offsets, offsetcount);
+	if (res >= 0) {
+		int i;
+
+		if (res == 0) res = nmatch;
+
+		for (i = 0; i < res; i++) {
+			pmatch[i].rm_so = offsets[i * 2];
+			pmatch[i].rm_eo = offsets[i * 2 + 1];
+		}
+		for (; i < (int)nmatch; i++) {
+			pmatch[i].rm_so = -1;
+			pmatch[i].rm_eo = -1;
+		}
+		g_free (allocated);
+		return REG_NOERROR;
+	}
+
+	g_free (allocated);
+	switch (res) {
+	case PCRE_ERROR_NOMATCH:
+		return REG_NOMATCH;
+	case PCRE_ERROR_BADUTF8:
+	case PCRE_ERROR_BADUTF8_OFFSET:
+		/* POSIX doesn't seem to foresee this kind of error.  */
+		return REG_BADPAT;
+	default:
+		return REG_ESPACE;
+	}
+#endif
 }
 
 /* ------------------------------------------------------------------------- */
diff --git a/tools/import-pcre b/tools/import-pcre
deleted file mode 100755
index cdbed18..0000000
--- a/tools/import-pcre
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/usr/bin/perl -w
-# -----------------------------------------------------------------------------
-
-use strict;
-
-$| = 1;
-
-my $myself = $0;
-$myself =~ s|^.*/||;
-
-die "$0: must run from top-level goffice directory.\n"
-    unless -r "goffice/goffice.h";
-my $dst = "goffice/cut-n-paste/pcre";
-
-my $srcdir = $ARGV[0];
-$srcdir = "../pcre" unless defined $srcdir;
-die "$0: must specify pcre directory on command line.\n"
-    unless -d $srcdir;
-
--d $dst or mkdir $dst or
-    die "$0: cannot mkdir $dst: $!\n";
-
-my $force_utf8 = 1;
-
-my $configfile = "<goffice/goffice-config.h>";
-
-# -----------------------------------------------------------------------------
-
-my ($PCRE_MAJOR,$PCRE_MINOR,$PCRE_DATE);
-{
-    my $filename = "$srcdir/configure.in";
-    local (*SRC);
-    open (SRC, "<$filename") or
-	die "$0: Cannot read $filename: $!\n";
-    while (<SRC>) {
-	$PCRE_MAJOR = $1 if /^PCRE_MAJOR\s*=\s*(.*)$/;
-	$PCRE_MINOR = $1 if /^PCRE_MINOR\s*=\s*(.*)$/;
-	$PCRE_DATE = $1 if /^PCRE_DATE\s*=\s*(.*)$/;
-    }
-    close (*SRC);
-}
-
-# Note: pcre_chartables.c is a generated file.
-my @SRC_C = ('pcre_exec.c', 'pcre_compile.c', 'pcre_tables.c',
-	     'pcre_chartables.c', 'pcre_globals.c', 'pcre_xclass.c',
-	     'pcre_info.c', 'pcre_valid_utf8.c', 'pcre_try_flipped.c',
-	     'pcre_ord2utf8.c');
-my @EXTRA_C = ();
-my @SRC_H = ();
-my @noinst_H = ('pcre.h', 'pcre_internal.h', 'ucp.h');
-my @EXTRA_FILES = ('COPYING');
-
-my %namehack = ('pcre.h' => 'pcre.in');
-
-for my $filename (@SRC_C, @EXTRA_C, @SRC_H, @noinst_H) {
-    my $srcfilename = "$srcdir/" . ($namehack{$filename} || $filename);
-    my $dstfilename = "$dst/$filename";
-    my $tmpfilename = "$dstfilename.new";
-
-    local (*SRC, *DST);
-    open (SRC, "<$srcfilename") or
-	die "$0: Cannot read $srcfilename: $!\n";
-    open (DST, ">$tmpfilename") or
-	die "$0: Cannot create $tmpfilename: $!\n";
-    print STDERR "Creating $dstfilename...";
-
-    my $where;
-    if ($filename =~ /\.h$/) {
-	$where = $filename;
-	$where =~ s/\.h$/.c/;
-    } else {
-	$where = 'below';
-    }
-
-    print DST "/* File import from pcre to goffice by $myself.  Do not edit.  */\n\n";
-    print DST "/* This file has been programatically changed.  */\n";
-
-    my $backchar_fix = 0;
-    my $backchar_indent = '';
-
-    if ($filename =~ /printint/) {
-	print DST "#include $configfile\n";
-    }
-
-    while (<SRC>) {
-	s/\@PCRE_MAJOR\@/$PCRE_MAJOR/;
-	s/\@PCRE_MINOR\@/$PCRE_MINOR/;
-	s/\@PCRE_DATE\@/$PCRE_DATE/;
-
-	s/\b(to(lower|upper)|is(lower|upper|digit|xdigit|space|print|cntrl|alpha|alnum|graph|punct))\b/g_unichar_$1/g;
-
-
-	if (/^\s*\#\s*include\s*"config\.h"/) {
-	    $_ = "#include <goffice/goffice-config.h>\n";
-	}
-
-	s/\bEXPORT\b\s*//;
-
-	print DST;
-    }
-
-    close (*SRC);
-    close (*DST);
-
-    if (1) {
-	system ("indent", "-kr", "-fc1", "-psl", "-pcs", $tmpfilename);
-	unlink "$tmpfilename~";
-    }
-    &update_file ($dstfilename);
-}
-
-foreach my $filename (@EXTRA_FILES) {
-    my $srcfilename = "$srcdir/" . ($namehack{$filename} || $filename);
-    my $dstfilename = "$dst/$filename";
-    my $tmpfilename = "$dstfilename.new";
-
-    local (*SRC, *DST);
-    open (SRC, "<$srcfilename") or
-	die "$0: Cannot read $srcfilename: $!\n";
-    open (DST, ">$tmpfilename") or
-	die "$0: Cannot create $tmpfilename: $!\n";
-    print STDERR "Creating $dstfilename...";
-
-    while (<SRC>) {
-	print DST;
-    }
-
-    close (*SRC);
-    close (*DST);
-    &update_file ($dstfilename);
-}
-
-{
-    my $filename = "Makefile.am";
-    my $dstfilename = "$dst/$filename";
-    my $tmpfilename = "$dstfilename.new";
-
-    local (*DST);
-    open (DST, ">$tmpfilename") or
-	die "$0: Cannot create $tmpfilename: $!\n";
-    print STDERR "Creating $dstfilename...";
-
-    print DST "noinst_LTLIBRARIES = libpcre.la\n";
-    print DST "libpcre_la_SOURCES = ", join (' ', @SRC_C), "\n";
-    print DST "EXTRA_DIST = ", join (' ', @EXTRA_C, @EXTRA_FILES), "\n\n";
-
-    print DST "libpcre_a_ladir = \$(includedir)/libgoffice-@GOFFICE_API_VER@/goffice/cut-n-paste/pcre\n";
-
-    print DST "libpcre_a_la_HEADERS = ", join (' ', @SRC_H), "\n";
-    print DST "noinst_HEADERS = ", join (' ', @noinst_H), "\n\n";
-
-    print DST "AM_CPPFLAGS = \\\n";
-    print DST "\t\$(GOFFICE_CFLAGS) \\\n";
-    print DST "\t-I\$(top_builddir) \\\n";
-    print DST "\t-DSUPPORT_UTF8 \\\n";
-    print DST "\t-DNEWLINE=10 \\\n";
-    print DST "\t-DPOSIX_MALLOC_THRESHOLD=100 \\\n";
-    print DST "\t-DLINK_SIZE=2 \\\n";
-    print DST "\t-DMATCH_LIMIT=10000000\n\n";
-
-    close (*DST);
-
-    &update_file ($dstfilename);
-}
-
-# -----------------------------------------------------------------------------
-
-sub update_file {
-    my ($old) = @_;
-    my ($new) = "$old.new";
-
-    if (!-r $old) {
-	rename $new, $old or
-	    die "$0: Cannot rename $new to $old: $!\n";
-	print STDERR " -- done.\n";
-    } else {
-	system ("cmp '$old' '$new' >/dev/null");
-	if ($? == 0) {
-	    print STDERR " -- unchanged.\n";
-	    unlink $new;
-	} else {
-	    rename $new, $old or
-		die "$0: Cannot rename $new to $old: $!\n";
-	    print STDERR " -- done.\n";
-	}
-    }
-}
-
-# -----------------------------------------------------------------------------
