This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=d27795961ad51245935f782222df0876790ef50a

commit d27795961ad51245935f782222df0876790ef50a
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Feb 28 23:46:16 2023 +0100

    build: Check for the host architecture attributes during configure
    
    Check part of what constitutes the ABI of the host architecture, and
    print it during configure, so that there's a ready reference on what
    the port looks like.
---
 configure.ac    | 20 +++++++++++++++++++-
 m4/dpkg-arch.m4 | 37 +++++++++++++++++++++++++++++++++++--
 2 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index dca34003a..6864405fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,7 @@ AS_IF([test "x$build_dselect" = "xyes"], [
 ])
 
 # Checks for typedefs, structures, and compiler characteristics.
-AC_C_BIGENDIAN
+DPKG_ARCH_ABI
 AC_C_CONST
 AC_C_INLINE
 AC_C_VOLATILE
@@ -254,6 +254,24 @@ AC_OUTPUT
 cat <<CONFIG
 
 Configuration:
+  Arch attributes:
+    cpu name  . . . . . . . . . . : ${cpu_type}
+    os name . . . . . . . . . . . : ${os_type}
+    arch name . . . . . . . . . . : ${dpkg_arch}
+    arch bits . . . . . . . . . . : ${dpkg_arch_bits}
+    arch endian . . . . . . . . . : ${dpkg_arch_endian}
+    char bits . . . . . . . . . . : ${dpkg_char_bits}
+    char sign . . . . . . . . . . : ${dpkg_char_sign}
+    sizeof(short) . . . . . . . . : ${ac_cv_sizeof_short}
+    sizeof(int) . . . . . . . . . : ${ac_cv_sizeof_int}
+    sizeof(long)  . . . . . . . . : ${ac_cv_sizeof_long}
+    sizeof(long long) . . . . . . : ${ac_cv_sizeof_long_long}
+    sizeof(float) . . . . . . . . : ${ac_cv_sizeof_float}
+    sizeof(double)  . . . . . . . : ${ac_cv_sizeof_double}
+    sizeof(long double) . . . . . : ${ac_cv_sizeof_long_double}
+    sizeof(void *)  . . . . . . . : ${ac_cv_sizeof_void_p}
+    alignof(max_align_t)  . . . . : ${ac_cv_alignof_max_align_t}
+
   Features:
     native language support . . . : $USE_NLS
     unicode support . . . . . . . : $USE_UNICODE
diff --git a/m4/dpkg-arch.m4 b/m4/dpkg-arch.m4
index 87ffd0d56..5540eedb7 100644
--- a/m4/dpkg-arch.m4
+++ b/m4/dpkg-arch.m4
@@ -1,6 +1,6 @@
-# serial 1
+# serial 2
 # Copyright © 2005 Scott James Remnant <[email protected]>
-# Copyright © 2006-2009 Guillem Jover <[email protected]>
+# Copyright © 2006-2023 Guillem Jover <[email protected]>
 
 # _DPKG_ARCHITECTURE([DEB_VAR], [sh_var])
 # ---------------------------------------
@@ -65,3 +65,36 @@ AC_DEFUN([DPKG_ARCHITECTURE], [
   AC_DEFINE_UNQUOTED([ARCHITECTURE], ["${dpkg_arch}"],
     [Set this to the canonical dpkg architecture name.])
 ])# DPKG_ARCHITECTURE
+
+# DPKG_ARCH_ABI
+# -------------
+# Determine parts of the Debian architecture ABI for the host system,
+# so that it can be printed during configure.
+AC_DEFUN([DPKG_ARCH_ABI], [
+  AC_CHECK_SIZEOF([short])
+  AC_CHECK_SIZEOF([int])
+  AC_CHECK_SIZEOF([long])
+  AC_CHECK_SIZEOF([long long])
+  AC_CHECK_SIZEOF([float])
+  AC_CHECK_SIZEOF([double])
+  AC_CHECK_SIZEOF([long double])
+  AC_CHECK_SIZEOF([void *])
+
+  AC_CHECK_ALIGNOF([max_align_t])
+
+  AC_C_CHAR_UNSIGNED
+  AS_IF([test "$ac_cv_c_char_unsigned" = yes],
+    [dpkg_char_sign=unsigned],
+    [dpkg_char_sign=signed]
+  )
+
+  AC_C_BIGENDIAN
+  AS_CASE([$ac_cv_c_bigendian],
+    [yes], [dpkg_arch_endian=big],
+    [no], [dpkg_arch_endian=little],
+    [dpkg_arch_endian=$ac_cv_c_bigendian]
+  )
+
+  AC_COMPUTE_INT([dpkg_char_bits], [CHAR_BIT], [#include <limits.h>])
+  dpkg_arch_bits=$((ac_cv_sizeof_void_p * dpkg_char_bits))
+])# DPKG_ARCH_ABI

-- 
Dpkg.Org's dpkg

Reply via email to