--- embedaddon/pcre/Makefile.am	2012/02/21 23:05:51	1.1.1.1
+++ embedaddon/pcre/Makefile.am	2012/10/09 09:19:17	1.1.1.3
@@ -17,6 +17,7 @@ dist_doc_DATA = \
 dist_html_DATA = \
   doc/html/index.html \
   doc/html/pcre.html \
+  doc/html/pcre16.html \
   doc/html/pcre-config.html \
   doc/html/pcre_assign_jit_stack.html \
   doc/html/pcre_compile.html \
@@ -35,12 +36,13 @@ dist_html_DATA = \
   doc/html/pcre_get_stringtable_entries.html \
   doc/html/pcre_get_substring.html \
   doc/html/pcre_get_substring_list.html \
-  doc/html/pcre_info.html \
   doc/html/pcre_jit_stack_alloc.html \
   doc/html/pcre_jit_stack_free.html \
   doc/html/pcre_maketables.html \
+  doc/html/pcre_pattern_to_host_byte_order.html \
   doc/html/pcre_refcount.html \
   doc/html/pcre_study.html \
+  doc/html/pcre_utf16_to_host_byte_order.html \
   doc/html/pcre_version.html \
   doc/html/pcreapi.html \
   doc/html/pcrebuild.html \
@@ -79,7 +81,7 @@ check_SCRIPTS =
 dist_noinst_SCRIPTS =
 
 # Some of the binaries we make are to be installed, and others are
-# (non-user-visible) helper programs needed to build libpcre.
+# (non-user-visible) helper programs needed to build libpcre or libpcre16.
 bin_PROGRAMS =
 noinst_PROGRAMS =
 
@@ -95,6 +97,7 @@ EXTRA_DIST =
 EXTRA_DIST += \
   doc/perltest.txt \
   NON-UNIX-USE \
+  NON-AUTOTOOLS-BUILD \
   HACKING
 
 # These files are used in the preparation of a release
@@ -169,10 +172,15 @@ pcre_chartables.c: $(srcdir)/pcre_chartables.c.dist
 
 endif # WITH_REBUILD_CHARTABLES
 
+BUILT_SOURCES = pcre_chartables.c
 
 ## The main pcre library
+
+# Build the 8 bit library if it is enabled.
+if WITH_PCRE8
 lib_LTLIBRARIES += libpcre.la
 libpcre_la_SOURCES = \
+  pcre_byte_order.c \
   pcre_compile.c \
   pcre_config.c \
   pcre_dfa_exec.c \
@@ -180,16 +188,15 @@ libpcre_la_SOURCES = \
   pcre_fullinfo.c \
   pcre_get.c \
   pcre_globals.c \
-  pcre_info.c \
   pcre_internal.h \
   pcre_jit_compile.c \
   pcre_maketables.c \
   pcre_newline.c \
   pcre_ord2utf8.c \
   pcre_refcount.c \
+  pcre_string_utils.c \
   pcre_study.c \
   pcre_tables.c \
-  pcre_try_flipped.c \
   pcre_ucd.c \
   pcre_valid_utf8.c \
   pcre_version.c \
@@ -200,11 +207,45 @@ libpcre_la_SOURCES = \
 nodist_libpcre_la_SOURCES = \
   pcre_chartables.c
 
-# The pcre_printint.src file is #included by some source files, so it must be
-# distributed. The pcre_chartables.c.dist file is the default version of
-# pcre_chartables.c, used unless --enable-rebuild-chartables is specified.
-EXTRA_DIST += pcre_printint.src pcre_chartables.c.dist
+endif # WITH_PCRE8
 
+# Build the 16 bit library if it is enabled.
+if WITH_PCRE16
+lib_LTLIBRARIES += libpcre16.la
+libpcre16_la_SOURCES = \
+  pcre16_byte_order.c \
+  pcre16_chartables.c \
+  pcre16_compile.c \
+  pcre16_config.c \
+  pcre16_dfa_exec.c \
+  pcre16_exec.c \
+  pcre16_fullinfo.c \
+  pcre16_get.c \
+  pcre16_globals.c \
+  pcre16_jit_compile.c \
+  pcre16_maketables.c \
+  pcre16_newline.c \
+  pcre16_ord2utf16.c \
+  pcre16_refcount.c \
+  pcre16_string_utils.c \
+  pcre16_study.c \
+  pcre16_tables.c \
+  pcre16_ucd.c \
+  pcre16_utf16_utils.c \
+  pcre16_valid_utf16.c \
+  pcre16_version.c \
+  pcre16_xclass.c
+
+## This file is generated as part of the building process, so don't distribute.
+nodist_libpcre16_la_SOURCES = \
+  pcre_chartables.c
+
+endif # WITH_PCRE16
+
+# The pcre_chartables.c.dist file is the default version of pcre_chartables.c,
+# used unless --enable-rebuild-chartables is specified.
+EXTRA_DIST += pcre_chartables.c.dist
+
 # The JIT compiler lives in a separate directory, but its files are #included
 # when pcre_jit_compile.c is processed, so they must be distributed.
 EXTRA_DIST += \
@@ -225,7 +266,12 @@ EXTRA_DIST += \
   sljit/sljitNativeX86_common.c \
   sljit/sljitUtils.c
 
+if WITH_PCRE8
 libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS)
+endif # WITH_PCRE8
+if WITH_PCRE16
+libpcre16_la_LDFLAGS = $(EXTRA_LIBPCRE16_LDFLAGS)
+endif # WITH_PCRE16
 
 CLEANFILES += pcre_chartables.c
 
@@ -234,15 +280,23 @@ if WITH_JIT
 TESTS += pcre_jit_test
 noinst_PROGRAMS += pcre_jit_test
 pcre_jit_test_SOURCES = pcre_jit_test.c
-pcre_jit_test_LDADD = libpcre.la
+pcre_jit_test_LDADD =
+if WITH_PCRE8
+pcre_jit_test_LDADD += libpcre.la
+endif # WITH_PCRE8
+if WITH_PCRE16
+pcre_jit_test_LDADD += libpcre16.la
+endif # WITH_PCRE16
 endif # WITH_JIT
 
 ## A version of the main pcre library that has a posix re API.
+if WITH_PCRE8
 lib_LTLIBRARIES += libpcreposix.la
 libpcreposix_la_SOURCES = \
   pcreposix.c
 libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS)
 libpcreposix_la_LIBADD = libpcre.la
+endif # WITH_PCRE8
 
 ## There's a C++ library as well.
 if WITH_PCRE_CPP
@@ -283,15 +337,28 @@ dist_noinst_SCRIPTS += RunTest
 EXTRA_DIST += RunTest.bat
 bin_PROGRAMS += pcretest
 pcretest_SOURCES = pcretest.c
-pcretest_LDADD = libpcreposix.la $(LIBREADLINE)
+pcretest_LDADD = $(LIBREADLINE)
+if WITH_PCRE8
+pcretest_SOURCES += pcre_printint.c
+pcretest_LDADD += libpcre.la libpcreposix.la
+endif # WITH_PCRE8
+if WITH_PCRE16
+pcretest_SOURCES += pcre16_printint.c
+pcretest_LDADD += libpcre16.la
+endif # WITH_PCRE16
 
+if WITH_PCRE8
 TESTS += RunGrepTest
 dist_noinst_SCRIPTS += RunGrepTest
 bin_PROGRAMS += pcregrep
 pcregrep_SOURCES = pcregrep.c
-pcregrep_LDADD = libpcreposix.la $(LIBZ) $(LIBBZ2)
+pcregrep_LDADD = $(LIBZ) $(LIBBZ2)
+pcregrep_LDADD += libpcre.la libpcreposix.la
+endif # WITH_PCRE8
 
 EXTRA_DIST += \
+  testdata/grepbinary \
+  testdata/grepfilelist \
   testdata/grepinput \
   testdata/grepinput3 \
   testdata/grepinput8 \
@@ -301,6 +368,13 @@ EXTRA_DIST += \
   testdata/grepoutput \
   testdata/grepoutput8 \
   testdata/grepoutputN \
+  testdata/greppatN4 \
+  testdata/saved16 \
+  testdata/saved16BE-1 \
+  testdata/saved16BE-2 \
+  testdata/saved16LE-1 \
+  testdata/saved16LE-2 \
+  testdata/saved8 \
   testdata/testinput1 \
   testdata/testinput2 \
   testdata/testinput3 \
@@ -316,6 +390,13 @@ EXTRA_DIST += \
   testdata/testinput13 \
   testdata/testinput14 \
   testdata/testinput15 \
+  testdata/testinput16 \
+  testdata/testinput17 \
+  testdata/testinput18 \
+  testdata/testinput19 \
+  testdata/testinput20 \
+  testdata/testinput21 \
+  testdata/testinput22 \
   testdata/testoutput1 \
   testdata/testoutput2 \
   testdata/testoutput3 \
@@ -326,11 +407,19 @@ EXTRA_DIST += \
   testdata/testoutput8 \
   testdata/testoutput9 \
   testdata/testoutput10 \
-  testdata/testoutput11 \
+  testdata/testoutput11-16 \
+  testdata/testoutput11-8 \
   testdata/testoutput12 \
   testdata/testoutput13 \
   testdata/testoutput14 \
   testdata/testoutput15 \
+  testdata/testoutput16 \
+  testdata/testoutput17 \
+  testdata/testoutput18 \
+  testdata/testoutput19 \
+  testdata/testoutput20 \
+  testdata/testoutput21 \
+  testdata/testoutput22 \
   testdata/wintestinput3 \
   testdata/wintestoutput3 \
   perltest.pl
@@ -360,13 +449,12 @@ test: check ;
 # A PCRE user submitted the following addition, saying that it "will allow
 # anyone using the 'mingw32' compiler to simply type 'make pcre.dll' and get a
 # nice DLL for Windows use". (It is used by the pcre.dll target.)
-DLL_OBJS= pcre_compile.o pcre_config.o \
+DLL_OBJS= pcre_byte_order.o pcre_compile.o pcre_config.o \
 	pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
-	pcre_globals.o pcre_info.o pcre_jit_compile.o pcre_maketables.o \
+	pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
 	pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
-	pcre_study.o pcre_tables.o pcre_try_flipped.o \
-	pcre_ucd.o pcre_valid_utf8.o pcre_version.o \
-	pcre_chartables.o \
+	pcre_study.o pcre_tables.o pcre_ucd.o \
+	pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
 	pcre_xclass.o
 
 # A PCRE user submitted the following addition, saying that it "will allow
@@ -379,12 +467,16 @@ pcre.dll: $(DLL_OBJS)
 # We have .pc files for pkg-config users.
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libpcre.pc libpcreposix.pc
+if WITH_PCRE16
+pkgconfig_DATA += libpcre16.pc
+endif
 if WITH_PCRE_CPP
 pkgconfig_DATA += libpcrecpp.pc
 endif
 
 dist_man_MANS = \
   doc/pcre.3 \
+  doc/pcre16.3 \
   doc/pcre-config.1 \
   doc/pcre_assign_jit_stack.3 \
   doc/pcre_compile.3 \
@@ -403,12 +495,13 @@ dist_man_MANS = \
   doc/pcre_get_stringtable_entries.3 \
   doc/pcre_get_substring.3 \
   doc/pcre_get_substring_list.3 \
-  doc/pcre_info.3 \
   doc/pcre_jit_stack_alloc.3 \
   doc/pcre_jit_stack_free.3 \
   doc/pcre_maketables.3 \
+  doc/pcre_pattern_to_host_byte_order.3 \
   doc/pcre_refcount.3 \
   doc/pcre_study.3 \
+  doc/pcre_utf16_to_host_byte_order.3 \
   doc/pcre_version.3 \
   doc/pcreapi.3 \
   doc/pcrebuild.3 \
@@ -429,6 +522,34 @@ dist_man_MANS = \
   doc/pcretest.1 \
   doc/pcreunicode.3
 
+# Arrange for the per-function man pages to have 16-bit names as well.
+install-data-hook:
+	ln -sf pcre_assign_jit_stack.3		 $(DESTDIR)$(man3dir)/pcre16_assign_jit_stack.3
+	ln -sf pcre_compile.3			 $(DESTDIR)$(man3dir)/pcre16_compile.3
+	ln -sf pcre_compile2.3			 $(DESTDIR)$(man3dir)/pcre16_compile2.3
+	ln -sf pcre_config.3			 $(DESTDIR)$(man3dir)/pcre16_config.3
+	ln -sf pcre_copy_named_substring.3	 $(DESTDIR)$(man3dir)/pcre16_copy_named_substring.3
+	ln -sf pcre_copy_substring.3		 $(DESTDIR)$(man3dir)/pcre16_copy_substring.3
+	ln -sf pcre_dfa_exec.3			 $(DESTDIR)$(man3dir)/pcre16_dfa_exec.3
+	ln -sf pcre_exec.3			 $(DESTDIR)$(man3dir)/pcre16_exec.3
+	ln -sf pcre_free_study.3		 $(DESTDIR)$(man3dir)/pcre16_free_study.3
+	ln -sf pcre_free_substring.3		 $(DESTDIR)$(man3dir)/pcre16_free_substring.3
+	ln -sf pcre_free_substring_list.3	 $(DESTDIR)$(man3dir)/pcre16_free_substring_list.3
+	ln -sf pcre_fullinfo.3			 $(DESTDIR)$(man3dir)/pcre16_fullinfo.3
+	ln -sf pcre_get_named_substring.3	 $(DESTDIR)$(man3dir)/pcre16_get_named_substring.3
+	ln -sf pcre_get_stringnumber.3		 $(DESTDIR)$(man3dir)/pcre16_get_stringnumber.3
+	ln -sf pcre_get_stringtable_entries.3	 $(DESTDIR)$(man3dir)/pcre16_get_stringtable_entries.3
+	ln -sf pcre_get_substring.3		 $(DESTDIR)$(man3dir)/pcre16_get_substring.3
+	ln -sf pcre_get_substring_list.3	 $(DESTDIR)$(man3dir)/pcre16_get_substring_list.3
+	ln -sf pcre_jit_stack_alloc.3		 $(DESTDIR)$(man3dir)/pcre16_jit_stack_alloc.3
+	ln -sf pcre_jit_stack_free.3		 $(DESTDIR)$(man3dir)/pcre16_jit_stack_free.3
+	ln -sf pcre_maketables.3		 $(DESTDIR)$(man3dir)/pcre16_maketables.3
+	ln -sf pcre_pattern_to_host_byte_order.3 $(DESTDIR)$(man3dir)/pcre16_pattern_to_host_byte_order.3
+	ln -sf pcre_refcount.3			 $(DESTDIR)$(man3dir)/pcre16_refcount.3
+	ln -sf pcre_study.3			 $(DESTDIR)$(man3dir)/pcre16_study.3
+	ln -sf pcre_utf16_to_host_byte_order.3	 $(DESTDIR)$(man3dir)/pcre16_utf16_to_host_byte_order.3
+	ln -sf pcre_version.3			 $(DESTDIR)$(man3dir)/pcre16_version.3
+
 pcrecpp_man = doc/pcrecpp.3
 EXTRA_DIST += $(pcrecpp_man)
 
@@ -442,6 +563,7 @@ EXTRA_DIST += \
   cmake/COPYING-CMAKE-SCRIPTS \
   cmake/FindPackageHandleStandardArgs.cmake \
   cmake/FindReadline.cmake \
+  cmake/FindEditline.cmake \
   CMakeLists.txt \
   config-cmake.h.in