6 if [ "x$PCRE" = x
-o "x$PCRE" = x--help
-o "x$PCRE" = x-h
]; then
11 Updates the local PCRE copy with a different version of the library,
12 contained in the directory PCRE-DIR.
14 This will delete the content of the local pcre directory, copy the
15 necessary files from PCRE-DIR, and generate other needed files, such
21 if [ ! -f gregex.h
]; then
22 echo "This script should be executed from the directory containing gregex.c." 2> /dev
/null
26 if [ ! -f $PCRE/Makefile.
in -o ! -f $PCRE/pcre_compile.c
]; then
27 echo "'$PCRE' does not contain a valid PCRE version." 2> /dev
/null
32 echo "Deleting old PCRE library"
33 mv pcre
/.svn tmp-pcre-svn
34 rm -R pcre
2> /dev
/null
38 # pcre_chartables.c is generated by dfatables.
39 # We do not want to compile and execute dfatables.c every time, because
40 # this could be a problem (e.g. when cross-compiling), so now generate
41 # the file and then distribuite it with GRegex.
42 echo "Generating pcre_chartables.c"
45 .
/configure
--enable-utf8 --enable-unicode-properties --disable-cpp > /dev
/null
46 make pcre_chartables.c
> /dev
/null
47 cat > ..
/pcre_chartables.c
<< \EOF
48 /* This
file is autogenerated by ..
/update-pcre
/update.sh during
49 * the update of the
local copy of PCRE.
52 cat pcre_chartables.c
>> ..
/pcre_chartables.c
57 echo "Generating makefiles"
58 all_files
=`awk '/^OBJ = /, /^\\s*$/ \
61 sub(".@OBJEXT@[[:blank:]]*\\\\\\\\", ""); \
62 sub("\\\\$\\\\(POSIX_OBJ\\\\)", ""); \
68 included_files
="pcre.h pcre_internal.h ucp.h ucpinternal.h"
70 # Generate Makefile.am.
71 cat $IN/Makefile.am-1
> Makefile.am
72 for name
in $all_files; do
73 echo " $name.c \\" >> Makefile.am
74 if [ $name != pcre_chartables
]; then
75 # pcre_chartables.c is a generated file.
79 for f
in $included_files; do
80 echo " $f \\" >> Makefile.am
83 cat $IN/Makefile.am-2
>> Makefile.am
90 # Use glib for memory allocation.
91 patch > /dev
/null
< $IN/memory.
patch
93 # Copy the modified version of pcre_valid_utf8.c.
94 cp $IN/pcre_valid_utf8.c .
96 # Copy the modified version of pcre_ucp_searchfuncs.c that uses glib
97 # for Unicode properties.
98 cp $IN/pcre_ucp_searchfuncs.c .
99 patch > /dev
/null
< $IN/ucp.
patch
101 # Remove the digitab array in pcre_compile.c.
102 patch > /dev
/null
< $IN/digitab.
patch
103 sed -i -e 's/(digitab\[\(.*\)\] & ctype_digit)/g_ascii_isdigit(\1)/' pcre_compile.c
104 sed -i -e 's/(digitab\[\(.*\)\] & ctype_xdigit)/g_ascii_isxdigit(\1)/' pcre_compile.c
106 # Reduce the number of relocations.
107 python
$IN/make_utt.py
108 patch > /dev
/null
< $IN/utt.
patch
109 patch > /dev
/null
< $IN/table-reduction.
patch
111 # Copy back the old SVN directory.
112 mv ..
/tmp-pcre-svn .svn
117 Update completed. You now should check that everything is working.
118 Remember to update the regex syntax doc with the new features
119 (docs/reference/glib/regex-syntax.sgml) and to run the tests.