diff options
author | Nick Clifton <nickc@redhat.com> | 2022-03-18 15:45:34 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2022-03-18 15:46:33 +0000 |
commit | 0a30596cfad9cd221a81eea984b6fe3fabb20b95 (patch) | |
tree | b688d33f46d2507a16dc89d7f057cba01618c355 /gprofng/configure | |
parent | f0cf07f341f565978228c9a2cfa73d2a9f3001c3 (diff) | |
download | gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.zip gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.tar.gz gdb-0a30596cfad9cd221a81eea984b6fe3fabb20b95.tar.bz2 |
Fix Build issues due to patch "gprofng: a new GNU profiler"
Find and fix more places where clock_gettime() and CLOCK_MONOTONIC_RAW are used.
Diffstat (limited to 'gprofng/configure')
-rwxr-xr-x | gprofng/configure | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/gprofng/configure b/gprofng/configure index 983150f..bd52fd9 100755 --- a/gprofng/configure +++ b/gprofng/configure @@ -634,6 +634,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS BUILD_SUBDIRS +CLOCK_GETTIME_LINK GPROFNG_LIBDIR GPROFNG_CPPFLAGS GPROFNG_CFLAGS @@ -12136,7 +12137,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12139 "configure" +#line 12140 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12242,7 +12243,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12245 "configure" +#line 12246 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16721,6 +16722,58 @@ fi done +clock_gettime_link= +# At least for glibc, clock_gettime is in librt. But don't +# pull that in if it still doesn't give us the function we want. This +# test is copied from libgomp, and modified to not link in -lrt as +# we're using this for test timing only. +if test "$ac_cv_func_clock_gettime" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + CLOCK_GETTIME_LINK=-lrt + +$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +fi + +fi + + ac_config_files="$ac_config_files Makefile src/Makefile gp-display-html/Makefile doc/Makefile" |