aboutsummaryrefslogtreecommitdiffstats
path: root/src/mkheader.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-06-15 08:32:11 +0000
committerWerner Koch <[email protected]>2015-06-15 08:32:11 +0000
commit13918d05a333255d22aa6718dd467fcb8eaf80c8 (patch)
tree8ae6fb48ee7e93bf12cc92b578abe6b36292fa10 /src/mkheader.c
parentpo: Update Japanese translation. (diff)
downloadlibgpg-error-13918d05a333255d22aa6718dd467fcb8eaf80c8.tar.gz
libgpg-error-13918d05a333255d22aa6718dd467fcb8eaf80c8.zip
Allow building with --disable-threads.
* src/posix-lock-obj.h (LOCK_ABI_NOT_AVAILABLE): New. (LOCK_ABI_VERSION): Define depending on USE_POSIX_THREADS. (_gpgrt_lock_t) [!USE_POSIX_THREADS]: Do not define the union. * src/gen-posix-lock-obj.c: Take care of USE_POSIX_THREADS. * src/posix-lock.c (_gpgrt_lock_init, _gpgrt_lock_lock) (_gpgrt_lock_trylock, _gpgrt_lock_unlock) (_gpgrt_lock_destroy): Return success for a no-threads version. * tests/t-lock.c: Disable tests if threads are not available. * src/mkheader.c (main): Add NO-THREADS to the printed comment. * configure.ac: Show NO-TRHEADS in the final summary. -- Warning: Using --disable-threads creates a different ABI which we can't encode in the the cpu-vendor-os triplet. The run time checks should detect this and abort the process. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/mkheader.c')
-rw-r--r--src/mkheader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mkheader.c b/src/mkheader.c
index 380c7e3..b8fd783 100644
--- a/src/mkheader.c
+++ b/src/mkheader.c
@@ -33,6 +33,7 @@ static int have_stdint_h;
static int have_w32_system;
static int have_w64_system;
static char *replacement_for_off_type;
+static int use_posix_threads;
/* Various state flags. */
static int stdint_h_included;
@@ -148,6 +149,8 @@ parse_config_h (const char *fname)
xfree (replacement_for_off_type);
replacement_for_off_type = xstrdup (p1);
}
+ else if (!strcmp (p1, "USE_POSIX_THREADS"))
+ use_posix_threads = 1;
}
if (ferror (fp))
@@ -597,6 +600,8 @@ main (int argc, char **argv)
printf ("%s", host_triplet);
else
printf ("%s (%s)", host_triplet, host_triplet_raw);
+ if (!use_posix_threads && !have_w32_system && !have_w64_system)
+ fputs (" NO-THREADS", stdout);
fputs (p2, stdout);
}
else if (!write_special (fname, lnr, p1))