aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-02-28 05:33:31 -0500
committerThiago de Arruda <tpadilha84@gmail.com>2014-02-28 08:15:27 -0300
commitd2e567a8354573ec96c71eb490e7c991f55ac397 (patch)
tree1daf4d3a6cd72aec1be2d9602592cc7a8a252f49 /config
parent55e00334fb8056e9dbd54513e9052519581808fb (diff)
downloadrneovim-d2e567a8354573ec96c71eb490e7c991f55ac397.tar.gz
rneovim-d2e567a8354573ec96c71eb490e7c991f55ac397.tar.bz2
rneovim-d2e567a8354573ec96c71eb490e7c991f55ac397.zip
Use _NSGetEnviron on Mac OS X to gain access to environ.
When building nvim as a shared library for testing, environ is not exposed. In order to gain access to the environment variables, you must get a pointer to them from _NSGetEnviron(). It appears that this may affect the FreeBSD platform too.
Diffstat (limited to 'config')
-rw-r--r--config/CMakeLists.txt5
-rw-r--r--config/config.h.in2
2 files changed, 7 insertions, 0 deletions
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index 71103738d7..a21d2d75c4 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -1,10 +1,15 @@
include(CheckTypeSize)
+include(CheckIncludeFiles)
+include(CheckSymbolExists)
check_type_size("int" SIZEOF_INT)
check_type_size("long" SIZEOF_LONG)
check_type_size("time_t" SIZEOF_TIME_T)
check_type_size("off_t" SIZEOF_OFF_T)
+check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
+check_symbol_exists(_NSGetEnviron "crt_externs.h" HAVE__NSGETENVIRON)
+
# generate configuration header and update include directories
configure_file (
"${PROJECT_SOURCE_DIR}/config/config.h.in"
diff --git a/config/config.h.in b/config/config.h.in
index 34aa72a52f..762da7e13d 100644
--- a/config/config.h.in
+++ b/config/config.h.in
@@ -12,7 +12,9 @@
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
#define _FILE_OFFSET_BITS 64
+#cmakedefine HAVE__NSGETENVIRON
#define HAVE_BCMP 1
+#cmakedefine HAVE_CRT_EXTERNS_H
#define HAVE_DATE_TIME 1
#define HAVE_DIRENT_H 1
#define HAVE_DLFCN_H 1