Skip to content

Commit

Permalink
trust: Remove generated *.asn.h files from repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Aug 17, 2020
1 parent 015fe11 commit adbb94e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 430 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ x86_64-w64-mingw32
/test-*
frob-*
!frob-*.c
*.asn.h

/x86_64_w64-mingw32/

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ AS_IF([test "$with_libtasn1" != "no"], [
)
AC_SUBST(LIBTASN1_CFLAGS)
AC_SUBST(LIBTASN1_LIBS)
AC_PATH_PROG([ASN1PARSER], [asn1Parser])
with_libtasn1="yes"
AC_DEFINE_UNQUOTED(WITH_ASN1, 1, [Build with libtasn1 and certificate support])
])
Expand Down
25 changes: 17 additions & 8 deletions trust/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ check_LTLIBRARIES += \

libtrust_data_la_SOURCES = \
trust/asn1.c trust/asn1.h \
trust/basic.asn trust/basic.asn.h \
trust/base64.c trust/base64.h \
trust/pem.c trust/pem.h \
trust/pkix.asn trust/pkix.asn.h \
trust/oid.c trust/oid.h \
trust/openssl.asn trust/openssl.asn.h \
trust/utf8.c trust/utf8.h \
trust/x509.c trust/x509.h \
$(asn_h) \
$(NULL)

libtrust_data_la_CFLAGS = \
Expand Down Expand Up @@ -110,9 +108,9 @@ trust_trust_SOURCES = \
trust/extract-pem.c \
trust/extract-cer.c \
trust/list.c trust/list.h \
trust/openssl.asn trust/openssl.asn.h \
trust/save.c trust/save.h \
trust/trust.c \
$(asn_h) \
$(NULL)

externaldir = $(privatedir)
Expand All @@ -127,10 +125,21 @@ EXTRA_DIST += \
trust/p11-kit-trust.module \
trust/meson.build

asn:
asn1Parser -o $(srcdir)/trust/pkix.asn.h $(srcdir)/trust/pkix.asn
asn1Parser -o $(srcdir)/trust/openssl.asn.h $(srcdir)/trust/openssl.asn
asn1Parser -o $(srcdir)/trust/basic.asn.h $(srcdir)/trust/basic.asn
SUFFIXES = .asn .asn.h
.asn.asn.h:
$(AM_V_GEN)$(ASN1PARSER) -o $@ $<

asn_h = \
trust/basic.asn.h \
trust/openssl.asn.h \
trust/pkix.asn.h

BUILT_SOURCES += $(asn_h)

EXTRA_DIST += \
trust/basic.asn \
trust/openssl.asn \
trust/pkix.asn

# Tests ----------------------------------------------------------------

Expand Down
13 changes: 0 additions & 13 deletions trust/basic.asn.h

This file was deleted.

43 changes: 26 additions & 17 deletions trust/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@ libtrust_data_sources = [
'x509.c'
]

asn_sources = [
'basic.asn',
'pkix.asn',
'openssl.asn'
]
basic_asn_h = custom_target('basic.asn.h',
output: 'basic.asn.h',
input: 'basic.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'])

pkix_asn_h = custom_target('pkix.asn.h',
output: 'pkix.asn.h',
input: 'pkix.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'])

openssl_asn_h = custom_target('openssl.asn.h',
output: 'openssl.asn.h',
input: 'openssl.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'])

asn_h_gen = generator(asn1Parser,
output: '@BASENAME@.h',
arguments: ['-o', '@OUTPUT@', '@INPUT@'])
asn_h = asn_h_gen.process(asn_sources)
asn_h_dep = declare_dependency(
sources: [basic_asn_h, pkix_asn_h, openssl_asn_h]
)

libtrust_data = static_library('libtrust-data',
asn_h,
libtrust_data_sources,
include_directories: [configinc, commoninc],
dependencies: libtasn1_deps)
dependencies: [asn_h_dep] + libtasn1_deps)

libtrust_sources = [
'builder.c',
Expand All @@ -49,7 +56,7 @@ shared_module('p11-kit-trust',
'module-init.c',
name_prefix: '',
c_args: p11_kit_trust_c_args,
dependencies: [libp11_library_dep] + libtasn1_deps,
dependencies: [asn_h_dep, libp11_library_dep] + libtasn1_deps,
link_args: p11_module_ldflags,
link_depends: [p11_module_symbol_map,
p11_module_symbol_def],
Expand All @@ -68,7 +75,7 @@ if get_option('test')
libtrust_sources,
include_directories: [configinc, commoninc],
c_args: libtrust_testable_c_args,
dependencies: libtasn1_deps)
dependencies: [asn_h_dep] + libtasn1_deps)
endif

trust_sources = [
Expand All @@ -90,11 +97,11 @@ trust_sources = [
]

executable('trust',
asn_h,
trust_sources,
c_args: common_c_args,
link_with: libtrust_data,
dependencies: [libp11_kit_dep,
dependencies: [asn_h_dep,
libp11_kit_dep,
libp11_tool_dep] + libffi_deps + dlopen_deps + libtasn1_deps,
install: true)

Expand Down Expand Up @@ -136,7 +143,8 @@ if get_option('test')
foreach name : trust_tests
t = executable(name, '@0@.c'.format(name),
c_args: common_c_args + tests_c_args + libtrust_testable_c_args,
dependencies: [libp11_kit_dep,
dependencies: [asn_h_dep,
libp11_kit_dep,
libp11_library_dep,
libp11_test_dep] + dlopen_deps,
link_with: [libtrust_testable, libtrust_data, libtrust_test])
Expand All @@ -158,7 +166,8 @@ if get_option('test')
foreach name : trust_progs
t = executable(name, '@0@.c'.format(name),
c_args: tests_c_args,
dependencies: [libp11_kit_dep,
dependencies: [asn_h_dep,
libp11_kit_dep,
libp11_library_dep,
libp11_test_dep] + libffi_deps + dlopen_deps,
link_with: [libtrust_testable, libtrust_data, libtrust_test])
Expand Down
26 changes: 0 additions & 26 deletions trust/openssl.asn.h

This file was deleted.

0 comments on commit adbb94e

Please sign in to comment.