From d83b12213231443b93de39863b916ada6232035a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 9 Jan 2014 19:14:09 +0100 Subject: 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 --- src/gen-posix-lock-obj.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/gen-posix-lock-obj.c') 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 #include +#include #include #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; } -- cgit v1.2.3