Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2015 11:41:05 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r277296 - in stable: 10/lib/libmagic 9/lib/libmagic
Message-ID:  <201501171141.t0HBf5jG099723@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Jan 17 11:41:04 2015
New Revision: 277296
URL: https://svnweb.freebsd.org/changeset/base/277296

Log:
  MFC r277147:
  
  Since the merge of file 5.21 in r276415 and r276416, stable/9 and
  stable/10 cannot be built from FreeBSD 8.x.  This is because the
  build-tools stage requires libmagic, but lib/libmagic/config.h was
  generated on head, and it now enables using the xlocale.h APIs, which
  are not supported on 8.x (and on 9.x before __FreeBSD_version 900506).
  
  See also the start of this thread on -stable:
  https://lists.freebsd.org/pipermail/freebsd-stable/2015-January/081521.html
  
  To fix this, conditionalize the use of xlocale.h APIs to make
  bootstrapping from older FreeBSD versions work correctly.
  
  Reviewed by:	delphij
  Differential Revision: https://reviews.freebsd.org/D1518

Modified:
  stable/10/lib/libmagic/config.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/9/lib/libmagic/config.h
Directory Properties:
  stable/9/lib/libmagic/   (props changed)

Modified: stable/10/lib/libmagic/config.h
==============================================================================
--- stable/10/lib/libmagic/config.h	Sat Jan 17 11:32:09 2015	(r277295)
+++ stable/10/lib/libmagic/config.h	Sat Jan 17 11:41:04 2015	(r277296)
@@ -1,5 +1,13 @@
 /* $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.  */
 
@@ -48,7 +56,9 @@
 #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
@@ -102,7 +112,9 @@
 #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 `pread' function. */
 #define HAVE_PREAD 1
@@ -195,7 +207,9 @@
 #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
@@ -235,7 +249,9 @@
 #define HAVE_WORKING_VFORK 1
 
 /* Define to 1 if you have the <xlocale.h> header file. */
+#ifdef FREEBSD_XLOCALE_SUPPORT
 #define HAVE_XLOCALE_H 1
+#endif
 
 /* Define to 1 if you have the <zlib.h> header file. */
 #define HAVE_ZLIB_H 1



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