From: Peter Griess Date: Mon, 23 Sep 2013 16:47:58 +0000 (-0700) Subject: Clean up use of Boost and PThread libraries. X-Git-Tag: v0.22.0~851 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=de4088dd4906f03251c764adcaa848ed1004bb43;p=folly.git 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 --- diff --git a/folly/Makefile.am b/folly/Makefile.am index 77967ebb..195ceb9e 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -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 diff --git a/folly/configure.ac b/folly/configure.ac index 8d5765c1..eb8a175e 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -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"]) diff --git a/folly/test/Makefile.am b/folly/test/Makefile.am index 47854421..6ec48124 100644 --- a/folly/test/Makefile.am +++ b/folly/test/Makefile.am @@ -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