This fixes issues with linking the tools on OS X if not building
shared libraries.
Currently, if building with --disable-shared on OS X, the build
fails with:
CCLD gnutls-serv
Undefined symbols for architecture x86_64:
"__gnutls_file_mutex", referenced from:
_gnutls_global_deinit in libgnutls.a(gnutls_global.o)
_gnutls_global_init in libgnutls.a(gnutls_global.o)
ld: symbol(s) not found for architecture x86_64
It seems that the linker fails to pull in verify-tofu.o to satisfy
the undefined reference to _gnutls_file_mutex.o in gnutls_global.o
unless gnutls_global.o (or any other object file in the link) also
calls functions that pulls in verify-tofu.o. Since gnutls_global.o
always is linked in, but verify-tofu.o can be left out unless someone
calls the functions in it, defining the mutex in gnutls_global.c makes
sense and simplifies the dependencies.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
/* created by asn1c */
extern const ASN1_ARRAY_TYPE gnutls_asn1_tab[];
extern const ASN1_ARRAY_TYPE pkix_asn1_tab[];
-extern void *_gnutls_file_mutex;
+void *_gnutls_file_mutex;
ASN1_TYPE _gnutls_pkix1_asn;
ASN1_TYPE _gnutls_gnutls_asn;
static int find_config_file(char* file, size_t max_size);
#define MAX_FILENAME 512
-void *_gnutls_file_mutex;
+extern void *_gnutls_file_mutex;
struct gnutls_tdb_int default_tdb = {
store_pubkey,