relocated tagtable.c from lib to rpmdb

This commit is contained in:
Дмитрий Левин 2005-10-15 15:13:29 +00:00
parent adacd53a24
commit 857446207e
2 changed files with 23 additions and 14 deletions

View File

@ -32,23 +32,12 @@ librpm_la_SOURCES = \
header_internal.c manifest.c misc.c package.c \
problems.c poptI.c poptK.c poptQV.c psm.c query.c \
rpmchecksig.c rpminstall.c rpmlead.c rpmlibprov.c rpmrc.c \
signature.c stringbuf.c tagtable.c transaction.c \
signature.c stringbuf.c transaction.c \
verify.c
librpm_la_LDFLAGS = -release @VERSION@
librpm_la_LIBADD = $(top_builddir)/rpmdb/librpmdb.la $(top_builddir)/rpmio/librpmio.la @LIBPOPT@
librpm_la_DEPENDENCIES = $(top_builddir)/rpmdb/librpmdb.la $(top_builddir)/rpmio/librpmio.la
tagtable.c: rpmlib.h
@echo '#include "system.h"' > tagtable.c
@echo '#include "rpmlib.h"' >> tagtable.c
@echo '' >> tagtable.c
@echo 'const struct headerTagTableEntry_s rpmTagTable[] = {' >> tagtable.c
$(AWK) '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ { if ($$2 == "=") { printf("\t{ \"%s\", %s },\n", $$1, $$3); } else { printf("\t{ \"%s\", %s },\n", $$2, $$3); } }' < $(srcdir)/rpmlib.h >> tagtable.c
@echo ' { NULL, 0 }' >> tagtable.c
@echo '};' >> tagtable.c
@echo '' >> tagtable.c
@echo 'const int rpmTagTableSize = sizeof(rpmTagTable) / sizeof(rpmTagTable[0]) - 1;' >> tagtable.c
getdate.c: getdate.y
@echo expect 10 shift/reduce conflicts
$(YACC) $(srcdir)/getdate.y
@ -75,7 +64,7 @@ getdate.c: getdate.y
fi ;\
fi
BUILT_SOURCES = tagtable.c getdate.c
BUILT_SOURCES = getdate.c
.PHONY: sources
sources:

View File

@ -24,11 +24,31 @@ LIBS =
lib_LTLIBRARIES = librpmdb.la
librpmdb_la_SOURCES = $(DBLIBSRCS) \
dbconfig.c header.c fprint.c merge.c poptDB.c rpmhash.c rpmdb.c \
rpmvercmp.c tagname.c
rpmvercmp.c tagname.c tagtbl.c
librpmdb_la_LDFLAGS = -release @VERSION@ @libdb3@
librpmdb_la_LIBADD = $(LIBDB) $(top_builddir)/rpmio/librpmio.la
librpmdb_la_DEPENDENCIES = $(top_builddir)/rpmio/librpmio.la
tagtbl.c: Makefile.am $(top_srcdir)/lib/rpmlib.h
@echo '/*@-bounds@*/' > $@
@echo '#include "system.h"' >> $@
@echo '#include <rpmlib.h>' >> $@
@echo '' >> $@
@echo '/*@observer@*/ /*@unchecked@*/' >> $@
@echo 'static const struct headerTagTableEntry_s rpmTagTbl[] = {' >> $@
${AWK} '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ { tt = "NULL"; if ($$5 == "c") {tt = "CHAR"} if ($$5 == "h") {tt = "INT16"} if ($$5 == "i") {tt = "INT32"} if ($$5 == "l") {tt = "INT64"} if ($$5 == "s") {tt = "STRING"} if ($$5 == "x") {tt = "BIN"} if ($$5 == "s[]") {tt = "STRING_ARRAY"} if ($$5 == "s{}") {tt = "I18NSTRING"} if ($$2 == "=") { printf("\t{ \"%s\", %s RPM_%s_TYPE },\n", $$1, $$3, tt) } else { printf("\t{ \"%s\", %s, RPM_%s_TYPE },\n", $$2, $$3, tt) } }' < $(top_srcdir)/lib/rpmlib.h >> $@
@echo ' { NULL, 0, 0 }' >> $@
@echo '};' >> $@
@echo '' >> $@
@echo '/*@observer@*/ /*@unchecked@*/' >> $@
@echo 'const struct headerTagTableEntry_s * rpmTagTable = rpmTagTbl;' >> $@
@echo '' >> $@
@echo '/*@unchecked@*/' >> $@
@echo 'const int rpmTagTableSize = sizeof(rpmTagTbl) / sizeof(rpmTagTbl[0]) - 1;' >> $@
@echo '/*@=bounds@*/' >> $@
BUILT_SOURCES = tagtbl.c
falloc.lo: falloc.c $(top_srcdir)/system.h $(top_srcdir)/rpmio/rpmio.h falloc.h
$(LIBTOOL) --mode=compile $(COMPILE) -c $<