This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8591

-- gerrit

commit 41f02b8c4ac2a59082440e7342a5827e34e99bdb
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sun Nov 17 21:35:45 2024 +0100

    configure: make more robust the check for elf 64
    
    The check if 'elf.h' defines the type 'Elf64_Ehdr' is currently
    done through 'grep' on the file. While there is no false positive,
    so far, such test could incorrectly find the text inside a comment
    or in a block guarded by #if/#endif.
    
    Use the autoconf macro AC_CHECK_TYPE() to detect if the type is
    properly declared.
    
    Change-Id: Ibb74db3d90ac6d1589b9dc1e5a7ae59e47945e78
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/configure.ac b/configure.ac
index 291e854a42..4c03208736 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,9 +52,10 @@ AC_SEARCH_LIBS([openpty], [util])
 
 AC_CHECK_HEADERS([sys/socket.h])
 AC_CHECK_HEADERS([elf.h])
-AC_EGREP_HEADER(Elf64_Ehdr, [elf.h], [
-  AC_DEFINE([HAVE_ELF64], [1], [Define to 1 if the system has the type 
`Elf64_Ehdr'.])
-])
+
+AC_CHECK_TYPE([Elf64_Ehdr], [have_elf64=1], [have_elf64=0], [[#include 
<elf.h>]])
+AC_DEFINE_UNQUOTED([HAVE_ELF64], $have_elf64, [Define to 1 if the system has 
the type 'Elf64_Ehdr'.])
+
 AC_CHECK_HEADERS([fcntl.h])
 AC_CHECK_HEADERS([malloc.h])
 AC_CHECK_HEADERS([netdb.h])

-- 

Reply via email to