From 125582e08eb3858b36292400fb73961f2193385a Mon Sep 17 00:00:00 2001 From: Xing Lin Date: Sun, 10 Nov 2013 17:06:55 -0700 Subject: [PATCH 1/2] autoconf: add check for the boost_program_options library check for the existence of boost_program_options library in configure.ac since several files need that library Signed-off-by: Xing Lin --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index 8523c3fb06e..26f9c81040d 100644 --- a/configure.ac +++ b/configure.ac @@ -553,6 +553,19 @@ AC_CHECK_LIB(boost_thread-mt, main, [], [AC_CHECK_LIB(boost_thread, main, [], AC_MSG_FAILURE(["Boost thread library not found."]))]) +# +# Check for boost_program_options library (defines BOOST_PROGRAM_OPTIONS_LIBS). +# +BOOST_PROGRAM_OPTIONS_LIBS="" +saved_LIBS="${LIBS}" +LIBS="" +AC_CHECK_LIB(boost_program_options-mt, main, [], + [AC_CHECK_LIB(boost_program_options, main, [], + AC_MSG_FAILURE(["Boost program options library not found."]))]) +BOOST_PROGRAM_OPTIONS_LIBS="${LIBS}" +LIBS="${saved_LIBS}" +AC_SUBST(BOOST_PROGRAM_OPTIONS_LIBS) + AC_LANG([C]) AC_CHECK_MEMBER([struct fiemap_extent.fe_logical], From dcef9fb9bdd1c203b7924f912bbe5e934343a81b Mon Sep 17 00:00:00 2001 From: Xing Lin Date: Sun, 10 Nov 2013 17:13:07 -0700 Subject: [PATCH 2/2] automake: replaced hardcoded '-lboost_program_options' with a macro replaced '-lboost_program_options' with the BOOST_PROGRAM_OPTIONS_LIBS macro in related Makefile.am files Signed-off-by: Xing Lin --- src/test/Makefile.am | 10 +++++----- src/tools/Makefile.am | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/Makefile.am b/src/test/Makefile.am index da9f33b3d42..b1cbf9fac99 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -130,7 +130,7 @@ ceph_smalliobench_SOURCES = \ test/bench/rados_backend.cc \ test/bench/detailed_stat_collector.cc \ test/bench/bencher.cc -ceph_smalliobench_LDADD = $(LIBRADOS) -lboost_program_options $(CEPH_GLOBAL) +ceph_smalliobench_LDADD = $(LIBRADOS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(CEPH_GLOBAL) bin_DEBUGPROGRAMS += ceph_smalliobench ceph_smalliobenchfs_SOURCES = \ @@ -138,7 +138,7 @@ ceph_smalliobenchfs_SOURCES = \ test/bench/testfilestore_backend.cc \ test/bench/detailed_stat_collector.cc \ test/bench/bencher.cc -ceph_smalliobenchfs_LDADD = $(LIBRADOS) -lboost_program_options $(LIBOS) $(CEPH_GLOBAL) +ceph_smalliobenchfs_LDADD = $(LIBRADOS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(LIBOS) $(CEPH_GLOBAL) bin_DEBUGPROGRAMS += ceph_smalliobenchfs ceph_smalliobenchdumb_SOURCES = \ @@ -146,7 +146,7 @@ ceph_smalliobenchdumb_SOURCES = \ test/bench/dumb_backend.cc \ test/bench/detailed_stat_collector.cc \ test/bench/bencher.cc -ceph_smalliobenchdumb_LDADD = $(LIBRADOS) -lboost_program_options $(LIBOS) $(CEPH_GLOBAL) +ceph_smalliobenchdumb_LDADD = $(LIBRADOS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(LIBOS) $(CEPH_GLOBAL) bin_DEBUGPROGRAMS += ceph_smalliobenchdumb ceph_smalliobenchrbd_SOURCES = \ @@ -154,13 +154,13 @@ ceph_smalliobenchrbd_SOURCES = \ test/bench/rbd_backend.cc \ test/bench/detailed_stat_collector.cc \ test/bench/bencher.cc -ceph_smalliobenchrbd_LDADD = $(LIBRBD) $(LIBRADOS) -lboost_program_options $(CEPH_GLOBAL) +ceph_smalliobenchrbd_LDADD = $(LIBRBD) $(LIBRADOS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(CEPH_GLOBAL) bin_DEBUGPROGRAMS += ceph_smalliobenchrbd ceph_tpbench_SOURCES = \ test/bench/tp_bench.cc \ test/bench/detailed_stat_collector.cc -ceph_tpbench_LDADD = $(LIBRADOS) -lboost_program_options $(LIBOS) $(CEPH_GLOBAL) +ceph_tpbench_LDADD = $(LIBRADOS) $(BOOST_PROGRAM_OPTIONS_LIBS) $(LIBOS) $(CEPH_GLOBAL) bin_DEBUGPROGRAMS += ceph_tpbench ceph_omapbench_SOURCES = test/omap_bench.cc diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index 89417014dd4..44dff92b162 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -1,9 +1,9 @@ ceph_osdomap_tool_SOURCES = tools/ceph-osdomap-tool.cc -ceph_osdomap_tool_LDADD = $(LIBOS) $(CEPH_GLOBAL) -lboost_program_options +ceph_osdomap_tool_LDADD = $(LIBOS) $(CEPH_GLOBAL) $(BOOST_PROGRAM_OPTIONS_LIBS) bin_DEBUGPROGRAMS += ceph-osdomap-tool ceph_monstore_tool_SOURCES = tools/ceph-monstore-tool.cc -ceph_monstore_tool_LDADD = $(LIBOS) $(CEPH_GLOBAL) -lboost_program_options +ceph_monstore_tool_LDADD = $(LIBOS) $(CEPH_GLOBAL) $(BOOST_PROGRAM_OPTIONS_LIBS) bin_DEBUGPROGRAMS += ceph-monstore-tool ceph_kvstore_tool_SOURCES = tools/ceph-kvstore-tool.cc @@ -13,7 +13,7 @@ bin_DEBUGPROGRAMS += ceph-kvstore-tool ceph_filestore_dump_SOURCES = tools/ceph-filestore-dump.cc -ceph_filestore_dump_LDADD = $(LIBOSD) $(LIBOS) $(CEPH_GLOBAL) -lboost_program_options +ceph_filestore_dump_LDADD = $(LIBOSD) $(LIBOS) $(CEPH_GLOBAL) $(BOOST_PROGRAM_OPTIONS_LIBS) if LINUX ceph_filestore_dump_LDADD += -ldl endif # LINUX