1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Move CRC tables to libpgport, and provide them in a separate include file.

This makes it much more convenient to build tools for Postgres that are
separately compiled and require a matching CRC implementation.

To prevent multiple copies of the CRC polynomial tables being introduced
into the postgres binaries, they are now included in the static library
libpgport that is mainly meant for replacement system functions.  That
seems like a bit of a kludge, but there's no better place.

This cleans up building of the tools pg_controldata and pg_resetxlog,
which previously had to build their own copies of pg_crc.o.

In the future, external programs that need access to the CRC tables can
include the tables directly from the new header file pg_crc_tables.h.

Daniel Farina, reviewed by Abhijit Menon-Sen and Tom Lane
This commit is contained in:
Tom Lane
2012-02-28 19:53:39 -05:00
parent 0140a11b9b
commit 5c02a00d44
9 changed files with 41 additions and 28 deletions

View File

@ -261,8 +261,8 @@ sub AddDir
$mf =~ s{OBJS[^=]*=\s*(.*)$}{}m;
}
# Match rules that pull in source files from different directories
# example: pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
# Match rules that pull in source files from different directories, eg
# pgstrcasecmp.c rint.c snprintf.c: % : $(top_srcdir)/src/port/%
my $replace_re = qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$}m;
while ($mf =~ m{$replace_re}m)
{