summaryrefslogtreecommitdiff
path: root/maint
diff options
context:
space:
mode:
Diffstat (limited to 'maint')
-rwxr-xr-xmaint/MultiStage2.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/maint/MultiStage2.py b/maint/MultiStage2.py
index f1a8e15..2e20039 100755
--- a/maint/MultiStage2.py
+++ b/maint/MultiStage2.py
@@ -26,6 +26,7 @@
# Adjusted global table names by prefixing _pcre_.
# Commented out stuff relating to the casefolding table, which isn't used.
# Corrected size calculation
+# Add #ifndef SUPPORT_UCP to use dummy tables when no UCP support is needed.
#
# The tables generated by this script are used by macros defined in
# pcre_internal.h. They look up Unicode character properties using short
@@ -276,11 +277,28 @@ for block_size in [2 ** i for i in range(5,10)]:
print "#ifdef HAVE_CONFIG_H"
print "#include \"config.h\""
print "#endif"
+print
print "#include \"pcre_internal.h\""
print
print "/* Unicode character database. */"
print "/* This file was autogenerated by the MultiStage2.py script. */"
print "/* Total size: %d bytes, block size: %d. */" % (min_size, min_block_size)
+print
+print "/* The tables herein are needed only when UCP support is built */"
+print "/* into PCRE. This module should not be referenced otherwise, so */"
+print "/* it should not matter whether it is compiled or not. However */"
+print "/* a comment was received about space saving - maybe the guy linked */"
+print "/* all the modules rather than using a library - so we include a */"
+print "/* condition to cut out the tables when not needed. But don't leave */"
+print "/* a totally empty module because some compilers barf at that. */"
+print "/* Instead, just supply small dummy tables. */"
+print
+print "#ifndef SUPPORT_UCP"
+print "const ucd_record _pcre_ucd_records[] = {{0,0,0 }};"
+print "const uschar _pcre_ucd_stage1[] = {0};"
+print "const pcre_uint16 _pcre_ucd_stage2[] = {0};"
+print "#else"
+print
print record_struct
print_records(records, record_size)
print_table(min_stage1, '_pcre_ucd_stage1')
@@ -288,6 +306,7 @@ print_table(min_stage2, '_pcre_ucd_stage2', min_block_size)
print "#if UCD_BLOCK_SIZE != %d" % min_block_size
print "#error Please correct UCD_BLOCK_SIZE in pcre_internal.h"
print "#endif"
+print "#endif /* SUPPORT_UCP */"
"""