aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-04-03 04:27:36 -0400
committerJohn Szakmeister <john@szakmeister.net>2014-04-03 04:32:27 -0400
commita3ec68ce1e85c165741ccdee1e0fec16a34838c6 (patch)
tree21a286c63c6b9f9bec45eb0873b286b9144ffc62
parent0895bf88282155f12ee464de16fed01b7c159fab (diff)
downloadrneovim-a3ec68ce1e85c165741ccdee1e0fec16a34838c6.tar.gz
rneovim-a3ec68ce1e85c165741ccdee1e0fec16a34838c6.tar.bz2
rneovim-a3ec68ce1e85c165741ccdee1e0fec16a34838c6.zip
Use check_symbol_exists() instead of check_function_exists().
This is mostly a revert of 477031c03b2c525b117fae8a9b61c98245a06908. Now that we are not setting `CMAKE_C_FLAGS`, the check can work correctly and it helps `pcc` (portable c compiler) make it further along--though it still doesn't produce usable results (see #427 for the details).
-rw-r--r--config/CMakeLists.txt10
-rw-r--r--src/os/env.c2
2 files changed, 3 insertions, 9 deletions
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index 77edd62882..b233418bda 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -1,18 +1,12 @@
include(CheckTypeSize)
-include(CheckIncludeFiles)
-include(CheckFunctionExists)
+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)
-
-if (HAVE_CRT_EXTERNS_H)
- set(CMAKE_REQUIRED_INCLUDES crt_externs.h)
-endif()
-check_function_exists(_NSGetEnviron HAVE__NSGETENVIRON)
+check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
# generate configuration header and update include directories
configure_file (
diff --git a/src/os/env.c b/src/os/env.c
index cf08a33f96..9415b19573 100644
--- a/src/os/env.c
+++ b/src/os/env.c
@@ -5,7 +5,7 @@
#include "os/os.h"
#include "misc2.h"
-#ifdef HAVE_CRT_EXTERNS_H
+#ifdef HAVE__NSGETENVIRON
#include <crt_externs.h>
#endif