Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jul 2022 00:34:48 GMT
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: add8a4dc1ce2 - stable/12 - libmagic: Remove support for older FreeBSD where xlocale was not available.
Message-ID:  <202207180034.26I0YmHE086671@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by delphij:

URL: https://cgit.FreeBSD.org/src/commit/?id=add8a4dc1ce27f13bb5cc3811e7a71e79b79779f

commit add8a4dc1ce27f13bb5cc3811e7a71e79b79779f
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2022-01-03 02:05:08 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2022-07-18 00:33:28 +0000

    libmagic: Remove support for older FreeBSD where xlocale was not available.
    
    The MINIMUM_SUPPORTED_OSREL is 1002501 (FreeBSD 10.3), and xlocale is
    supported there.
    
    While I'm there, explicitly use config.h generated with --disable-bzlib
    --disable-xzlib instead of deleting them manually.
    
    (cherry picked from commit 90266521018938b7b9f0003ba9a383b6920859e9)
    
    file: Turns out we need xlocal.h protection
    
    It turns out that we still need xlocal.h protection for when we're
    cross building on Linux. Linux doesn't have this file, but os/x
    does. Before, we'd assume we didn't have it, like old FreeBSD, when
    cross compiling. After the latest update, all that code was removed so
    cross compiling needs to be handled separaetly. Do so by defining
    HAVE_XLOCALE_H only when we're not building on linux. This allows us
    to build the mkmagic build tool needed to build file(1).
    
    Sponsored by:           Netflix
    Reviewed by:            jrtc27
    Differential Revision:  https://reviews.freebsd.org/D33741
    
    (cherry picked from commit f3d7ace4b235422e5ccff0315f2965ac935241d8)
---
 lib/libmagic/config.h | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 382314f12928..35d090dd48b9 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -1,13 +1,3 @@
-/* $FreeBSD$ */
-
-/* Get __FreeBSD_version. */
-#include <osreldate.h>
-
-/* Only specific versions of FreeBSD support xlocale */
-#if __FreeBSD_version >= 1000002 || (__FreeBSD_version < 1000000 && __FreeBSD_version >= 900506)
-#define FREEBSD_XLOCALE_SUPPORT 1
-#endif
-
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
@@ -17,6 +7,9 @@
 /* Define in built-in ELF support is used */
 #define BUILTIN_ELF 1
 
+/* Enable bzlib compression support */
+/* #undef BZLIBSUPPORT */
+
 /* Define for ELF core file support */
 #define ELFCORE 1
 
@@ -26,6 +19,9 @@
 /* Define to 1 if you have the `asprintf' function. */
 #define HAVE_ASPRINTF 1
 
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
 /* Define to 1 if you have the `ctime_r' function. */
 #define HAVE_CTIME_R 1
 
@@ -59,9 +55,7 @@
 #define HAVE_FORK 1
 
 /* Define to 1 if you have the `freelocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
 #define HAVE_FREELOCALE 1
-#endif
 
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #define HAVE_FSEEKO 1
@@ -87,9 +81,15 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
 /* Define to 1 if you have the `gnurx' library (-lgnurx). */
 /* #undef HAVE_LIBGNURX */
 
+/* Define to 1 if you have the `lzma' library (-llzma). */
+/* #undef HAVE_LIBLZMA */
+
 /* Define to 1 if you have the `seccomp' library (-lseccomp). */
 /* #undef HAVE_LIBSECCOMP */
 
@@ -99,6 +99,9 @@
 /* Define to 1 if you have the `localtime_r' function. */
 #define HAVE_LOCALTIME_R 1
 
+/* Define to 1 if you have the <lzma.h> header file. */
+/* #undef HAVE_LZMA_H */
+
 /* Define to 1 if mbrtowc and mbstate_t are properly declared. */
 #define HAVE_MBRTOWC 1
 
@@ -121,9 +124,7 @@
 #define HAVE_MMAP 1
 
 /* Define to 1 if you have the `newlocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
 #define HAVE_NEWLOCALE 1
-#endif
 
 /* Define to 1 if you have the `pipe2' function. */
 #define HAVE_PIPE2 1
@@ -213,9 +214,7 @@
 #define HAVE_UNISTD_H 1
 
 /* Define to 1 if you have the `uselocale' function. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
 #define HAVE_USELOCALE 1
-#endif
 
 /* Define to 1 if you have the `utime' function. */
 #define HAVE_UTIME 1
@@ -255,7 +254,7 @@
 #define HAVE_WORKING_VFORK 1
 
 /* Define to 1 if you have the <xlocale.h> header file. */
-#ifdef FREEBSD_XLOCALE_SUPPORT
+#ifndef __linux__ /* Cross building tools build with glibc on linux */
 #define HAVE_XLOCALE_H 1
 #endif
 
@@ -337,6 +336,9 @@
 # endif
 #endif
 
+/* Enable xzlib compression support */
+/* #undef XZLIBSUPPORT */
+
 /* Enable zlib compression support */
 #define ZLIBSUPPORT 1
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207180034.26I0YmHE086671>