aboutsummaryrefslogtreecommitdiff
path: root/gold/Makefile.am
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2018-06-19 18:57:28 -0700
committerCary Coutant <ccoutant@gmail.com>2018-06-19 18:57:28 -0700
commitc8dc28bcc04532f3074a827dc940c033be4be4e7 (patch)
tree1b66812e19ad306c2676a5985f2d30800f693d9f /gold/Makefile.am
parent27ab04240bb40e052f288b2960fb99210b6f67b1 (diff)
downloadgdb-c8dc28bcc04532f3074a827dc940c033be4be4e7.zip
gdb-c8dc28bcc04532f3074a827dc940c033be4be4e7.tar.gz
gdb-c8dc28bcc04532f3074a827dc940c033be4be4e7.tar.bz2
Replace thread config with automatic config using ax_pthread.m4.
The autotools library macro (AX_PTHREAD) is now used to detect if pthreads is present and multi-threaded linking in gold is automatically enabled if it is found. This enables multi-threaded gold on platforms where pthreads is enabled via other methods than just -lpthread (e.g., MinGW). 2018-06-19 Joshua Watt <jpewhacker@gmail.com> Cary Coutant <ccoutant@gmail.com> gold/ * configure.ac: Replace manual thread configuration with AX_PTHREAD. Add --enable-threads=auto. * Makefile.am (THREADFLAGS, THREADLIBS): New defines. (AM_CFLAGS, AM_CXXFLAGS): Add $(THREADFLAGS. (THREADSLIB): Remove; change all references to THREADLIBS. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * testsuite/Makefile.am (THREADSLIB): Replace with... (THREADFLAGS, THREADLIBS): ... these. (LDADD): Remove; add as individual defines for... (object_unittest, binary_unittest, leb128_unittest) (overflow_unittest): ... these tests. (tls_test, tls_pic_test, tls_pie_test, tls_pie_pic_test) (tls_shared_test, tls_shared_ie_test, tls_shared_gd_to_ie_test) (tls_shared_gnu2_gd_to_ie_test, tls_shared_gnu2_test_LDFLAGS) (tls_shared_nonpic_test_LDFLAGS): Add $(THREADFLAGS) and ($THREADLIBS). * testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'gold/Makefile.am')
-rw-r--r--gold/Makefile.am18
1 files changed, 9 insertions, 9 deletions
diff --git a/gold/Makefile.am b/gold/Makefile.am
index 675deec..3586ebd 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -31,8 +31,12 @@ ACLOCAL_AMFLAGS = -I ../bfd -I ../config
ZLIB = @zlibdir@ -lz
ZLIBINC = @zlibinc@
-AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC)
-AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC)
+THREADFLAGS = @PTHREAD_CFLAGS@
+THREADLIBS = @PTHREAD_LIBS@
+
+AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS)
+AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) $(ZLIBINC) $(THREADFLAGS)
+AM_LDFLAGS = $(THREADFLAGS)
AM_CPPFLAGS = \
-I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
@@ -46,10 +50,6 @@ if PLUGINS
LIBDL = @DLOPEN_LIBS@
endif
-if THREADS
-THREADSLIB = -lpthread
-endif
-
AM_YFLAGS = -d
# Automake 1.10+ disables lex and yacc output file regeneration if
@@ -187,7 +187,7 @@ libgold_a_LIBADD = $(LIBOBJS)
sources_var = main.cc
deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
- $(THREADSLIB) $(LIBDL) $(ZLIB)
+ $(THREADLIBS) $(LIBDL) $(ZLIB)
ldflags_var = $(GOLD_LDFLAGS)
ld_new_SOURCES = $(sources_var)
@@ -201,11 +201,11 @@ incremental_dump_SOURCES = incremental-dump.cc
incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
$(LIBINTL_DEP)
incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
- $(THREADSLIB) $(LIBDL) $(ZLIB)
+ $(THREADLIBS) $(LIBDL) $(ZLIB)
dwp_SOURCES = dwp.cc
dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
-dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \
+dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADLIBS) \
$(LIBDL) $(ZLIB)
dwp_LDFLAGS = $(GOLD_LDFLAGS)