llvm.org GIT mirror llvm / 78e2074
Adds some platform checks to cmake/config-ix.cmake and fixes checking for dlopen/dlerror. Patch by arrowdodger! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124590 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 8 years ago
2 changed file(s) with 36 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
8888 check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE)
8989 check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT)
9090 check_function_exists(isatty HAVE_ISATTY)
91 check_symbol_exists(index strings.h HAVE_INDEX)
9192 check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH)
9293 check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H)
9394 check_symbol_exists(finite ieeefp.h HAVE_FINITE_IN_IEEEFP_H)
9697 check_symbol_exists(ceilf math.h HAVE_CEILF)
9798 check_symbol_exists(floorf math.h HAVE_FLOORF)
9899 check_symbol_exists(fmodf math.h HAVE_FMODF)
100 if( HAVE_SETJMP_H )
101 check_symbol_exists(longjmp setjmp.h HAVE_LONGJMP)
102 check_symbol_exists(setjmp setjmp.h HAVE_SETJMP)
103 check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
104 check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
105 endif()
99106 check_symbol_exists(nearbyintf math.h HAVE_NEARBYINTF)
100107 check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
101108 check_symbol_exists(malloc_zone_statistics malloc/malloc.h
105112 check_symbol_exists(mktemp "stdlib.h;unistd.h" HAVE_MKTEMP)
106113 check_symbol_exists(closedir "sys/types.h;dirent.h" HAVE_CLOSEDIR)
107114 check_symbol_exists(opendir "sys/types.h;dirent.h" HAVE_OPENDIR)
115 check_symbol_exists(readdir "sys/types.h;dirent.h" HAVE_READDIR)
108116 check_symbol_exists(getcwd unistd.h HAVE_GETCWD)
109117 check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
110118 check_symbol_exists(getrlimit "sys/types.h;sys/time.h;sys/resource.h" HAVE_GETRLIMIT)
119 check_symbol_exists(rindex strings.h HAVE_RINDEX)
111120 check_symbol_exists(strchr string.h HAVE_STRCHR)
112121 check_symbol_exists(strcmp string.h HAVE_STRCMP)
113122 check_symbol_exists(strdup string.h HAVE_STRDUP)
116125 check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
117126 endif()
118127 check_symbol_exists(sbrk unistd.h HAVE_SBRK)
128 check_symbol_exists(srand48 stdlib.h HAVE_RAND48_SRAND48)
129 if( HAVE_RAND48_SRAND48 )
130 check_symbol_exists(lrand48 stdlib.h HAVE_RAND48_LRAND48)
131 if( HAVE_RAND48_LRAND48 )
132 check_symbol_exists(drand48 stdlib.h HAVE_RAND48_DRAND48)
133 if( HAVE_RAND48_DRAND48 )
134 set(HAVE_RAND48 1 CACHE INTERNAL "are srand48/lrand48/drand48 available?")
135 endif()
136 endif()
137 endif()
119138 check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
139 check_symbol_exists(strtoq stdlib.h HAVE_STRTOQ)
120140 check_symbol_exists(strerror string.h HAVE_STRERROR)
121141 check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
122142 check_symbol_exists(strerror_s string.h HAVE_STRERROR_S)
133153 check_symbol_exists(argz_next argz.h HAVE_ARGZ_NEXT)
134154 check_symbol_exists(argz_stringify argz.h HAVE_ARGZ_STRINGIFY)
135155 endif()
136 if( HAVE_DLFCN_H AND HAVE_LIBDL )
137 list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
156 if( HAVE_DLFCN_H )
157 if( HAVE_LIBDL )
158 list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
159 endif()
138160 check_symbol_exists(dlerror dlfcn.h HAVE_DLERROR)
139161 check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
140 list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
162 if( HAVE_LIBDL )
163 list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
164 endif()
141165 endif()
142166
143167 check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
168168 #cmakedefine HAVE_GV ${HAVE_GV}
169169
170170 /* Define to 1 if you have the `index' function. */
171 #undef HAVE_INDEX
171 #cmakedefine HAVE_INDEX ${HAVE_INDEX}
172172
173173 /* Define to 1 if the system has the type `int64_t'. */
174174 #cmakedefine HAVE_INT64_T ${HAVE_INT64_T}
223223 #undef HAVE_LINK_R
224224
225225 /* Define to 1 if you have the `longjmp' function. */
226 #undef HAVE_LONGJMP
226 #cmakedefine HAVE_LONGJMP ${HAVE_LONGJMP}
227227
228228 /* Define to 1 if you have the header file. */
229229 #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
308308 #cmakedefine HAVE_PTHREAD_RWLOCK_INIT ${HAVE_PTHREAD_RWLOCK_INIT}
309309
310310 /* Define to 1 if srand48/lrand48/drand48 exist in */
311 #undef HAVE_RAND48
311 #cmakedefine HAVE_RAND48 ${HAVE_RAND48}
312312
313313 /* Define to 1 if you have the `readdir' function. */
314 #undef HAVE_READDIR
314 #cmakedefine HAVE_READDIR ${HAVE_READDIR}
315315
316316 /* Define to 1 if you have the `realpath' function. */
317317 #undef HAVE_REALPATH
318318
319319 /* Define to 1 if you have the `rindex' function. */
320 #undef HAVE_RINDEX
320 #cmakedefine HAVE_RINDEX ${HAVE_RINDEX}
321321
322322 /* Define to 1 if you have the `rintf' function. */
323323 #undef HAVE_RINTF
335335 #cmakedefine HAVE_SETENV ${HAVE_SETENV}
336336
337337 /* Define to 1 if you have the `setjmp' function. */
338 #undef HAVE_SETJMP
338 #cmakedefine HAVE_SETJMP ${HAVE_SETJMP}
339339
340340 /* Define to 1 if you have the header file. */
341341 #cmakedefine HAVE_SETJMP_H ${HAVE_SETJMP_H}
347347 #undef HAVE_SHL_LOAD
348348
349349 /* Define to 1 if you have the `siglongjmp' function. */
350 #undef HAVE_SIGLONGJMP
350 #cmakedefine HAVE_SIGLONGJMP ${HAVE_SIGLONGJMP}
351351
352352 /* Define to 1 if you have the header file. */
353353 #cmakedefine HAVE_SIGNAL_H ${HAVE_SIGNAL_H}
354354
355355 /* Define to 1 if you have the `sigsetjmp' function. */
356 #undef HAVE_SIGSETJMP
356 #cmakedefine HAVE_SIGSETJMP ${HAVE_SIGSETJMP}
357357
358358 /* Define to 1 if you have the header file. */
359359 #cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
404404 #cmakedefine HAVE_STRTOLL ${HAVE_STRTOLL}
405405
406406 /* Define to 1 if you have the `strtoq' function. */
407 #undef HAVE_STRTOQ
407 #cmakedefine HAVE_STRTOQ ${HAVE_STRTOQ}
408408
409409 /* Define to 1 if you have the `sysconf' function. */
410410 #undef HAVE_SYSCONF