tests: Build using GPG_ERROR_MT_LIBS for thread use.

* tests/gpg/Makefile.am (WITH_THREAD_CPPFLAGS): New.
(WITH_THREAD_LDADD): New.
(t_thread1_CPPFLAGS, t_thread_keylist_CPPFLAGS)
(t_thread_keylist_verify_CPPFLAGS)
(t_cancel_CPPFLAGS): Use WITH_THREAD_CPPFLAGS.
(t_thread1_LDADD, t_thread_keylist_LDADD)
(t_thread_keylist_verify_LDADD)
(t_cancel_LDADD): Use WITH_THREAD_LDADD.

--

For library dependency at runtime, it's not 100% right to use
GPG_ERROR_MT_LIBS here, because those test programs don't use
libgpg-error directly at runtime.  But, it's OK, because these are
test programs, which don't need specifying minimum library dependency.

It would be too much for configure of gpgme, to check how threaded
application should be built, just for these test programs.

Co-authored-by: Ben Kibbey <bjk@luxsci.net>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2021-11-12 10:22:21 +09:00
parent 8cd2fe7b3d
commit 1cedac2bba

View File

@ -68,10 +68,18 @@ BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \
AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@
AM_LDFLAGS = -no-install
LDADD = ../../src/libgpgme.la @LDADD_FOR_TESTS_KLUDGE@
t_thread1_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
t_thread_keylist_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
t_thread_keylist_verify_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
t_cancel_LDADD = ../../src/libgpgme.la -lpthread @LDADD_FOR_TESTS_KLUDGE@
WITH_THREAD_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_MT_CFLAGS@
WITH_THREAD_LDADD = ../../src/libgpgme.la \
@GPG_ERROR_MT_LIBS@ @LDADD_FOR_TESTS_KLUDGE@
t_thread1_CPPFLAGS = $(WITH_THREAD_CPPFLAGS)
t_thread1_LDADD = $(WITH_THREAD_LDADD)
t_thread_keylist_CPPFLAGS = $(WITH_THREAD_CPPFLAGS)
t_thread_keylist_LDADD = $(WITH_THREAD_LDADD)
t_thread_keylist_verify_CPPFLAGS = $(WITH_THREAD_CPPFLAGS)
t_thread_keylist_verify_LDADD = $(WITH_THREAD_LDADD)
t_cancel_CPPFLAGS = $(WITH_THREAD_CPPFLAGS)
t_cancel_LDADD = $(WITH_THREAD_LDADD)
# We don't run t-genkey and t-cancel in the test suite, because it
# takes too long