mirror of
https://git.freebsd.org/ports.git
synced 2025-07-15 00:09:15 -04:00
- Add STAGE support - Use OptionsNG helpers - Rename X11TOOLKIT option to X11 - Add OPTIONS for emacs-nox11 slave - Install info manuals to their own directory to avoid conflicts[1][3][4] - Add a patch from upstream to fix building on non-X11 platforms[2] - Add a patch from upstream to fix building on 9.x and later platforms due to C11 support - Explicitly depend on GCC for i386 platforms, broken due to clang bug# 18171 - Mark port as MAKE_JOBS_SAFE PR: ports/183064[2], ports/181758[3], ports/179843[4] Reported by: Jay Borkenhagen <jayb at braeburn.org>[1]
276 lines
9.5 KiB
Diff
276 lines
9.5 KiB
Diff
|
|
$FreeBSD$
|
|
|
|
Backport of changeset: 113322
|
|
fixes bug: http://debbugs.gnu.org/14812
|
|
committer: Paul Eggert <eggert@cs.ucla.edu>
|
|
branch nick: trunk
|
|
timestamp: Sun 2013-07-07 23:15:38 -0700
|
|
message:
|
|
Try to fix FreeBSD 9.1 porting problem.
|
|
|
|
This incorporates the following merge from gnulib:
|
|
2013-07-07 stdalign, verify: port to FreeBSD 9.1, to C11, and to C++11
|
|
|
|
--- lib/verify.h.orig
|
|
+++ lib/verify.h
|
|
@@ -18,7 +18,7 @@
|
|
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
|
|
|
|
#ifndef _GL_VERIFY_H
|
|
-# define _GL_VERIFY_H
|
|
+#define _GL_VERIFY_H
|
|
|
|
|
|
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
|
|
@@ -31,14 +31,24 @@
|
|
Use this only with GCC. If we were willing to slow 'configure'
|
|
down we could also use it with other compilers, but since this
|
|
affects only the quality of diagnostics, why bother? */
|
|
-# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
|
|
-# define _GL_HAVE__STATIC_ASSERT 1
|
|
-# endif
|
|
+#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
|
|
+ && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
|
|
+ && !defined __cplusplus)
|
|
+# define _GL_HAVE__STATIC_ASSERT 1
|
|
+#endif
|
|
/* The condition (99 < __GNUC__) is temporary, until we know about the
|
|
first G++ release that supports static_assert. */
|
|
-# if (99 < __GNUC__) && defined __cplusplus
|
|
-# define _GL_HAVE_STATIC_ASSERT 1
|
|
-# endif
|
|
+#if (99 < __GNUC__) && defined __cplusplus
|
|
+# define _GL_HAVE_STATIC_ASSERT 1
|
|
+#endif
|
|
+
|
|
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
|
|
+ system headers, defines a conflicting _Static_assert that is no
|
|
+ better than ours; override it. */
|
|
+#ifndef _GL_HAVE_STATIC_ASSERT
|
|
+# include <stddef.h>
|
|
+# undef _Static_assert
|
|
+#endif
|
|
|
|
/* Each of these macros verifies that its argument R is nonzero. To
|
|
be portable, R should be an integer constant expression. Unlike
|
|
@@ -141,50 +151,50 @@
|
|
Use a template type to work around the problem. */
|
|
|
|
/* Concatenate two preprocessor tokens. */
|
|
-# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
|
|
-# define _GL_CONCAT0(x, y) x##y
|
|
+#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
|
|
+#define _GL_CONCAT0(x, y) x##y
|
|
|
|
/* _GL_COUNTER is an integer, preferably one that changes each time we
|
|
use it. Use __COUNTER__ if it works, falling back on __LINE__
|
|
otherwise. __LINE__ isn't perfect, but it's better than a
|
|
constant. */
|
|
-# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
|
|
-# define _GL_COUNTER __COUNTER__
|
|
-# else
|
|
-# define _GL_COUNTER __LINE__
|
|
-# endif
|
|
+#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
|
|
+# define _GL_COUNTER __COUNTER__
|
|
+#else
|
|
+# define _GL_COUNTER __LINE__
|
|
+#endif
|
|
|
|
/* Generate a symbol with the given prefix, making it unique if
|
|
possible. */
|
|
-# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
|
|
+#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
|
|
|
|
/* Verify requirement R at compile-time, as an integer constant expression
|
|
that returns 1. If R is false, fail at compile-time, preferably
|
|
with a diagnostic that includes the string-literal DIAGNOSTIC. */
|
|
|
|
-# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
|
|
- (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
|
|
+#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
|
|
+ (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
|
|
|
|
-# ifdef __cplusplus
|
|
-# if !GNULIB_defined_struct__gl_verify_type
|
|
+#ifdef __cplusplus
|
|
+# if !GNULIB_defined_struct__gl_verify_type
|
|
template <int w>
|
|
struct _gl_verify_type {
|
|
unsigned int _gl_verify_error_if_negative: w;
|
|
};
|
|
-# define GNULIB_defined_struct__gl_verify_type 1
|
|
-# endif
|
|
-# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
- _gl_verify_type<(R) ? 1 : -1>
|
|
-# elif defined _GL_HAVE__STATIC_ASSERT
|
|
-# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
- struct { \
|
|
- _Static_assert (R, DIAGNOSTIC); \
|
|
- int _gl_dummy; \
|
|
- }
|
|
-# else
|
|
-# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
- struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
|
|
+# define GNULIB_defined_struct__gl_verify_type 1
|
|
# endif
|
|
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
+ _gl_verify_type<(R) ? 1 : -1>
|
|
+#elif defined _GL_HAVE__STATIC_ASSERT
|
|
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
+ struct { \
|
|
+ _Static_assert (R, DIAGNOSTIC); \
|
|
+ int _gl_dummy; \
|
|
+ }
|
|
+#else
|
|
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
|
|
+ struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
|
|
+#endif
|
|
|
|
/* Verify requirement R at compile-time, as a declaration without a
|
|
trailing ';'. If R is false, fail at compile-time, preferably
|
|
@@ -193,23 +203,23 @@
|
|
Unfortunately, unlike C11, this implementation must appear as an
|
|
ordinary declaration, and cannot appear inside struct { ... }. */
|
|
|
|
-# ifdef _GL_HAVE__STATIC_ASSERT
|
|
-# define _GL_VERIFY _Static_assert
|
|
-# else
|
|
-# define _GL_VERIFY(R, DIAGNOSTIC) \
|
|
- extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
|
|
- [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
|
|
-# endif
|
|
+#ifdef _GL_HAVE__STATIC_ASSERT
|
|
+# define _GL_VERIFY _Static_assert
|
|
+#else
|
|
+# define _GL_VERIFY(R, DIAGNOSTIC) \
|
|
+ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
|
|
+ [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
|
|
+#endif
|
|
|
|
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
|
|
-# ifdef _GL_STATIC_ASSERT_H
|
|
-# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
|
|
-# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
|
|
-# endif
|
|
-# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
|
|
-# define static_assert _Static_assert /* C11 requires this #define. */
|
|
-# endif
|
|
+#ifdef _GL_STATIC_ASSERT_H
|
|
+# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
|
|
+# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
|
|
+# endif
|
|
+# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
|
|
+# define static_assert _Static_assert /* C11 requires this #define. */
|
|
# endif
|
|
+#endif
|
|
|
|
/* @assert.h omit start@ */
|
|
|
|
@@ -227,18 +237,18 @@
|
|
|
|
verify_true is obsolescent; please use verify_expr instead. */
|
|
|
|
-# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
|
|
+#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
|
|
|
|
/* Verify requirement R at compile-time. Return the value of the
|
|
expression E. */
|
|
|
|
-# define verify_expr(R, E) \
|
|
- (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
|
|
+#define verify_expr(R, E) \
|
|
+ (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
|
|
|
|
/* Verify requirement R at compile-time, as a declaration without a
|
|
trailing ';'. */
|
|
|
|
-# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
|
|
+#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
|
|
|
|
/* @assert.h omit end@ */
|
|
|
|
|
|
--- lib/stdalign.in.h.orig
|
|
+++ lib/stdalign.in.h
|
|
@@ -41,13 +41,28 @@
|
|
are 4 unless the option '-malign-double' is used.
|
|
|
|
The result cannot be used as a value for an 'enum' constant, if you
|
|
- want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
|
|
+ want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
|
|
+
|
|
+ Include <stddef.h> for offsetof. */
|
|
#include <stddef.h>
|
|
-#if defined __cplusplus
|
|
+
|
|
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
|
|
+ standard headers, defines conflicting implementations of _Alignas
|
|
+ and _Alignof that are no better than ours; override them. */
|
|
+#undef _Alignas
|
|
+#undef _Alignof
|
|
+
|
|
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
|
|
+# ifdef __cplusplus
|
|
+# if 201103 <= __cplusplus
|
|
+# define _Alignof(type) alignof (type)
|
|
+# else
|
|
template <class __t> struct __alignof_helper { char __a; __t __b; };
|
|
-# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
|
|
-#else
|
|
-# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
|
|
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
|
|
+# endif
|
|
+# else
|
|
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
|
|
+# endif
|
|
#endif
|
|
#define alignof _Alignof
|
|
#define __alignof_is_defined 1
|
|
@@ -77,12 +92,16 @@
|
|
|
|
*/
|
|
|
|
-#if __GNUC__ || __IBMC__ || __IBMCPP__ || 0x5110 <= __SUNPRO_C
|
|
-# define _Alignas(a) __attribute__ ((__aligned__ (a)))
|
|
-#elif 1300 <= _MSC_VER
|
|
-# define _Alignas(a) __declspec (align (a))
|
|
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
|
|
+# if defined __cplusplus && 201103 <= __cplusplus
|
|
+# define _Alignas(a) alignas (a)
|
|
+# elif __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC || 0x5110 <= __SUNPRO_C
|
|
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
|
|
+# elif 1300 <= _MSC_VER
|
|
+# define _Alignas(a) __declspec (align (a))
|
|
+# endif
|
|
#endif
|
|
-#ifdef _Alignas
|
|
+#if defined _Alignas || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__)
|
|
# define alignas _Alignas
|
|
# define __alignas_is_defined 1
|
|
#endif
|
|
--- m4/stdalign.m4.orig
|
|
+++ m4/stdalign.m4
|
|
@@ -31,7 +31,8 @@
|
|
|
|
/* Test _Alignas only on platforms where gnulib can help. */
|
|
#if \
|
|
- (__GNUC__ || __IBMC__ || __IBMCPP__ \
|
|
+ ((defined __cplusplus && 201103 <= __cplusplus) \
|
|
+ || __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \
|
|
|| 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
|
|
int alignas (8) alignas_int = 1;
|
|
char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1];
|
|
--- ChangeLog.orig
|
|
+++ ChangeLog
|
|
@@ -1,3 +1,9 @@
|
|
+2013-07-08 Paul Eggert <eggert@cs.ucla.edu>
|
|
+
|
|
+ Try to fix FreeBSD 9.1 porting problem (Bug#14812).
|
|
+ This incorporates the following merge from gnulib:
|
|
+ 2013-07-07 stdalign, verify: port to FreeBSD 9.1, to C11, and to C++11
|
|
+
|
|
2013-03-11 Glenn Morris <rgm@gnu.org>
|
|
|
|
* Verson 24.3 released.
|