build: more accurate Boost lib dependencies

See also named-data/ndn-cxx@5686c51b87b6a642aa2dc8d93e061caebbb226cc

Change-Id: I28cfc24c3d8f0dd16a7bdcec092090a09c024fdf
diff --git a/wscript b/wscript
index d4264d4..833277c 100644
--- a/wscript
+++ b/wscript
@@ -43,11 +43,13 @@
     conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'],
                    uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
 
-    boost_libs = ['system', 'program_options']
-    if conf.env.WITH_TESTS:
-        boost_libs.append('unit_test_framework')
+    conf.check_boost()
 
-    conf.check_boost(lib=boost_libs, mt=True)
+    if conf.env.WITH_TESTS:
+        conf.check_boost(lib='unit_test_framework', mt=True, uselib_store='BOOST_TESTS')
+
+    if conf.env.WITH_TOOLS:
+        conf.check_boost(lib='program_options', mt=True, uselib_store='BOOST_TOOLS')
 
     conf.check_compiler_flags()