summaryrefslogtreecommitdiff
path: root/libbacktrace/configure.ac
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-06-12 03:25:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-06-12 03:25:04 +0000
commitd1609a232616d0a85f2f7bd9ebf4dae4b11fd481 (patch)
tree9b4b2fbd658631dc5cb019d57ba0843423218b4b /libbacktrace/configure.ac
parent1e7a4be3a1f37e9feb5b5b3a6a1f9a31d7a2cd7e (diff)
elf.c (backtrace_initialize): Always set *fileline_fn.
* elf.c (backtrace_initialize): Always set *fileline_fn. * ttest.c: New file. * btest.c: Move support functions into testlib.c. Change calls to check to pass file name. * testlib.c: New file, copied from (part of) btest.c. * testlib.h: New file, declarations for testlib.c. * edtest.c: Use testlib.h and testlib.c. * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional. * Makefile.am (btest_SOURCES): Add testlib.c. (edtest_SOURCES): Likewise. (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD. (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define. * configure, Makefile.in: Rebuild. From-SVN: r249111
Diffstat (limited to 'libbacktrace/configure.ac')
-rw-r--r--libbacktrace/configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index f9cad214447..75a8ed8f0ff 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -355,6 +355,23 @@ if test "$have_getexecname" = "yes"; then
AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.])
fi
+dnl Test whether the compiler supports the -pthread option.
+AC_CACHE_CHECK([whether -pthread is supported],
+[libgo_cv_lib_pthread],
+[CFLAGS_hold=$CFLAGS
+CFLAGS="$CFLAGS -pthread"
+AC_COMPILE_IFELSE([[int i;]],
+[libgo_cv_lib_pthread=yes],
+[libgo_cv_lib_pthread=no])
+CFLAGS=$CFLAGS_hold])
+PTHREAD_CFLAGS=
+if test "$libgo_cv_lib_pthread" = yes; then
+ PTHREAD_CFLAGS=-pthread
+fi
+AC_SUBST(PTHREAD_CFLAGS)
+
+AM_CONDITIONAL(HAVE_PTHREAD, test "$libgo_cv_lib_pthread" = yes)
+
AC_CACHE_CHECK([whether tests can run],
[libbacktrace_cv_sys_native],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0;])],