Commit 60d26958 by Paolo Bonzini Committed by Paolo Bonzini

extensions.m4: New.

config:
2008-03-27  Paolo Bonzini  <bonzini@gnu.org>

	* extensions.m4: New.

gcc:
2008-03-27  Paolo Bonzini  <bonzini@gnu.org>

	* configure.ac: Replace custom __GNU_SOURCE test with
	AC_USE_SYSTEM_EXTENSIONS.  Move it earlier.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r133635
parent 639223bd
2008-03-27 Paolo Bonzini <bonzini@gnu.org>
* extensions.m4: New.
2008-03-27 Paolo Bonzini <bonzini@gnu.org>
* mh-armpic: Remove.
* mh-i370pic: Remove.
* mh-m68kpic: Remove.
......
# serial 5 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
# Autoconf. Perhaps we can remove this once we can assume Autoconf
# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
# AC_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
# cause problems on some platforms (such as __EXTENSIONS__).
AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
[Define to 1 if you need to in order for `stat' and other
things to work.])
AC_DEFINE([_POSIX_1_SOURCE], [2],
[Define to 2 if the system does not provide POSIX.1 features
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
fi
AH_VERBATIM([__EXTENSIONS__],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
])
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
# define __EXTENSIONS__ 1
AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
])# AC_USE_SYSTEM_EXTENSIONS
2008-03-27 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Replace custom __GNU_SOURCE test with
AC_USE_SYSTEM_EXTENSIONS. Move it earlier.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
2008-03-27 Richard Guenther <rguenther@suse.de>
* fold-const.c (target.h): Include.
......
......@@ -95,6 +95,7 @@ fi
m4_include([../config/acx.m4])
m4_include([../config/codeset.m4])
m4_include([../config/depstand.m4])
m4_include([../config/extensions.m4])
m4_include([../config/gettext-sister.m4])
m4_include([../config/iconv.m4])
m4_include([../config/lcmessage.m4])
......
......@@ -1369,37 +1369,37 @@
#endif
/* The size of `int', as computed by sizeof. */
/* The size of a `int', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_INT
#endif
/* The size of `long', as computed by sizeof. */
/* The size of a `long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_LONG
#endif
/* The size of `long long', as computed by sizeof. */
/* The size of a `long long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_LONG_LONG
#endif
/* The size of `short', as computed by sizeof. */
/* The size of a `short', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_SHORT
#endif
/* The size of `void *', as computed by sizeof. */
/* The size of a `void *', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_VOID_P
#endif
/* The size of `__int64', as computed by sizeof. */
/* The size of a `__int64', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF___INT64
#endif
......@@ -1464,9 +1464,44 @@
#endif
/* Always define this when using the GNU C Library */
/* Define to 1 if on MINIX. */
#ifndef USED_FOR_TARGET
#undef _GNU_SOURCE
#undef _MINIX
#endif
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#ifndef USED_FOR_TARGET
#undef _POSIX_1_SOURCE
#endif
/* Define to 1 if you need to in order for `stat' and other things to work. */
#ifndef USED_FOR_TARGET
#undef _POSIX_SOURCE
#endif
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
......
......@@ -297,6 +297,7 @@ AC_SUBST(CFLAGS)
# Check C compiler features
# -------------------------
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CPP
AC_C_INLINE
......@@ -896,20 +897,6 @@ fi
# Checks for C headers
# --------------------
AC_MSG_CHECKING(for GNU C library)
AC_CACHE_VAL(gcc_cv_glibc,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <features.h>]], [[
#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
#error Not a GNU C library system
#endif]])],
[gcc_cv_glibc=yes],
[gcc_cv_glibc=no])])
AC_MSG_RESULT($gcc_cv_glibc)
if test $gcc_cv_glibc = yes; then
AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
fi
# Need to reject headers which give warnings, so that the -Werror bootstrap
# works later. *sigh* This needs to come before all header checks.
AC_PROG_CPP_WERROR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment