summaryrefslogtreecommitdiff
path: root/src/gen-posix-lock-obj.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-01-09 19:14:09 +0100
committerWerner Koch <wk@gnupg.org>2014-01-17 17:54:59 +0100
commitd83b12213231443b93de39863b916ada6232035a (patch)
tree6096c3c710f24185435d130edf9549c96e274efa /src/gen-posix-lock-obj.c
parent4f9b13e99bdfed886dadfd1b70a69af3747ebc98 (diff)
downloadlibgpg-error-d83b12213231443b93de39863b916ada6232035a.tar.gz
Extend the platform dependent build rules.
* src/mkheader.c (mk_include_name): New. (include_file): Implement '&' substitution. (try_include_file): New. (write_special): Use try_include_file and syscfg/. (main): Add a new arg. * configure.ac (CROSS_COMPILING): New am_conditional. (HOST_TRIPLET_STRING): New ac_define. * src/gen-posix-lock-obj.c (main): Print the host triplet. * src/w32-lock-obj-pub.in: Move to ... * src/syscfg/lock-obj-pub.mingw32.h: here. * src/Makefile.am (lock_obj_pub): New. (pre_mkheader_cmds): New. (gpg-error.h): Run pre_mkheader_cmds. (parts_of_gpg_error_h, lock-obj-pub.native.h): Do not use when cross-compiling. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gen-posix-lock-obj.c')
-rw-r--r--src/gen-posix-lock-obj.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
index b641fd0..5dbc6c6 100644
--- a/src/gen-posix-lock-obj.c
+++ b/src/gen-posix-lock-obj.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include <pthread.h>
#include "posix-lock-obj.h"
@@ -65,7 +66,8 @@ main (void)
/* To force a probably suitable alignment of the structure we use a
union and include a long and a pointer to a long. */
- printf ("## File created by " PGM " - DO NOT EDIT\n"
+ printf ("## lock-obj.%s.h\n"
+ "## File created by " PGM " - DO NOT EDIT\n"
"## To be included by mkheader into gpg-error.h\n"
"\n"
"typedef union\n"
@@ -79,6 +81,7 @@ main (void)
"} gpgrt_lock_t;\n"
"\n"
"#define GPGRT_LOCK_INITIALIZER {{{",
+ HOST_TRIPLET_STRING,
SIZEOF_PTHREAD_MUTEX_T);
p = (unsigned char *)&mtx;
for (i=0; i < sizeof mtx; i++)
@@ -90,6 +93,18 @@ main (void)
putchar (',');
}
printf ("},%d}}\n", LOCK_ABI_VERSION);
+ fputs ("##\n"
+ "## Loc" "al Variables:\n"
+ "## mode: c\n"
+ "## buffer-read-only: t\n"
+ "## End:\n"
+ "##\n", stdout);
+
+ if (ferror (stdout))
+ {
+ fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+ return 1;
+ }
return 0;
}