view src/mingw-libgcrypt-1-fixes.patch @ 5893:53a6c7df43f8

Mesa 3D: Update to version 21.1.8. * src/mesa.mk: Update version and checksum. * src/mesa-2-uninitialized.patch: Remove file. * dist-files.mk: Remove file from list.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 16 Sep 2021 22:37:45 +0200
parents aa9f810ee050
children e229031d9f6d
line wrap: on
line source

This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Thu, 4 Dec 2014 15:07:43 +1100
Subject: [PATCH 1/3] fix for mingw cross building

Taken from:
https://aur.archlinux.org/packages/mingw-w64-libgcrypt/

diff --git a/acinclude.m4 b/acinclude.m4
index 1111111..2222222 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -102,7 +102,9 @@ AC_DEFUN([GNUPG_SYS_SYMBOL_UNDERSCORE],
 [tmp_do_check="no"
 case "${host}" in
     i?86-mingw32* | i?86-*-mingw32*)
-        ac_cv_sys_symbol_underscore=yes
+        if test "x$ac_cv_sys_symbol_underscore" = x ; then
+           ac_cv_sys_symbol_underscore=yes
+        fi
         ;;
     x86_64-*-mingw32*)
         ac_cv_sys_symbol_underscore=no
diff --git a/mpi/generic/mpi-asm-defs.h b/mpi/generic/mpi-asm-defs.h
index 1111111..2222222 100644
--- a/mpi/generic/mpi-asm-defs.h
+++ b/mpi/generic/mpi-asm-defs.h
@@ -4,5 +4,9 @@
 #if __GNUC__ >= 3 && defined(__x86_64__) && defined(__ILP32__)
 #define BYTES_PER_MPI_LIMB 8
 #else
+#ifdef _WIN64
+#define BYTES_PER_MPI_LIMB  (SIZEOF_UNSIGNED_LONG_LONG)
+#else
 #define BYTES_PER_MPI_LIMB  (SIZEOF_UNSIGNED_LONG)
 #endif
+#endif
diff --git a/src/libgcrypt.def b/src/libgcrypt.def
index 1111111..2222222 100644
--- a/src/libgcrypt.def
+++ b/src/libgcrypt.def
@@ -1,3 +1,4 @@
+EXPORTS
 ;; libgcrypt.defs -  Exported symbols for W32
 ;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 ;;
@@ -22,7 +23,6 @@
 ;; never be changed.  Also check libgcrypt.vers and visibility.h.
 
 
-EXPORTS
       gcry_check_version  @1
       gcry_control  @2
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Sun, 28 Jun 2015 17:17:25 +0200
Subject: [PATCH 3/3] configure.ac: no serial-tests if automake < 1.12

Earlier versions of automake complain if they get a configuration
parameter which they don't understand.  The error is:

configure.ac:27: error: option 'serial-tests' not recognized

Use some m4 hackery to work around this.

Fix libgcrypt build under x86_64
See https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html

diff --git a/configure.ac b/configure.ac
index 1111111..2222222 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,24 @@ VERSION=$PACKAGE_VERSION
 
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([src/libgcrypt.vers])
-AM_INIT_AUTOMAKE([serial-tests dist-bzip2])
+
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace ...'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version |
+                head -1 |
+                awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { '\
+                    'print "serial-tests" }}'
+    ])
+])
+dnl NB: Do not [quote] this parameter.
+AM_INIT_AUTOMAKE(serial_tests dist-bzip2)
+
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_LIBOBJ_DIR([compat])