summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-05-14 01:01:44 -0400
committerMike Frysinger <vapier@gentoo.org>2016-05-14 01:01:44 -0400
commitb083ec17ad9cba4ad9fe7fac1c6a168d90dd1a31 (patch)
tree5d0763127783736704740c6f3b0371f754580256 /cmake
parent2db153a93e22c9cd53022e131915c1000259eb52 (diff)
downloadlibgd-b083ec17ad9cba4ad9fe7fac1c6a168d90dd1a31.tar.gz
cmake: update build files to match autotools more
Clean up redundant header logic and focus on what we actually care about: whether specific headers exist. Update the program list to omit programs when required libs are not found.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/AC_HEADER_STDC.cmake48
1 files changed, 10 insertions, 38 deletions
diff --git a/cmake/modules/AC_HEADER_STDC.cmake b/cmake/modules/AC_HEADER_STDC.cmake
index cf4fff8..9f054a3 100644
--- a/cmake/modules/AC_HEADER_STDC.cmake
+++ b/cmake/modules/AC_HEADER_STDC.cmake
@@ -1,42 +1,14 @@
-message(STATUS "Checking whether system has ANSI C header files")
-include(CheckPrototypeExists)
-
-include(CheckPrototypeExists)
-check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist)
-if(StandardHeadersExist)
- check_prototype_exists(memchr string.h memchrExists)
- if(memchrExists)
-
- check_prototype_exists(free stdlib.h freeExists)
- if(freeExists)
- message(STATUS "ANSI C header files - found")
- set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files")
- set(HAVE_STRINGS_H 1)
- set(HAVE_STRING_H 1)
- set(HAVE_FLOAT_H 1)
- set(HAVE_STDLIB_H 1)
- set(HAVE_STDDEF_H 1)
- set(HAVE_STDINT_H 1)
- set(HAVE_INTTYPES_H 1)
- set(HAVE_DLFCN_H 1)
- endif(freeExists)
- endif(memchrExists)
-endif(StandardHeadersExist)
-
-if(NOT STDC_HEADERS)
- message(STATUS "ANSI C header files - not found")
- set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files")
-endif(NOT STDC_HEADERS)
-
-
+check_include_files(dirent.h HAVE_DIRENT_H)
+check_include_files(errno.h HAVE_ERRNO_H)
+check_include_files(inttypes.h HAVE_INTTYPES_H)
+check_include_files(stddef.h HAVE_STDDEF_H)
+check_include_files(stdint.h HAVE_STDINT_H)
+check_include_files(stdlib.h HAVE_STDLIB_H)
+check_include_files(string.h HAVE_STRING_H)
+check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(unistd.h HAVE_UNISTD_H)
-include(CheckDIRSymbolExists)
-check_dirsymbol_exists("sys/stat.h;sys/types.h;dirent.h" HAVE_DIRENT_H)
-if (HAVE_DIRENT_H)
- set(HAVE_SYS_STAT_H 1)
- set(HAVE_SYS_TYPES_H 1)
-endif (HAVE_DIRENT_H)
+check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+check_include_files(sys/types.h HAVE_SYS_TYPES_H)
-check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist)
set(HAVE_LIBM 1)