[commit: ghc] master: Use Autoconf's AC_USE_SYSTEM_EXTENSIONS (7af29da)

git at git.haskell.org git at git.haskell.org
Fri Dec 4 09:12:06 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7af29da05d2e5a5e311a5f73f20d0f232035973b/ghc

>---------------------------------------------------------------

commit 7af29da05d2e5a5e311a5f73f20d0f232035973b
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Dec 4 09:15:29 2015 +0100

    Use Autoconf's AC_USE_SYSTEM_EXTENSIONS
    
    This takes care of setting feature test macros (i.e. let Autoconf decide when
    those can be set safely) to allow subsequent Autoconf tests to better detect
    available OS features.
    
    This also includes a submodule update of unix which enables the use of
    `AC_USE_SYSTEM_EXTENSIONS` in there as well.
    
    Specifically, this takes care of setting `_GNU_SOURCE` (which allows to remove
    two occurences where it's set manually) and `_ALL_SOURCE` (which fixes issues
    on AIX).
    
    See also
    
      https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Posix-Variants.html
    
    for details.
    
    At some point we may want to reconsider the purpose of "rts/PosixSource.h" and
    rely more on Autoconf instead.


>---------------------------------------------------------------

7af29da05d2e5a5e311a5f73f20d0f232035973b
 configure.ac                | 3 +++
 libraries/base/configure.ac | 5 +++++
 libraries/unix              | 2 +-
 rts/Linker.c                | 7 -------
 rts/posix/OSThreads.c       | 6 ------
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3889cea..57d877a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,9 @@ dnl  #define SIZEOF_CHAR 0
 dnl recently.
 AC_PREREQ([2.60])
 
+dnl make extensions visible to allow feature-tests to detect them lateron
+AC_USE_SYSTEM_EXTENSIONS
+
 # -------------------------------------------------------------------------
 # Prepare to generate the following header files
 #
diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
index 85b2f2e..99474a6 100644
--- a/libraries/base/configure.ac
+++ b/libraries/base/configure.ac
@@ -3,6 +3,11 @@ AC_INIT([Haskell base package], [1.0], [libraries at haskell.org], [base])
 # Safety check: Ensure that we are in the correct source directory.
 AC_CONFIG_SRCDIR([include/HsBase.h])
 
+AC_PREREQ([2.60])
+
+dnl make extensions visible to allow feature-tests to detect them lateron
+AC_USE_SYSTEM_EXTENSIONS
+
 AC_CONFIG_HEADERS([include/HsBaseConfig.h include/EventConfig.h])
 
 AC_CANONICAL_BUILD
diff --git a/libraries/unix b/libraries/unix
index 137fa1b..5740003 160000
--- a/libraries/unix
+++ b/libraries/unix
@@ -1 +1 @@
-Subproject commit 137fa1b06a79a9baa0d5fcf2ec11f964c3423f6a
+Subproject commit 5740003e06f0c585460501514f3352f5e105c98c
diff --git a/rts/Linker.c b/rts/Linker.c
index 51142c5..f728f0e 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -10,13 +10,6 @@
 #include "PosixSource.h"
 #endif
 
-/* Linux needs _GNU_SOURCE to get RTLD_DEFAULT from <dlfcn.h> and
-   MREMAP_MAYMOVE from <sys/mman.h>.
- */
-#if defined(__linux__)  || defined(__GLIBC__)
-#define _GNU_SOURCE 1
-#endif
-
 #include "Rts.h"
 #include "HsFFI.h"
 
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 8c1beda..91f9523 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -7,12 +7,6 @@
  *
  * --------------------------------------------------------------------------*/
 
-#if defined(__linux__) || defined(__GLIBC__)
-/* We want GNU extensions in DEBUG mode for mutex error checking */
-/* We also want the affinity API, which requires _GNU_SOURCE */
-#define _GNU_SOURCE
-#endif
-
 #include "PosixSource.h"
 
 #if defined(freebsd_HOST_OS)



More information about the ghc-commits mailing list