llvm.org GIT mirror llvm / 8e9fde1
Add support for linking librt and using clock_gettime to the sample autoconf setup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188617 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 6 years ago
2 changed file(s) with 105 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
10781078 [Define if dlopen() is available on this platform.]),
10791079 AC_MSG_WARN([dlopen() not found - disabling plugin support]))
10801080
1081 dnl Search for the clock_gettime() function. Note that we rely on the POSIX
1082 dnl macros to detect whether clock_gettime is available, this just finds the
1083 dnl right libraries to link with.
1084 AC_SEARCH_LIBS(clock_gettime,rt)
1085
10811086 dnl The curses library is optional; used for querying terminal info
10821087 if test "$llvm_cv_enable_terminfo" = "yes" ; then
10831088 dnl We need the has_color functionality in curses for it to be useful.
1247712477 fi
1247812478
1247912479
12480 { echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
12481 echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6; }
12482 if test "${ac_cv_search_clock_gettime+set}" = set; then
12483 echo $ECHO_N "(cached) $ECHO_C" >&6
12484 else
12485 ac_func_search_save_LIBS=$LIBS
12486 cat >conftest.$ac_ext <<_ACEOF
12487 /* confdefs.h. */
12488 _ACEOF
12489 cat confdefs.h >>conftest.$ac_ext
12490 cat >>conftest.$ac_ext <<_ACEOF
12491 /* end confdefs.h. */
12492
12493 /* Override any GCC internal prototype to avoid an error.
12494 Use char because int might match the return type of a GCC
12495 builtin and then its argument prototype would still apply. */
12496 #ifdef __cplusplus
12497 extern "C"
12498 #endif
12499 char clock_gettime ();
12500 int
12501 main ()
12502 {
12503 return clock_gettime ();
12504 ;
12505 return 0;
12506 }
12507 _ACEOF
12508 for ac_lib in '' rt; do
12509 if test -z "$ac_lib"; then
12510 ac_res="none required"
12511 else
12512 ac_res=-l$ac_lib
12513 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
12514 fi
12515 rm -f conftest.$ac_objext conftest$ac_exeext
12516 if { (ac_try="$ac_link"
12517 case "(($ac_try" in
12518 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12519 *) ac_try_echo=$ac_try;;
12520 esac
12521 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
12522 (eval "$ac_link") 2>conftest.er1
12523 ac_status=$?
12524 grep -v '^ *+' conftest.er1 >conftest.err
12525 rm -f conftest.er1
12526 cat conftest.err >&5
12527 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12528 (exit $ac_status); } &&
12529 { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
12530 { (case "(($ac_try" in
12531 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12532 *) ac_try_echo=$ac_try;;
12533 esac
12534 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
12535 (eval "$ac_try") 2>&5
12536 ac_status=$?
12537 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12538 (exit $ac_status); }; } &&
12539 { ac_try='test -s conftest$ac_exeext'
12540 { (case "(($ac_try" in
12541 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12542 *) ac_try_echo=$ac_try;;
12543 esac
12544 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
12545 (eval "$ac_try") 2>&5
12546 ac_status=$?
12547 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12548 (exit $ac_status); }; }; then
12549 ac_cv_search_clock_gettime=$ac_res
12550 else
12551 echo "$as_me: failed program was:" >&5
12552 sed 's/^/| /' conftest.$ac_ext >&5
12553
12554
12555 fi
12556
12557 rm -f core conftest.err conftest.$ac_objext \
12558 conftest$ac_exeext
12559 if test "${ac_cv_search_clock_gettime+set}" = set; then
12560 break
12561 fi
12562 done
12563 if test "${ac_cv_search_clock_gettime+set}" = set; then
12564 :
12565 else
12566 ac_cv_search_clock_gettime=no
12567 fi
12568 rm conftest.$ac_ext
12569 LIBS=$ac_func_search_save_LIBS
12570 fi
12571 { echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5
12572 echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6; }
12573 ac_res=$ac_cv_search_clock_gettime
12574 if test "$ac_res" != no; then
12575 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12576
12577 fi
12578
12579
1248012580 if test "$llvm_cv_enable_terminfo" = "yes" ; then
1248112581 { echo "$as_me:$LINENO: checking for library containing setupterm" >&5
1248212582 echo $ECHO_N "checking for library containing setupterm... $ECHO_C" >&6; }