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
SpookyHashV1.cpp \
SpookyHashV2.cpp
-libfolly_la_LIBADD = $(BOOST_THREAD_LIB) -lpthread
-
FingerprintTables.cpp: generate_fingerprint_tables
./generate_fingerprint_tables
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
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"])
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
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
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