From 7285a27a7985c10f6778c67b31dd501e6594cb44 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 15 Oct 2014 11:18:42 +0200 Subject: Fix to help building native on Windows. * configure.ac (FORCE_USE_SYSCFG): New am_conditional. * src/Makefile.am: Use new conditional to decide whether to build the native lock object header. -- This should help to build using msys2 and mingw. GnuPG-bug-id: 1717 Signed-off-by: Werner Koch --- configure.ac | 7 +++++++ src/Makefile.am | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4652a2b..b55051d 100644 --- a/configure.ac +++ b/configure.ac @@ -452,6 +452,7 @@ AC_SUBST(GPG_ERROR_CONFIG_HOST) # # Special defines for certain platforms # +force_use_syscfg=no if test "$have_w32_system" = yes; then AC_DEFINE(HAVE_W32_SYSTEM,1,[Defined if we run on a W32 API based system]) if test "$have_w64_system" = yes; then @@ -461,11 +462,17 @@ if test "$have_w32_system" = yes; then AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE]) GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra" fi + force_use_syscfg=yes fi +if test x$cross_compiling = xyes; then + force_use_syscfg=yes +fi + AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes) AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes) AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) +AM_CONDITIONAL(FORCE_USE_SYSCFG, test x$force_use_syscfg = xyes) AC_DEFINE_UNQUOTED(HOST_TRIPLET_STRING, "$host", [The host triplet]) diff --git a/src/Makefile.am b/src/Makefile.am index 65f8513..efc5970 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -262,9 +262,9 @@ parts_of_gpg_error_h = \ w32ce-add.h \ $(lock_obj_pub) -# If we are cross-compiling we better make sure that no stale native -# lock include file will be found by mkheader. -if CROSS_COMPILING +# If we are cross-compiling or building on Windows we better make sure +# that no stale native lock include file will be found by mkheader. +if FORCE_USE_SYSCFG pre_mkheader_cmds = -rm lock-obj-pub.native.h 2>/dev/null else pre_mkheader_cmds = : -- cgit v1.2.3