From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BE87F158094 for ; Tue, 12 Jul 2022 06:33:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8B885E104C; Tue, 12 Jul 2022 06:33:31 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 61B4FE104A for ; Tue, 12 Jul 2022 06:33:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 48549340F7F for ; Tue, 12 Jul 2022 06:33:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 92C0952B for ; Tue, 12 Jul 2022 06:33:28 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1657607600.7b95b1831d71396150c5cb10d4edf899e135d068.sam@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: tests/source/, / X-VCS-Repository: proj/pax-utils X-VCS-Files: porting.h tests/source/dotest X-VCS-Directories: tests/source/ / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7b95b1831d71396150c5cb10d4edf899e135d068 X-VCS-Branch: master Date: Tue, 12 Jul 2022 06:33:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b70c47da-69f5-4d52-baae-f07e9debd69d X-Archives-Hash: 9f9a7beeb2f80fc65f3eee9be74d636e commit: 7b95b1831d71396150c5cb10d4edf899e135d068 Author: Arsen Arsenović aarsen me> AuthorDate: Fri Jun 24 14:03:46 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jul 12 06:33:20 2022 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=7b95b183 Probe the target system for needed headers This prevents new or unconventional systems requiring upstream changes, though, this is not perfect, as it doesn't address some of the other defines related to OSes the preprocessor does (namely, wrt the ldso cache handling). I didn't touch these yet as I took a more conservative approach of (probably) not changing what happens at runtime. Signed-off-by: Arsen Arsenović aarsen.me> Signed-off-by: Sam James gentoo.org> porting.h | 25 +++++++++++-------------- tests/source/dotest | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/porting.h b/porting.h index 8e5542d..0d43a92 100644 --- a/porting.h +++ b/porting.h @@ -11,9 +11,7 @@ #ifndef _PORTING_H #define _PORTING_H -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "probes.h" #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr)) @@ -41,36 +39,36 @@ #include #include #include "elf.h" -#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) +#if HAS_ALLOCA_H # include #endif -#if defined(__linux__) +#if HAS_SYS_PRCTL_H # include -# if !defined(HAVE_CONFIG_H) || defined(HAVE_LINUX_SECCOMP_H) +# if HAS_LINUX_SECCOMP_H # include # endif -# if !defined(HAVE_CONFIG_H) || defined(HAVE_LINUX_SECUREBITS_H) +# if HAS_LINUX_SECUREBITS_H # include # endif #endif -#if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__ANDROID__) +#if HAS_ENDIAN_H && HAS_BYTESWAP_H # include # include -#elif defined(__FreeBSD__) +#elif HAS_SYS_ENDIAN_H # include -#elif defined(__sun__) +#elif HAS_ISA_DEFS_H # include -#elif defined(__MACH__) +#elif HAS_MACHINE_ENDIAN_H # include #endif -#if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__NetBSD__) +#ifdef HAS_GLOB_H # include #endif #if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__NetBSD__) # define __PAX_UTILS_DEFAULT_LD_CACHE_CONFIG "/etc/ld.so.conf" -#elif defined(__FreeBSD__) || defined(__DragonFly__) +#elif HAS_ELF_HINTS_H # include # define __PAX_UTILS_DEFAULT_LD_CACHE_CONFIG _PATH_ELF_HINTS #else @@ -168,7 +166,6 @@ # define __PAX_UTILS_PATH_MAX PATH_MAX #endif -/* fall back case for non-Linux hosts ... so lame */ #if !defined(ELF_DATA) # if defined(BYTE_ORDER) # if BYTE_ORDER == LITTLE_ENDIAN diff --git a/tests/source/dotest b/tests/source/dotest index c97e8cb..cc278a5 100755 --- a/tests/source/dotest +++ b/tests/source/dotest @@ -5,7 +5,7 @@ findfiles() { find "${top_srcdir}" \ '(' -type d -a '(' -name .git -o -name autotools ')' -prune ')' \ - -o '(' '(' -name '*.[ch]' -a ! -name 'config.h' ')' -print0 ')' + -o '(' '(' -name '*.[ch]' -a ! -name 'probes.h' ')' -print0 ')' } #