Commit de4088dd authored by Peter Griess's avatar Peter Griess

Clean up use of Boost and PThread libraries.

Summary:
- Use AM_LDFLAGS rather than AM_CXXFLAGS to link against Boost.
- Link against $(BOOST_REGEX_LIB) in addition to other Boost libs.
- Add $(BOOST_LDFLAGS) to AM_LDFLAGS so that we get the library path
that we configured Boost to use.
- Add -lpthread to AM_LDFLAGS rather than ad-hoc '-lpthread' additions
to various library builds.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac

Reviewed By: oyamauchi@fb.com

FB internal diff: D998504
parent 28312163
......@@ -112,8 +112,6 @@ libfolly_la_SOURCES = \
SpookyHashV1.cpp \
SpookyHashV2.cpp
libfolly_la_LIBADD = $(BOOST_THREAD_LIB) -lpthread
FingerprintTables.cpp: generate_fingerprint_tables
./generate_fingerprint_tables
......@@ -122,7 +120,7 @@ libfollyfingerprint_la_SOURCES = \
libfollyfingerprint_la_LIBADD = libfolly.la
libfollybenchmark_la_SOURCES = Benchmark.cpp
libfollybenchmark_la_LIBADD = $(BOOST_REGEX_LIB) -lrt libfolly.la
libfollybenchmark_la_LIBADD = -lrt libfolly.la
libfollytimeout_queue_la_SOURCES = TimeoutQueue.cpp
libfollytimeout_queue_la_LIBADD = libfolly.la
......
......@@ -102,8 +102,8 @@ if test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
CXX_FLAGS="-std=gnu++0x"
fi
AC_SUBST(AM_CPPFLAGS, '-I../$(top_srcdir)'" "'-I$(top_srcdir)/io'" "'-I$(top_srcdir)/test'" -lstdc++ $CXX_FLAGS $BOOST_CPPFLAGS")
AC_SUBST(AM_CXXFLAGS, "$BOOST_THREAD_LIB $BOOST_SYSTEM_LIB")
AC_SUBST(AM_CPPFLAGS, '-I../$(top_srcdir)'" "'-I$(top_srcdir)/io'" "'-I$(top_srcdir)/test'" $CXX_FLAGS $BOOST_CPPFLAGS")
AC_SUBST(AM_LDFLAGS, "$BOOST_LDFLAGS $BOOST_THREAD_LIB $BOOST_SYSTEM_LIB $BOOST_REGEX_LIB -lpthread")
AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"])
AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"])
......
......@@ -18,7 +18,6 @@ lib_LTLIBRARIES = libgtestmain.la libgtest.la
libgtestmain_la_CPPFLAGS = -Igtest-1.6.0 -Igtest-1.6.0/src
libgtestmain_la_SOURCES = gtest-1.6.0/src/gtest-all.cc gtest-1.6.0/src/gtest_main.cc
libgtestmain_la_LIBADD = -lpthread
libgtest_la_CPPFLAGS = -Igtest-1.6.0 -Igtest-1.6.0/src
libgtest_la_SOURCES = gtest-1.6.0/src/gtest-all.cc
......@@ -115,7 +114,7 @@ endian_test_LDADD = libgtestmain.la $(top_builddir)/libfolly.la
TESTS += endian_test
rw_spinlock_test_SOURCES = RWSpinLockTest.cpp
rw_spinlock_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la $(BOOST_THREAD_LIB)
rw_spinlock_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
TESTS += rw_spinlock_test
synchronized_test_SOURCES = SynchronizedTest.cpp
......@@ -127,7 +126,7 @@ concurrent_skiplist_test_LDADD = libgtest.la $(top_builddir)/libfolly.la
TESTS += concurrent_skiplist_test
concurrent_skiplist_benchmark_SOURCES = ConcurrentSkipListBenchmark.cpp
concurrent_skiplist_benchmark_LDADD = $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la $(BOOST_SYSTEM_LIB)
concurrent_skiplist_benchmark_LDADD = $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
noinst_PROGRAMS += concurrent_skiplist_benchmark
histogram_test_SOURCES = HistogramTest.cpp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment