Skip to content

Commit ba7ed40

Browse files
committed
configure, meson: convert libtasn1 detection to meson
Make it depend on gnutls too, since it is only used as part of gnutls tests. Reviewed-by: Richard Henderson <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 5761251 commit ba7ed40

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

configure

-19
Original file line numberDiff line numberDiff line change
@@ -2799,20 +2799,6 @@ EOF
27992799
fi
28002800
fi
28012801

2802-
##########################################
2803-
# libtasn1 - only for the TLS creds/session test suite
2804-
2805-
tasn1=yes
2806-
tasn1_cflags=""
2807-
tasn1_libs=""
2808-
if $pkg_config --exists "libtasn1"; then
2809-
tasn1_cflags=$($pkg_config --cflags libtasn1)
2810-
tasn1_libs=$($pkg_config --libs libtasn1)
2811-
else
2812-
tasn1=no
2813-
fi
2814-
2815-
28162802
##########################################
28172803
# PAM probe
28182804

@@ -5554,9 +5540,6 @@ if test "$gdbus_codegen" != "" ; then
55545540
echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
55555541
fi
55565542
echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
5557-
if test "$tasn1" = "yes" ; then
5558-
echo "CONFIG_TASN1=y" >> $config_host_mak
5559-
fi
55605543
if test "$auth_pam" = "yes" ; then
55615544
echo "CONFIG_AUTH_PAM=y" >> $config_host_mak
55625545
fi
@@ -6017,8 +6000,6 @@ echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
60176000
echo "EXESUF=$EXESUF" >> $config_host_mak
60186001
echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak
60196002
echo "LIBS_QGA=$libs_qga" >> $config_host_mak
6020-
echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak
6021-
echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak
60226003
if test "$gcov" = "yes" ; then
60236004
echo "CONFIG_GCOV=y" >> $config_host_mak
60246005
fi

meson.build

+5-4
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,10 @@ if 'CONFIG_LIBDAXCTL' in config_host
985985
libdaxctl = declare_dependency(link_args: config_host['LIBDAXCTL_LIBS'].split())
986986
endif
987987
tasn1 = not_found
988-
if 'CONFIG_TASN1' in config_host
989-
tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(),
990-
link_args: config_host['TASN1_LIBS'].split())
988+
if gnutls.found()
989+
tasn1 = dependency('libtasn1',
990+
method: 'pkg-config',
991+
kwargs: static_kwargs)
991992
endif
992993
keyutils = dependency('libkeyutils', required: false,
993994
method: 'pkg-config', kwargs: static_kwargs)
@@ -2727,7 +2728,7 @@ summary_info += {'pixman': pixman.found()}
27272728
summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
27282729
# TODO: add back version
27292730
summary_info += {'slirp support': slirp_opt == 'disabled' ? false : slirp_opt}
2730-
summary_info += {'libtasn1': config_host.has_key('CONFIG_TASN1')}
2731+
summary_info += {'libtasn1': tasn1.found()}
27312732
summary_info += {'PAM': config_host.has_key('CONFIG_AUTH_PAM')}
27322733
summary_info += {'iconv support': iconv.found()}
27332734
summary_info += {'curses support': curses.found()}

tests/unit/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if have_block
8484
'test-crypto-block': [io],
8585
}
8686
if gnutls.found() and \
87-
'CONFIG_TASN1' in config_host and \
87+
tasn1.found() and \
8888
'CONFIG_POSIX' in config_host
8989
tests += {
9090
'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c',

0 commit comments

Comments
 (0)