llvm.org GIT mirror llvm / 484fc8e
Provide support for detecting if the Win32 imaghlp and psapi libraries are available. These libraries are used in lib/System and should be included on the link line or if not available generate an error when building lib/System. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28628 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 14 years ago
3 changed file(s) with 318 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
485485 dnl libelf is for sparc only; we can ignore it if we don't have it
486486 AC_CHECK_LIB(elf, elf_begin)
487487 AC_CHECK_LIB(m,sin)
488 if test "$llvm_cv_os_type" == "MingW" ; then
489 AC_CHECK_HEADERS([imagehlp.h psapi.h])
490 AC_CHECK_LIB(imagehlp,[SymGetOptions])
491 AC_CHECK_LIB(psapi,[GetProcessMemoryInfo])
492 fi
488493
489494 dnl lt_dlopen may be required for plugin support.
490495 AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1],
2514425144
2514525145 fi
2514625146
25147 if test "$llvm_cv_os_type" == "MingW" ; then
25148
25149
25150 for ac_header in imagehlp.h psapi.h
25151 do
25152 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
25153 if eval "test \"\${$as_ac_Header+set}\" = set"; then
25154 echo "$as_me:$LINENO: checking for $ac_header" >&5
25155 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
25156 if eval "test \"\${$as_ac_Header+set}\" = set"; then
25157 echo $ECHO_N "(cached) $ECHO_C" >&6
25158 fi
25159 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
25160 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
25161 else
25162 # Is the header compilable?
25163 echo "$as_me:$LINENO: checking $ac_header usability" >&5
25164 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
25165 cat >conftest.$ac_ext <<_ACEOF
25166 /* confdefs.h. */
25167 _ACEOF
25168 cat confdefs.h >>conftest.$ac_ext
25169 cat >>conftest.$ac_ext <<_ACEOF
25170 /* end confdefs.h. */
25171 $ac_includes_default
25172 #include <$ac_header>
25173 _ACEOF
25174 rm -f conftest.$ac_objext
25175 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
25176 (eval $ac_compile) 2>conftest.er1
25177 ac_status=$?
25178 grep -v '^ *+' conftest.er1 >conftest.err
25179 rm -f conftest.er1
25180 cat conftest.err >&5
25181 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25182 (exit $ac_status); } &&
25183 { ac_try='test -z "$ac_c_werror_flag"
25184 || test ! -s conftest.err'
25185 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25186 (eval $ac_try) 2>&5
25187 ac_status=$?
25188 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25189 (exit $ac_status); }; } &&
25190 { ac_try='test -s conftest.$ac_objext'
25191 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25192 (eval $ac_try) 2>&5
25193 ac_status=$?
25194 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25195 (exit $ac_status); }; }; then
25196 ac_header_compiler=yes
25197 else
25198 echo "$as_me: failed program was:" >&5
25199 sed 's/^/| /' conftest.$ac_ext >&5
25200
25201 ac_header_compiler=no
25202 fi
25203 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
25204 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
25205 echo "${ECHO_T}$ac_header_compiler" >&6
25206
25207 # Is the header present?
25208 echo "$as_me:$LINENO: checking $ac_header presence" >&5
25209 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
25210 cat >conftest.$ac_ext <<_ACEOF
25211 /* confdefs.h. */
25212 _ACEOF
25213 cat confdefs.h >>conftest.$ac_ext
25214 cat >>conftest.$ac_ext <<_ACEOF
25215 /* end confdefs.h. */
25216 #include <$ac_header>
25217 _ACEOF
25218 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
25219 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
25220 ac_status=$?
25221 grep -v '^ *+' conftest.er1 >conftest.err
25222 rm -f conftest.er1
25223 cat conftest.err >&5
25224 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25225 (exit $ac_status); } >/dev/null; then
25226 if test -s conftest.err; then
25227 ac_cpp_err=$ac_c_preproc_warn_flag
25228 ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
25229 else
25230 ac_cpp_err=
25231 fi
25232 else
25233 ac_cpp_err=yes
25234 fi
25235 if test -z "$ac_cpp_err"; then
25236 ac_header_preproc=yes
25237 else
25238 echo "$as_me: failed program was:" >&5
25239 sed 's/^/| /' conftest.$ac_ext >&5
25240
25241 ac_header_preproc=no
25242 fi
25243 rm -f conftest.err conftest.$ac_ext
25244 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
25245 echo "${ECHO_T}$ac_header_preproc" >&6
25246
25247 # So? What about this header?
25248 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
25249 yes:no: )
25250 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
25251 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
25252 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
25253 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
25254 ac_header_preproc=yes
25255 ;;
25256 no:yes:* )
25257 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
25258 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
25259 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
25260 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
25261 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
25262 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
25263 { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
25264 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
25265 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
25266 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
25267 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
25268 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
25269 (
25270 cat <<\_ASBOX
25271 ## ----------------------------------- ##
25272 ## Report this to llvmbugs@cs.uiuc.edu ##
25273 ## ----------------------------------- ##
25274 _ASBOX
25275 ) |
25276 sed "s/^/$as_me: WARNING: /" >&2
25277 ;;
25278 esac
25279 echo "$as_me:$LINENO: checking for $ac_header" >&5
25280 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
25281 if eval "test \"\${$as_ac_Header+set}\" = set"; then
25282 echo $ECHO_N "(cached) $ECHO_C" >&6
25283 else
25284 eval "$as_ac_Header=\$ac_header_preproc"
25285 fi
25286 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
25287 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
25288
25289 fi
25290 if test `eval echo '${'$as_ac_Header'}'` = yes; then
25291 cat >>confdefs.h <<_ACEOF
25292 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
25293 _ACEOF
25294
25295 fi
25296
25297 done
25298
25299
25300 echo "$as_me:$LINENO: checking for SymGetOptions in -limagehlp" >&5
25301 echo $ECHO_N "checking for SymGetOptions in -limagehlp... $ECHO_C" >&6
25302 if test "${ac_cv_lib_imagehlp_SymGetOptions+set}" = set; then
25303 echo $ECHO_N "(cached) $ECHO_C" >&6
25304 else
25305 ac_check_lib_save_LIBS=$LIBS
25306 LIBS="-limagehlp $LIBS"
25307 cat >conftest.$ac_ext <<_ACEOF
25308 /* confdefs.h. */
25309 _ACEOF
25310 cat confdefs.h >>conftest.$ac_ext
25311 cat >>conftest.$ac_ext <<_ACEOF
25312 /* end confdefs.h. */
25313
25314 /* Override any gcc2 internal prototype to avoid an error. */
25315 #ifdef __cplusplus
25316 extern "C"
25317 #endif
25318 /* We use char because int might match the return type of a gcc2
25319 builtin and then its argument prototype would still apply. */
25320 char SymGetOptions ();
25321 int
25322 main ()
25323 {
25324 SymGetOptions ();
25325 ;
25326 return 0;
25327 }
25328 _ACEOF
25329 rm -f conftest.$ac_objext conftest$ac_exeext
25330 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
25331 (eval $ac_link) 2>conftest.er1
25332 ac_status=$?
25333 grep -v '^ *+' conftest.er1 >conftest.err
25334 rm -f conftest.er1
25335 cat conftest.err >&5
25336 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25337 (exit $ac_status); } &&
25338 { ac_try='test -z "$ac_c_werror_flag"
25339 || test ! -s conftest.err'
25340 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25341 (eval $ac_try) 2>&5
25342 ac_status=$?
25343 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25344 (exit $ac_status); }; } &&
25345 { ac_try='test -s conftest$ac_exeext'
25346 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25347 (eval $ac_try) 2>&5
25348 ac_status=$?
25349 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25350 (exit $ac_status); }; }; then
25351 ac_cv_lib_imagehlp_SymGetOptions=yes
25352 else
25353 echo "$as_me: failed program was:" >&5
25354 sed 's/^/| /' conftest.$ac_ext >&5
25355
25356 ac_cv_lib_imagehlp_SymGetOptions=no
25357 fi
25358 rm -f conftest.err conftest.$ac_objext \
25359 conftest$ac_exeext conftest.$ac_ext
25360 LIBS=$ac_check_lib_save_LIBS
25361 fi
25362 echo "$as_me:$LINENO: result: $ac_cv_lib_imagehlp_SymGetOptions" >&5
25363 echo "${ECHO_T}$ac_cv_lib_imagehlp_SymGetOptions" >&6
25364 if test $ac_cv_lib_imagehlp_SymGetOptions = yes; then
25365 cat >>confdefs.h <<_ACEOF
25366 #define HAVE_LIBIMAGEHLP 1
25367 _ACEOF
25368
25369 LIBS="-limagehlp $LIBS"
25370
25371 fi
25372
25373
25374 echo "$as_me:$LINENO: checking for GetProcessMemoryInfo in -lpsapi" >&5
25375 echo $ECHO_N "checking for GetProcessMemoryInfo in -lpsapi... $ECHO_C" >&6
25376 if test "${ac_cv_lib_psapi_GetProcessMemoryInfo+set}" = set; then
25377 echo $ECHO_N "(cached) $ECHO_C" >&6
25378 else
25379 ac_check_lib_save_LIBS=$LIBS
25380 LIBS="-lpsapi $LIBS"
25381 cat >conftest.$ac_ext <<_ACEOF
25382 /* confdefs.h. */
25383 _ACEOF
25384 cat confdefs.h >>conftest.$ac_ext
25385 cat >>conftest.$ac_ext <<_ACEOF
25386 /* end confdefs.h. */
25387
25388 /* Override any gcc2 internal prototype to avoid an error. */
25389 #ifdef __cplusplus
25390 extern "C"
25391 #endif
25392 /* We use char because int might match the return type of a gcc2
25393 builtin and then its argument prototype would still apply. */
25394 char GetProcessMemoryInfo ();
25395 int
25396 main ()
25397 {
25398 GetProcessMemoryInfo ();
25399 ;
25400 return 0;
25401 }
25402 _ACEOF
25403 rm -f conftest.$ac_objext conftest$ac_exeext
25404 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
25405 (eval $ac_link) 2>conftest.er1
25406 ac_status=$?
25407 grep -v '^ *+' conftest.er1 >conftest.err
25408 rm -f conftest.er1
25409 cat conftest.err >&5
25410 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25411 (exit $ac_status); } &&
25412 { ac_try='test -z "$ac_c_werror_flag"
25413 || test ! -s conftest.err'
25414 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25415 (eval $ac_try) 2>&5
25416 ac_status=$?
25417 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25418 (exit $ac_status); }; } &&
25419 { ac_try='test -s conftest$ac_exeext'
25420 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
25421 (eval $ac_try) 2>&5
25422 ac_status=$?
25423 echo "$as_me:$LINENO: \$? = $ac_status" >&5
25424 (exit $ac_status); }; }; then
25425 ac_cv_lib_psapi_GetProcessMemoryInfo=yes
25426 else
25427 echo "$as_me: failed program was:" >&5
25428 sed 's/^/| /' conftest.$ac_ext >&5
25429
25430 ac_cv_lib_psapi_GetProcessMemoryInfo=no
25431 fi
25432 rm -f conftest.err conftest.$ac_objext \
25433 conftest$ac_exeext conftest.$ac_ext
25434 LIBS=$ac_check_lib_save_LIBS
25435 fi
25436 echo "$as_me:$LINENO: result: $ac_cv_lib_psapi_GetProcessMemoryInfo" >&5
25437 echo "${ECHO_T}$ac_cv_lib_psapi_GetProcessMemoryInfo" >&6
25438 if test $ac_cv_lib_psapi_GetProcessMemoryInfo = yes; then
25439 cat >>confdefs.h <<_ACEOF
25440 #define HAVE_LIBPSAPI 1
25441 _ACEOF
25442
25443 LIBS="-lpsapi $LIBS"
25444
25445 fi
25446
25447 fi
2514725448
2514825449 echo "$as_me:$LINENO: checking for library containing lt_dlopen" >&5
2514925450 echo $ECHO_N "checking for library containing lt_dlopen... $ECHO_C" >&6
135135 /* Define if the gv program is available */
136136 #undef HAVE_GV
137137
138 /* Define to 1 if you have the header file. */
139 #undef HAVE_IMAGEHLP_H
140
138141 /* Define to 1 if you have the `index' function. */
139142 #undef HAVE_INDEX
140143
165168 /* Define to 1 if you have the `elf' library (-lelf). */
166169 #undef HAVE_LIBELF
167170
171 /* Define to 1 if you have the `imagehlp' library (-limagehlp). */
172 #undef HAVE_LIBIMAGEHLP
173
168174 /* Define to 1 if you have the `m' library (-lm). */
169175 #undef HAVE_LIBM
176
177 /* Define to 1 if you have the `psapi' library (-lpsapi). */
178 #undef HAVE_LIBPSAPI
170179
171180 /* Define to 1 if you have the `pthread' library (-lpthread). */
172181 #undef HAVE_LIBPTHREAD
244253
245254 /* Define to have the %a format string */
246255 #undef HAVE_PRINTF_A
256
257 /* Define to 1 if you have the header file. */
258 #undef HAVE_PSAPI_H
247259
248260 /* Define to 1 if you have the header file. */
249261 #undef HAVE_PTHREAD_H