hx509: Build libhx509template and hxtool with it

This commit is contained in:
Nicolas Williams
2021-07-12 17:01:06 -05:00
parent df4b09f8af
commit b8112ac562
2 changed files with 21 additions and 11 deletions

View File

@@ -2,8 +2,9 @@ include $(top_srcdir)/Makefile.am.common
AM_CPPFLAGS += $(INCLUDE_openssl_crypto) AM_CPPFLAGS += $(INCLUDE_openssl_crypto)
lib_LTLIBRARIES = libhx509.la lib_LTLIBRARIES = libhx509.la libhx509template.la
libhx509_la_LDFLAGS = -version-info 5:0:0 libhx509_la_LDFLAGS = -version-info 5:0:0
libhx509template_la_LDFLAGS = -version-info 5:0:0
BUILT_SOURCES = \ BUILT_SOURCES = \
sel-gram.h \ sel-gram.h \
@@ -47,9 +48,12 @@ dist_libhx509_la_SOURCES = \
req.c \ req.c \
revoke.c revoke.c
dist_libhx509template_la_SOURCES = $(dist_libhx509_la_SOURCES)
sel-lex.c: sel-gram.h sel-lex.c: sel-gram.h
libhx509_la_DEPENDENCIES = version-script.map libhx509_la_DEPENDENCIES = version-script.map
libhx509template_la_DEPENDENCIES = version-script.map
libhx509_la_LIBADD = \ libhx509_la_LIBADD = \
$(LIB_com_err) \ $(LIB_com_err) \
@@ -61,16 +65,30 @@ libhx509_la_LIBADD = \
$(LIBADD_roken) \ $(LIBADD_roken) \
$(LIB_dlopen) $(LIB_dlopen)
libhx509template_la_LIBADD = \
$(LIB_com_err) \
$(LIB_hcrypto) \
$(LIB_openssl_crypto) \
$(top_builddir)/lib/asn1/libasn1template.la \
$(top_builddir)/lib/wind/libwind.la \
$(top_builddir)/lib/base/libheimbase.la \
$(LIBADD_roken) \
$(LIB_dlopen)
if FRAMEWORK_SECURITY if FRAMEWORK_SECURITY
libhx509_la_LDFLAGS += -framework Security -framework CoreFoundation libhx509_la_LDFLAGS += -framework Security -framework CoreFoundation
libhx509template_la_LDFLAGS += -framework Security -framework CoreFoundation
endif endif
if versionscript if versionscript
libhx509_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map libhx509_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
libhx509template_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
endif endif
$(libhx509_la_OBJECTS): $(srcdir)/version-script.map $(nodist_include_HEADERS) $(priv_headers) $(libhx509_la_OBJECTS): $(srcdir)/version-script.map $(nodist_include_HEADERS) $(priv_headers)
$(libhx509template_la_OBJECTS): $(srcdir)/version-script.map $(nodist_include_HEADERS) $(priv_headers)
nodist_libhx509_la_SOURCES = $(BUILT_SOURCES) nodist_libhx509_la_SOURCES = $(BUILT_SOURCES)
nodist_libhx509template_la_SOURCES = $(BUILT_SOURCES)
dist_include_HEADERS = hx509.h $(srcdir)/hx509-protos.h dist_include_HEADERS = hx509.h $(srcdir)/hx509-protos.h
@@ -86,6 +104,7 @@ HX509_PROTOS = $(srcdir)/hx509-protos.h $(srcdir)/hx509-private.h
$(ALL_OBJECTS): $(HX509_PROTOS) $(ALL_OBJECTS): $(HX509_PROTOS)
$(libhx509_la_OBJECTS): $(srcdir)/hx_locl.h $(libhx509_la_OBJECTS): $(srcdir)/hx_locl.h
$(libhx509template_la_OBJECTS): $(srcdir)/hx_locl.h
$(srcdir)/hx509-protos.h: $(dist_libhx509_la_SOURCES) $(srcdir)/hx509-protos.h: $(dist_libhx509_la_SOURCES)
$(heim_verbose)cd $(srcdir) && perl ../../cf/make-proto.pl -R '^(_|^C)' -E HX509_LIB -q -P comment -o hx509-protos.h $(dist_libhx509_la_SOURCES) || rm -f hx509-protos.h $(heim_verbose)cd $(srcdir) && perl ../../cf/make-proto.pl -R '^(_|^C)' -E HX509_LIB -q -P comment -o hx509-protos.h $(dist_libhx509_la_SOURCES) || rm -f hx509-protos.h
@@ -104,16 +123,12 @@ nodist_hxtool_SOURCES = hxtool-commands.c hxtool-commands.h
$(hxtool_OBJECTS): hxtool-commands.h $(nodist_include_HEADERS) $(hxtool_OBJECTS): hxtool-commands.h $(nodist_include_HEADERS)
hxtool_LDADD = \ hxtool_LDADD = \
libhx509.la \ libhx509template.la \
$(top_builddir)/lib/asn1/libasn1.la \ $(top_builddir)/lib/asn1/libasn1.la \
$(LIB_hcrypto) \ $(LIB_hcrypto) \
$(LIB_roken) \ $(LIB_roken) \
$(top_builddir)/lib/sl/libsl.la $(top_builddir)/lib/sl/libsl.la
if ASN1_TEMPLATING
hxtool_CPPFLAGS = -DASN1_PRINTING_WORKS
endif
CLEANFILES = $(BUILT_SOURCES) sel-gram.c sel-lex.c \ CLEANFILES = $(BUILT_SOURCES) sel-gram.c sel-lex.c \
$(TESTS) \ $(TESTS) \
hxtool-commands.c hxtool-commands.h *.tmp \ hxtool-commands.c hxtool-commands.h *.tmp \

View File

@@ -754,7 +754,6 @@ print_f(hx509_context hxcontext, void *ctx, hx509_cert cert)
static int HX509_LIB_CALL static int HX509_LIB_CALL
print_fjson(hx509_context hxcontext, void *ctx, hx509_cert cert) print_fjson(hx509_context hxcontext, void *ctx, hx509_cert cert)
{ {
#ifdef ASN1_PRINTING_WORKS
const Certificate *c = NULL; const Certificate *c = NULL;
char *json = NULL; char *json = NULL;
@@ -767,10 +766,6 @@ print_fjson(hx509_context hxcontext, void *ctx, hx509_cert cert)
hx509_err(context, 1, errno, "Could not format certificate as JSON"); hx509_err(context, 1, errno, "Could not format certificate as JSON");
free(json); free(json);
return 0; return 0;
#else
err(1, "JSON printing of certificates not supported; try enabling or "
"not disabling ASN.1 templating in Heimdal build configuration");
#endif
} }